summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTünde Tóth <tundeth@gmail.com>2020-05-21 10:20:43 +0200
committerLászló Németh <nemeth@numbertext.org>2020-05-25 13:41:49 +0200
commited2c880a691a0b179bbc92a8ce4ee49eac004035 (patch)
tree40fae66a1dc0b237c31d881a25552d4bb8b506cd /sw
parent7ed0993b9c2de38dfe2e71df15755b495f9a2299 (diff)
tdf#133005 Chart: fix ODF import of date axis position
Chart with date axis setting "On tick marks" wasn't imported correctly. See commit 40d83914d43f60a196dfabddea0b52e2046b333a (tdf#127792 implement UNO chart attribute MajorOrigin) Change-Id: I5967c4bab8690df1f191b33ecb0e5b043bca68a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94621 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/layout/data/tdf133005.odtbin0 -> 13251 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx26
2 files changed, 26 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/tdf133005.odt b/sw/qa/extras/layout/data/tdf133005.odt
new file mode 100644
index 000000000000..660112d66712
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf133005.odt
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 853d6b997381..adac583c8ed2 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2347,6 +2347,32 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf123268)
41);
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf133005)
+{
+ SwDoc* pDoc = createDoc("tdf133005.odt");
+ SwDocShell* pShell = pDoc->GetDocShell();
+
+ // Dump the rendering of the first page as an XML file.
+ std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile();
+ MetafileXmlDump dumper;
+ xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ sal_Int32 nXChartWall = getXPath(pXmlDoc,
+ "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/"
+ "push[1]/push[1]/polyline[1]/point[2]",
+ "x")
+ .toInt32();
+ sal_Int32 nXColumn = getXPath(pXmlDoc,
+ "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/"
+ "push[1]/push[42]/polypolygon/polygon/point[1]",
+ "x")
+ .toInt32();
+
+ // This failed, if the value axis doesn't appear inside category.
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(nXChartWall, nXColumn, 5);
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf115630)
{
SwDoc* pDoc = createDoc("tdf115630.docx");