diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-25 16:31:42 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-25 16:52:30 +0100 |
commit | c59a5b81e9521a92587e701bcad82bf643b00493 (patch) | |
tree | b08b97f67c53e6ec1b3cae06cd19ebac2ca15cea /linguistic/source | |
parent | 75299cd119dcb3121540471354d2b33af7f6684d (diff) |
tdf#120703 PVS: V560 A part of conditional expression is always true/false
Change-Id: I8d98aa7dd77fbd79611b8a4aba77e8c378fd1cae
Reviewed-on: https://gerrit.libreoffice.org/63981
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'linguistic/source')
-rw-r--r-- | linguistic/source/gciterator.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index 9e1e11532080..5d27876d6d57 100644 --- a/linguistic/source/gciterator.cxx +++ b/linguistic/source/gciterator.cxx @@ -206,14 +206,11 @@ static sal_Int32 lcl_BacktraceWhiteSpaces( const OUString &rText, sal_Int32 nSta if (0 <= nPosBefore && nPosBefore < nLen && lcl_IsWhiteSpace( pStart[ nPosBefore ] )) { nStartPos = nPosBefore; - if (0 <= nStartPos && nStartPos < nLen) - { - const sal_Unicode *pText = rText.getStr() + nStartPos; - while (pText > pStart && lcl_IsWhiteSpace( *pText )) - --pText; - // now add 1 since we want to point to the first char after the last char in the sentence... - nRes = pText - pStart + 1; - } + const sal_Unicode *pText = rText.getStr() + nStartPos; + while (pText > pStart && lcl_IsWhiteSpace( *pText )) + --pText; + // now add 1 since we want to point to the first char after the last char in the sentence... + nRes = pText - pStart + 1; } DBG_ASSERT( 0 <= nRes && nRes <= nLen, "lcl_BacktraceWhiteSpaces return value out of range" ); |