diff options
author | László Németh <laszlo.nemeth@collabora.com> | 2015-09-25 11:51:04 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-10-17 23:22:26 +0200 |
commit | c51fb3adcbce67813827e50610255d91a916c096 (patch) | |
tree | e8dc4805c2480d13875476883f570d2976a3b5e7 /editeng | |
parent | 23e8d5b6ad01ec2340add362de2eb9f4be82ac73 (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
Reviewed-on: https://gerrit.libreoffice.org/18849
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
(cherry picked from commit 1e15cf04b5e167de1bfc5c19019dcae2042e1414)
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 8b50d9f58e55..510545d88b0f 100644 --- a/editeng/source/editeng/edtspell.cxx +++ b/editeng/source/editeng/edtspell.cxx @@ -743,9 +743,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?!"); |