summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2019-11-21 14:56:43 +0100
committerLászló Németh <nemeth@numbertext.org>2019-11-27 12:02:50 +0100
commit739ed2c29f49ea5e83bcd1352b2644c2e2d09f7b (patch)
tree1df3153f300af63631410770638beebf5ea916fc /sw
parent6bced3c6a1bf8d4652dd6ba75e41b128ce1bfc5c (diff)
tdf#115630 tdf#88922 Chart: fix custom legend position and size
Do not need to set the "AnchorPosition" value, when we move the legend object. It is enough to set only the "Expansion" as custom, so we keep the previously set "AnchorPosition" value and we can use the lcl_calculatePositionAndRemainingSpace function to calculate the remaining space of the inner chart area. Change-Id: I7b577bc6acf2de9b6755329b92603ea5ba631d57 Reviewed-on: https://gerrit.libreoffice.org/83399 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/layout/data/tdf115630.docxbin0 -> 26224 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx25
2 files changed, 25 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/tdf115630.docx b/sw/qa/extras/layout/data/tdf115630.docx
new file mode 100644
index 000000000000..e9f6339a1242
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf115630.docx
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 89df9aa18d90..d1517323b581 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2285,6 +2285,31 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf75659)
// These failed, if the legend names are empty strings.
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf115630)
+{
+ SwDoc* pDoc = createDoc("tdf115630.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;
+ xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ // Test wide of inner chart area.
+ sal_Int32 nXRight
+ = getXPath(pXmlDoc,
+ "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[3]/polyline[1]/point[1]",
+ "x")
+ .toInt32();
+ sal_Int32 nXLeft
+ = getXPath(pXmlDoc,
+ "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[3]/polyline[1]/point[2]",
+ "x")
+ .toInt32();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2886), nXRight - nXLeft);
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf108021)
{
SwDoc* pDoc = createDoc("tdf108021.odt");