[Libreoffice-commits] core.git: i18npool/source sc/source sw/source
Julien Nabet
serval2412 at yahoo.fr
Tue Oct 29 07:51:13 CET 2013
i18npool/source/nativenumber/nativenumbersupplier.cxx | 8 ++++----
sc/source/ui/optdlg/tpusrlst.cxx | 2 +-
sw/source/ui/docvw/srcedtw.cxx | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
New commits:
commit a3f0eab294df3a48d497c2b985ec9655f2da2357
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Tue Oct 29 07:50:49 2013 +0100
cppcheck: Array index is used before limits check
Change-Id: I51f7408a81a10e2c586cb05b863f20b13bb7b263
diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index 382d58c..bf2ff11 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -194,7 +194,7 @@ OUString SAL_CALL AsciiToNative( const OUString& inStr, sal_Int32 startPos, sal_
srcStr[len++] = str[i];
} else {
if (len > 0) {
- if (isSeparator(str[i]) && i < nCount-1 && isNumber(str[i+1]))
+ if (i < nCount-1 && isSeparator(str[i]) && isNumber(str[i+1]))
continue; // skip comma inside number string
sal_Bool notZero = sal_False;
for (sal_Int32 begin = 0, end = len % number->multiplierExponent[0];
@@ -224,11 +224,11 @@ OUString SAL_CALL AsciiToNative( const OUString& inStr, sal_Int32 startPos, sal_
len = 0;
}
if (i < nCount) {
- if ((doDecimal = (!doDecimal && isDecimal(str[i]) && i < nCount-1 && isNumber(str[i+1]))) != sal_False)
+ if ((doDecimal = (!doDecimal && i < nCount-1 && isDecimal(str[i]) && isNumber(str[i+1]))) != sal_False)
newStr[count] = (DecimalChar[number->number] ? DecimalChar[number->number] : str[i]);
- else if (isMinus(str[i]) && i < nCount-1 && isNumber(str[i+1]))
+ else if (i < nCount-1 && isMinus(str[i]) && isNumber(str[i+1]))
newStr[count] = (MinusChar[number->number] ? MinusChar[number->number] : str[i]);
- else if (isSeparator(str[i]) && i < nCount-1 && isNumber(str[i+1]))
+ else if (i < nCount-1 && isSeparator(str[i]) && isNumber(str[i+1]))
newStr[count] = (SeparatorChar[number->number] ? SeparatorChar[number->number] : str[i]);
else
newStr[count] = str[i];
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index c19e7bd..5fcb9bf 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -339,7 +339,7 @@ void ScTpUserLists::MakeListStr( OUString& rListStr )
{
rListStr += OUString(aStr[c]);
- while ( (aStr[c] == cDelimiter) && (c < nLen) )
+ while ( (c < nLen) && (aStr[c] == cDelimiter) )
c++;
}
}
diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx
index 7d3f42b..46435db 100644
--- a/sw/source/ui/docvw/srcedtw.cxx
+++ b/sw/source/ui/docvw/srcedtw.cxx
@@ -82,7 +82,7 @@ static void lcl_Highlight(const OUString& rSource, SwTextPortions& aPortionList)
while(nActPos < nStrLen)
{
svtools::ColorConfigEntry eFoundType = svtools::HTMLUNKNOWN;
- if(rSource[nActPos] == cOpenBracket && nActPos < nStrLen - 2 )
+ if((nActPos < nStrLen - 2) && (rSource[nActPos] == cOpenBracket))
{
// insert 'empty' portion
if(nPortEnd < nActPos - 1 )
More information about the Libreoffice-commits
mailing list