diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2012-12-29 13:36:43 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2012-12-29 13:37:25 +0100 |
commit | cf068828d334fcb0998755118e262d16c9db5b3a (patch) | |
tree | ca63d7c1e2b7099e7b038d8305a1b76800ceafe1 /lingucomponent/source/languageguessing/simpleguesser.cxx | |
parent | 6306926e038fd7ad49c0089ebce8be0f0f8da3c7 (diff) |
Fix SimpleGuesser::operator=' should return 'SimpleGuesser &
Change-Id: I29205bc8db7569cf123a52dd248a9165ebaef3a3
Diffstat (limited to 'lingucomponent/source/languageguessing/simpleguesser.cxx')
-rw-r--r-- | lingucomponent/source/languageguessing/simpleguesser.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lingucomponent/source/languageguessing/simpleguesser.cxx b/lingucomponent/source/languageguessing/simpleguesser.cxx index 1162884ef45a..b6d52cdba4be 100644 --- a/lingucomponent/source/languageguessing/simpleguesser.cxx +++ b/lingucomponent/source/languageguessing/simpleguesser.cxx @@ -95,9 +95,14 @@ SimpleGuesser::SimpleGuesser() h = NULL; } -void SimpleGuesser::operator=(SimpleGuesser& sg){ +SimpleGuesser& SimpleGuesser::operator=(const SimpleGuesser& sg){ + // Check for self-assignment! + if (this == &sg) // Same object? + return *this; // Yes, so skip assignment, and just return *this. + if(h){textcat_Done(h);} h = sg.h; + return *this; } SimpleGuesser::~SimpleGuesser() |