[Libreoffice-commits] .: linguistic/source

Julien Nabet serval2412 at kemper.freedesktop.org
Sat Feb 11 08:39:31 PST 2012


 linguistic/source/spelldsp.hxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit fef3122259092e03b3cf11721171d4b621c3a97f
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Feb 11 17:34:20 2012 +0100

    Avoid Possible null pointer dereference in linguistic/source/spelldsp.hxx
    
    (Thank you to Ivan and Riccardo for their suggestions)

diff --git a/linguistic/source/spelldsp.hxx b/linguistic/source/spelldsp.hxx
index 9ae9cd4..e2186f9 100644
--- a/linguistic/source/spelldsp.hxx
+++ b/linguistic/source/spelldsp.hxx
@@ -73,7 +73,7 @@ class SpellCheckerDispatcher :
         ::com::sun::star::linguistic2::XSearchableDictionaryList >  xDicList;
 
     LngSvcMgr                   &rMgr;
-    linguistic::SpellCache      *pCache; // Spell Cache (holds known words)
+    mutable linguistic::SpellCache      *pCache; // Spell Cache (holds known words)
 
     // disallow copy-constructor and assignment-operator for now
     SpellCheckerDispatcher(const SpellCheckerDispatcher &);
@@ -134,7 +134,7 @@ public:
 inline linguistic::SpellCache & SpellCheckerDispatcher::GetCache() const
 {
     if (!pCache)
-        ((SpellCheckerDispatcher *) this)->pCache = new linguistic::SpellCache();
+        pCache = new linguistic::SpellCache();
     return *pCache;
 }
 


More information about the Libreoffice-commits mailing list