diff options
author | Tünde Tóth <toth.tunde@nisz.hu> | 2022-02-18 10:30:54 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2022-03-01 14:08:41 +0100 |
commit | 366954ef0acce4952c4a8945e43a531dc20659fa (patch) | |
tree | ea89d5dd06f21e2c3e86977f82b98505025a6d44 /oox | |
parent | 0c7edf73fcd3df053060e723282d6d788fc3848f (diff) |
tdf#103800 PPTX shape import: fix regression of text color
defined by list styles. Properties in a:lstStyle of p:txBody
should take precedence over the same properties defined in
a:fontRef of style elements.
Change-Id: I02cc886eb9eba94f49fe413a63bf7c46c9e3c127
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130237
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130712
Tested-by: Jenkins
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; |