[Libreoffice-commits] .: 2 commits - editeng/source

Caolán McNamara caolan at kemper.freedesktop.org
Wed Feb 23 04:13:10 PST 2011


 editeng/source/misc/svxacorr.cxx |   24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

New commits:
commit 29149f68d61e222f65f8539c57bce19ec2c08eb7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 23 12:03:32 2011 +0000

    .is() rather than != NULL

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 4c2d26b..88a9369 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -448,7 +448,9 @@ BOOL SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const String& rTxt,
                 SvxGetSpellChecker();
             Sequence< ::com::sun::star::beans::PropertyValue > aEmptySeq;
             // Check that word isn't correctly spelled before correcting
-            if(xSpeller->spell( sWord, eLang, aEmptySeq ) != NULL)
+            ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellAlternatives > xSpellAlt
+                = xSpeller->spell(sWord, eLang, aEmptySeq);
+            if(xSpellAlt.is())
             {
                 sal_Unicode cSave = rTxt.GetChar( nSttPos );
                 String sChar( cSave );
commit 399858c46404a6088248f341e1b8bc44e0689a98
Author: Sébastien Le Ray <sebastien-libreoffice at orniz.org>
Date:   Tue Feb 22 20:17:59 2011 +0100

    Double-capital autocor takes spellcheck in account

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 70c9728..4c2d26b 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;
+                }
             }
         }
     }


More information about the Libreoffice-commits mailing list