summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-11-23 08:13:06 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-11-23 10:00:44 +0100
commitb26012ef159bd420ac3bb9275607d3a1622422f7 (patch)
treee39d6e31122a22d7c0c27336410acaafe71c4fcf /vcl
parentbfaf5740bb10ce8c51017cba44681de10953bea4 (diff)
Make loplugin:unnecessaryparen look through implicit
...similar to how <https://gerrit.libreoffice.org/#/c/45083/2> "Make not warning about !! in loplugin:simplifybool consistent" does for loplugin:simplifybool Change-Id: I23eef400af71c582d380c9bae6546ce06e8a1e18 Reviewed-on: https://gerrit.libreoffice.org/45122 Tested-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/imp_listbox.cxx8
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx16
-rw-r--r--vcl/source/gdi/salgdilayout.cxx12
-rw-r--r--vcl/source/outdev/bitmap.cxx2
-rw-r--r--vcl/source/window/toolbox.cxx2
-rw-r--r--vcl/unx/generic/window/salframe.cxx10
-rw-r--r--vcl/unx/gtk/gtksalframe.cxx8
-rw-r--r--vcl/unx/gtk/salnativewidgets-gtk.cxx2
-rw-r--r--vcl/unx/gtk3/gtk3gtkframe.cxx8
-rw-r--r--vcl/unx/kde4/KDESalGraphics.cxx12
10 files changed, 40 insertions, 40 deletions
diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx
index d23659e3e8f1..c9d4babe859b 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -619,7 +619,7 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry )
if ( aMetrics.bText )
{
- if( (rEntry.mnFlags & ListBoxEntryFlags::MultiLine) )
+ if( rEntry.mnFlags & ListBoxEntryFlags::MultiLine )
{
// multiline case
Size aCurSize( PixelToLogic( GetSizePixel() ) );
@@ -1796,7 +1796,7 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32
{
long nMaxWidth = std::max(mnMaxWidth, GetOutputSizePixel().Width() - 2 * mnBorder);
// a multiline entry should only be as wide a the window
- if ((pEntry->mnFlags & ListBoxEntryFlags::MultiLine))
+ if (pEntry->mnFlags & ListBoxEntryFlags::MultiLine)
nMaxWidth = GetOutputSizePixel().Width() - 2 * mnBorder;
tools::Rectangle aTextRect(Point(mnBorder - mnLeft, nY),
@@ -1818,9 +1818,9 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32
}
DrawTextFlags nDrawStyle = ImplGetTextStyle();
- if ((pEntry->mnFlags & ListBoxEntryFlags::MultiLine))
+ if (pEntry->mnFlags & ListBoxEntryFlags::MultiLine)
nDrawStyle |= MULTILINE_ENTRY_DRAW_FLAGS;
- if ((pEntry->mnFlags & ListBoxEntryFlags::DrawDisabled))
+ if (pEntry->mnFlags & ListBoxEntryFlags::DrawDisabled)
nDrawStyle |= DrawTextFlags::Disable;
rRenderContext.DrawText(aTextRect, aStr, nDrawStyle);
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 6d958b3bc231..e6bd9760c9d4 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -10232,7 +10232,7 @@ void PDFWriterImpl::updateGraphicsState(Mode const mode)
GraphicsState& rNewState = m_aGraphicsStack.front();
// first set clip region since it might invalidate everything else
- if( (rNewState.m_nUpdateFlags & GraphicsStateUpdateFlags::ClipRegion) )
+ if( rNewState.m_nUpdateFlags & GraphicsStateUpdateFlags::ClipRegion )
{
rNewState.m_nUpdateFlags &= ~GraphicsStateUpdateFlags::ClipRegion;
@@ -10268,32 +10268,32 @@ void PDFWriterImpl::updateGraphicsState(Mode const mode)
}
}
- if( (rNewState.m_nUpdateFlags & GraphicsStateUpdateFlags::MapMode) )
+ if( rNewState.m_nUpdateFlags & GraphicsStateUpdateFlags::MapMode )
{
rNewState.m_nUpdateFlags &= ~GraphicsStateUpdateFlags::MapMode;
getReferenceDevice()->SetMapMode( rNewState.m_aMapMode );
}
- if( (rNewState.m_nUpdateFlags & GraphicsStateUpdateFlags::Font) )
+ if( rNewState.m_nUpdateFlags & GraphicsStateUpdateFlags::Font )
{
rNewState.m_nUpdateFlags &= ~GraphicsStateUpdateFlags::Font;
getReferenceDevice()->SetFont( rNewState.m_aFont );
getReferenceDevice()->ImplNewFont();
}
- if( (rNewState.m_nUpdateFlags & GraphicsStateUpdateFlags::LayoutMode) )
+ if( rNewState.m_nUpdateFlags & GraphicsStateUpdateFlags::LayoutMode )
{
rNewState.m_nUpdateFlags &= ~GraphicsStateUpdateFlags::LayoutMode;
getReferenceDevice()->SetLayoutMode( rNewState.m_nLayoutMode );
}
- if( (rNewState.m_nUpdateFlags & GraphicsStateUpdateFlags::DigitLanguage) )
+ if( rNewState.m_nUpdateFlags & GraphicsStateUpdateFlags::DigitLanguage )
{
rNewState.m_nUpdateFlags &= ~GraphicsStateUpdateFlags::DigitLanguage;
getReferenceDevice()->SetDigitLanguage( rNewState.m_aDigitLanguage );
}
- if( (rNewState.m_nUpdateFlags & GraphicsStateUpdateFlags::LineColor) )
+ if( rNewState.m_nUpdateFlags & GraphicsStateUpdateFlags::LineColor )
{
rNewState.m_nUpdateFlags &= ~GraphicsStateUpdateFlags::LineColor;
if( m_aCurrentPDFState.m_aLineColor != rNewState.m_aLineColor &&
@@ -10304,7 +10304,7 @@ void PDFWriterImpl::updateGraphicsState(Mode const mode)
}
}
- if( (rNewState.m_nUpdateFlags & GraphicsStateUpdateFlags::FillColor) )
+ if( rNewState.m_nUpdateFlags & GraphicsStateUpdateFlags::FillColor )
{
rNewState.m_nUpdateFlags &= ~GraphicsStateUpdateFlags::FillColor;
if( m_aCurrentPDFState.m_aFillColor != rNewState.m_aFillColor &&
@@ -10315,7 +10315,7 @@ void PDFWriterImpl::updateGraphicsState(Mode const mode)
}
}
- if( (rNewState.m_nUpdateFlags & GraphicsStateUpdateFlags::TransparentPercent) )
+ if( rNewState.m_nUpdateFlags & GraphicsStateUpdateFlags::TransparentPercent )
{
rNewState.m_nUpdateFlags &= ~GraphicsStateUpdateFlags::TransparentPercent;
if( m_aContext.Version >= PDFWriter::PDFVersion::PDF_1_4 )
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index 1c99d4d2ac1a..732a7181cf2b 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -120,7 +120,7 @@ void SalGraphics::mirror( long& x, const OutputDevice *pOutDev ) const
{
OutputDevice *pOutDevRef = const_cast<OutputDevice*>(pOutDev);
// mirror this window back
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) )
+ if( m_nLayout & SalLayoutFlags::BiDiRtl )
{
long devX = w-pOutDevRef->GetOutputWidthPixel()-pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX
x = devX + (x - pOutDevRef->GetOutOffXPixel());
@@ -131,7 +131,7 @@ void SalGraphics::mirror( long& x, const OutputDevice *pOutDev ) const
x = pOutDevRef->GetOutputWidthPixel() - (x - devX) + pOutDevRef->GetOutOffXPixel() - 1;
}
}
- else if( (m_nLayout & SalLayoutFlags::BiDiRtl) )
+ else if( m_nLayout & SalLayoutFlags::BiDiRtl )
x = w-1-x;
}
}
@@ -150,7 +150,7 @@ void SalGraphics::mirror( long& x, long nWidth, const OutputDevice *pOutDev, boo
{
OutputDevice *pOutDevRef = const_cast<OutputDevice*>(pOutDev);
// mirror this window back
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) )
+ if( m_nLayout & SalLayoutFlags::BiDiRtl )
{
long devX = w-pOutDevRef->GetOutputWidthPixel()-pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX
if( bBack )
@@ -167,7 +167,7 @@ void SalGraphics::mirror( long& x, long nWidth, const OutputDevice *pOutDev, boo
x = pOutDevRef->GetOutputWidthPixel() - (x - devX) + pOutDevRef->GetOutOffXPixel() - nWidth;
}
}
- else if( (m_nLayout & SalLayoutFlags::BiDiRtl) )
+ else if( m_nLayout & SalLayoutFlags::BiDiRtl )
x = w-nWidth-x;
}
@@ -189,7 +189,7 @@ bool SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *
{
OutputDevice *pOutDevRef = const_cast<OutputDevice*>(pOutDev);
// mirror this window back
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) )
+ if( m_nLayout & SalLayoutFlags::BiDiRtl )
{
long devX = w-pOutDevRef->GetOutputWidthPixel()-pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX
for( i=0, j=nPoints-1; i<nPoints; i++,j-- )
@@ -208,7 +208,7 @@ bool SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *
}
}
}
- else if( (m_nLayout & SalLayoutFlags::BiDiRtl) )
+ else if( m_nLayout & SalLayoutFlags::BiDiRtl )
{
for( i=0, j=nPoints-1; i<nPoints; i++,j-- )
{
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index cfdae8d46e9d..0e6b651f3b10 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -65,7 +65,7 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const Size& rDestSize,
if( ImplIsRecordLayout() )
return;
- if ( ( mnDrawMode & DrawModeFlags::NoBitmap ) )
+ if ( mnDrawMode & DrawModeFlags::NoBitmap )
{
return;
}
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 71172415fc49..c7b98962689b 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3517,7 +3517,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
}
// was dropdown arrow pressed
- if( (it->mnBits & ToolBoxItemBits::DROPDOWN) )
+ if( it->mnBits & ToolBoxItemBits::DROPDOWN )
{
if( ( (it->mnBits & ToolBoxItemBits::DROPDOWNONLY) == ToolBoxItemBits::DROPDOWNONLY)
|| it->GetDropDownRect( mbHorz && ( meTextPosition == ToolBoxTextPosition::Right ) ).IsInside( aMousePos ))
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index 10516bec1158..f88e9b6219a8 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -436,7 +436,7 @@ void X11SalFrame::Init( SalFrameStyleFlags nSalFrameStyle, SalX11Screen nXScreen
}
Attributes.override_redirect = True;
}
- else if( (nSalFrameStyle & SalFrameStyleFlags::SYSTEMCHILD ) )
+ else if( nSalFrameStyle & SalFrameStyleFlags::SYSTEMCHILD )
{
SAL_WARN_IF( !mpParent, "vcl", "SalFrameStyleFlags::SYSTEMCHILD window without parent" );
if( mpParent )
@@ -618,7 +618,7 @@ void X11SalFrame::Init( SalFrameStyleFlags nSalFrameStyle, SalX11Screen nXScreen
X11SalFrame* pFrame = this;
while( pFrame->mpParent )
pFrame = pFrame->mpParent;
- if( (pFrame->nStyle_ & SalFrameStyleFlags::PLUG ) )
+ if( pFrame->nStyle_ & SalFrameStyleFlags::PLUG )
{
// if the top level window is a plugin window,
// then we should place us in the same window group as
@@ -703,7 +703,7 @@ void X11SalFrame::Init( SalFrameStyleFlags nSalFrameStyle, SalX11Screen nXScreen
a[n++] = pDisplay_->getWMAdaptor()->getAtom( WMAdaptor::NET_WM_PING );
#endif
- if( (nSalFrameStyle & SalFrameStyleFlags::OWNERDRAWDECORATION) )
+ if( nSalFrameStyle & SalFrameStyleFlags::OWNERDRAWDECORATION )
a[n++] = pDisplay_->getWMAdaptor()->getAtom( WMAdaptor::WM_TAKE_FOCUS );
XSetWMProtocols( GetXDisplay(), GetShellWindow(), a, n );
@@ -1919,7 +1919,7 @@ void X11SalFrame::SetSize( const Size &rSize )
XResizeWindow( GetXDisplay(), IsSysChildWindow() ? GetWindow() : GetShellWindow(), rSize.Width(), rSize.Height() );
if( GetWindow() != GetShellWindow() )
{
- if( (nStyle_ & SalFrameStyleFlags::PLUG ) )
+ if( nStyle_ & SalFrameStyleFlags::PLUG )
XMoveResizeWindow( GetXDisplay(), GetWindow(), 0, 0, rSize.Width(), rSize.Height() );
else
XResizeWindow( GetXDisplay(), GetWindow(), rSize.Width(), rSize.Height() );
@@ -2017,7 +2017,7 @@ void X11SalFrame::SetPosSize( const tools::Rectangle &rPosSize )
XMoveResizeWindow( GetXDisplay(), IsSysChildWindow() ? GetWindow() : GetShellWindow(), values.x, values.y, values.width, values.height );
if( GetShellWindow() != GetWindow() )
{
- if( (nStyle_ & SalFrameStyleFlags::PLUG ) )
+ if( nStyle_ & SalFrameStyleFlags::PLUG )
XMoveResizeWindow( GetXDisplay(), GetWindow(), 0, 0, values.width, values.height );
else
XMoveResizeWindow( GetXDisplay(), GetWindow(), values.x, values.y, values.width, values.height );
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index 4d039a0d0759..c0bbf1303b1a 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -1201,17 +1201,17 @@ void GtkSalFrame::Init( SalFrame* pParent, SalFrameStyleFlags nStyle )
GdkWindowTypeHint eType = GDK_WINDOW_TYPE_HINT_NORMAL;
if( (nStyle & SalFrameStyleFlags::DIALOG) && m_pParent != nullptr )
eType = GDK_WINDOW_TYPE_HINT_DIALOG;
- if( (nStyle & SalFrameStyleFlags::INTRO) )
+ if( nStyle & SalFrameStyleFlags::INTRO )
{
gtk_window_set_role( GTK_WINDOW(m_pWindow), "splashscreen" );
eType = GDK_WINDOW_TYPE_HINT_SPLASHSCREEN;
}
- else if( (nStyle & SalFrameStyleFlags::TOOLWINDOW ) )
+ else if( nStyle & SalFrameStyleFlags::TOOLWINDOW )
{
eType = GDK_WINDOW_TYPE_HINT_UTILITY;
gtk_window_set_skip_taskbar_hint( GTK_WINDOW(m_pWindow), true );
}
- else if( (nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION) )
+ else if( nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION )
{
eType = GDK_WINDOW_TYPE_HINT_TOOLBAR;
lcl_set_accept_focus( GTK_WINDOW(m_pWindow), false, true );
@@ -1226,7 +1226,7 @@ void GtkSalFrame::Init( SalFrame* pParent, SalFrameStyleFlags nStyle )
gtk_window_set_type_hint( GTK_WINDOW(m_pWindow), eType );
gtk_window_set_gravity( GTK_WINDOW(m_pWindow), GDK_GRAVITY_STATIC );
}
- else if( (nStyle & SalFrameStyleFlags::FLOAT) )
+ else if( nStyle & SalFrameStyleFlags::FLOAT )
gtk_window_set_type_hint( GTK_WINDOW(m_pWindow), GDK_WINDOW_TYPE_HINT_POPUP_MENU );
if( eWinType == GTK_WINDOW_TOPLEVEL )
diff --git a/vcl/unx/gtk/salnativewidgets-gtk.cxx b/vcl/unx/gtk/salnativewidgets-gtk.cxx
index 71cdf74f0ca5..313af6cc0518 100644
--- a/vcl/unx/gtk/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/salnativewidgets-gtk.cxx
@@ -1645,7 +1645,7 @@ bool GtkSalGraphics::NWPaintGTKButtonReal(
if ( GTK_IS_BUTTON(button) )
{
- if ( (nState & ControlState::DEFAULT) )
+ if ( nState & ControlState::DEFAULT )
gtk_paint_box( button->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_IN,
&clipRect, button, "buttondefault", x, y, w, h );
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 19b6e815ff26..725c64594d92 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -1221,17 +1221,17 @@ void GtkSalFrame::Init( SalFrame* pParent, SalFrameStyleFlags nStyle )
GdkWindowTypeHint eType = GDK_WINDOW_TYPE_HINT_NORMAL;
if( (nStyle & SalFrameStyleFlags::DIALOG) && m_pParent != nullptr )
eType = GDK_WINDOW_TYPE_HINT_DIALOG;
- if( (nStyle & SalFrameStyleFlags::INTRO) )
+ if( nStyle & SalFrameStyleFlags::INTRO )
{
gtk_window_set_role( GTK_WINDOW(m_pWindow), "splashscreen" );
eType = GDK_WINDOW_TYPE_HINT_SPLASHSCREEN;
}
- else if( (nStyle & SalFrameStyleFlags::TOOLWINDOW ) )
+ else if( nStyle & SalFrameStyleFlags::TOOLWINDOW )
{
eType = GDK_WINDOW_TYPE_HINT_DIALOG;
gtk_window_set_skip_taskbar_hint( GTK_WINDOW(m_pWindow), true );
}
- else if( (nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION) )
+ else if( nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION )
{
eType = GDK_WINDOW_TYPE_HINT_TOOLBAR;
gtk_window_set_focus_on_map(GTK_WINDOW(m_pWindow), false);
@@ -1241,7 +1241,7 @@ void GtkSalFrame::Init( SalFrame* pParent, SalFrameStyleFlags nStyle )
gtk_window_set_gravity( GTK_WINDOW(m_pWindow), GDK_GRAVITY_STATIC );
gtk_window_set_resizable( GTK_WINDOW(m_pWindow), bool(nStyle & SalFrameStyleFlags::SIZEABLE) );
}
- else if( (nStyle & SalFrameStyleFlags::FLOAT) )
+ else if( nStyle & SalFrameStyleFlags::FLOAT )
gtk_window_set_type_hint( GTK_WINDOW(m_pWindow), GDK_WINDOW_TYPE_HINT_POPUP_MENU );
InitCommon();
diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index f58240ea3aec..a4ad88117f57 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -513,17 +513,17 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
if( value.getType() == ControlType::SpinButtons )
{
const SpinbuttonValue* pSpinVal = static_cast<const SpinbuttonValue *>(&value);
- if( (pSpinVal->mnUpperState & ControlState::PRESSED) )
+ if( pSpinVal->mnUpperState & ControlState::PRESSED )
option.activeSubControls |= QStyle::SC_SpinBoxUp;
- if( (pSpinVal->mnLowerState & ControlState::PRESSED) )
+ if( pSpinVal->mnLowerState & ControlState::PRESSED )
option.activeSubControls |= QStyle::SC_SpinBoxDown;
- if( (pSpinVal->mnUpperState & ControlState::ENABLED) )
+ if( pSpinVal->mnUpperState & ControlState::ENABLED )
option.stepEnabled |= QAbstractSpinBox::StepUpEnabled;
- if( (pSpinVal->mnLowerState & ControlState::ENABLED) )
+ if( pSpinVal->mnLowerState & ControlState::ENABLED )
option.stepEnabled |= QAbstractSpinBox::StepDownEnabled;
- if( (pSpinVal->mnUpperState & ControlState::ROLLOVER) )
+ if( pSpinVal->mnUpperState & ControlState::ROLLOVER )
option.state = QStyle::State_MouseOver;
- if( (pSpinVal->mnLowerState & ControlState::ROLLOVER) )
+ if( pSpinVal->mnLowerState & ControlState::ROLLOVER )
option.state = QStyle::State_MouseOver;
}