[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - chart2/source sw/qa

Balazs Varga (via logerrit) logerrit at kemper.freedesktop.org
Tue Jan 5 19:30:39 UTC 2021


 chart2/source/view/main/PropertyMapper.cxx |    2 ++
 sw/qa/extras/layout/data/tdf134659.docx    |binary
 sw/qa/extras/layout/layout.cxx             |   19 +++++++++++++++++++
 3 files changed, 21 insertions(+)

New commits:
commit cad61bc6601380e2716b70aec49a5526782165a7
Author:     Balazs Varga <balazs.varga991 at gmail.com>
AuthorDate: Thu Jul 9 11:08:38 2020 +0200
Commit:     Gabor Kelemen <kelemen.gabor2 at nisz.hu>
CommitDate: Tue Jan 5 20:30:06 2021 +0100

    tdf#134659 chart2: use centered label alignment at text break
    
    instead of left for axis labels broken into several lines.
    
    Change-Id: Iaf516055748189fa50165f0e954dfe0db15bbfb0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98413
    Tested-by: László Németh <nemeth at numbertext.org>
    Reviewed-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit 9eb614f8d2d9cc983c51bcdde211ee0c59c3a96c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108729
    Tested-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
    Reviewed-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>

diff --git a/chart2/source/view/main/PropertyMapper.cxx b/chart2/source/view/main/PropertyMapper.cxx
index b33ab3ee3ec6..8611cef5d43a 100644
--- a/chart2/source/view/main/PropertyMapper.cxx
+++ b/chart2/source/view/main/PropertyMapper.cxx
@@ -25,6 +25,7 @@
 #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
 #include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
 #include <com/sun/star/drawing/LineJoint.hpp>
+#include <com/sun/star/style/ParagraphAdjust.hpp>
 #include <comphelper/sequence.hxx>
 #include <tools/diagnose_ex.h>
 
@@ -460,6 +461,7 @@ void PropertyMapper::getTextLabelMultiPropertyLists(
     aValueMap.emplace( "TextVerticalAdjust", uno::Any(drawing::TextVerticalAdjust_CENTER) ); //drawing::TextVerticalAdjust - needs to be overwritten
     aValueMap.emplace( "TextAutoGrowHeight", uno::Any(true) ); // sal_Bool
     aValueMap.emplace( "TextAutoGrowWidth", uno::Any(true) ); // sal_Bool
+    aValueMap.emplace( "ParaAdjust", uno::Any(style::ParagraphAdjust_CENTER) ); // style::ParagraphAdjust_CENTER - needs to be overwritten
     if( bName )
         aValueMap.emplace( "Name", uno::Any( OUString() ) ); //CID OUString - needs to be overwritten for each point
 
diff --git a/sw/qa/extras/layout/data/tdf134659.docx b/sw/qa/extras/layout/data/tdf134659.docx
new file mode 100644
index 000000000000..7fb0bed23d7f
Binary files /dev/null and b/sw/qa/extras/layout/data/tdf134659.docx differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 28657f40c236..aa48934b8f64 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2932,6 +2932,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf132956)
 }
 
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122014)
+
 {
     SwDoc* pDoc = createDoc("tdf122014.docx");
     SwDocShell* pShell = pDoc->GetDocShell();
@@ -2948,6 +2949,24 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122014)
     CPPUNIT_ASSERT_GREATER(nX1 + 100, nX2);
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf134659)
+
+{
+    SwDoc* pDoc = createDoc("tdf134659.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);
+
+    // This failed, if the axis label is aligned to left.
+    sal_Int32 nX1 = getXPath(pXmlDoc, "//textarray[1]", "x").toInt32();
+    sal_Int32 nX2 = getXPath(pXmlDoc, "//textarray[2]", "x").toInt32();
+    CPPUNIT_ASSERT_GREATER(nX1 + 250, nX2);
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf134235)
 {
     SwDoc* pDoc = createDoc("tdf134235.docx");


More information about the Libreoffice-commits mailing list