From 7c300296dd727990455449b19b111b9fc49eadad Mon Sep 17 00:00:00 2001 From: Balazs Varga Date: Mon, 2 Mar 2020 13:55:35 +0100 Subject: tdf#131060 tdf#117088 chart view: fix missing or truncated axis labels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit if we have enough space under the horizontal X axis. Note: allow truncation of vertical X axis labels only if they are text labels and the position is NEAR_AXIS or OUTSIDE_START. Regressions from commit 35d062f7879d5414334643cb90bff411726b2168 (tdf#116163: Limit label height in chart if needed) and commit 26caf1bc59c81704f11225e3e431e412deb8c475 (tdf#114179: Custom size and position of the chart wall) Change-Id: Idf86bc2b5482bb50a266cda57cc502621c2e08ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89829 Tested-by: László Németh Reviewed-by: László Németh --- sw/qa/extras/layout/layout.cxx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'sw/qa/extras/layout/layout.cxx') diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 2fcc9f8da6f4..e57b72264ec4 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -2416,6 +2416,30 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122800) // This failed, if the textarray length of the first axis label not 22. } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTruncatedAxisLabel) +{ + SwDoc* pDoc = createDoc("testTruncatedAxisLabel.odt"); + SwDocShell* pShell = pDoc->GetDocShell(); + + // Dump the rendering of the first page as an XML file. + std::shared_ptr xMetaFile = pShell->GetPreviewMetaFile(); + MetafileXmlDump dumper; + xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + CPPUNIT_ASSERT(pXmlDoc); + + // test the X axis label visibility + assertXPathContent( + pXmlDoc, + "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/textarray[1]/text", + "Long axis label truncated 1"); + + // test the Y axis label visibility + assertXPathContent( + pXmlDoc, + "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/push[1]/textarray[3]/text", + "-5.00"); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128996) { SwDoc* pDoc = createDoc("tdf128996.docx"); -- cgit v1.2.3