summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-12-07 13:10:57 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-12-07 13:57:07 +0100
commit7bf6d0d9d8e3e2e07726ca6df246619ee1ead3a3 (patch)
tree0d076d430e1ac339f186209dec4168ed4d971cd0 /editeng
parent40144617ce05d7eff86eeb8a412c6991fe0b819e (diff)
tdf#121779: extend TWo CApitals list to also ignore sMALL iNITIALS
Now this list is used also in rules for capitalizing first letter of every sentence, and for correcting accidental use of Caps Lock key. Change-Id: I4fbdbccbae32743d5e9a6757344361eefd88e167 Reviewed-on: https://gerrit.libreoffice.org/64759 Tested-by: Jenkins Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com> Reviewed-by: Sophie Gautier <gautier.sophie@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/misc/svxacorr.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 520003d139f4..c6cb322d58b0 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -898,6 +898,10 @@ void SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
return; // no valid separator -> no replacement
}
+ // No replacement for words in TWo INitial CApitals or sMALL iNITIAL list
+ if (FindInWrdSttExceptList(eLang, OUString(pWordStt, pDelim - pWordStt)))
+ return;
+
if( bAtStart ) // at the beginning of a paragraph?
{
// Check out the previous paragraph, if it exists.
@@ -1112,6 +1116,10 @@ bool SvxAutoCorrect::FnCorrectCapsLock( SvxAutoCorrDoc& rDoc, const OUString& rT
aConverted.append( rCC.uppercase(OUString(rTxt[nSttPos])) );
aConverted.append( rCC.lowercase(OUString(rTxt[nSttPos+1])) );
+ // No replacement for words in TWo INitial CApitals or sMALL iNITIAL list
+ if (FindInWrdSttExceptList(eLang, rTxt.copy(nSttPos, nEndPos - nSttPos)))
+ return false;
+
for( sal_Int32 i = nSttPos+2; i < nEndPos; ++i )
{
if ( IsLowerLetter(rCC.getCharacterType(rTxt, i)) )