summaryrefslogtreecommitdiff
path: root/sw/source/core/undo
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-09-04 18:52:56 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2018-09-19 10:18:30 +0200
commit12a841e1f102ff7f47a7281120fe777bf440d2fd (patch)
tree4d15f3b0227514531b863ebc2b1a57716a755c19 /sw/source/core/undo
parent51a5c1c454e217127fba3978c7e93c4fb4eff783 (diff)
sw: SwUndoOverwrite ctor shouldn't DeleteRedline if ...
... it's at the end of the node already, similar to CanGrouping(). Change-Id: Ic7c6f5caa6e69e9414112cb245db97fd5d79e87d
Diffstat (limited to 'sw/source/core/undo')
-rw-r--r--sw/source/core/undo/unovwr.cxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index da8ff670d186..19d754faa085 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -43,6 +43,13 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos,
: SwUndo(SwUndoId::OVERWRITE, pDoc),
bGroup( false )
{
+ SwTextNode *const pTextNd = rPos.nNode.GetNode().GetTextNode();
+ assert(pTextNd);
+ sal_Int32 const nTextNdLen = pTextNd->GetText().getLength();
+
+ nSttNode = rPos.nNode.GetIndex();
+ nSttContent = rPos.nContent.GetIndex();
+
if( !pDoc->getIDocumentRedlineAccess().IsIgnoreRedline() && !pDoc->getIDocumentRedlineAccess().GetRedlineTable().empty() )
{
SwPaM aPam( rPos.nNode, rPos.nContent.GetIndex(),
@@ -52,16 +59,13 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos,
{
pRedlSaveData.reset();
}
+ if (nSttContent < nTextNdLen)
+ {
+ pDoc->getIDocumentRedlineAccess().DeleteRedline(aPam, false, USHRT_MAX);
+ }
}
- nSttNode = rPos.nNode.GetIndex();
- nSttContent = rPos.nContent.GetIndex();
-
- SwTextNode* pTextNd = rPos.nNode.GetNode().GetTextNode();
- OSL_ENSURE( pTextNd, "Overwrite not in a TextNode?" );
-
bInsChar = true;
- sal_Int32 nTextNdLen = pTextNd->GetText().getLength();
if( nSttContent < nTextNdLen ) // no pure insert?
{
aDelStr += OUStringLiteral1( pTextNd->GetText()[nSttContent] );