diff options
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/drawingml/textbody.cxx | 5 | ||||
-rw-r--r-- | oox/source/drawingml/textparagraph.cxx | 5 | ||||
-rw-r--r-- | oox/source/drawingml/textparagraphproperties.cxx | 10 |
3 files changed, 15 insertions, 5 deletions
diff --git a/oox/source/drawingml/textbody.cxx b/oox/source/drawingml/textbody.cxx index 0f053ab6ad74..1be15c4f885d 100644 --- a/oox/source/drawingml/textbody.cxx +++ b/oox/source/drawingml/textbody.cxx @@ -65,7 +65,7 @@ void TextBody::insertAt( for (auto const& paragraph : maParagraphs) { paragraph->insertAt(rFilterBase, xText, xAt, rTextStyleProperties, aMasterTextStyle, - maTextListStyle, (nIndex == 0), nCharHeight); + maTextListStyle, (nIndex == 0), nCharHeight, getTextProperties().mnFontScale); ++nIndex; } } @@ -148,7 +148,8 @@ void TextBody::ApplyStyleEmpty( float nCharHeight = xProps->getPropertyValue("CharHeight").get<float>(); TextParagraphProperties aParaProp; aParaProp.apply(*pTextParagraphStyle); - aParaProp.pushToPropSet(&rFilterBase, xProps, aioBulletList, &pTextParagraphStyle->getBulletList(), true, nCharHeight, true); + aParaProp.pushToPropSet(&rFilterBase, xProps, aioBulletList, &pTextParagraphStyle->getBulletList(), + true, nCharHeight, getTextProperties().mnFontScale, true); } } diff --git a/oox/source/drawingml/textparagraph.cxx b/oox/source/drawingml/textparagraph.cxx index 23f051cdd5df..f08efdbff3c3 100644 --- a/oox/source/drawingml/textparagraph.cxx +++ b/oox/source/drawingml/textparagraph.cxx @@ -87,7 +87,8 @@ void TextParagraph::insertAt( const Reference < XTextCursor > &xAt, const TextCharacterProperties& rTextStyleProperties, const TextListStyle& rMasterTextListStyle, - const TextListStyle& rTextListStyle, bool bFirst, float nDefaultCharHeight) const + const TextListStyle& rTextListStyle, bool bFirst, + float nDefaultCharHeight, sal_Int32 nAutofitFontScale) const { try { sal_Int32 nParagraphSize = 0; @@ -175,7 +176,7 @@ void TextParagraph::insertAt( } float fCharacterSize = nCharHeight > 0 ? GetFontHeight ( nCharHeight ) : pTextParagraphStyle->getCharHeightPoints( 12 ); - aParaProp.pushToPropSet( &rFilterBase, xProps, aioBulletList, &pTextParagraphStyle->getBulletList(), true, fCharacterSize, true ); + aParaProp.pushToPropSet( &rFilterBase, xProps, aioBulletList, &pTextParagraphStyle->getBulletList(), true, fCharacterSize, nAutofitFontScale, true ); } // empty paragraphs do not have bullets in ppt diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx index 23efb301e963..0006b7530a76 100644 --- a/oox/source/drawingml/textparagraphproperties.cxx +++ b/oox/source/drawingml/textparagraphproperties.cxx @@ -405,7 +405,7 @@ void TextParagraphProperties::apply( const TextParagraphProperties& rSourceProps void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* pFilterBase, const Reference < XPropertySet >& xPropSet, PropertyMap& rioBulletMap, const BulletList* pMasterBuList, bool bApplyBulletMap, float fCharacterSize, - bool bPushDefaultValues ) const + sal_Int32 nAutofitFontScale, bool bPushDefaultValues ) const { PropertySet aPropSet( xPropSet ); aPropSet.setProperties( maTextParagraphPropertyMap ); @@ -431,6 +431,14 @@ void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* p std::optional< sal_Int32 > noParaLeftMargin( moParaLeftMargin ); std::optional< sal_Int32 > noFirstLineIndentation( moFirstLineIndentation ); + // tdf#149961 Impress scales the indents when text is autofitted while Powerpoint doesn't + // Try to counteract this by multiplying indents by the inverse of the autofit font scale. + if ( nAutofitFontScale ) + { + if ( noParaLeftMargin ) noParaLeftMargin = *noParaLeftMargin * MAX_PERCENT / nAutofitFontScale; + if ( noFirstLineIndentation ) noFirstLineIndentation = *noFirstLineIndentation * MAX_PERCENT / nAutofitFontScale; + } + if ( nNumberingType != NumberingType::NUMBER_NONE ) { if ( noParaLeftMargin ) |