From 51efaa592d4f54133c74e38cf294526bc78dffcd Mon Sep 17 00:00:00 2001 From: Sébastien Le Ray Date: Tue, 22 Feb 2011 20:17:59 +0100 Subject: Double-capital autocor takes spellcheck in account --- editeng/source/misc/svxacorr.cxx | 22 +++++++++++++++------- 1 file 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; + } } } } -- cgit v1.2.3