diff options
Diffstat (limited to 'oox')
-rw-r--r-- | oox/inc/drawingml/textparagraph.hxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/textbody.cxx | 18 | ||||
-rw-r--r-- | oox/source/drawingml/textparagraph.cxx | 15 |
3 files changed, 23 insertions, 12 deletions
diff --git a/oox/inc/drawingml/textparagraph.hxx b/oox/inc/drawingml/textparagraph.hxx index 021434d6a5fb..1f43249372a5 100644 --- a/oox/inc/drawingml/textparagraph.hxx +++ b/oox/inc/drawingml/textparagraph.hxx @@ -63,6 +63,7 @@ public: TextCharacterProperties getCharacterStyle( const TextCharacterProperties& rTextStyleProperties, + const TextListStyle& rMasterTextListStyle, const TextListStyle& rTextListStyle) const; TextParagraphProperties* getParagraphStyle( @@ -73,6 +74,7 @@ public: const css::uno::Reference < css::text::XText > & xText, const css::uno::Reference < css::text::XTextCursor > &xAt, const TextCharacterProperties& rTextStyleProperties, + const TextListStyle& rMasterTextListStyle, const TextListStyle& rTextListStyle, bool bFirst, float nDefaultCharHeight) const; diff --git a/oox/source/drawingml/textbody.cxx b/oox/source/drawingml/textbody.cxx index f4da6886a69c..41a237e97cee 100644 --- a/oox/source/drawingml/textbody.cxx +++ b/oox/source/drawingml/textbody.cxx @@ -57,16 +57,15 @@ void TextBody::insertAt( const TextCharacterProperties& rTextStyleProperties, const TextListStylePtr& pMasterTextListStylePtr ) const { - TextListStyle aCombinedTextStyle; - aCombinedTextStyle.apply( *pMasterTextListStylePtr ); - aCombinedTextStyle.apply( maTextListStyle ); + TextListStyle aMasterTextStyle(*pMasterTextListStylePtr); Reference<css::beans::XPropertySet> xPropertySet(xAt, UNO_QUERY); float nCharHeight = xPropertySet->getPropertyValue("CharHeight").get<float>(); size_t nIndex = 0; for (auto const& paragraph : maParagraphs) { - paragraph->insertAt( rFilterBase, xText, xAt, rTextStyleProperties, aCombinedTextStyle, (nIndex == 0), nCharHeight ); + paragraph->insertAt(rFilterBase, xText, xAt, rTextStyleProperties, aMasterTextStyle, + maTextListStyle, (nIndex == 0), nCharHeight); ++nIndex; } } @@ -127,15 +126,16 @@ void TextBody::ApplyStyleEmpty( return; // Apply character properties - TextListStyle aCombinedTextStyle; - aCombinedTextStyle.apply( *pMasterTextListStylePtr ); - aCombinedTextStyle.apply( maTextListStyle ); - PropertySet aPropSet(xText); - TextCharacterProperties aTextCharacterProps(maParagraphs[0]->getCharacterStyle(rTextStyleProperties, aCombinedTextStyle)); + TextCharacterProperties aTextCharacterProps(maParagraphs[0]->getCharacterStyle( + rTextStyleProperties, *pMasterTextListStylePtr, maTextListStyle)); aTextCharacterProps.pushToPropSet(aPropSet, rFilterBase); // Apply paragraph properties + TextListStyle aCombinedTextStyle; + aCombinedTextStyle.apply(*pMasterTextListStylePtr); + aCombinedTextStyle.apply(maTextListStyle); + TextParagraphProperties* pTextParagraphStyle = maParagraphs[0]->getParagraphStyle(aCombinedTextStyle); if (pTextParagraphStyle) { diff --git a/oox/source/drawingml/textparagraph.cxx b/oox/source/drawingml/textparagraph.cxx index 9e4f309e9391..f91ee279bb3b 100644 --- a/oox/source/drawingml/textparagraph.cxx +++ b/oox/source/drawingml/textparagraph.cxx @@ -48,14 +48,18 @@ TextParagraph::~TextParagraph() TextCharacterProperties TextParagraph::getCharacterStyle ( const TextCharacterProperties& rTextStyleProperties, + const TextListStyle& rMasterTextListStyle, const TextListStyle& rTextListStyle) const { + const TextParagraphProperties* pMasterTextParagraphStyle = getParagraphStyle(rMasterTextListStyle); const TextParagraphProperties* pTextParagraphStyle = getParagraphStyle(rTextListStyle); TextCharacterProperties aTextCharacterStyle; + if (pMasterTextParagraphStyle) + aTextCharacterStyle.assignUsed(pMasterTextParagraphStyle->getTextCharacterProperties()); + aTextCharacterStyle.assignUsed(rTextStyleProperties); if (pTextParagraphStyle) aTextCharacterStyle.assignUsed(pTextParagraphStyle->getTextCharacterProperties()); - aTextCharacterStyle.assignUsed(rTextStyleProperties); aTextCharacterStyle.assignUsed(maProperties.getTextCharacterProperties()); return aTextCharacterStyle; } @@ -82,11 +86,13 @@ void TextParagraph::insertAt( const Reference < XText > &xText, const Reference < XTextCursor > &xAt, const TextCharacterProperties& rTextStyleProperties, + const TextListStyle& rMasterTextListStyle, const TextListStyle& rTextListStyle, bool bFirst, float nDefaultCharHeight) const { try { sal_Int32 nParagraphSize = 0; - TextCharacterProperties aTextCharacterStyle = getCharacterStyle(rTextStyleProperties, rTextListStyle); + TextCharacterProperties aTextCharacterStyle + = getCharacterStyle(rTextStyleProperties, rMasterTextListStyle, rTextListStyle); if( !bFirst ) { @@ -127,7 +133,10 @@ void TextParagraph::insertAt( PropertyMap aioBulletList; Reference< XPropertySet > xProps( xAt, UNO_QUERY); - TextParagraphProperties* pTextParagraphStyle = getParagraphStyle(rTextListStyle); + TextListStyle aCombinedTextStyle; + aCombinedTextStyle.apply(rMasterTextListStyle); + aCombinedTextStyle.apply(rTextListStyle); + TextParagraphProperties* pTextParagraphStyle = getParagraphStyle(aCombinedTextStyle); if ( pTextParagraphStyle ) { TextParagraphProperties aParaProp; |