diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-14 15:54:14 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-14 15:47:48 +0200 |
commit | 6154489314d2f2bf9cb99b72f15c79dd48a1da14 (patch) | |
tree | d9bbbc2e0233d417555109206bdb2d298ce838ac /sw | |
parent | eb772683513f4f2b6c8e6404c29b8e477ffc7fad (diff) |
tdf#120703 PVS: V581 ifs with identical conditions
V581 The conditional expressions of the 'if' statements situated
alongside each other are identical.
Change-Id: I18562d60e33c7ecff14807976dde4cbcae3f665b
Reviewed-on: https://gerrit.libreoffice.org/70731
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/access/accframebase.cxx | 15 | ||||
-rw-r--r-- | sw/source/core/access/accpara.cxx | 15 | ||||
-rw-r--r-- | sw/source/uibase/app/appopt.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/shells/drwtxtsh.cxx | 3 |
4 files changed, 16 insertions, 22 deletions
diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx index f53edaa4ea3b..609ca2e5b4d5 100644 --- a/sw/source/core/access/accframebase.cxx +++ b/sw/source/core/access/accframebase.cxx @@ -68,15 +68,14 @@ void SwAccessibleFrameBase::GetStates( const SwViewShell *pVSh = GetMap()->GetShell(); assert(pVSh); - bool bSelectable = dynamic_cast<const SwFEShell*>( pVSh) != nullptr; - // SELECTABLE - if( bSelectable ) - rStateSet.AddState( AccessibleStateType::SELECTABLE ); - - // FOCUSABLE - if( bSelectable ) - rStateSet.AddState( AccessibleStateType::FOCUSABLE ); + if (dynamic_cast<const SwFEShell*>(pVSh)) + { + // SELECTABLE + rStateSet.AddState(AccessibleStateType::SELECTABLE); + // FOCUSABLE + rStateSet.AddState(AccessibleStateType::FOCUSABLE); + } // SELECTED and FOCUSED if( IsSelected() ) diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 350458840bcb..dc2938ab286b 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -226,14 +226,13 @@ void SwAccessibleParagraph::GetStates( // MULTILINE rStateSet.AddState( AccessibleStateType::MULTI_LINE ); - // MULTISELECTABLE - SwCursorShell *pCursorSh = GetCursorShell(); - if( pCursorSh ) - rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE ); - - // FOCUSABLE - if( pCursorSh ) - rStateSet.AddState( AccessibleStateType::FOCUSABLE ); + if (GetCursorShell()) + { + // MULTISELECTABLE + rStateSet.AddState(AccessibleStateType::MULTI_SELECTABLE); + // FOCUSABLE + rStateSet.AddState(AccessibleStateType::FOCUSABLE); + } // FOCUSED (simulates node index of cursor) SwPaM* pCaret = GetCursor( false ); // #i27301# - consider adjusted method signature diff --git a/sw/source/uibase/app/appopt.cxx b/sw/source/uibase/app/appopt.cxx index f02549e38c6f..7929b5a4efd1 100644 --- a/sw/source/uibase/app/appopt.cxx +++ b/sw/source/uibase/app/appopt.cxx @@ -224,14 +224,13 @@ std::unique_ptr<SfxItemSet> SwModule::CreateItemSet( sal_uInt16 nId ) SwAddPrinterItem aAddPrinterItem(*pOpt ); pRet->Put(aAddPrinterItem); - // Options for Web background + // Options for Web if(!bTextDialog) { pRet->Put(SvxBrushItem(aViewOpt.GetRetoucheColor(), RES_BACKGROUND)); + pRet->Put(SfxUInt16Item(SID_HTML_MODE, HTMLMODE_ON)); } - if(!bTextDialog) - pRet->Put(SfxUInt16Item(SID_HTML_MODE, HTMLMODE_ON)); return pRet; } diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx index 9bc1292501ee..ebd0e711d6bf 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -731,9 +731,6 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) return; } - if( sSym.isEmpty() ) - return; - // do not flicker pOLV->HideCursor(); SdrOutliner * pOutliner = pSdrView->GetTextEditOutliner(); |