summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/ooxmlexport/data/croppedAndRotated.odtbin0 -> 11188 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport13.cxx4
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport15.cxx14
3 files changed, 16 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/croppedAndRotated.odt b/sw/qa/extras/ooxmlexport/data/croppedAndRotated.odt
new file mode 100644
index 000000000000..825db09da8bf
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/croppedAndRotated.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index 5fbe91f16070..f26859d48e4e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -554,8 +554,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf116371, "tdf116371.odt")
auto xShape(getShape(1));
CPPUNIT_ASSERT_DOUBLES_EQUAL(4700.0, getProperty<double>(xShape, "RotateAngle"), 10);
auto frameRect = getProperty<awt::Rectangle>(xShape, "FrameRect");
- CPPUNIT_ASSERT_EQUAL(sal_Int32(24070), frameRect.Height);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(24188), frameRect.Width);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(24063), frameRect.Height);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(24179), frameRect.Width);
}
DECLARE_OOXMLEXPORT_TEST(testFrameSizeExport, "floating-tables-anchor.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index a663e914db1e..843ef1f3704c 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -143,6 +143,20 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135973, "tdf135973.odt")
}
}
+DECLARE_OOXMLEXPORT_TEST(testTdf138953, "croppedAndRotated.odt")
+{
+ CPPUNIT_ASSERT_EQUAL(1, getShapes());
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+ // Make sure the rotation is exported correctly, and size not distorted
+ auto xShape(getShape(1));
+ CPPUNIT_ASSERT_EQUAL(27000.0, getProperty<double>(xShape, "RotateAngle"));
+ auto frameRect = getProperty<css::awt::Rectangle>(xShape, "FrameRect");
+ // Before the fix, original object size (i.e., before cropping) was written to spPr in OOXML,
+ // and the resulting object size was much larger than should be.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(12961), frameRect.Height);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(8664), frameRect.Width);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */