From d7e7bf139a615f68345c36572d12219bcf2c2658 Mon Sep 17 00:00:00 2001 From: László Németh Date: Fri, 25 Sep 2015 11:51:04 +0200 Subject: tdf#93141 Calc/Impress: remove last colon of emoji short names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- editeng/source/editeng/edtspell.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'editeng') 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?!"); -- cgit