summaryrefslogtreecommitdiff
path: root/sc/qa/unit/subsequent_export-test.cxx
diff options
context:
space:
mode:
authorSzabolcs Toth <toth.szabolcs@nisz.hu>2020-12-31 10:31:30 +0100
committerLászló Németh <nemeth@numbertext.org>2021-01-15 12:48:07 +0100
commitfddad2ed797f1773ed5be979a0b05d3f976b744e (patch)
treea4518852c2a92861ad858e289c8811ba53c3e05a /sc/qa/unit/subsequent_export-test.cxx
parente93267693fb66b48f92843bb6dab346e6212f683 (diff)
tdf#139258 XLSX export: fix position of rotated images
Follow-up of commit a4eec60c388cc65ae0b4c8ea0fd7235f520a749d (tdf#123613 XLSX export: fix position of rotated shapes) and commit 368c56144aab5794c39d5bc2082d9b3d6d7cebdb (refactor for xlsx shape export). Change-Id: If5a79685efa1a80ea82eac19aed12bb426d10987 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108533 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sc/qa/unit/subsequent_export-test.cxx')
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 1f8b648d81c6..27fa72e76d30 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -278,6 +278,7 @@ public:
void testTdf129969();
void testTdf84874();
void testTdf136721_paper_size();
+ void testTdf139258_rotated_image();
CPPUNIT_TEST_SUITE(ScExportTest);
CPPUNIT_TEST(test);
@@ -454,6 +455,7 @@ public:
CPPUNIT_TEST(testTdf129969);
CPPUNIT_TEST(testTdf84874);
CPPUNIT_TEST(testTdf136721_paper_size);
+ CPPUNIT_TEST(testTdf139258_rotated_image);
CPPUNIT_TEST_SUITE_END();
@@ -5769,6 +5771,25 @@ void ScExportTest::testTdf136721_paper_size()
assertXPath(pDoc, "/x:worksheet/x:pageSetup", "paperSize", "70");
}
+void ScExportTest::testTdf139258_rotated_image()
+{
+ // Check that the topleft position of the image is correct.
+ ScDocShellRef xShell = loadDoc(u"tdf139258_rotated_image.", FORMAT_ODS);
+ CPPUNIT_ASSERT(xShell.is());
+
+ std::shared_ptr<utl::TempFile> pXPathFile
+ = ScBootstrapFixture::exportTo(&(*xShell), FORMAT_XLSX);
+
+ xmlDocUniquePtr pDrawing
+ = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/drawing1.xml");
+ CPPUNIT_ASSERT(pDrawing);
+
+ assertXPathContent(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:from/xdr:col", "1");
+ assertXPathContent(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:from/xdr:row", "12");
+ assertXPathContent(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:to/xdr:col", "6");
+ assertXPathContent(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:to/xdr:row", "25");
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();