summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-10-28 00:13:29 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-10-28 07:55:59 +0100
commit5f0ddb2d2068a4388a7df12cd0e11f628b91e4c0 (patch)
tree2007c4a1f6c21a9f0d5a11aab60a10cd178d1d8b /sw
parent8522572cdd27f62a031bb07c9cf7f6f85e8453ad (diff)
tdf#120703 PVS: V547 Expression is always true/false
Change-Id: Ic92cc594979cac2edac04a085957398672a5dfcc Reviewed-on: https://gerrit.libreoffice.org/62450 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/app/docsh.cxx15
-rw-r--r--sw/source/uibase/app/docsh2.cxx2
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx9
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx2
-rw-r--r--sw/source/uibase/frmdlg/colex.cxx6
5 files changed, 11 insertions, 23 deletions
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index 6976d844b2ea..3559a500fba6 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -222,8 +222,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReaderPtr& rpRdr,
pSet->GetItemState( SID_FILE_FILTEROPTIONS, true, &pItem ) )
aOpt.ReadUserData( static_cast<const SfxStringItem*>(pItem)->GetValue() );
- if( pRead )
- pRead->GetReaderOpt().SetASCIIOpts( aOpt );
+ pRead->GetReaderOpt().SetASCIIOpts( aOpt );
}
return pRead;
@@ -239,17 +238,11 @@ bool SwDocShell::ConvertFrom( SfxMedium& rMedium )
tools::SvRef<SotStorage> pStg=pRead->getSotStorageRef(); // #i45333# save sot storage ref in case of recursive calls
m_xDoc->setDocAccTitle(OUString());
- SfxViewFrame* pFrame1 = SfxViewFrame::GetFirst( this );
- if (pFrame1)
+ if (const auto pFrame1 = SfxViewFrame::GetFirst(this))
{
- vcl::Window* pWindow = &pFrame1->GetWindow();
- if ( pWindow )
+ if (auto pSysWin = pFrame1->GetWindow().GetSystemWindow())
{
- vcl::Window* pSysWin = pWindow->GetSystemWindow();
- if ( pSysWin )
- {
- pSysWin->SetAccessibleName(OUString());
- }
+ pSysWin->SetAccessibleName(OUString());
}
}
SwWait aWait( *this, true );
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index d299b67de20f..b77c8d9951ec 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -747,7 +747,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
GetDoc()->getIDocumentDeviceAccess().setPrinter( pSavePrinter, true, true);
//pSavePrinter must not be deleted again
}
- pViewFrame->GetBindings().SetState(SfxBoolItem(SID_SOURCEVIEW, nSlot == SID_VIEWSHELL2));
+ pViewFrame->GetBindings().SetState(SfxBoolItem(SID_SOURCEVIEW, false)); // not SID_VIEWSHELL2
pViewFrame->GetBindings().Invalidate( SID_NEWWINDOW );
pViewFrame->GetBindings().Invalidate( SID_BROWSER_MODE );
pViewFrame->GetBindings().Invalidate( FN_PRINT_LAYOUT );
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 81af597d8951..9af9d7933401 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -2357,12 +2357,9 @@ bool SwDBManager::ToRecordId(sal_Int32 nSet)
return false;
bool bRet = false;
sal_Int32 nAbsPos = nSet;
-
- if(nAbsPos >= 0)
- {
- bRet = lcl_MoveAbsolute(pImpl->pMergeData, nAbsPos);
- pImpl->pMergeData->bEndOfDB = !bRet;
- }
+ assert(nAbsPos >= 0);
+ bRet = lcl_MoveAbsolute(pImpl->pMergeData, nAbsPos);
+ pImpl->pMergeData->bEndOfDB = !bRet;
return bRet;
}
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 6ce63b23a55d..1f1cb9adf328 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -1458,7 +1458,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
if( KEY_UP == nKey ) nKey = KEY_LEFT;
else if( KEY_DOWN == nKey ) nKey = KEY_RIGHT;
else if( KEY_LEFT == nKey ) nKey = KEY_DOWN;
- else if( KEY_RIGHT == nKey ) nKey = KEY_UP;
+ else /* KEY_RIGHT == nKey */ nKey = KEY_UP;
}
if ( rSh.IsInRightToLeftText() )
diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx
index 53028e9486fa..d00de282e8cb 100644
--- a/sw/source/uibase/frmdlg/colex.cxx
+++ b/sw/source/uibase/frmdlg/colex.cxx
@@ -54,10 +54,8 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet )
if ( rSet.GetItemState( nWhich, false ) == SfxItemState::SET )
{
// alignment
- const SvxPageItem* pPage = static_cast<const SvxPageItem*>(&rSet.Get( nWhich ));
-
- if ( pPage )
- SetUsage( pPage->GetPageUsage() );
+ const SvxPageItem& rPage = static_cast<const SvxPageItem&>(rSet.Get(nWhich));
+ SetUsage(rPage.GetPageUsage());
}
nWhich = pPool->GetWhich( SID_ATTR_PAGE_SIZE );