summaryrefslogtreecommitdiff
path: root/sw/qa/extras/layout
diff options
context:
space:
mode:
authorTünde Tóth <tundeth@gmail.com>2020-06-15 16:42:40 +0200
committerLászló Németh <nemeth@numbertext.org>2020-06-30 12:44:23 +0200
commit72613bd2a04b4b1ba614c0f645e9804ebfe73682 (patch)
tree84699adbd30081c0a90a4a9ea75ba453f3811589 /sw/qa/extras/layout
parentd828da851efa8e243a940f3eceefc39c6c735f9b (diff)
tdf#126425 Chart: fix missing legend with exceeding text
Ellipsize legend box contents, if the custom size of the chart legend is too small to contain the text. Change-Id: I91ef913f509b233912a8bfb878a1c80d577e2a88 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96437 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/long_legendentry.docxbin0 -> 27020 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx17
2 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/long_legendentry.docx b/sw/qa/extras/layout/data/long_legendentry.docx
new file mode 100644
index 000000000000..6259438a16e3
--- /dev/null
+++ b/sw/qa/extras/layout/data/long_legendentry.docx
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index e5c2784c17cb..c8b5665c5e00 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2363,6 +2363,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf75659)
// These failed, if the legend names are empty strings.
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf126425)
+{
+ SwDoc* pDoc = createDoc("long_legendentry.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);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 14
+ // - Actual : 12
+ // i.e. the text of the chart legend lost.
+ assertXPath(pXmlDoc, "//textarray", 14);
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf123268)
{
SwDoc* pDoc = createDoc("tdf123268.odt");