Update ooo320-m1
[ooovba.git] / writerfilter / source / dmapper / TblStylePrHandler.cxx
blob8f901eccdeeff1474641b368a51773a3a14cb6cf
1 #include <TblStylePrHandler.hxx>
2 #include <PropertyMap.hxx>
3 #include <ooxml/resourceids.hxx>
5 namespace writerfilter {
6 namespace dmapper {
8 TblStylePrHandler::TblStylePrHandler( DomainMapper & rDMapper ) :
9 m_rDMapper( rDMapper ),
10 m_pTablePropsHandler( new TablePropertiesHandler( true ) ),
11 m_nType( TBL_STYLE_UNKNOWN ),
12 m_pProperties( new PropertyMap )
16 TblStylePrHandler::~TblStylePrHandler( )
18 delete m_pTablePropsHandler, m_pTablePropsHandler = NULL;
21 void TblStylePrHandler::attribute(Id rName, Value & rVal)
23 switch ( rName )
25 case NS_ooxml::LN_CT_TblStyleOverrideType:
27 // The tokenid should be the same in the model.xml than
28 // in the TblStyleType enum
29 m_nType = TblStyleType( rVal.getInt( ) );
31 break;
35 void TblStylePrHandler::sprm(Sprm & rSprm)
37 Value::Pointer_t pValue = rSprm.getValue();
38 switch ( rSprm.getId( ) )
40 case NS_ooxml::LN_CT_PPrBase:
41 case NS_ooxml::LN_EG_RPrBase:
42 case NS_ooxml::LN_CT_TblPrBase:
43 case NS_ooxml::LN_CT_TrPrBase:
44 case NS_ooxml::LN_CT_TcPrBase:
45 resolveSprmProps( rSprm );
46 break;
47 default:
48 // Tables specific properties have to handled here
49 m_pTablePropsHandler->SetProperties( m_pProperties );
50 bool bRet = m_pTablePropsHandler->sprm( rSprm );
52 if ( !bRet )
54 // The DomainMapper can handle some of the properties
55 m_rDMapper.PushStyleSheetProperties( m_pProperties, true );
56 m_rDMapper.sprm( rSprm );
57 m_rDMapper.PopStyleSheetProperties( true );
62 void TblStylePrHandler::resolveSprmProps(Sprm & rSprm)
64 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
65 if( pProperties.get())
66 pProperties->resolve(*this);