summaryrefslogtreecommitdiff
path: root/sw/qa/extras/layout
diff options
context:
space:
mode:
authorTünde Tóth <toth.tunde@nisz.hu>2020-09-30 13:11:26 +0200
committerLászló Németh <nemeth@numbertext.org>2020-10-19 08:58:51 +0200
commitdb49cdcf2f367e27ed8fb5f1619f0b41f2c63fd2 (patch)
tree78fcb53c14a82af63b9b8f13efab77e1679be6d0 /sw/qa/extras/layout
parent56847f654de05ca610f7117d5a19784b0fb421d5 (diff)
tdf#137154 pie chart: improve Outside position of data labels
Some pie chart data labels were too close to the pie with Outside placement. Change-Id: I0eecdfc32601bdfa8bb3115183f9ca723a9f945b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103683 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/qa/extras/layout')
-rw-r--r--sw/qa/extras/layout/data/tdf137154.docxbin0 -> 27388 bytes
-rw-r--r--sw/qa/extras/layout/layout2.cxx20
2 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/tdf137154.docx b/sw/qa/extras/layout/data/tdf137154.docx
new file mode 100644
index 000000000000..0dc8d3220e4e
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf137154.docx
Binary files differ
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index f0a8e943f1ab..f0bb71e9b9f5 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -812,6 +812,26 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137116)
CPPUNIT_ASSERT_DOUBLES_EQUAL(694, nX2 - nX4, 100);
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137154)
+{
+ SwDoc* pDoc = createDoc("tdf137154.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;
+ xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+ CPPUNIT_ASSERT(pXmlDoc);
+ sal_Int32 nX1 = getXPath(pXmlDoc, "//textarray[1]", "x").toInt32(); // first data label
+ sal_Int32 nX4 = getXPath(pXmlDoc, "//textarray[4]", "x").toInt32(); // fourth data label
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 10865
+ // - Actual : 10252
+ // - Delta : 50
+ // i.e. the first data label appeared too close to the pie.
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(nX4, nX1, 50);
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130031)
{
SwDoc* pDoc = createDoc("tdf130031.docx");