tdf#172093 editeng: Fix freeze in character transliteration
Deletes some experimental YRS code that was causing an infinite loop in
drawing the selection after character transliteration. This code was
originally part of a patch meant to correct peer cursors after inserts
and deletes. Unfortunately, the implementation for transliteration was
incorrect and leaves the selection in an invalid state.
Regression from commit 0ff4c66190
Author: Michael Stahl <michael.stahl@allotropia.de>
Date: Fri Feb 14 18:03:16 2025 +0100
LOCRDT editeng,sw: yrs peer cursors for editengine
Change-Id: I2b8cd9d501b8262dfc07b808beda7a3767f9455c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208174
Tested-by: Jenkins
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
This commit is contained in:
@@ -3254,16 +3254,11 @@ short ImpEditEngine::ReplaceTextOnly(
|
||||
|
||||
DBG_ASSERT( (nCurrentPos+1) < pNode->Len(), "TransliterateText - String smaller than expected!" );
|
||||
GetEditDoc().RemoveChars( EditPaM( pNode, nCurrentPos+1 ), -nDiff);
|
||||
ESelection const deleted{maEditDoc.GetPos(pNode), nCurrentPos+1, maEditDoc.GetPos(pNode), nCurrentPos-nDiff};
|
||||
UpdateSelectionsDelete(deleted);
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_ASSERT( nDiff == 1, "TransliterateText - Diff other than expected! But should work..." );
|
||||
GetEditDoc().InsertText( EditPaM( pNode, nCurrentPos ), OUStringChar(rNewText[n]) );
|
||||
ESelection const inserted{maEditDoc.GetPos(pNode), nCurrentPos, maEditDoc.GetPos(pNode), nCurrentPos+nDiff};
|
||||
UpdateSelectionsInsert(inserted);
|
||||
|
||||
}
|
||||
nDiffs = sal::static_int_cast< short >(nDiffs + nDiff);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user