diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-11 18:04:43 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-11 19:38:25 +0100 |
commit | 6b67f867cca1cb62ca045b60635f6da0a347c4f2 (patch) | |
tree | 726c4b4b59dded0cb2cc2b852636d10170b79505 /sc | |
parent | b7f022234589c84ddb8566ddf7d91701eba55d3d (diff) |
tdf#120703 PVS: V560 A part of conditional expression is always true/false
Change-Id: I1027242192dfd2be4918094d59f2a8f8c8fec041
Reviewed-on: https://gerrit.libreoffice.org/63266
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/attarray.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/address.cxx | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index 24e782bb8d39..ed59c0c5a451 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -520,7 +520,7 @@ void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPattern ni++; nInsert = ni; } - else if ( ni > 0 && mvData[ni-1].nEndRow == nStartRow - 1 ) + else if (mvData[ni - 1].nEndRow == nStartRow - 1) nInsert = ni; } if ( ni > 0 && mvData[ni-1].pPattern == pPattern ) diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 730e7de022a9..abb057647be3 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -793,14 +793,14 @@ static ScRefFlags lcl_ScRange_Parse_XL_R1C1( ScRange& r, applyStartToEndFlags(nFlags); r.aEnd.SetRow( r.aStart.Row() ); } - else + else // pTmp != nullptr { // Full row range successfully parsed. applyStartToEndFlags(nFlags, nFlags2); p = pTmp; } - if (p && p[0] != 0) + if (p[0] != 0) { // any trailing invalid character must invalidate the whole address. nFlags &= ~ScRefFlags(ScRefFlags::VALID | ScRefFlags::COL_VALID | ScRefFlags::ROW_VALID | ScRefFlags::TAB_VALID | @@ -829,7 +829,7 @@ static ScRefFlags lcl_ScRange_Parse_XL_R1C1( ScRange& r, { // single cell reference - if (p && p[0] != 0) + if (p[0] != 0) { // any trailing invalid character must invalidate the whole address. nFlags &= ~ScRefFlags(ScRefFlags::VALID | ScRefFlags::COL_VALID | ScRefFlags::ROW_VALID | ScRefFlags::TAB_VALID); @@ -838,11 +838,12 @@ static ScRefFlags lcl_ScRange_Parse_XL_R1C1( ScRange& r, return bOnlyAcceptSingle ? nFlags : ScRefFlags::ZERO; } + assert(pTmp); p = pTmp; // double reference - if (p && p[0] != 0) + if (p[0] != 0) { // any trailing invalid character must invalidate the whole range. nFlags &= ~ScRefFlags(ScRefFlags::VALID | ScRefFlags::COL_VALID | ScRefFlags::ROW_VALID | ScRefFlags::TAB_VALID | @@ -864,13 +865,13 @@ static ScRefFlags lcl_ScRange_Parse_XL_R1C1( ScRange& r, applyStartToEndFlags(nFlags); r.aEnd.SetCol( r.aStart.Col() ); } - else + else // pTmp != nullptr { applyStartToEndFlags(nFlags, nFlags2); p = pTmp; } - if (p && p[0] != 0) + if (p[0] != 0) { // any trailing invalid character must invalidate the whole address. nFlags &= ~ScRefFlags(ScRefFlags::VALID | ScRefFlags::COL_VALID | ScRefFlags::ROW_VALID | ScRefFlags::TAB_VALID | |