summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlexport
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2021-07-01 22:05:48 +0200
committerRegina Henschel <rb.henschel@t-online.de>2021-07-02 10:16:58 +0200
commita020f2c3993fd8b625cee07ed73949982e719fca (patch)
tree05a7c20a6f0fe43674d16f421cf89190d9bc32f6 /sw/qa/extras/ooxmlexport
parent125500fed7ee9929ae9f94bcdc113801813dbf73 (diff)
tdf#123569 correct position of rotated Writer image
Error was, that the position pFrameFormat->GetHoriOrient().GetPos() was treated as left/top of snap rectangle and the associated left/top of a logic rectangle was calculated from it based on rotation angle. But actually it is already left/top of logic rectangle. Nevertheless effectExtent has to be calculated for the rotation. The fix is based on commit 3262fc5ef3bde5b158909d11ccb008161ea95519. A direct backport to LO7.2 is not possible. Change-Id: I8761b673d1358bb476f1678fd2a104eaec6dcb2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118243 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'sw/qa/extras/ooxmlexport')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf123569_rotWriterImage_46deg.odtbin0 -> 18450 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport16.cxx12
2 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf123569_rotWriterImage_46deg.odt b/sw/qa/extras/ooxmlexport/data/tdf123569_rotWriterImage_46deg.odt
new file mode 100644
index 000000000000..b452852afee2
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf123569_rotWriterImage_46deg.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index ecd0e4b62803..b670c72333ff 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -70,6 +70,18 @@ protected:
return OString(filename).endsWith(".docx");
}
};
+DECLARE_OOXMLEXPORT_TEST(testTdf123569_rotWriterImage, "tdf123569_rotWriterImage_46deg.odt")
+{
+ uno::Reference<beans::XPropertySet> xFrame(getShape(1), uno::UNO_QUERY);
+ // Error was, that position of logical rectangle was treated as position of snap rectangle.
+ // Thus a wrong position was calculated.
+ // Without fix this would have failed with expected 4798, actual 4860
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(4798),
+ getProperty<sal_Int32>(xFrame, "HoriOrientPosition"), 1);
+ // Without fix this would have failed with expected 1438, actual 4062
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(1438),
+ getProperty<sal_Int32>(xFrame, "VertOrientPosition"), 1);
+}
DECLARE_OOXMLEXPORT_TEST(testTdf142486_LeftMarginShadowLeft, "tdf142486_LeftMarginShadowLeft.docx")
{