summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/shape.cxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2022-06-06 22:53:23 +0200
committerTomaž Vajngerl <quikee@gmail.com>2022-06-08 11:36:12 +0200
commite216988657e20a1e52986f742ab60464697bcb41 (patch)
treeb61ad736892ceb1ab2abf5de8fc0fa7b644de2ea /oox/source/drawingml/shape.cxx
parente9a7ed53260feef439b7b046286352b23a69668b (diff)
tdf148321: convert OOXML inset values to text distance values
Inset values for top, bottom are calcualted differently in OOXML and need to be coverted on import to the text distance LO values, that place the text relative to the shape correctly. At export, the values can be converted back to the OOXML inset compatible values, but the values are not always converted back to the same values as the conversion is not bijective, however they do render the same. This also adds the test for the conversion when importing and checks that the exported values are expected. Change-Id: Ic64eec1a2a80ddad997f916da3e87dc30aaa12be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135463 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'oox/source/drawingml/shape.cxx')
-rw-r--r--oox/source/drawingml/shape.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 8739d4d8989d..8ef86298fd8b 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1237,7 +1237,7 @@ Reference< XShape > const & Shape::createAndInsert(
// add properties from textbody to shape properties
if( mpTextBody )
{
- mpTextBody->getTextProperties().pushRotationAdjustments();
+ mpTextBody->getTextProperties().pushTextDistances(Size(aShapeRectHmm.Width, aShapeRectHmm.Height));
aShapeProps.assignUsed( mpTextBody->getTextProperties().maPropertyMap );
// Push char properties as well - specifically useful when this is a placeholder
if( mpMasterTextListStyle && mpMasterTextListStyle->getListStyle()[0].getTextCharacterProperties().moHeight.has() )
@@ -1827,9 +1827,14 @@ Reference< XShape > const & Shape::createAndInsert(
}
}
- if( mxShape.is() )
+ if (mxShape.is())
+ {
finalizeXShape( rFilterBase, rxShapes );
+ if (mpTextBody)
+ mpTextBody->getTextProperties().readjustTextDistances(mxShape);
+ }
+
return mxShape;
}