summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorRegényi Balázs <regenyi.balazs@nisz.hu>2020-09-30 15:19:36 +0200
committerLászló Németh <nemeth@numbertext.org>2020-10-06 11:22:17 +0200
commit3b6de95a0d59cf5942af5ecf4a402c224b76f8a3 (patch)
treea0ab243874672c6ca9ed0e474c5a543f43015389 /sw/qa
parentff5ca4e5fc6a9fb24b0eb6eb629210b024473f67 (diff)
tdf#105875 DOCX VML shape import: fix missing rotation
Also to avoid bad resizing of the rotated shape, remove obsolete(?) code part from commit 0423a6741fc08a35b123556f9b10219d090ee42a (Import bezier curves from .docx.). Co-authored-by: Szabolcs Toth Change-Id: I77266ba65e558cf9e6dd0e1c37fad85abd038819 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103693 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf105875_VmlShapeRotationWithFlip.docxbin0 -> 23175 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport10.cxx34
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx4
3 files changed, 36 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf105875_VmlShapeRotationWithFlip.docx b/sw/qa/extras/ooxmlexport/data/tdf105875_VmlShapeRotationWithFlip.docx
new file mode 100644
index 000000000000..e6512e075c21
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf105875_VmlShapeRotationWithFlip.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index 4f77681d2eaf..27a651d2dde7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -1347,6 +1347,40 @@ DECLARE_OOXMLEXPORT_TEST(testTdf77236_MissingSolidFill, "tdf77236_MissingSolidFi
assertXPath(pXmlDoc, "//mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill", 1);
}
+DECLARE_OOXMLEXPORT_TEST(testTdf105875_VmlShapeRotationWithFlip, "tdf105875_VmlShapeRotationWithFlip.docx")
+{
+ // tdf#105875: check whether the rotation of the VML bezier shape is ok (with flip too)
+ // TODO: fix export too
+ if (mbExported)
+ return;
+
+ {
+ uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xPropertySet->getPropertyValue("RotateAngle").get<sal_Int32>());
+ }
+
+ {
+ uno::Reference<beans::XPropertySet> xPropertySet(getShape(2), uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(220 * 100), xPropertySet->getPropertyValue("RotateAngle").get<sal_Int32>(), 1);
+ }
+
+ {
+ uno::Reference<beans::XPropertySet> xPropertySet(getShape(3), uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(320 * 100), xPropertySet->getPropertyValue("RotateAngle").get<sal_Int32>(), 1);
+ }
+
+ {
+ uno::Reference<beans::XPropertySet> xPropertySet(getShape(4), uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(140 * 100), xPropertySet->getPropertyValue("RotateAngle").get<sal_Int32>(), 1);
+ }
+
+ {
+ uno::Reference<beans::XPropertySet> xPropertySet(getShape(5), uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(40 * 100), xPropertySet->getPropertyValue("RotateAngle").get<sal_Int32>(), 1);
+ }
+
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 97011d4bf997..ee1b545821be 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -751,7 +751,7 @@ DECLARE_OOXMLIMPORT_TEST(testTdf105127, "tdf105127.docx")
// ForceMetricTo100th_mm -> the old results were in twips due to the
// object residing in Writer. The UNO API by definition is in 100thmm,
// thus I will correct the value here.
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(5744), aPolyPolygon.Coordinates[0][0].Y); // was: 3257
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(5719), aPolyPolygon.Coordinates[0][0].Y); // was: 3257
}
DECLARE_OOXMLIMPORT_TEST(testTdf105143, "tdf105143.docx")
@@ -759,7 +759,7 @@ DECLARE_OOXMLIMPORT_TEST(testTdf105143, "tdf105143.docx")
OUString aTop = parseDump("/root/page/body/txt/anchored/SwAnchoredDrawObject/bounds", "top");
// This was 6272, i.e. the shape was moved up (incorrect position) to be
// inside the page rectangle.
- CPPUNIT_ASSERT_EQUAL(OUString("6674"), aTop);
+ CPPUNIT_ASSERT_EQUAL(OUString("6731"), aTop);
}
DECLARE_OOXMLIMPORT_TEST(testTdf105975, "105975.docx")