diff options
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/edtspell.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx index 4ba31d7e822f..547c377ffec9 100644 --- a/editeng/source/editeng/edtspell.cxx +++ b/editeng/source/editeng/edtspell.cxx @@ -713,9 +713,13 @@ bool EdtAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, pCurNode->GetString(), rSttPos, nEndPos, *this, aLanguageTag); if( pFnd && pFnd->IsTextOnly() ) { + + // replace also last colon of keywords surrounded by colons (for example, ":name:") + bool replaceLastChar = pFnd->GetShort()[0] == ':' && pFnd->GetShort().endsWith(":"); + // then replace EditSelection aSel( EditPaM( pCurNode, rSttPos ), - EditPaM( pCurNode, nEndPos ) ); + EditPaM( pCurNode, nEndPos + (replaceLastChar ? 1 : 0) )); aSel = mpEditEngine->DeleteSelection(aSel); SAL_WARN_IF(nCursor < nEndPos, "editeng", "Cursor in the heart of the action?!"); |