diff options
author | Tünde Tóth <toth.tunde@nisz.hu> | 2020-12-11 09:13:46 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-12-16 18:26:26 +0100 |
commit | b0068342398786ca50304260434a18880dddf74d (patch) | |
tree | 3ab817e39b7c9bad27a825f335008ed347ee2cf6 /sw/qa | |
parent | f5ab8bcbfd20ecce4a358f62ee3f81b8b968a5de (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.docx | bin | 0 -> 27245 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout2.cxx | 18 |
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 Binary files differnew file mode 100644 index 000000000000..fb5110a43eaa --- /dev/null +++ b/sw/qa/extras/layout/data/outside_long_data_label.docx 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"); |