summaryrefslogtreecommitdiff
path: root/oox/source/export
diff options
context:
space:
mode:
authorSzabolcs Toth <toth.szabolcs@nisz.hu>2020-09-16 14:41:24 +0200
committerLászló Németh <nemeth@numbertext.org>2020-09-24 12:54:14 +0200
commit8c23be49fb5a9044989532e6e20feb1e3ff64f2b (patch)
tree9479b0ea74d33dc582d8b9c7266cc3e9281dea74 /oox/source/export
parent4a899a5f8a72ea29a6919316afe3627de9f33e95 (diff)
tdf#106197 XLSX shape import: keep text upright
Handle and grab-bag attribute upright to keep text upright regardless of shape rotation, fixing the text direction after import and after a round-trip. Co-authored-by: Balázs Regényi Change-Id: If4c73aeaebad55af967cea894a94756068ca3766 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102870 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox/source/export')
-rw-r--r--oox/source/export/drawingml.cxx37
1 files changed, 19 insertions, 18 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 8d3cbd23a6a7..8ea8035ea39a 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2932,24 +2932,6 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo
else if( bVertical && eHorizontalAlignment == TextHorizontalAdjust_LEFT )
sVerticalAlignment = "b";
- bool isUpright = false;
- if (GetProperty(rXPropSet, "InteropGrabBag"))
- {
- if (rXPropSet->getPropertySetInfo()->hasPropertyByName("InteropGrabBag"))
- {
- uno::Sequence<beans::PropertyValue> aGrabBag;
- rXPropSet->getPropertyValue("InteropGrabBag") >>= aGrabBag;
- for (auto& aProp : aGrabBag)
- {
- if (aProp.Name == "Upright")
- {
- aProp.Value >>= isUpright;
- break;
- }
- }
- }
- }
-
bool bHasWrap = false;
bool bWrap = false;
// Only custom shapes obey the TextWordWrap option, normal text always wraps.
@@ -2971,6 +2953,25 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo
if (xServiceInfo.is() && xServiceInfo->supportsService("com.sun.star.drawing.TextShape"))
pWrap = "square";
}
+
+ bool isUpright = false;
+ if (GetProperty(rXPropSet, "InteropGrabBag"))
+ {
+ if (rXPropSet->getPropertySetInfo()->hasPropertyByName("InteropGrabBag"))
+ {
+ uno::Sequence<beans::PropertyValue> aGrabBag;
+ rXPropSet->getPropertyValue("InteropGrabBag") >>= aGrabBag;
+ for (auto& aProp : aGrabBag)
+ {
+ if (aProp.Name == "Upright")
+ {
+ aProp.Value >>= isUpright;
+ break;
+ }
+ }
+ }
+ }
+
mpFS->startElementNS( (nXmlNamespace ? nXmlNamespace : XML_a), XML_bodyPr,
XML_wrap, pWrap,
XML_fromWordArt, sax_fastparser::UseIf("1", bFromWordArt),