diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-10-07 21:10:33 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-10-08 08:49:03 +0200 |
commit | 9c81d0a268cca4ff36eff94c0842361b9c0287ef (patch) | |
tree | 6c469ceabe9c55b2763d1e76a7ebc0228e908d0c /writerfilter | |
parent | 266303e867fae0eb10fe9aa52cf683e3db88376a (diff) |
tdf#127825 DOCX import: fix handling for tbrl, auto-height and rel size shapes
Regression from commit ff17478e069cc82681df62514876c06365dd5cd6 (sw btlr
writing mode: implement DOCX shape import for tbrl, 2019-04-25), there
were two problems here:
1) Relative size currently only works properly for the lrtb direction,
so disable that during import till sw core is improved.
2) When SwFlyFrame::Format() auto-grows a text frame which is the
textbox of a shape, it needs to notify the shape about the physical size
of the frame, not the logical one. So going via the SwRectFnSet
abstraction is not correct in this case.
Change-Id: Ie185c7415d90594434eac8f459630d6a3212328a
Reviewed-on: https://gerrit.libreoffice.org/80398
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/GraphicImport.cxx | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index 2f7ef092a018..131ff53d60a3 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -1116,7 +1116,25 @@ void GraphicImport::lcl_sprm(Sprm& rSprm) { uno::Reference<beans::XPropertySet> xPropertySet(m_xShape, uno::UNO_QUERY); OUString aProperty = nSprmId == NS_ooxml::LN_CT_SizeRelH_pctWidth ? OUString("RelativeWidth") : OUString("RelativeHeight"); - xPropertySet->setPropertyValue(aProperty, uno::makeAny(nPositivePercentage)); + + sal_Int32 nTextPreRotateAngle = 0; + uno::Any aAny; + if (xPropertySet->getPropertySetInfo()->hasPropertyByName( + "CustomShapeGeometry")) + { + aAny = xPropertySet->getPropertyValue("CustomShapeGeometry"); + } + comphelper::SequenceAsHashMap aCustomShapeGeometry(aAny); + auto it = aCustomShapeGeometry.find("TextPreRotateAngle"); + if (it != aCustomShapeGeometry.end()) + { + nTextPreRotateAngle = it->second.get<sal_Int32>(); + } + if (nTextPreRotateAngle == 0) + { + xPropertySet->setPropertyValue(aProperty, + uno::makeAny(nPositivePercentage)); + } } } |