diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-02-15 16:56:30 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-02-16 22:52:30 +0100 |
commit | 54cbd46dc52c51dda1594ee090f0619a7b92d56a (patch) | |
tree | 4d09037f0f4d78803da32be4f78abcf82ebf9528 /sw | |
parent | 09baf615705715b318b6ae42ef82193dffd57e1f (diff) |
Avoid assignment in complex if condition
Change-Id: Ibaff0eb54b67e946d07e5a626f5af04ac46132cc
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/wrong.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx index cbd184fe629b..4a56bceefb70 100644 --- a/sw/source/core/text/wrong.cxx +++ b/sw/source/core/text/wrong.cxx @@ -99,9 +99,11 @@ void SwWrongList::ClearList() */ bool SwWrongList::InWrongWord( sal_Int32 &rChk, sal_Int32 &rLn ) const { - MSHORT nPos = GetWrongPos( rChk ); - sal_Int32 nWrPos; - if( nPos < Count() && ( nWrPos = Pos( nPos ) ) <= rChk ) + const MSHORT nPos = GetWrongPos( rChk ); + if ( nPos >= Count() ) + return false; + const sal_Int32 nWrPos = Pos( nPos ); + if ( nWrPos <= rChk ) { rLn = Len( nPos ); if( nWrPos + rLn <= rChk ) |