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-03-31 07:24:37 +0000
commitb8fdf370d8732d39d6739e320aa1450ead5a31b7 (patch)
tree5f4e123a04ec4ddddf5532c96a4e07ebe8b74ffa /sw
parent7042961f4d3e383c04f792a60e96d909b7e44363 (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/15083
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 471095cb4c91..f71e03e71a54 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -76,13 +76,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);
}
};
@@ -2560,6 +2560,27 @@ DECLARE_OOXMLIMPORT_TEST(testChtOutlineNumberingOoxml, "chtoutline.docx")
CPPUNIT_ASSERT_EQUAL(OUString(aExpectedSuffix,SAL_N_ELEMENTS(aExpectedSuffix)), aSuffix);
}
+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();