[Libreoffice-commits] core.git: sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sat Dec 1 18:08:28 UTC 2018
sc/source/ui/view/printfun.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 4e8f01716ec11ea8e7b8991a659e3ef708f4fee4
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Nov 26 11:17:01 2018 +0300
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Sat Dec 1 19:08:05 2018 +0100
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 at collabora.com>
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 )
{
More information about the Libreoffice-commits
mailing list