summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLászló Németh <laszlo.nemeth@collabora.com>2015-09-25 11:51:04 +0200
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2015-09-26 04:34:15 +0000
commit1e15cf04b5e167de1bfc5c19019dcae2042e1414 (patch)
treea3b73a644c0d0b0d75ac806602243a18fe0b771d
parente0910afb2235180821146139e6b44ac4e6cc5561 (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>
-rw-r--r--editeng/source/editeng/edtspell.cxx6
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?!");