summaryrefslogtreecommitdiff
path: root/sw/qa/extras/layout/layout.cxx
diff options
context:
space:
mode:
authorTünde Tóth <tundeth@gmail.com>2020-01-30 14:22:51 +0100
committerLászló Németh <nemeth@numbertext.org>2020-02-04 11:22:30 +0100
commitbe936c5896045794b251a63ab1175ac06a36eee5 (patch)
treeac242b1a15260538cf38f06399ffbdcea817b85a /sw/qa/extras/layout/layout.cxx
parentfaeeef2e6ce378a9e8572b5034edc612dc6beabf (diff)
tdf#130242 chart: default center label placement in stacked area charts
instead of top label placement, like MSO does (or LO has already done in stacked bar charts) for readability. Change-Id: Icac6e8703d0d04122f9cc28254b053ee9fd434ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87846 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.cxx32
1 files changed, 32 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index b6bdd958cbed..c1c43399c9f4 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2515,9 +2515,41 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf130031)
xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
sal_Int32 nY = getXPath(pXmlDoc, "//textarray[11]", "y").toInt32();
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 4339
+ // - Actual : 2182
+ // - Delta : 50
+ // i.e. the data label appeared above the data point.
CPPUNIT_ASSERT_DOUBLES_EQUAL(4339, nY, 50);
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf130242)
+{
+ SwDoc* pDoc = createDoc("tdf130242.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;
+ xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+ CPPUNIT_ASSERT(pXmlDoc);
+ sal_Int32 nY = getXPath(pXmlDoc, "//textarray[11]", "y").toInt32();
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 4958
+ // - Actual : 3352
+ // - Delta : 50
+ // i.e. the data label appeared above the data point.
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(4958, nY, 50);
+
+ nY = getXPath(pXmlDoc, "//textarray[13]", "y").toInt32();
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 3018
+ // - Actual : 2343
+ // - Delta : 50
+ // i.e. the data label appeared above the data point.
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(3018, nY, 50);
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf116925)
{
SwDoc* pDoc = createDoc("tdf116925.docx");