1 #include "SettingsTable.hxx"
3 #include <ooxml/resourceids.hxx>
5 #include <com/sun/star/beans/XPropertySet.hpp>
6 #include <com/sun/star/text/XTextDocument.hpp>
12 using namespace com::sun::star
;
15 namespace writerfilter
{
18 SettingsTable_Impl::SettingsTable_Impl( ) :
19 m_bRecordChanges( false )
23 SettingsTable_Impl::~SettingsTable_Impl( )
27 SettingsTable::SettingsTable( ) :
28 m_pImpl( new SettingsTable_Impl
)
32 SettingsTable::~SettingsTable( )
34 delete m_pImpl
, m_pImpl
= NULL
;
37 void SettingsTable::attribute( Id nName
, Value
& rVal
)
40 clog
<< "SettingsTable::attribute( )" << endl
;
44 void SettingsTable::sprm( Sprm
& rSprm
)
46 switch ( rSprm
.getId( ) )
48 case NS_ooxml::LN_CT_Settings_trackRevisions
:
50 m_pImpl
->m_bRecordChanges
= bool(rSprm
.getValue( )->getInt( ) );
56 clog
<< __FILE__
<< ":" << __LINE__
;
57 clog
<< ": unknown SPRM: " << rSprm
.getName( ) << endl
;
63 void SettingsTable::entry( int nPos
, writerfilter::Reference
<Properties
>::Pointer_t pRef
)
66 fprintf( stderr
, "SettingsTable::entry( ), pos: %d\n", nPos
);
68 pRef
->resolve( *this );
71 void SettingsTable::resolveSprmProps( Sprm
& rSprm
)
73 writerfilter::Reference
<Properties
>::Pointer_t pProperties
= rSprm
.getProps();
74 if( pProperties
.get())
75 pProperties
->resolve(*this);
78 void SettingsTable::ApplyProperties( uno::Reference
< text::XTextDocument
> xDoc
)
80 uno::Reference
< beans::XPropertySet
> xDocProps( xDoc
, uno::UNO_QUERY
);
82 // Record changes value
83 xDocProps
->setPropertyValue( OUString::createFromAscii( "RecordChanges" ), uno::makeAny( m_pImpl
->m_bRecordChanges
) );