summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorGary Houston <ghouston@arglist.com>2014-12-20 15:41:15 +1100
committerAndras Timar <andras.timar@collabora.com>2015-04-04 10:49:27 +0200
commit111766ae23510275ab64c2ee049bced62e967b3d (patch)
tree135a1119d92d0a64bd0a476da96f55731785e72a /sw
parent1d439fb738ef4896fe1ff8196c5c2e2bf8f15943 (diff)
fdo#87488 Wrong text rotation inside a preset shape from docx
Preset shape text rotation values are read in a few places and stored in moRotation. With these changes, moRotation is always read unchanged, but multiplied by -1 when it's used. Change-Id: I633d665c21daa69e15fa828a43300f10d2bf2054 Reviewed-on: https://gerrit.libreoffice.org/13561 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 921cea89da8adbe714ea8f71169dd6afc42354c4) Signed-off-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/15084
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlimport/data/fdo87488.docxbin0 -> 26418 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx25
2 files changed, 23 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/fdo87488.docx b/sw/qa/extras/ooxmlimport/data/fdo87488.docx
new file mode 100644
index 000000000000..2bd51b65fd87
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/fdo87488.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 44876b907c0b..c4bc13ab6fbf 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -73,13 +73,13 @@ public:
virtual void preTest(const char* filename) SAL_OVERRIDE
{
- if (OString(filename) == "smartart.docx" || OString(filename) == "strict-smartart.docx")
+ if (OString(filename) == "smartart.docx" || OString(filename) == "strict-smartart.docx" || OString(filename) == "fdo87488.docx")
SvtFilterOptions::Get().SetSmartArt2Shape(true);
}
virtual void postTest(const char* filename) SAL_OVERRIDE
{
- if (OString(filename) == "smartart.docx" || OString(filename) == "strict-smartart.docx")
+ if (OString(filename) == "smartart.docx" || OString(filename) == "strict-smartart.docx" || OString(filename) == "fdo87488.docx")
SvtFilterOptions::Get().SetSmartArt2Shape(false);
}
};
@@ -2408,6 +2408,27 @@ DECLARE_OOXMLIMPORT_TEST(testUnbalancedColumns, "unbalanced-columns.docx")
CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTextSections->getByIndex(2), "DontBalanceTextColumns"));
}
+DECLARE_OOXMLIMPORT_TEST(testFdo87488, "fdo87488.docx")
+{
+ // The shape on the right (index 0, CustomShape within a
+ // GroupShape) is rotated 90 degrees clockwise and contains text
+ // rotated 90 degrees anticlockwise. Must be read with SmartArt
+ // enabled in preTest above, otherwise it gets converted to a
+ // StarView MetaFile.
+ uno::Reference<container::XIndexAccess> group(getShape(1), uno::UNO_QUERY);
+ {
+ uno::Reference<text::XTextRange> text(group->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("text2"), text->getString());
+ }
+ {
+ uno::Reference<beans::XPropertySet> props(group->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(props->getPropertyValue("RotateAngle"),
+ uno::makeAny(270 * 100));
+ comphelper::SequenceAsHashMap geom(props->getPropertyValue("CustomShapeGeometry"));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(90), geom["TextPreRotateAngle"].get<sal_Int32>());
+ }
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();