diff options
author | László Németh <laszlo.nemeth@collabora.com> | 2015-09-25 11:51:04 +0200 |
---|---|---|
committer | László Németh <laszlo.nemeth@collabora.com> | 2015-09-25 12:03:41 +0200 |
commit | d7e7bf139a615f68345c36572d12219bcf2c2658 (patch) | |
tree | 48bc1889f4544188b89d03c760fc2d0cb62121eb /editeng | |
parent | 6f70cf8348c67c76c92178d508f0b74f892cf9dd (diff) |
tdf#93141 Calc/Impress: remove last colon of emoji short names
AutoCorrect Emoji replacements were incomplete in Calc cells and
Impress text boxes, keeping the terminating colon:
:omega: -> Ω:
Corrected by this patch:
:omega: -> Ω
Change-Id: I0d1f6f9ec9c31a7b37e0c9afaaad17dcee568dd5
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?!"); |