From 6154489314d2f2bf9cb99b72f15c79dd48a1da14 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sun, 14 Apr 2019 15:54:14 +0300 Subject: 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 --- sw/source/core/access/accframebase.cxx | 15 +++++++-------- sw/source/core/access/accpara.cxx | 15 +++++++-------- sw/source/uibase/app/appopt.cxx | 5 ++--- sw/source/uibase/shells/drwtxtsh.cxx | 3 --- 4 files changed, 16 insertions(+), 22 deletions(-) (limited to 'sw') 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( pVSh) != nullptr; - // SELECTABLE - if( bSelectable ) - rStateSet.AddState( AccessibleStateType::SELECTABLE ); - - // FOCUSABLE - if( bSelectable ) - rStateSet.AddState( AccessibleStateType::FOCUSABLE ); + if (dynamic_cast(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 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(); -- cgit ro/collabora/cp-6.2 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff