diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-24 21:55:10 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-25 09:13:12 +0100 |
commit | f2cd9c0c789b5825b4d5bb84b352d089e231e527 (patch) | |
tree | 95f6ecfaf25231ee4de3320995263780cd655792 /sd | |
parent | e1cbd518118a5f2889213e5725e0e0a3c133de5d (diff) |
tdf#120703 PVS: V560 A part of conditional expression is always true/false
Change-Id: If173f42302553b164267909a0a3156bb25a6d558
Reviewed-on: https://gerrit.libreoffice.org/63957
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/func/fupoor.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drviews1.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/view/drviews7.cxx | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx index ac64ac4ccde1..ddf4866b95bb 100644 --- a/sd/source/ui/func/fupoor.cxx +++ b/sd/source/ui/func/fupoor.cxx @@ -722,7 +722,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) else { // move handle with index nHandleIndex - if(pHdl && (nX || nY)) + if (nX || nY) { // now move the Handle (nX, nY) Point aStartPoint(pHdl->GetPos()); diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index 365a3b57b21e..ec8cdbb1e273 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -632,22 +632,22 @@ IMPL_LINK( DrawViewShell, TabSplitHdl, TabBar *, pTab, void ) /// inherited from sd::ViewShell SdPage* DrawViewShell::getCurrentPage() const { - const sal_Int32 nPageCount = (meEditMode == EditMode::Page)? + const sal_uInt16 nPageCount = (meEditMode == EditMode::Page)? GetDoc()->GetSdPageCount(mePageKind): GetDoc()->GetMasterSdPageCount(mePageKind); - sal_Int32 nCurrentPage = maTabControl->GetCurPagePos(); - DBG_ASSERT( (nPageCount>0) && (nCurrentPage<nPageCount), "sd::DrawViewShell::getCurrentPage(), illegal page index!" ); - if( (nPageCount < 0) || (nCurrentPage>=nPageCount) ) + sal_uInt16 nCurrentPage = maTabControl->GetCurPagePos(); + DBG_ASSERT((nCurrentPage<nPageCount), "sd::DrawViewShell::getCurrentPage(), illegal page index!"); + if (nCurrentPage >= nPageCount) nCurrentPage = 0; // play safe here if (meEditMode == EditMode::Page) { - return GetDoc()->GetSdPage(static_cast<sal_uInt16>(nCurrentPage), mePageKind); + return GetDoc()->GetSdPage(nCurrentPage, mePageKind); } else // EditMode::MasterPage { - return GetDoc()->GetMasterSdPage(static_cast<sal_uInt16>(nCurrentPage), mePageKind); + return GetDoc()->GetMasterSdPage(nCurrentPage, mePageKind); } } diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 7fc676643d6d..73c1e7253a67 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1836,7 +1836,7 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq) { nLeft = static_cast<const SvxLongLRSpaceItem*>(pPoolItem)->GetLeft(); nRight = static_cast<const SvxLongLRSpaceItem*>(pPoolItem)->GetRight(); - if (nLeft != -1 && nUpper == -1) + if (nLeft != -1) { nUpper = pPage->GetUpperBorder(); nLower = pPage->GetLowerBorder(); @@ -1851,7 +1851,7 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq) { nUpper = static_cast<const SvxLongULSpaceItem*>(pPoolItem)->GetUpper(); nLower = static_cast<const SvxLongULSpaceItem*>(pPoolItem)->GetLower(); - if (nLeft == -1 && nUpper != -1) + if (nUpper != -1) { nLeft = pPage->GetLeftBorder(); nRight = pPage->GetRightBorder(); |