Kaydet (Commit) 12a841e1 authored tarafından Michael Stahl's avatar Michael Stahl

sw: SwUndoOverwrite ctor shouldn't DeleteRedline if ...

... it's at the end of the node already, similar to CanGrouping().

Change-Id: Ic7c6f5caa6e69e9414112cb245db97fd5d79e87d
üst 51a5c1c4
...@@ -43,6 +43,13 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos, ...@@ -43,6 +43,13 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos,
: SwUndo(SwUndoId::OVERWRITE, pDoc), : SwUndo(SwUndoId::OVERWRITE, pDoc),
bGroup( false ) 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() ) if( !pDoc->getIDocumentRedlineAccess().IsIgnoreRedline() && !pDoc->getIDocumentRedlineAccess().GetRedlineTable().empty() )
{ {
SwPaM aPam( rPos.nNode, rPos.nContent.GetIndex(), SwPaM aPam( rPos.nNode, rPos.nContent.GetIndex(),
...@@ -52,16 +59,13 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos, ...@@ -52,16 +59,13 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos,
{ {
pRedlSaveData.reset(); 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; bInsChar = true;
sal_Int32 nTextNdLen = pTextNd->GetText().getLength();
if( nSttContent < nTextNdLen ) // no pure insert? if( nSttContent < nTextNdLen ) // no pure insert?
{ {
aDelStr += OUStringLiteral1( pTextNd->GetText()[nSttContent] ); aDelStr += OUStringLiteral1( pTextNd->GetText()[nSttContent] );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment