From 868d8c8f0fdf376b0a3eb545ee841c9c12ffee3b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 7 Jul 2017 08:42:54 +0200 Subject: loplugin:unnecessaryparen handle parens inside call expr stick to single-arg function calls, sometimes parens in multi-arg calls might be there for clarity Change-Id: Ib80190c571ce65b5d219a88056687042de749e74 Reviewed-on: https://gerrit.libreoffice.org/39676 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/core/doc/DocumentStylePoolManager.cxx | 2 +- sw/source/filter/ww8/rtfattributeoutput.cxx | 2 +- sw/source/filter/ww8/ww8par6.cxx | 6 +++--- sw/source/ui/table/tabledlg.cxx | 4 ++-- sw/source/uibase/shells/grfsh.cxx | 2 +- sw/source/uibase/shells/tabsh.cxx | 5 +++-- sw/source/uibase/uiview/viewtab.cxx | 4 ++-- 7 files changed, 13 insertions(+), 12 deletions(-) (limited to 'sw') diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx index 15b6b0565824..f29114005681 100644 --- a/sw/source/core/doc/DocumentStylePoolManager.cxx +++ b/sw/source/core/doc/DocumentStylePoolManager.cxx @@ -1991,7 +1991,7 @@ SwNumRule* DocumentStylePoolManager::GetNumRuleFromPool( sal_uInt16 nId ) for (sal_uInt16 n = 0; n < MAXLEVEL; ++n) { - aFormat.SetBulletChar( ( (n & 1) ? 0x25a1 : 0x2611 ) ); + aFormat.SetBulletChar( (n & 1) ? 0x25a1 : 0x2611 ); if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) { diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 76af28b3dc49..11f2b7d56a7f 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -1275,7 +1275,7 @@ void RtfAttributeOutput::SectionPageBorders(const SwFrameFormat* pFormat, const void RtfAttributeOutput::SectionBiDi(bool bBiDi) { - m_rExport.Strm().WriteCharPtr((bBiDi ? OOO_STRING_SVTOOLS_RTF_RTLSECT : OOO_STRING_SVTOOLS_RTF_LTRSECT)); + m_rExport.Strm().WriteCharPtr(bBiDi ? OOO_STRING_SVTOOLS_RTF_RTLSECT : OOO_STRING_SVTOOLS_RTF_LTRSECT); } void RtfAttributeOutput::SectionPageNumbering(sal_uInt16 nNumType, const ::boost::optional& oPageRestartNumber) diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index fd24098031ed..a585b8d48233 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -1042,11 +1042,11 @@ void wwSectionManager::CreateSep(const long nTextPos) if (eVer >= ww::eWW6) { - aRes = pSep->HasSprm((eVer <= ww::eWW7 ? 132 : 0x3001)); + aRes = pSep->HasSprm(eVer <= ww::eWW7 ? 132 : 0x3001); if (aRes.pSprm && aRes.nRemainingData >= 1) aNewSection.maSep.iHeadingPgn = *aRes.pSprm; - aRes = pSep->HasSprm((eVer <= ww::eWW7 ? 131 : 0x3000)); + aRes = pSep->HasSprm(eVer <= ww::eWW7 ? 131 : 0x3000); if (aRes.pSprm && aRes.nRemainingData >= 1) aNewSection.maSep.cnsPgn = *aRes.pSprm; } @@ -1817,7 +1817,7 @@ WW8SwFlyPara::WW8SwFlyPara( SwPaM& rPaM, { bAutoWidth = true; nWidth = nNetWidth = - msword_cast((nPgWidth ? nPgWidth : 2268)); // 4 cm + msword_cast(nPgWidth ? nPgWidth : 2268); // 4 cm } if( nWidth <= MINFLY ) nWidth = nNetWidth = MINFLY; // minimum width diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index f38c0d7fdf96..b1f9298fd594 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -770,8 +770,8 @@ SwTableColumnPage::SwTableColumnPage(vcl::Window* pParent, const SfxItemSet& rSe SetExchangeSupport(); const SfxPoolItem* pItem; - Init((SfxItemState::SET == rSet.GetItemState( SID_HTML_MODE, false,&pItem ) - && static_cast(pItem)->GetValue() & HTMLMODE_ON)); + Init(SfxItemState::SET == rSet.GetItemState( SID_HTML_MODE, false,&pItem ) + && static_cast(pItem)->GetValue() & HTMLMODE_ON); } SwTableColumnPage::~SwTableColumnPage() diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index 3b6eeda36108..5a7fa6afcc82 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -287,7 +287,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell()); aSet.Put(SfxUInt16Item(SID_HTML_MODE, nHtmlMode)); - FieldUnit eMetric = ::GetDfltMetric((0 != (nHtmlMode&HTMLMODE_ON))); + FieldUnit eMetric = ::GetDfltMetric(0 != (nHtmlMode&HTMLMODE_ON)); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) ); const SwRect* pRect = &rSh.GetAnyCurRect(CurRectType::Page); diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 1a32de2bf9a8..3347c1af6d44 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -1061,10 +1061,11 @@ void SwTableShell::Execute(SfxRequest &rReq) case FN_TABLE_MODE_FIX_PROP : case FN_TABLE_MODE_VARIABLE : { - rSh.SetTableChgMode( ( FN_TABLE_MODE_FIX == nSlot ? TableChgMode::FixedWidthChangeAbs + rSh.SetTableChgMode( FN_TABLE_MODE_FIX == nSlot + ? TableChgMode::FixedWidthChangeAbs : FN_TABLE_MODE_FIX_PROP == nSlot ? TableChgMode::FixedWidthChangeProp - : TableChgMode::VarWidthChangeAbs ) ); + : TableChgMode::VarWidthChangeAbs ); SfxBindings& rBind = GetView().GetViewFrame()->GetBindings(); static sal_uInt16 aInva[] = diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index 3ac39c0f091c..138069464a09 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -1365,8 +1365,8 @@ void SwView::StateTabWin(SfxItemSet& rSet) else if( nFrameType & FrameTypeFlags::DRAWOBJ) { const SwRect &rRect = rSh.GetObjRect(); - aLongUL.SetUpper((rRect.Top() - rPageRect.Top())); - aLongUL.SetLower((rPageRect.Bottom() - rRect.Bottom())); + aLongUL.SetUpper(rRect.Top() - rPageRect.Top()); + aLongUL.SetLower(rPageRect.Bottom() - rRect.Bottom()); } else if(bBrowse) { -- cgit