diff options
author | anuragkanungo <anuragkanungo@gmail.com> | 2013-04-20 03:15:55 +0530 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-04-26 15:58:54 +0000 |
commit | 3a390f36e8931e50009438f992ed0e4cdb02cca4 (patch) | |
tree | 4e371e2f58750b9ca4ba8869ad931b74d781be64 | |
parent | 092fa33f22bbdcb74c3533750158db1724971878 (diff) |
Resolves: fdo#42893 improve Capitalize first letter of Sentence
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 <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
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; |