diff options
author | Akash Shetye <shetyeakash@gmail.com> | 2013-08-30 04:40:26 +0530 |
---|---|---|
committer | Akash Shetye <shetyeakash@gmail.com> | 2013-08-30 04:40:26 +0530 |
commit | 9b09732f864d5599f1e85b5ba717d77595b1abd9 (patch) | |
tree | fb5fea679f55459fc2e64bfc437ec46a220dfaf0 | |
parent | cc5ab36c5ae3e9145261ec7645e2e798aa2fd95e (diff) |
Added support for importing stripe sizes as well
Change-Id: I83b83d74b6241f4884461f4d07944946e1f25fe8
-rw-r--r-- | sc/source/filter/inc/stylesbuffer.hxx | 3 | ||||
-rw-r--r-- | sc/source/filter/oox/stylesbuffer.cxx | 25 |
2 files changed, 23 insertions, 5 deletions
diff --git a/sc/source/filter/inc/stylesbuffer.hxx b/sc/source/filter/inc/stylesbuffer.hxx index c274d2d8bad5..44c4d6854238 100644 --- a/sc/source/filter/inc/stylesbuffer.hxx +++ b/sc/source/filter/inc/stylesbuffer.hxx @@ -789,7 +789,8 @@ typedef ::boost::shared_ptr< Dxf > DxfRef; struct TableStyleElementModel { - sal_Int32 maDxfId; + sal_Int32 nDxfId; + sal_Int32 nSize; OUString maStyleElementType; }; diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index 82f9315b3548..c5ccdb4238ef 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -2644,10 +2644,15 @@ void TableStyle::importTableStyleElement( const AttributeList& rAttribs ) //Get the table Style element type. OUString aStyleElementType = rAttribs.getXString( XML_type, OUString() ); //Extract the Dxf Id and create such a style - sal_Int32 aDxfId = static_cast< sal_Int32 >( rAttribs.getInteger( XML_dxfId, -1 ) ); - SAL_WARN_IF( (aDxfId == -1) ,"sc", "TableStyle::importTableStyleElement - DxfId not defined for table style element" ); + sal_Int32 nDxfId = static_cast< sal_Int32 >( rAttribs.getInteger( XML_dxfId, -1 ) ); + SAL_WARN_IF( (nDxfId == -1) ,"sc", "TableStyle::importTableStyleElement - DxfId not defined for table style element" ); + sal_Int32 nSize = static_cast< sal_Int32 >( rAttribs.getInteger( XML_size, -1 ) ); + SAL_WARN_IF( ( nSize == -1 ), "sc", "TableStyle::importTableStyleElement - Size not defined assuming as 1"); + if ( nSize == -1 ) + nSize = 1; TableStyleElementModel aTableStyleElementModel; - aTableStyleElementModel.maDxfId = aDxfId; + aTableStyleElementModel.nDxfId = nDxfId; + aTableStyleElementModel.nSize = nSize; aTableStyleElementModel.maStyleElementType = aStyleElementType; maStyleElementVector.push_back( aTableStyleElementModel ); } @@ -2668,15 +2673,27 @@ void TableStyle::finalizeImport() for( TableStyleElementModelVector::iterator itr = maStyleElementVector.begin(); itr!=maStyleElementVector.end(); ++itr) { //Should I stop on finding this missing feild or keep going? - OUString aDxfStyleName = getStyles().createDxfStyle( itr->maDxfId ); + OUString aDxfStyleName = getStyles().createDxfStyle( itr->nDxfId ); if( itr->maStyleElementType.equals("firstColumnStripe") ) + { mxTableFormatting->SetFirstColStripeStyle( aDxfStyleName ); + mxTableFormatting->SetFirstColStripeSize( itr->nSize ); + } else if( itr->maStyleElementType.equals("secondColumnStripe") ) + { mxTableFormatting->SetSecondColStripeStyle( aDxfStyleName ); + mxTableFormatting->SetSecondColStripeSize( itr->nSize ); + } else if( itr->maStyleElementType.equals("firstRowStripe") ) + { mxTableFormatting->SetFirstRowStripeStyle( aDxfStyleName ); + mxTableFormatting->SetFirstRowStripeSize( itr->nSize ); + } else if( itr->maStyleElementType.equals("secondRowStripe") ) + { mxTableFormatting->SetSecondRowStripeStyle( aDxfStyleName ); + mxTableFormatting->SetSecondRowStripeSize( itr->nSize ); + } } } |