From 3a390f36e8931e50009438f992ed0e4cdb02cca4 Mon Sep 17 00:00:00 2001 From: anuragkanungo Date: Sat, 20 Apr 2013 03:15:55 +0530 Subject: Resolves: fdo#42893 improve Capitalize first letter of Sentence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit don't autocapitalize a word if the previous word is clearly an anagram with intermediate periods. Committer: anuragkanungo@gmail.com modified: editeng/source/misc/svxacorr.cxx On branch localbranch_anurag Change-Id: Ic559f4b6d5e15768870aabab29350bee51b24b08 Reviewed-on: https://gerrit.libreoffice.org/3495 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- editeng/source/misc/svxacorr.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'editeng') diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 96f5b8602470..9f3649827541 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -904,6 +904,15 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, case 0x3002 : case 0xFF0E : { + if (pStr >= pStart + 2 && *(pStr-2) == '.') + { + //e.g. text "f.o.o. word": Now currently considering + //capitalizing word but second last character of + //previous word is a . So probably last word is an + //anagram that ends in . and not truly the end of a + //previous sentence, so don't autocapitalize this word + return sal_False; + } if( nFlag & C_FULL_STOP ) return sal_False; // no valid separator -> no replacement nFlag |= C_FULL_STOP; -- cgit