diff options
author | Radek Doulik <rodo@novell.com> | 2011-08-17 13:12:52 +0200 |
---|---|---|
committer | Radek Doulik <rodo@novell.com> | 2011-08-17 13:14:54 +0200 |
commit | 83a0796604dedc039a3e65c02453b7de1429316d (patch) | |
tree | 6a9add54535f4f2ab2d766d3b2c731fa1d41309b /oox | |
parent | dee4142489bb287bb8d506d3549957dea46a72c0 (diff) |
fix how table style is applied
- make sure it doesn't replace character properties of textbody inside cells
- fixes bnc#705991
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/table/tablecell.cxx | 53 | ||||
-rw-r--r-- | oox/source/drawingml/textparagraph.cxx | 3 |
2 files changed, 28 insertions, 28 deletions
diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx index be51773de826..d4bbbcf26770 100644 --- a/oox/source/drawingml/table/tablecell.cxx +++ b/oox/source/drawingml/table/tablecell.cxx @@ -97,14 +97,15 @@ void applyBorder( TableStylePart& rTableStylePart, sal_Int32 nLineType, oox::dra rLineProperties.assignUsed( *aIter->second ); } -void applyTableStylePart( const ::oox::core::XmlFilterBase& rFilterBase, const Reference < text::XTextRange >& rxStart, oox::drawingml::FillProperties& rFillProperties, - oox::drawingml::LineProperties& rLeftBorder, - oox::drawingml::LineProperties& rRightBorder, - oox::drawingml::LineProperties& rTopBorder, - oox::drawingml::LineProperties& rBottomBorder, - oox::drawingml::LineProperties& rTopLeftToBottomRightBorder, - oox::drawingml::LineProperties& rBottomLeftToTopRightBorder, - TableStylePart& rTableStylePart ) +void applyTableStylePart( oox::drawingml::FillProperties& rFillProperties, + TextCharacterProperties& aTextCharProps, + oox::drawingml::LineProperties& rLeftBorder, + oox::drawingml::LineProperties& rRightBorder, + oox::drawingml::LineProperties& rTopBorder, + oox::drawingml::LineProperties& rBottomBorder, + oox::drawingml::LineProperties& rTopLeftToBottomRightBorder, + oox::drawingml::LineProperties& rBottomLeftToTopRightBorder, + TableStylePart& rTableStylePart ) { boost::shared_ptr< ::oox::drawingml::FillProperties >& rPartFillPropertiesPtr( rTableStylePart.getFillProperties() ); if ( rPartFillPropertiesPtr.get() ) @@ -117,19 +118,16 @@ void applyTableStylePart( const ::oox::core::XmlFilterBase& rFilterBase, const R applyBorder( rTableStylePart, XML_tl2br, rTopLeftToBottomRightBorder ); applyBorder( rTableStylePart, XML_tr2bl, rBottomLeftToTopRightBorder ); - TextCharacterProperties aTextCharProps; aTextCharProps.maLatinFont = rTableStylePart.getLatinFont(); aTextCharProps.maAsianFont = rTableStylePart.getAsianFont(); aTextCharProps.maComplexFont = rTableStylePart.getComplexFont(); aTextCharProps.maSymbolFont = rTableStylePart.getSymbolFont(); - aTextCharProps.maCharColor = rTableStylePart.getTextColor(); + if (rTableStylePart.getTextColor().isUsed()) + aTextCharProps.maCharColor = rTableStylePart.getTextColor(); if( rTableStylePart.getTextBoldStyle().is_initialized() ) aTextCharProps.moBold = rTableStylePart.getTextBoldStyle(); if( rTableStylePart.getTextItalicStyle().is_initialized() ) aTextCharProps.moItalic = rTableStylePart.getTextItalicStyle(); - - PropertySet aPropSet( rxStart ); - aTextCharProps.pushToPropSet( aPropSet, rFilterBase, true ); } void applyTableCellProperties( const Reference < ::com::sun::star::table::XCell >& rxCell, const TableCell& rTableCell ) @@ -171,7 +169,6 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo applyTableCellProperties( rxCell, *this ); TextCharacterProperties aTextStyleProps; - getTextBody()->insertAt( rFilterBase, xText, xAt, aTextStyleProps, pMasterTextListStyle ); xAt->gotoStart( sal_True ); Reference< text::XTextRange > xStart( xAt, UNO_QUERY ); xAt->gotoEnd( sal_True ); @@ -189,7 +186,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo if ( rBackgroundFillPropertiesPtr.get() ) aFillProperties.assignUsed( *rBackgroundFillPropertiesPtr ); - applyTableStylePart( rFilterBase, xStart, aFillProperties, + applyTableStylePart( aFillProperties, aTextStyleProps, aLinePropertiesLeft, aLinePropertiesRight, aLinePropertiesTop, @@ -200,7 +197,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo if ( rProperties.isFirstRow() && ( nRow == 0 ) ) { - applyTableStylePart( rFilterBase, xStart, aFillProperties, + applyTableStylePart( aFillProperties, aTextStyleProps, aLinePropertiesLeft, aLinePropertiesRight, aLinePropertiesTop, @@ -211,7 +208,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo } if ( rProperties.isLastRow() && ( nRow == nMaxRow ) ) { - applyTableStylePart( rFilterBase, xStart, aFillProperties, + applyTableStylePart( aFillProperties, aTextStyleProps, aLinePropertiesLeft, aLinePropertiesRight, aLinePropertiesTop, @@ -222,7 +219,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo } if ( rProperties.isFirstCol() && ( nColumn == 0 ) ) { - applyTableStylePart( rFilterBase, xStart, aFillProperties, + applyTableStylePart( aFillProperties, aTextStyleProps, aLinePropertiesLeft, aLinePropertiesRight, aLinePropertiesTop, @@ -233,7 +230,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo } if ( rProperties.isLastCol() && ( nColumn == nMaxColumn ) ) { - applyTableStylePart( rFilterBase, xStart, aFillProperties, + applyTableStylePart( aFillProperties, aTextStyleProps, aLinePropertiesLeft, aLinePropertiesRight, aLinePropertiesTop, @@ -252,7 +249,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo nBand++; if ( nBand & 1 ) { - applyTableStylePart( rFilterBase, xStart, aFillProperties, + applyTableStylePart( aFillProperties, aTextStyleProps, aLinePropertiesLeft, aLinePropertiesRight, aLinePropertiesTop, @@ -263,7 +260,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo } else { - applyTableStylePart( rFilterBase, xStart, aFillProperties, + applyTableStylePart( aFillProperties, aTextStyleProps, aLinePropertiesLeft, aLinePropertiesRight, aLinePropertiesTop, @@ -276,7 +273,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo } if ( ( nRow == 0 ) && ( nColumn == 0 ) ) { - applyTableStylePart( rFilterBase, xStart, aFillProperties, + applyTableStylePart( aFillProperties, aTextStyleProps, aLinePropertiesLeft, aLinePropertiesRight, aLinePropertiesTop, @@ -287,7 +284,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo } if ( ( nRow == nMaxRow ) && ( nColumn == 0 ) ) { - applyTableStylePart( rFilterBase, xStart, aFillProperties, + applyTableStylePart( aFillProperties, aTextStyleProps, aLinePropertiesLeft, aLinePropertiesRight, aLinePropertiesTop, @@ -298,7 +295,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo } if ( ( nRow == 0 ) && ( nColumn == nMaxColumn ) ) { - applyTableStylePart( rFilterBase, xStart, aFillProperties, + applyTableStylePart( aFillProperties, aTextStyleProps, aLinePropertiesLeft, aLinePropertiesRight, aLinePropertiesTop, @@ -309,7 +306,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo } if ( ( nRow == nMaxColumn ) && ( nColumn == nMaxColumn ) ) { - applyTableStylePart( rFilterBase, xStart, aFillProperties, + applyTableStylePart( aFillProperties, aTextStyleProps, aLinePropertiesLeft, aLinePropertiesRight, aLinePropertiesTop, @@ -328,7 +325,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo nBand++; if ( nBand & 1 ) { - applyTableStylePart( rFilterBase, xStart, aFillProperties, + applyTableStylePart( aFillProperties, aTextStyleProps, aLinePropertiesLeft, aLinePropertiesRight, aLinePropertiesTop, @@ -339,7 +336,7 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo } else { - applyTableStylePart( rFilterBase, xStart, aFillProperties, + applyTableStylePart( aFillProperties, aTextStyleProps, aLinePropertiesLeft, aLinePropertiesRight, aLinePropertiesTop, @@ -368,6 +365,8 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo // TODO: phClr? aFillProperties.pushToPropMap( aPropMap, rFilterBase.getGraphicHelper() ); PropertySet( xPropSet ).setProperties( aPropMap ); + + getTextBody()->insertAt( rFilterBase, xText, xAt, aTextStyleProps, pMasterTextListStyle ); } } } } diff --git a/oox/source/drawingml/textparagraph.cxx b/oox/source/drawingml/textparagraph.cxx index 1f198b7c711b..964932fd9c58 100644 --- a/oox/source/drawingml/textparagraph.cxx +++ b/oox/source/drawingml/textparagraph.cxx @@ -73,9 +73,10 @@ void TextParagraph::insertAt( if ( rListStyle.size() ) pTextParagraphStyle = rListStyle[ nLevel ]; - TextCharacterProperties aTextCharacterStyle( rTextStyleProperties ); + TextCharacterProperties aTextCharacterStyle; if ( pTextParagraphStyle.get() ) aTextCharacterStyle.assignUsed( pTextParagraphStyle->getTextCharacterProperties() ); + aTextCharacterStyle.assignUsed( rTextStyleProperties ); aTextCharacterStyle.assignUsed( maProperties.getTextCharacterProperties() ); if( !bFirst ) |