Kaydet (Commit) fef31222 authored tarafından Julien Nabet's avatar Julien Nabet

Avoid Possible null pointer dereference in linguistic/source/spelldsp.hxx

(Thank you to Ivan and Riccardo for their suggestions)
üst 0f4451c0
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment