diff options
author | Satya <skompella@opentext.com> | 2022-09-05 13:20:33 +0530 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2022-09-07 00:32:52 +0200 |
commit | 88338b6bf1fdf9420d9ae9d1c78dc8b897f0ad7d (patch) | |
tree | 1f4de30d488f8830b30f7d2a479e9d25814be139 | |
parent | 19648eca2d9cd729251af5ddfca7aae2dd8c7e14 (diff) |
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 <jluth@mail.com>
Reviewed-by: Justin Luth <jluth@mail.com>
-rw-r--r-- | sw/source/core/unocore/unotbl.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/unocore/unotext.cxx | 3 |
2 files changed, 17 insertions, 0 deletions
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> @@ -977,6 +978,19 @@ void SwXCell::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV } + 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 { auto pEntry(m_pPropSet->getPropertyMap().getByName(rPropertyName)); 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)); + } } } |