summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTünde Tóth <tundeth@gmail.com>2020-07-24 10:06:40 +0200
committerLászló Németh <nemeth@numbertext.org>2020-07-27 14:11:10 +0200
commitc0fac974cefffb16e811259fbc66148712533190 (patch)
treeaf6ca82abeaebbc3a79ea95388b361e01198a368 /sw
parent055735fa8589670f67e016bc3b7835d4cf81641f (diff)
tdf#134866 Chart OOXML import: fix percentage in custom pie chart label
Custom pie chart label showed incorrect percentage value. Follow-up of commit 8c1dc30cc9fc96ef3d3ab0c4445959473248ae4d (tdf#125444 Percentage as custom chart label). Change-Id: I2fe9cbca876da26a7c3a371c1e711b9e1fc33b1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99353 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/layout/data/tdf134866.docxbin0 -> 27169 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx16
2 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/tdf134866.docx b/sw/qa/extras/layout/data/tdf134866.docx
new file mode 100644
index 000000000000..3358b527133c
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf134866.docx
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 710efbf54f89..d6249e412b44 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2785,6 +2785,22 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf129173)
pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/textarray[22]/text", "56");
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf134866)
+{
+ SwDoc* pDoc = createDoc("tdf134866.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);
+
+ // Check the data label of pie chart.
+ assertXPathContent(
+ pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/textarray[2]/text", "100%");
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf130031)
{
SwDoc* pDoc = createDoc("tdf130031.docx");