editeng/source/editeng/edtspell.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 1e15cf04b5e167de1bfc5c19019dcae2042e1414
Author: László Németh <laszlo.nem...@collabora.com>
Date:   Fri Sep 25 11:51:04 2015 +0200

    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 <fit...@ubuntu.com>
    Tested-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/editeng/source/editeng/edtspell.cxx 
b/editeng/source/editeng/edtspell.cxx
index 8b50d9f..510545d 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?!");
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to