diff options
author | Sébastien Le Ray <sebastien-libreoffice@orniz.org> | 2011-02-22 20:17:59 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-02-23 12:02:02 +0000 |
commit | 51efaa592d4f54133c74e38cf294526bc78dffcd (patch) | |
tree | bc39acb2bc0d6cf4b64ec6d39abd1d657bc0d058 /editeng | |
parent | 9779f2bd45a687be122d406490e4f1cb284119a8 (diff) |
Double-capital autocor takes spellcheck in account
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 2abaa2b8d257..f52d698b410d 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -443,14 +443,22 @@ BOOL SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const String& rTxt, String sWord( rTxt.Copy( nSttPos - 1, nEndPos - nSttPos + 1 )); if( !FindInWrdSttExceptList(eLang, sWord) ) { - sal_Unicode cSave = rTxt.GetChar( nSttPos ); - String sChar( cSave ); - rCC.toLower( sChar ); - if( sChar.GetChar(0) != cSave && rDoc.Replace( nSttPos, sChar )) + ::com::sun::star::uno::Reference< + ::com::sun::star::linguistic2::XSpellChecker1 > xSpeller = + SvxGetSpellChecker(); + Sequence< ::com::sun::star::beans::PropertyValue > aEmptySeq; + // Check that word isn't correctly spelled before correcting + if(xSpeller->spell( sWord, eLang, aEmptySeq ) != NULL) { - if( SaveWordWrdSttLst & nFlags ) - rDoc.SaveCpltSttWord( CptlSttWrd, nSttPos, sWord, cSave ); - bRet = TRUE; + sal_Unicode cSave = rTxt.GetChar( nSttPos ); + String sChar( cSave ); + rCC.toLower( sChar ); + if( sChar.GetChar(0) != cSave && rDoc.Replace( nSttPos, sChar )) + { + if( SaveWordWrdSttLst & nFlags ) + rDoc.SaveCpltSttWord( CptlSttWrd, nSttPos, sWord, cSave ); + bRet = TRUE; + } } } } |