diff options
author | László Németh <nemeth@numbertext.org> | 2020-11-05 10:17:03 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-11-05 17:06:39 +0100 |
commit | 2d3c77e9b10f20091ef338e262ba7756eb280ce9 (patch) | |
tree | c09cc0b03d0fe04b7f7ca1f248eb81e8832b5333 /sw/source/core/txtnode/txtedt.cxx | |
parent | 9f3b85dc29326e779ccc6be3b649b7fb24571ee0 (diff) |
tdf#109266 sw change tracking: track transliteration
Format->Text->UPPERCASE, tOGGLE cASE etc. weren't
supported by change tracking.
Change-Id: Ic2c94375522a5469056837ab23fdbb9557212b53
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105345
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/core/txtnode/txtedt.cxx')
-rw-r--r-- | sw/source/core/txtnode/txtedt.cxx | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 243683581d67..ba47a0021b73 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -1898,6 +1898,7 @@ void SwTextNode::TransliterateText( // now apply the changes from end to start to leave the offsets of the // yet unchanged text parts remain the same. size_t nSum(0); + bool bIsRedlineOn(GetDoc().getIDocumentRedlineAccess().IsRedlineOn()); for (size_t i = 0; i < aChanges.size(); ++i) { // check this here since AddChanges cannot be moved below // call to ReplaceTextOnly @@ -1910,9 +1911,24 @@ void SwTextNode::TransliterateText( "node text with insertion > node capacity."); return; } - if (pUndo) - pUndo->AddChanges( *this, rData.nStart, rData.nLen, rData.aOffsets ); - ReplaceTextOnly( rData.nStart, rData.nLen, rData.sChanged, rData.aOffsets ); + + if ( bIsRedlineOn ) + { + // create SwPaM with mark & point spanning the attributed text + //SwPaM aCurPaM( *this, *this, nBegin, nBegin + nLen ); <-- wrong c-tor, does sth different + SwPaM aCurPaM( *this, rData.nStart ); + aCurPaM.SetMark(); + aCurPaM.GetPoint()->nContent = rData.nStart + rData.nLen; + // replace the changed words + if ( aCurPaM.GetText() != rData.sChanged ) + GetDoc().getIDocumentContentOperations().ReplaceRange( aCurPaM, rData.sChanged, false ); + } + else + { + if (pUndo) + pUndo->AddChanges( *this, rData.nStart, rData.nLen, rData.aOffsets ); + ReplaceTextOnly( rData.nStart, rData.nLen, rData.sChanged, rData.aOffsets ); + } } } |