summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2019-05-22 16:30:02 +0200
committerLászló Németh <nemeth@numbertext.org>2019-05-24 15:09:00 +0200
commitcbd894925e6b9869baedcd6476484c14d3a3df87 (patch)
tree6c1beda826af998f3975a16a41ad309d7fa73c56
parente0a5f0738b76dd06e9d258cfa674de86f34bd6ec (diff)
tdf#125319 DOCX track changes: don't change numbering
of a paragraph after a tracked deletion in Hide Changes mode (including hiding the numbering completely). We add the numbering of the paragraph to the first node of the deletion, so Hide Changes mode will show the actual text content correctly. Note: file saving already makes the same changes in the deletion without this workaround, too. Change-Id: I09d3ad2c05bfd6c7f9f65cfe21a4bade2ac18a14 Reviewed-on: https://gerrit.libreoffice.org/72784 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
-rw-r--r--sw/source/core/doc/DocumentRedlineManager.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx
index 47fc8db4db05..93f8f0b972e7 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -3032,14 +3032,21 @@ void DocumentRedlineManager::FinalizeImport()
? pRedl->GetMark() : pRedl->GetPoint();
SwTextNode* pDelNode = pStt->nNode.GetNode().GetTextNode();
SwTextNode* pTextNode = pEnd->nNode.GetNode().GetTextNode();
- // remove numbering of the first deleted list item
- // to avoid of incorrect numbering after the deletion
+ // avoid of incorrect numbering after the deletion
if ( pDelNode->GetNumRule() && !pTextNode->GetNumRule() )
{
+ // remove numbering of the first deleted list item
const SwPaM aPam( *pStt, *pStt );
m_rDoc.DelNumRules( aPam );
}
- }
+ else if ( pDelNode->GetNumRule() != pTextNode->GetNumRule() )
+ {
+ // copy numbering to the first deleted list item
+ const SwPaM aPam( *pStt, *pStt );
+ SwNumRule *pRule = pTextNode->GetNumRule();
+ m_rDoc.SetNumRule( aPam, *pRule, false );
+ }
+ }
}
}