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

Vasily Melenchuk (via logerrit) logerrit at kemper.freedesktop.org
Sat Jul 11 17:44:18 UTC 2020


 sw/qa/extras/layout/data/tdf134548.odt      |binary
 sw/qa/extras/layout/layout.cxx              |   20 ++++++++++++++++++++
 sw/qa/extras/ooxmlexport/data/tdf83309.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx  |   12 +++++-------
 sw/source/core/text/txttab.cxx              |    5 -----
 5 files changed, 25 insertions(+), 12 deletions(-)

New commits:
commit 41d06c9ca1f4381691d822cbf97bdb17eda716fa
Author:     Vasily Melenchuk <vasily.melenchuk at cib.de>
AuthorDate: Fri Jul 10 10:09:06 2020 +0300
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Sat Jul 11 19:43:53 2020 +0200

    tdf#134548: sw: revert of changes to tab at zero pos
    
    It looks like solution for provided in 5ed96c for
    tdf#83309 is enough to resolve original bugdoc, so
    these changes for emission of tab at zero position
    are not required and produce just regressions.
    
    Corresponding unittest for tdf#83309 is adjusted: it
    is using now original bugdoc.
    
    Conflicts:
            sw/source/core/text/txttab.cxx
    
    Change-Id: I2e7683f071f78c720436b4c9ccb903133a985e7c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98476
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98547
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/qa/extras/layout/data/tdf134548.odt b/sw/qa/extras/layout/data/tdf134548.odt
new file mode 100644
index 000000000000..bc714b0d5e01
Binary files /dev/null and b/sw/qa/extras/layout/data/tdf134548.odt differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 9e0ee4c66c66..0a84d6ab69f6 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -4114,6 +4114,26 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testStableAtPageAnchoredFlyPosition)
     CPPUNIT_ASSERT_EQUAL(aOrigRect, aRelayoutRect);
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf134548)
+{
+    createDoc("tdf134548.odt");
+    xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+    // Second paragraph has two non zero width tabs in beginning of line
+    {
+        OUString sNodeType = parseDump("/root/page/body/txt[2]/Text[1]", "nType");
+        CPPUNIT_ASSERT_EQUAL(OUString("PortionType::TabLeft"), sNodeType);
+        sal_Int32 nWidth = parseDump("/root/page/body/txt[2]/Text[1]", "nWidth").toInt32();
+        CPPUNIT_ASSERT_GREATER(sal_Int32(0), nWidth);
+    }
+    {
+        OUString sNodeType = parseDump("/root/page/body/txt[2]/Text[2]", "nType");
+        CPPUNIT_ASSERT_EQUAL(OUString("PortionType::TabLeft"), sNodeType);
+        sal_Int32 nWidth = parseDump("/root/page/body/txt[2]/Text[2]", "nWidth").toInt32();
+        CPPUNIT_ASSERT_GREATER(sal_Int32(0), nWidth);
+    }
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlexport/data/tdf83309.docx b/sw/qa/extras/ooxmlexport/data/tdf83309.docx
index e8f59bc81969..03e0797877d8 100644
Binary files a/sw/qa/extras/ooxmlexport/data/tdf83309.docx and b/sw/qa/extras/ooxmlexport/data/tdf83309.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 167c05111a51..11499ec87c72 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -623,16 +623,14 @@ DECLARE_OOXMLIMPORT_TEST(testTdf125038c, "tdf125038c.docx")
 
 DECLARE_OOXMLEXPORT_TEST(testTdf83309, "tdf83309.docx")
 {
-    CPPUNIT_ASSERT_EQUAL(1, getPages());
-    OUString sNodeType;
+    // Important: bug case had 4 pages
+    CPPUNIT_ASSERT_EQUAL(2, getPages());
 
     // First paragraph does not have tab before
-    sNodeType = parseDump("/root/page/body/txt[1]/Text[1]", "nType");
+    // (same applies to all paragraphs in doc, but lets assume they are
+    // behave same way)
+    OUString sNodeType = parseDump("/root/page[1]/body/txt[1]/Text[1]", "nType");
     CPPUNIT_ASSERT_EQUAL(OUString("PortionType::Text"), sNodeType);
-
-    // Second paragraph starts with tab
-    sNodeType = parseDump("/root/page/body/txt[2]/Text[1]", "nType");
-    CPPUNIT_ASSERT_EQUAL(OUString("PortionType::TabLeft"), sNodeType);
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTdf121661, "tdf121661.docx")
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index df8b5ee4ce75..a38cbe048d44 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -48,11 +48,6 @@ const SvxTabStop *SwLineInfo::GetTabStop( const SwTwips nSearchPos, const SwTwip
         if( rTabStop.GetTabPos() > SwTwips(nRight) )
             return i ? nullptr : &rTabStop;
 
-        // If we are starting search from zero position,
-        // than we should include tabstop at zero position
-        if ((nSearchPos == 0) && (rTabStop.GetTabPos() == 0))
-            return &rTabStop;
-
         if( rTabStop.GetTabPos() > nSearchPos )
             return &rTabStop;
     }


More information about the Libreoffice-commits mailing list