summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-11-26 11:17:01 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-12-01 19:08:05 +0100
commit4e8f01716ec11ea8e7b8991a659e3ef708f4fee4 (patch)
treefdbea92b2f8133b0f3644ae987d2ef8d70ba7caa
parent56d97cdd0af15c90c744d2ac66e879818c073ec6 (diff)
tdf#120703 PVS: the condition needs &&, not ||
... ever since commit 9ae5a91f7955e44d3b24a3f7741f9bca02ac7f24 V560 A part of conditional expression is always false: nRangeNo < nRCount. The value range of unsigned short type: [0, 65535]. Actually, simple if (nRangeNo < nRCount) would be enough, given that if sal_uInt16 is less than another sal_uInt16, it cannot be equal to greatest sal_uInt16. But let's keep this redundant comparison, in case types or define changes later. Change-Id: I886a0bc847a8c30966dea3ea0670bcee9b43c7f1 Reviewed-on: https://gerrit.libreoffice.org/64021 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--sc/source/ui/view/printfun.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 2ba69ecc79dc..b2de8a6bf82d 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -2773,7 +2773,7 @@ void ScPrintFunc::CalcZoom( sal_uInt16 nRangeNo ) // calcu
{
sal_uInt16 nRCount = pDoc->GetPrintRangeCount( nPrintTab );
const ScRange* pThisRange = nullptr;
- if ( nRangeNo != RANGENO_NORANGE || nRangeNo < nRCount )
+ if (nRangeNo != RANGENO_NORANGE && nRangeNo < nRCount)
pThisRange = pDoc->GetPrintRange( nPrintTab, nRangeNo );
if ( pThisRange )
{