diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-05 08:32:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-05 11:08:48 +0200 |
commit | 4b2262ab5b10f334f1984fec84d2978db81c58f1 (patch) | |
tree | de56663eba6ed2edf7a26127339dd8563fdf47be /vcl/source | |
parent | ec1de6895d84fbe4f2d5fb7135a59a918138d970 (diff) |
new loplugin unnecessaryparen
Change-Id: Ic883a07b30069ca6342d7521c8ad890f4326f0ec
Reviewed-on: https://gerrit.libreoffice.org/39549
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/control/button.cxx | 2 | ||||
-rw-r--r-- | vcl/source/edit/texteng.cxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/graphicfilter.cxx | 4 | ||||
-rw-r--r-- | vcl/source/filter/ipdf/pdfread.cxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/sgvtext.cxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/wmf/winwmf.cxx | 4 | ||||
-rw-r--r-- | vcl/source/font/PhysicalFontCollection.cxx | 2 | ||||
-rw-r--r-- | vcl/source/font/PhysicalFontFamily.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/legacyaccessibility.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/menu.cxx | 5 | ||||
-rw-r--r-- | vcl/source/window/printdlg.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/toolbox.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 2 |
15 files changed, 25 insertions, 22 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index c8769355051b..e9f048b19dd3 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -1082,7 +1082,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext) Size aInRectSize(rRenderContext.LogicToPixel(Size(aInRect.GetWidth(), aInRect.GetHeight()))); aControlValue.mbSingleLine = (aInRectSize.Height() < 2 * aFontSize.Height()); - if (((nState & ControlState::ROLLOVER)) || !(GetStyle() & WB_FLATBUTTON)) + if ((nState & ControlState::ROLLOVER) || !(GetStyle() & WB_FLATBUTTON)) { bNativeOK = rRenderContext.DrawNativeControl(ControlType::Pushbutton, ControlPart::Entire, aCtrlRegion, nState, aControlValue, OUString() /*PushButton::GetText()*/); diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 78d2e1dbb656..5f8084ee9d31 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -1833,7 +1833,7 @@ void TextEngine::RecalcTextPortion( sal_uInt32 nPara, sal_Int32 nStartPos, sal_I // Or if at the very beginning ( StartPos 0 ) followed by a tab... if ( ( pNode->GetCharAttribs().HasBoundingAttrib( nStartPos ) ) || ( nStartPos && ( pNode->GetText()[ nStartPos - 1 ] == '\t' ) ) || - ( ( !nStartPos && ( nNewChars < pNode->GetText().getLength() ) && pNode->GetText()[ nNewChars ] == '\t' ) ) ) + ( !nStartPos && ( nNewChars < pNode->GetText().getLength() ) && pNode->GetText()[ nNewChars ] == '\t' ) ) { std::size_t nNewPortionPos = 0; if ( nStartPos ) diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index b78c2fdddafa..6ae9459f5bd6 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -762,8 +762,8 @@ static bool ImpPeekGraphicFormat( SvStream& rStream, OUString& rFormatExtension, if (!bTest || rFormatExtension.startsWith("PDF")) { - if ((sFirstBytes[0] == '%' && sFirstBytes[1] == 'P' && sFirstBytes[2] == 'D' && - sFirstBytes[3] == 'F' && sFirstBytes[4] == '-')) + if (sFirstBytes[0] == '%' && sFirstBytes[1] == 'P' && sFirstBytes[2] == 'D' && + sFirstBytes[3] == 'F' && sFirstBytes[4] == '-') { rFormatExtension = "PDF"; return true; diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx index f1a7e2b52a17..fc85066a2b03 100644 --- a/vcl/source/filter/ipdf/pdfread.cxx +++ b/vcl/source/filter/ipdf/pdfread.cxx @@ -123,7 +123,7 @@ bool isCompatible(SvStream& rInStream) if (nRead < 8) return false; - if ((aFirstBytes[0] != '%' || aFirstBytes[1] != 'P' || aFirstBytes[2] != 'D' || aFirstBytes[3] != 'F' || aFirstBytes[4] != '-')) + if (aFirstBytes[0] != '%' || aFirstBytes[1] != 'P' || aFirstBytes[2] != 'D' || aFirstBytes[3] != 'F' || aFirstBytes[4] != '-') return false; sal_Int32 nMajor = OString(aFirstBytes[5]).toInt32(); diff --git a/vcl/source/filter/sgvtext.cxx b/vcl/source/filter/sgvtext.cxx index 32ce4f1d44a2..e53e6066e5ef 100644 --- a/vcl/source/filter/sgvtext.cxx +++ b/vcl/source/filter/sgvtext.cxx @@ -580,7 +580,7 @@ bool UpcasePossible(UCHAR c) UCHAR Upcase(UCHAR c) { - if ((c>=(UCHAR)'a' && c<=(UCHAR)'z')) c=(c-(UCHAR)'a')+(UCHAR)'A'; + if (c>=(UCHAR)'a' && c<=(UCHAR)'z') c=(c-(UCHAR)'a')+(UCHAR)'A'; else if ( c == 0xe4 ) c = 0xc4; else if ( c == 0xf6 ) c = 0xd6; else if ( c == 0xfc ) c = 0xdc; diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx index b9d2f8d27615..501f36eabfe9 100644 --- a/vcl/source/filter/wmf/winwmf.cxx +++ b/vcl/source/filter/wmf/winwmf.cxx @@ -697,7 +697,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) pAcc.reset(); if ( nSye && nSxe && ( ( nSx + nSxe ) <= aBmp.GetSizePixel().Width() ) && - ( ( nSy + nSye <= aBmp.GetSizePixel().Height() ) ) ) + ( ( nSy + nSye ) <= aBmp.GetSizePixel().Height() ) ) { tools::Rectangle aCropRect( Point( nSx, nSy ), Size( nSxe, nSye ) ); aBmp.Crop( aCropRect ); @@ -748,7 +748,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) // test if it is sensible to crop if ( nSye && nSxe && ( ( nSx + nSxe ) <= aBmp.GetSizePixel().Width() ) && - ( ( nSy + nSye <= aBmp.GetSizePixel().Height() ) ) ) + ( ( nSy + nSye ) <= aBmp.GetSizePixel().Height() ) ) { tools::Rectangle aCropRect( Point( nSx, nSy ), Size( nSxe, nSye ) ); aBmp.Crop( aCropRect ); diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx index b10f3c295926..869578425aef 100644 --- a/vcl/source/font/PhysicalFontCollection.cxx +++ b/vcl/source/font/PhysicalFontCollection.cxx @@ -46,7 +46,7 @@ static ImplFontAttrs lcl_IsCJKFont( const OUString& rFontName ) return ImplFontAttrs::CJK|ImplFontAttrs::CJK_KR; // chinese - if ( ((ch >= 0x3400) && (ch <= 0x9FFF)) ) + if ( (ch >= 0x3400) && (ch <= 0x9FFF) ) return ImplFontAttrs::CJK|ImplFontAttrs::CJK_TC|ImplFontAttrs::CJK_SC; // cjk diff --git a/vcl/source/font/PhysicalFontFamily.cxx b/vcl/source/font/PhysicalFontFamily.cxx index 5e28ab37a03f..5381e29e175e 100644 --- a/vcl/source/font/PhysicalFontFamily.cxx +++ b/vcl/source/font/PhysicalFontFamily.cxx @@ -72,7 +72,7 @@ static ImplFontAttrs lcl_IsCJKFont( const OUString& rFontName ) return ImplFontAttrs::CJK|ImplFontAttrs::CJK_KR; // chinese - if ( ((ch >= 0x3400) && (ch <= 0x9FFF)) ) + if ( (ch >= 0x3400) && (ch <= 0x9FFF) ) return ImplFontAttrs::CJK|ImplFontAttrs::CJK_TC|ImplFontAttrs::CJK_SC; // cjk diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index f45dd1685b64..0126752d2c67 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -702,7 +702,7 @@ void PDFWriterImpl::createWidgetFieldName( sal_Int32 i_nWidgetIndex, const PDFWr * outside the interval [32(=ASCII' ');126(=ASCII'~')] * should be escaped hexadecimal */ - if( (aStr[i] >= 32 && aStr[i] <= 126 ) ) + if( aStr[i] >= 32 && aStr[i] <= 126 ) aBuffer.append( aStr[i] ); else { diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 32643162d110..0473c541ae0f 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -396,8 +396,8 @@ void VclBox::setAllocation(const Size &rAllocation) long nHomogeneousDimension = 0, nExtraSpace = 0; if (m_bHomogeneous) { - nHomogeneousDimension = ((nAllocPrimaryDimension - - (nVisibleChildren - 1) * m_nSpacing)) / nVisibleChildren; + nHomogeneousDimension = (nAllocPrimaryDimension - + (nVisibleChildren - 1) * m_nSpacing) / nVisibleChildren; } else if (nExpandChildren) { diff --git a/vcl/source/window/legacyaccessibility.cxx b/vcl/source/window/legacyaccessibility.cxx index 62a500a060e7..bcf4bc2c0be6 100644 --- a/vcl/source/window/legacyaccessibility.cxx +++ b/vcl/source/window/legacyaccessibility.cxx @@ -162,9 +162,9 @@ static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Windo if( pSWindow && isVisibleInLayout(pSWindow) && !(pSWindow->GetStyle() & WB_NOLABEL) ) { WindowType nType = pSWindow->GetType(); - if ( ( nType == WindowType::FIXEDTEXT || - nType == WindowType::FIXEDLINE || - nType == WindowType::GROUPBOX ) ) + if ( nType == WindowType::FIXEDTEXT || + nType == WindowType::FIXEDLINE || + nType == WindowType::GROUPBOX ) { // a fixed text can't be labeld by a fixed text. if ( ( nMyType != WindowType::FIXEDTEXT ) || ( nType != WindowType::FIXEDTEXT ) ) diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 8142bb649cc5..271ab84ac60a 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2764,7 +2764,10 @@ sal_uInt16 PopupMenu::ImplExecute( const VclPtr<vcl::Window>& pW, const tools::R // set the flag to hide or show accelerators in the menu depending on whether the menu was launched by mouse or keyboard shortcut if( pSFrom && pSFrom->IsMenuBar()) - ((static_cast<MenuBarWindow*>(pSFrom->pWindow.get())))->SetMBWHideAccel(!(static_cast<MenuBarWindow*>(pSFrom->pWindow.get())->GetMBWMenuKey())); + { + auto pMenuBarWindow = static_cast<MenuBarWindow*>(pSFrom->pWindow.get()); + pMenuBarWindow->SetMBWHideAccel( !(pMenuBarWindow->GetMBWMenuKey()) ); + } delete mpLayoutData; mpLayoutData = nullptr; diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 7c03f58eee8c..5630c1c09a08 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -919,7 +919,7 @@ void PrintDialog::setupOptionalUI() if( ! (rEntry.Value >>= aHelpTexts) ) { OUString aHelpText; - if( (rEntry.Value >>= aHelpText) ) + if( rEntry.Value >>= aHelpText ) { aHelpTexts.realloc( 1 ); *aHelpTexts.getArray() = aHelpText; @@ -931,7 +931,7 @@ void PrintDialog::setupOptionalUI() if( ! (rEntry.Value >>= aHelpIds ) ) { OUString aHelpId; - if( (rEntry.Value >>= aHelpId) ) + if( rEntry.Value >>= aHelpId ) { aHelpIds.realloc( 1 ); *aHelpIds.getArray() = aHelpId; diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 4475353a65a2..c76de72b03e1 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -1933,8 +1933,8 @@ void lcl_hideDoubleSeparators( ToolBox::ImplToolItems& rItems ) ToolBox::ImplToolItems::iterator temp_it; for ( temp_it = it+1; temp_it != rItems.end(); ++temp_it ) { - if ( ((temp_it->meType == ToolBoxItemType::BUTTON) && - temp_it->mbVisible) ) + if ( (temp_it->meType == ToolBoxItemType::BUTTON) && + temp_it->mbVisible ) { it->mbVisible = true; break; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 04d8e8d5c3b2..5d30f4f54fda 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -1009,7 +1009,7 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p ( !(nFrameStyle & ~SalFrameStyleFlags::CLOSEABLE) && ( mpWindowImpl->mbFloatWin || ((GetType() == WindowType::BORDERWINDOW) && static_cast<ImplBorderWindow*>(this)->mbFloatWindow) || (nStyle & WB_SYSTEMFLOATWIN) ) ) || // 2. borderwindows of floaters with ownerdraw decoration - ( ((GetType() == WindowType::BORDERWINDOW) && static_cast<ImplBorderWindow*>(this)->mbFloatWindow && (nStyle & WB_OWNERDRAWDECORATION) ) ) ) + ((GetType() == WindowType::BORDERWINDOW) && static_cast<ImplBorderWindow*>(this)->mbFloatWindow && (nStyle & WB_OWNERDRAWDECORATION) ) ) { nFrameStyle = SalFrameStyleFlags::FLOAT; if( nStyle & WB_OWNERDRAWDECORATION ) |