diff options
author | Regényi Balázs <regenyi.balazs+gerrit@gmail.com> | 2020-06-25 15:15:46 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-07-03 13:33:16 +0200 |
commit | cab956c480eb4f619580285c7b9a15b9e6d9b780 (patch) | |
tree | 3f93c46556d7e6a686e3d714aa3ce42edbffc27a /oox | |
parent | 7b14b4b377c1b94e4899860e1a45abd55230cdca (diff) |
tdf#112312 DOCX legacy shape export: keep fixed size
Classical/legacy shapes lost their fixed size when exporting them with the
option "Resize shape to fit text" because they do not have the ability to
resize to content.
Co-authored-by: Szabolcs Tóth
Change-Id: Idd84dea040f9607d0d498e591601a8648a605a2e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97127
Tested-by: Jenkins
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/drawingml.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index a5a44cc3e7fe..4adf7a9406b5 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -2901,9 +2901,14 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin if (GetDocumentType() == DOCUMENT_DOCX || GetDocumentType() == DOCUMENT_XLSX) { + // tdf#112312: only custom shapes obey the TextAutoGrowHeight option bool bTextAutoGrowHeight = false; - if (GetProperty(rXPropSet, "TextAutoGrowHeight")) + uno::Reference<drawing::XShape> xShape(rXIface, uno::UNO_QUERY); + auto pSdrObjCustomShape = xShape.is() ? dynamic_cast<SdrObjCustomShape*>(GetSdrObjectFromXShape(xShape)) : nullptr; + if (pSdrObjCustomShape && GetProperty(rXPropSet, "TextAutoGrowHeight")) + { mAny >>= bTextAutoGrowHeight; + } mpFS->singleElementNS(XML_a, (bTextAutoGrowHeight ? XML_spAutoFit : XML_noAutofit)); } if (GetDocumentType() == DOCUMENT_PPTX) |