chart2/source/view/main/VLegend.cxx     |    2 +-
 sw/qa/extras/layout/data/tdf122225.docx |binary
 sw/qa/extras/layout/layout.cxx          |   17 +++++++++++++++++
 3 files changed, 18 insertions(+), 1 deletion(-)

New commits:
commit 936259e7965857541a9ec02db1eebd966718beb4
Author:     Tünde Tóth <tund...@gmail.com>
AuthorDate: Mon Jun 22 15:51:51 2020 +0200
Commit:     Tünde Tóth <tund...@gmail.com>
CommitDate: Tue Jun 30 11:26:20 2020 +0200

    tdf#122225 Chart OOXML import: fix missing legend text
    
    resulted by inaccurate calculation of nMaxTextWidth.
    
    Change-Id: Ie41bbc30074c6bbccacbc58adda5d9f2cfdfeba8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96926
    Tested-by: László Németh <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>
    (cherry picked from commit 8c73d6b63714fb41486fd53ec4c7f68ad63cd190)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97372
    Tested-by: Jenkins
    Reviewed-by: Tünde Tóth <tund...@gmail.com>

diff --git a/chart2/source/view/main/VLegend.cxx 
b/chart2/source/view/main/VLegend.cxx
index 669e575a18ac..9bfd679e95f1 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -290,7 +290,7 @@ awt::Size lcl_placeLegendEntries(
 
     const sal_Int32 nSymbolToTextDistance = static_cast< sal_Int32 >( 
std::max( 100.0, fViewFontSize * 0.22 ) );//minimum 1mm
     const sal_Int32 nSymbolPlusDistanceWidth = rMaxSymbolExtent.Width + 
nSymbolToTextDistance;
-    sal_Int32 nMaxTextWidth = rRemainingSpace.Width - (2 * nXPadding) - 
nSymbolPlusDistanceWidth;
+    sal_Int32 nMaxTextWidth = rRemainingSpace.Width - nSymbolPlusDistanceWidth;
     uno::Any* pFrameWidthAny = PropertyMapper::getValuePointer( 
rTextProperties.second, rTextProperties.first, "TextMaximumFrameWidth");
     if(pFrameWidthAny)
     {
diff --git a/sw/qa/extras/layout/data/tdf122225.docx 
b/sw/qa/extras/layout/data/tdf122225.docx
new file mode 100644
index 000000000000..2b2b24a5548d
Binary files /dev/null and b/sw/qa/extras/layout/data/tdf122225.docx differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 7fe63d3f2217..d30d9a35af44 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2289,6 +2289,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf131707)
     assertXPath(pXmlDoc, 
"//body/tab/row[3]/cell[2]/txt/anchored/fly/infos/bounds", "top", "2185");
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122225)
+{
+    SwDoc* pDoc = createDoc("tdf122225.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);
+
+    assertXPathContent(pXmlDoc,
+                       
"/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/textarray[8]/text",
+                       "Advanced Diploma");
+    // This failed, if the legend label is not "Advanced Diploma".
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf125335)
 {
     SwDoc* pDoc = createDoc("tdf125335.odt");
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to