summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorTünde Tóth <toth.tunde@nisz.hu>2020-12-11 09:13:46 +0100
committerLászló Németh <nemeth@numbertext.org>2020-12-16 18:26:26 +0100
commitb0068342398786ca50304260434a18880dddf74d (patch)
tree3ab817e39b7c9bad27a825f335008ed347ee2cf6 /sw/qa
parentf5ab8bcbfd20ecce4a358f62ee3f81b8b968a5de (diff)
tdf#138777 pie chart: improve long data label width
to avoid chart distortion. Reduce the maximum text width of data point label shape based, because in some cases the long data label flowed out of the chart. Change-Id: I045c81ecc6ce579e1f472d7ea67e04315ce9c60b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107585 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')
-rw-r--r--sw/qa/extras/layout/data/outside_long_data_label.docxbin0 -> 27245 bytes
-rw-r--r--sw/qa/extras/layout/layout2.cxx18
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/outside_long_data_label.docx b/sw/qa/extras/layout/data/outside_long_data_label.docx
new file mode 100644
index 000000000000..fb5110a43eaa
--- /dev/null
+++ b/sw/qa/extras/layout/data/outside_long_data_label.docx
Binary files differ
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index b52ff9ecdb6c..0c2d2c47d3f6 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -856,6 +856,24 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf137154)
CPPUNIT_ASSERT_DOUBLES_EQUAL(nX4, nX1, 50);
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf138777)
+{
+ SwDoc* pDoc = createDoc("outside_long_data_label.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);
+
+ const sal_Int32 nFirstLabelLines
+ = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"really\")])").toInt32();
+
+ // This failed, if the first data label didn't break to multiple lines.
+ CPPUNIT_ASSERT_GREATER(static_cast<sal_Int32>(1), nFirstLabelLines);
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf130031)
{
SwDoc* pDoc = createDoc("tdf130031.docx");