[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - sw/qa sw/source

László Németh (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 11 14:15:27 UTC 2020


 sw/qa/extras/uiwriter/data2/tdf123102.odt |binary
 sw/qa/extras/uiwriter/uiwriter2.cxx       |   11 +++++++++++
 sw/source/core/table/swnewtable.cxx       |   15 +++++++++++++++
 3 files changed, 26 insertions(+)

New commits:
commit 6dfedeb37fe0334e78161419de058644553d955a
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Wed Feb 26 10:18:32 2020 +0100
Commit:     Gabor Kelemen <kelemen.gabor2 at nisz.hu>
CommitDate: Thu Jun 11 16:14:54 2020 +0200

    tdf#123102 Writer: fix numbering at row insertion
    
    in vertically merged cells. Hidden paragraph of
    the new merged cell inherited numbering of the
    previous row, resulting bad numbering of the next
    list item.
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89537
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit 3a69e1a6b8eab79c55b6e8f3edd2ee2da45b39c0)
    
    Change-Id: Ib6b29947caa22747ba8c79725ab6f9ef4db31319
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96137
    Tested-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
    Reviewed-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>

diff --git a/sw/qa/extras/uiwriter/data2/tdf123102.odt b/sw/qa/extras/uiwriter/data2/tdf123102.odt
new file mode 100644
index 000000000000..731a9b1521c1
Binary files /dev/null and b/sw/qa/extras/uiwriter/data2/tdf123102.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 949c04514da8..009e62c08505 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -19,6 +19,7 @@
 #include <com/sun/star/text/TableColumnSeparator.hpp>
 #include <com/sun/star/view/XSelectionSupplier.hpp>
 #include <comphelper/propertysequence.hxx>
+#include <svtools/popupmenucontrollerbase.hxx>
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
 #include <i18nlangtag/languagetag.hxx>
 #include <vcl/scheduler.hxx>
@@ -995,6 +996,16 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf105413)
                          getProperty<OUString>(getParagraph(1), "ParaStyleName"));
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf123102)
+{
+    createDoc("tdf123102.odt");
+    // insert a new row after a vertically merged cell
+    lcl_dispatchCommand(mxComponent, ".uno:InsertRowsAfter", {});
+    xmlDocPtr pXmlDoc = parseLayoutDump();
+    // This was "3." - caused by the hidden numbered paragraph of the new merged cell
+    assertXPath(pXmlDoc, "/root/page/body/tab/row[6]/cell[1]/txt/Special", "rText", "2.");
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testUnfloatButtonSmallTable)
 {
     // The floating table in the test document is too small, so we don't provide an unfloat button
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index 04a2509b1e37..cda74b4af5e9 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -1517,7 +1517,22 @@ bool SwTable::InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
                         if( nRowSpan == 1 || nRowSpan == -1 )
                             nRowSpan = n + 1;
                         else if( nRowSpan > 1 )
+                        {
                             nRowSpan = - nRowSpan;
+
+                            // tdf#123102 disable numbering of the new hidden
+                            // paragraph in merged cells to avoid of bad
+                            // renumbering of next list elements
+                            SwTableBox* pBox = pNewLine->GetTabBoxes()[nCurrBox];
+                            SwNodeIndex aIdx( *pBox->GetSttNd(), +1 );
+                            SwContentNode* pCNd = aIdx.GetNode().GetContentNode();
+                            if( pCNd && pCNd->IsTextNode() && pCNd->GetTextNode()->GetNumRule() )
+                            {
+                                SwPosition aPos( *pCNd->GetTextNode() );
+                                SwPaM aPam( aPos, aPos );
+                                pDoc->DelNumRules( aPam );
+                            }
+                        }
                     }
                     else
                     {


More information about the Libreoffice-commits mailing list