sw/source/core/unocore/unotbl.cxx  |   14 ++++++++++++++
 sw/source/core/unocore/unotext.cxx |    3 +++
 2 files changed, 17 insertions(+)

New commits:
commit 88338b6bf1fdf9420d9ae9d1c78dc8b897f0ad7d
Author:     Satya <skompe...@opentext.com>
AuthorDate: Mon Sep 5 13:20:33 2022 +0530
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Wed Sep 7 00:32:52 2022 +0200

    tdf#147646 Auto numbering is wrong when the row has split/merged cells.
    
    The fix is to,walk through the paragraphs in the cells that are
    vertically merged(PROP_VERTICAL_MERGE)and remove the numbering
    rules property from underlying text of those paragraph
    properties of a cell.
    
    Note that,there was a similar bug for DOC files,and it was fixed
    with tdf#49102,we need to provide a seperate fix for DOCX files
    as the DOCX filter is different than DOC.
    
    Change-Id: Ia1cc22cbc04448a11ae0d136519681d9363e2828
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139401
    Tested-by: Jenkins
    Tested-by: Justin Luth <jl...@mail.com>
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index 8f4094c7afce..266ca6f1aaa8 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -50,6 +50,7 @@
 #include <shellres.hxx>
 #include <docary.hxx>
 #include <ndole.hxx>
+#include <ndtxt.hxx>
 #include <frame.hxx>
 #include <vcl/svapp.hxx>
 #include <fmtfsize.hxx>
@@ -976,6 +977,19 @@ void SwXCell::setPropertyValue(const OUString& 
rPropertyName, const uno::Any& aV
         SwUnoCursorHelper::makeTableCellRedline(*m_pBox, sRedlineType, 
tableCellProperties);
 
 
+    }
+    else if (rPropertyName == "VerticalMerge")
+    {
+        //Hack to allow clearing of numbering from the paragraphs in the 
merged cells.
+        SwNodeIndex aIdx(*GetStartNode(), 1);
+        const SwNode* pEndNd = aIdx.GetNode().EndOfSectionNode();
+        while (&aIdx.GetNode() != pEndNd)
+        {
+            SwTextNode* pNd = aIdx.GetNode().GetTextNode();
+            if (pNd)
+                pNd->SetCountedInList(false);
+            ++aIdx;
+        }
     }
     else
     {
diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index bb024135a09d..c68a1a331c90 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -2226,7 +2226,10 @@ lcl_MergeCells(std::vector<VerticallyMergedCell> & 
rMergedCells)
         aMergedCell.aCells.front()->setPropertyValue(UNO_NAME_ROW_SPAN, 
uno::Any(nCellCount--));
         nCellCount*=-1;
         for(auto pxPSet = aMergedCell.aCells.begin()+1; nCellCount<0; 
++pxPSet, ++nCellCount)
+        {
             (*pxPSet)->setPropertyValue(UNO_NAME_ROW_SPAN, 
uno::Any(nCellCount));
+            (*pxPSet)->setPropertyValue("VerticalMerge", uno::Any(true));
+        }
     }
 }
 

Reply via email to