[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - oox/source sw/qa

Tünde Tóth (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 11 11:00:46 UTC 2021


 oox/source/drawingml/chart/axisconverter.cxx |   10 ++++++----
 sw/qa/extras/layout/data/tdf122225.docx      |binary
 sw/qa/extras/layout/layout2.cxx              |   16 +++++++++++-----
 3 files changed, 17 insertions(+), 9 deletions(-)

New commits:
commit 170f257ea5e3375257355def8bd7e998135ad98a
Author:     Tünde Tóth <toth.tunde at nisz.hu>
AuthorDate: Wed Jun 2 11:51:13 2021 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Fri Jun 11 13:00:09 2021 +0200

    tdf#140623 Chart OOXML import: set text overlap to false
    
    of category axis label unless the rotation is 0 in xml.
    
    Regression from commit: 21620f9d2f50e66dffc45a5afb539edb8d54434c
    (tdf#138194 Chart OOXML import: set text break to true)
    
    Change-Id: I18db7483f49c84a83760200037f8858a3b471994
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116575
    Tested-by: László Németh <nemeth at numbertext.org>
    Reviewed-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit 6185d1ff0130b3d178d5e50eeb6944ab70db41f9)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116905
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/oox/source/drawingml/chart/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx
index 1a8e23024612..7aa141c0f798 100644
--- a/oox/source/drawingml/chart/axisconverter.cxx
+++ b/oox/source/drawingml/chart/axisconverter.cxx
@@ -271,10 +271,12 @@ void AxisConverter::convertFromModel(const Reference<XCoordinateSystem>& rxCoord
                 }
                 else
                 {
-                    // do not overlap text when the rotation is undefined in xml
-                    bool bTextOverlap
-                        = mrModel.mxTextProp.is()
-                          && mrModel.mxTextProp->getTextProperties().moRotation.has();
+                    // do not overlap text unless the rotation is 0 in xml
+                    bool bTextOverlap = false;
+                    if (mrModel.mxTextProp.is()
+                        && mrModel.mxTextProp->getTextProperties().moRotation.has())
+                        bTextOverlap
+                            = mrModel.mxTextProp->getTextProperties().moRotation.get() == 0;
                     aAxisProp.setProperty(PROP_TextOverlap, bTextOverlap);
                     /* do not break text into several lines unless the rotation is 0 degree,
                        or the rotation is 90 degree and the inner size of the chart is not fixed,
diff --git a/sw/qa/extras/layout/data/tdf122225.docx b/sw/qa/extras/layout/data/tdf122225.docx
index 2b2b24a5548d..e4f0cc35f0e8 100644
Binary files a/sw/qa/extras/layout/data/tdf122225.docx and b/sw/qa/extras/layout/data/tdf122225.docx differ
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index 9894ceac418c..4202e7db087b 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -380,7 +380,6 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf131707)
     assertXPath(pXmlDoc, "//body/tab/row[3]/cell[2]/txt/anchored/fly/infos/bounds", "top", "2185");
 }
 
-#if HAVE_MORE_FONTS
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf122225)
 {
     SwDoc* pDoc = createDoc("tdf122225.docx");
@@ -392,12 +391,19 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf122225)
     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");
+    // Bug 122225 - FILEOPEN DOCX Textbox of Column chart legend reduces and text of legend disappears
+    const sal_Int32 nLegendLabelLines
+        = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"Advanced Diploma\")])")
+              .toInt32();
     // This failed, if the legend label is not "Advanced Diploma".
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nLegendLabelLines);
+
+    // Bug 140623 - Fileopen DOCX: Text Orientation of X-Axis 0 instead of 45 degrees
+    const sal_Int32 nThirdLabelLines
+        = getXPathContent(pXmlDoc, "count(//text[contains(text(),\"Hispanic\")])").toInt32();
+    // This failed, if the third X axis label broke to multiple lines.
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nThirdLabelLines);
 }
-#endif
 
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf125335)
 {


More information about the Libreoffice-commits mailing list