summaryrefslogtreecommitdiff
path: root/sw/qa/extras/layout/layout.cxx
diff options
context:
space:
mode:
authorTünde Tóth <tundeth@gmail.com>2020-02-03 15:51:52 +0100
committerLászló Németh <nemeth@numbertext.org>2020-02-07 18:36:18 +0100
commita979047eefec607b311773c7e2a71bb3ee2c6362 (patch)
tree97f274a45e3374872cd37792e0155cd5230b9eb8 /sw/qa/extras/layout/layout.cxx
parentcbfa11ab8f429bf0cb279c732ec7a8dba0090104 (diff)
tdf#130380 Chart: Fix area chart data labels position
Regression from commit: f8966bb398cf0623be841c618b123866801a063c (tdf#130031 Chart OOXML import: fix area chart data label position) Change-Id: Iafcbacb0ecf6f8a175adbf0782ee3e3a1185a726 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87881 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/qa/extras/layout/layout.cxx')
-rw-r--r--sw/qa/extras/layout/layout.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index bd1e609fdce1..ae3548737210 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2550,6 +2550,29 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf130242)
CPPUNIT_ASSERT_DOUBLES_EQUAL(3018, nY, 50);
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf130380)
+{
+ SwDoc* pDoc = createDoc("tdf130380.docx");
+ SwDocShell* pShell = pDoc->GetDocShell();
+
+ // Dump the rendering of the first page as an XML file.
+ std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile();
+ MetafileXmlDump dumper;
+ xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+ CPPUNIT_ASSERT(pXmlDoc);
+ sal_Int32 nY = getXPath(pXmlDoc,
+ "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[1]/polypolygon/"
+ "polygon/point[1]",
+ "y")
+ .toInt32();
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 6727
+ // - Actual : 4411
+ // - Delta : 50
+ // i.e. the area chart shrank.
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(6727, nY, 50);
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf116925)
{
SwDoc* pDoc = createDoc("tdf116925.docx");