summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-06-02 09:07:48 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-06-03 09:05:48 +0200
commite05a39f75cd304bfc1bd59aa2eebe4889cae109f (patch)
tree2911790530c251a1e0ad343b8b4a0edcc992001c /sw/source
parentdc96863cc541937123058b13269ef234ee40edd2 (diff)
tdf#133271 sw textbox: handle TextRotateAngle shape property
Shape with btlr text direction is imported as TextPreRotateAngle=-270 from DOCX. Saving this to ODT turns the property name into TextRotateAngle and its type into double. Handle that as well to survive the ODF roundtrip of a shape+textbox where the textbox has a btlr text direction. (Also add a way to make multiple tests in a suite to be more independent from each other: depending on ordering, the new test made the old test fail. Calling ErrorRegistry::Reset() makes that go away.) Change-Id: Iea9212f3bbb01059caf3b0f2d809e48debf52953 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95340 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit 413791a65597a1808d9b98e4887864f3624b70cc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95318
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/doc/textboxhelper.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx
index 4f2550f06b52..1dcc7e242016 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -361,11 +361,21 @@ void SwTextBoxHelper::syncProperty(SwFrameFormat* pShape, const OUString& rPrope
comphelper::SequenceAsHashMap aCustomShapeGeometry(rValue);
auto it = aCustomShapeGeometry.find("TextPreRotateAngle");
+ if (it == aCustomShapeGeometry.end())
+ {
+ it = aCustomShapeGeometry.find("TextRotateAngle");
+ }
+
if (it != aCustomShapeGeometry.end())
{
- auto nTextPreRotateAngle = it->second.get<sal_Int32>();
+ auto nAngle = it->second.has<sal_Int32>() ? it->second.get<sal_Int32>() : 0;
+ if (nAngle == 0)
+ {
+ nAngle = it->second.has<double>() ? it->second.get<double>() : 0;
+ }
+
sal_Int16 nDirection = 0;
- switch (nTextPreRotateAngle)
+ switch (nAngle)
{
case -90:
nDirection = text::WritingMode2::TB_RL;