[Libreoffice-commits] core.git: basegfx/source compilerplugins/clang cppcanvas/source cui/source dbaccess/source i18npool/source reportdesign/source sc/source sd/source sot/source svtools/source svx/source sw/source toolkit/source vcl/source vcl/unx

Stephan Bergmann sbergman at redhat.com
Thu Nov 23 09:01:11 UTC 2017


 basegfx/source/polygon/b2dpolygontools.cxx                        |    2 
 compilerplugins/clang/test/unnecessaryparen.cxx                   |   12 +++++
 compilerplugins/clang/unnecessaryparen.cxx                        |   19 ++++++-
 cppcanvas/source/mtfrenderer/implrenderer.cxx                     |   20 ++++----
 cui/source/tabpages/swpossizetabpage.cxx                          |    2 
 dbaccess/source/ui/dlg/advancedsettings.cxx                       |    2 
 dbaccess/source/ui/querydesign/JoinTableView.cxx                  |    2 
 i18npool/source/characterclassification/cclass_unicode_parser.cxx |    2 
 reportdesign/source/filter/xml/xmlfilter.cxx                      |    2 
 reportdesign/source/ui/dlg/Formula.cxx                            |    2 
 sc/source/core/data/column.cxx                                    |    2 
 sd/source/ui/tools/PreviewRenderer.cxx                            |    2 
 sot/source/sdstor/ucbstorage.cxx                                  |    4 -
 svtools/source/contnr/iconviewimpl.cxx                            |    2 
 svtools/source/contnr/treelistbox.cxx                             |    4 -
 svx/source/dialog/srchdlg.cxx                                     |   24 +++++-----
 sw/source/core/doc/DocumentContentOperationsManager.cxx           |    2 
 sw/source/core/layout/paintfrm.cxx                                |    2 
 sw/source/filter/html/htmlflywriter.cxx                           |    4 -
 sw/source/filter/xml/xmlexpit.cxx                                 |    2 
 sw/source/uibase/docvw/edtwin.cxx                                 |    2 
 toolkit/source/awt/vclxwindows.cxx                                |    2 
 vcl/source/control/imp_listbox.cxx                                |    8 +--
 vcl/source/gdi/pdfwriter_impl.cxx                                 |   16 +++---
 vcl/source/gdi/salgdilayout.cxx                                   |   12 ++---
 vcl/source/outdev/bitmap.cxx                                      |    2 
 vcl/source/window/toolbox.cxx                                     |    2 
 vcl/unx/generic/window/salframe.cxx                               |   10 ++--
 vcl/unx/gtk/gtksalframe.cxx                                       |    8 +--
 vcl/unx/gtk/salnativewidgets-gtk.cxx                              |    2 
 vcl/unx/gtk3/gtk3gtkframe.cxx                                     |    8 +--
 vcl/unx/kde4/KDESalGraphics.cxx                                   |   12 ++---
 32 files changed, 111 insertions(+), 86 deletions(-)

New commits:
commit b26012ef159bd420ac3bb9275607d3a1622422f7
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Nov 23 08:13:06 2017 +0100

    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 at redhat.com>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx
index 45fc27f5575f..489b77af92aa 100644
--- a/basegfx/source/polygon/b2dpolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolygontools.cxx
@@ -946,7 +946,7 @@ namespace basegfx
 
             if(!bFinished && (aCutFlags & CutFlagValue::LINE))
             {
-                if((aCutFlags & CutFlagValue::START1))
+                if(aCutFlags & CutFlagValue::START1)
                 {
                     // start1 on line 2 ?
                     if(isPointOnEdge(rEdge1Start, rEdge2Start, rEdge2Delta, &fCut2))
diff --git a/compilerplugins/clang/test/unnecessaryparen.cxx b/compilerplugins/clang/test/unnecessaryparen.cxx
index 968522d63a73..4e85fe97076f 100644
--- a/compilerplugins/clang/test/unnecessaryparen.cxx
+++ b/compilerplugins/clang/test/unnecessaryparen.cxx
@@ -14,6 +14,8 @@ bool foo(int);
 
 enum class EFoo { Bar };
 
+struct S { operator bool(); };
+
 int main()
 {
     int x = 1;
@@ -49,6 +51,16 @@ int main()
     std::string v3;
     v3 = (std::string("xx") + "xx"); // expected-error {{parentheses immediately inside assignment [loplugin:unnecessaryparen]}}
     (void)v3;
+
+    S s1;
+    if ((s1)) { // expected-error {{parentheses immediately inside if statement [loplugin:unnecessaryparen]}}
+        // expected-error at -1 {{unnecessary parentheses around identifier [loplugin:unnecessaryparen]}}
+        return 0;
+    }
+    S s2;
+    if ((s2 = s1)) {
+        return 0;
+    }
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/compilerplugins/clang/unnecessaryparen.cxx b/compilerplugins/clang/unnecessaryparen.cxx
index fdc83410cb0e..a7d3d26e6591 100644
--- a/compilerplugins/clang/unnecessaryparen.cxx
+++ b/compilerplugins/clang/unnecessaryparen.cxx
@@ -23,8 +23,8 @@ look for unnecessary parentheses
 
 namespace {
 
-// Like clang::Stmt::IgnoreImplicit (lib/AST/Stmt.cpp), but also ignoring
-// CXXConstructExpr:
+// Like clang::Stmt::IgnoreImplicit (lib/AST/Stmt.cpp), but also ignoring CXXConstructExpr and
+// looking through implicit UserDefinedConversion's member function call:
 Expr const * ignoreAllImplicit(Expr const * expr) {
     if (auto const e = dyn_cast<ExprWithCleanups>(expr)) {
         expr = e->getSubExpr();
@@ -40,7 +40,15 @@ Expr const * ignoreAllImplicit(Expr const * expr) {
     if (auto const e = dyn_cast<CXXBindTemporaryExpr>(expr)) {
         expr = e->getSubExpr();
     }
-    return expr->IgnoreImpCasts();
+    while (auto const e = dyn_cast<ImplicitCastExpr>(expr)) {
+        expr = e->getSubExpr();
+        if (e->getCastKind() == CK_UserDefinedConversion) {
+            auto const ce = cast<CXXMemberCallExpr>(expr);
+            assert(ce->getNumArgs() == 0);
+            expr = ce->getImplicitObjectArgument();
+        }
+    }
+    return expr;
 }
 
 class UnnecessaryParen:
@@ -239,6 +247,11 @@ void UnnecessaryParen::VisitSomeStmt(const Stmt * stmt, const Expr* cond, String
         auto binaryOp = dyn_cast<BinaryOperator>(parenExpr->getSubExpr());
         if (binaryOp && binaryOp->getOpcode() == BO_Assign)
             return;
+        if (auto const opCall = dyn_cast<CXXOperatorCallExpr>(parenExpr->getSubExpr())) {
+            if (opCall->getOperator() == OO_Equal) {
+                return;
+            }
+        }
         report(
             DiagnosticsEngine::Warning, "parentheses immediately inside %0 statement",
             parenExpr->getLocStart())
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 6804b121fd7f..b71b34ddd8b8 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -286,19 +286,19 @@ namespace cppcanvas
 
                 const OutDevState& rNewState( getState() );
 
-                if( (aCalculatedNewState.pushFlags & PushFlags::LINECOLOR) )
+                if( aCalculatedNewState.pushFlags & PushFlags::LINECOLOR )
                 {
                     aCalculatedNewState.lineColor      = rNewState.lineColor;
                     aCalculatedNewState.isLineColorSet = rNewState.isLineColorSet;
                 }
 
-                if( (aCalculatedNewState.pushFlags & PushFlags::FILLCOLOR) )
+                if( aCalculatedNewState.pushFlags & PushFlags::FILLCOLOR )
                 {
                     aCalculatedNewState.fillColor      = rNewState.fillColor;
                     aCalculatedNewState.isFillColorSet = rNewState.isFillColorSet;
                 }
 
-                if( (aCalculatedNewState.pushFlags & PushFlags::FONT) )
+                if( aCalculatedNewState.pushFlags & PushFlags::FONT )
                 {
                     aCalculatedNewState.xFont                   = rNewState.xFont;
                     aCalculatedNewState.fontRotation            = rNewState.fontRotation;
@@ -312,17 +312,17 @@ namespace cppcanvas
                     aCalculatedNewState.isTextOutlineModeSet    = rNewState.isTextOutlineModeSet;
                 }
 
-                if( (aCalculatedNewState.pushFlags & PushFlags::TEXTCOLOR) )
+                if( aCalculatedNewState.pushFlags & PushFlags::TEXTCOLOR )
                 {
                     aCalculatedNewState.textColor = rNewState.textColor;
                 }
 
-                if( (aCalculatedNewState.pushFlags & PushFlags::MAPMODE) )
+                if( aCalculatedNewState.pushFlags & PushFlags::MAPMODE )
                 {
                     aCalculatedNewState.mapModeTransform = rNewState.mapModeTransform;
                 }
 
-                if( (aCalculatedNewState.pushFlags & PushFlags::CLIPREGION) )
+                if( aCalculatedNewState.pushFlags & PushFlags::CLIPREGION )
                 {
                     aCalculatedNewState.clip        = rNewState.clip;
                     aCalculatedNewState.clipRect    = rNewState.clipRect;
@@ -334,13 +334,13 @@ namespace cppcanvas
                 // {
                 // }
 
-                if( (aCalculatedNewState.pushFlags & PushFlags::TEXTFILLCOLOR) )
+                if( aCalculatedNewState.pushFlags & PushFlags::TEXTFILLCOLOR )
                 {
                     aCalculatedNewState.textFillColor      = rNewState.textFillColor;
                     aCalculatedNewState.isTextFillColorSet = rNewState.isTextFillColorSet;
                 }
 
-                if( (aCalculatedNewState.pushFlags & PushFlags::TEXTALIGN) )
+                if( aCalculatedNewState.pushFlags & PushFlags::TEXTALIGN )
                 {
                     aCalculatedNewState.textReferencePoint = rNewState.textReferencePoint;
                 }
@@ -350,13 +350,13 @@ namespace cppcanvas
                 // {
                 // }
 
-                if( (aCalculatedNewState.pushFlags & PushFlags::TEXTLINECOLOR) )
+                if( aCalculatedNewState.pushFlags & PushFlags::TEXTLINECOLOR )
                 {
                     aCalculatedNewState.textLineColor      = rNewState.textLineColor;
                     aCalculatedNewState.isTextLineColorSet = rNewState.isTextLineColorSet;
                 }
 
-                if( (aCalculatedNewState.pushFlags & PushFlags::TEXTLAYOUTMODE) )
+                if( aCalculatedNewState.pushFlags & PushFlags::TEXTLAYOUTMODE )
                 {
                     aCalculatedNewState.textAlignment = rNewState.textAlignment;
                     aCalculatedNewState.textDirection = rNewState.textDirection;
diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx
index c220ca3d41cc..93eca0ac14f7 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -1093,7 +1093,7 @@ DeactivateRC SvxSwPosSizeTabPage::DeactivatePage( SfxItemSet* _pSet )
 
 void SvxSwPosSizeTabPage::EnableAnchorTypes(SvxAnchorIds nAnchorEnable)
 {
-    if((nAnchorEnable & SvxAnchorIds::Fly))
+    if(nAnchorEnable & SvxAnchorIds::Fly)
         m_pToFrameRB->Show();
     if(!(nAnchorEnable & SvxAnchorIds::Page))
         m_pToPageRB->Enable(false);
diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx
index 2ab712601efd..1f1501dd0c16 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.cxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.cxx
@@ -219,7 +219,7 @@ namespace dbaui
                 ++setting
              )
         {
-            if ( (*setting->ppControl) )
+            if ( *setting->ppControl )
             {
                 _rControlList.push_back( new OSaveValueWrapper< CheckBox >( *setting->ppControl ) );
             }
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index d59f85e15d89..5fc7ee8cf995 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -834,7 +834,7 @@ void OJoinTableView::MouseButtonUp( const MouseEvent& rEvt )
         {
             if( (*aIter)->CheckHit(rEvt.GetPosPixel()) )
             {
-                SelectConn((*aIter));
+                SelectConn(*aIter);
 
                 // Double-click
                 if( rEvt.GetClicks() == 2 )
diff --git a/i18npool/source/characterclassification/cclass_unicode_parser.cxx b/i18npool/source/characterclassification/cclass_unicode_parser.cxx
index 1979135b8eca..7c6aa2eb3819 100644
--- a/i18npool/source/characterclassification/cclass_unicode_parser.cxx
+++ b/i18npool/source/characterclassification/cclass_unicode_parser.cxx
@@ -934,7 +934,7 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32
             break;
             case ssGetBool :
             {
-                if ( (nMask & ParserFlags::BOOL) )
+                if ( nMask & ParserFlags::BOOL )
                     eState = ssStop;    // maximum 2: <, >, <>, <=, >=
                 else
                     eState = ssStopBack;
diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx
index f5aa9948ccba..cb16957ea836 100644
--- a/reportdesign/source/filter/xml/xmlfilter.cxx
+++ b/reportdesign/source/filter/xml/xmlfilter.cxx
@@ -978,7 +978,7 @@ SvXMLImportContext* ORptFilter::CreateMetaContext(const OUString& rLocalName)
 {
     SvXMLImportContext* pContext = nullptr;
 
-    if ( (getImportFlags() & SvXMLImportFlags::META) )
+    if ( getImportFlags() & SvXMLImportFlags::META )
     {
         uno::Reference<document::XDocumentPropertiesSupplier> xDPS(GetModel(), uno::UNO_QUERY_THROW);
         pContext = new SvXMLMetaDocumentContext(*this,XML_NAMESPACE_OFFICE, rLocalName,xDPS->getDocumentProperties());
diff --git a/reportdesign/source/ui/dlg/Formula.cxx b/reportdesign/source/ui/dlg/Formula.cxx
index bc7f0a465182..4ac618c5a756 100644
--- a/reportdesign/source/ui/dlg/Formula.cxx
+++ b/reportdesign/source/ui/dlg/Formula.cxx
@@ -96,7 +96,7 @@ void FormulaDialog::dispose()
     if ( m_pAddField )
     {
         SvtViewOptions aDlgOpt( EViewType::Window, HID_RPT_FIELD_SEL_WIN );
-        aDlgOpt.SetWindowState(OStringToOUString(m_pAddField->GetWindowState((WindowStateMask::X | WindowStateMask::Y | WindowStateMask::State | WindowStateMask::Minimized)), RTL_TEXTENCODING_ASCII_US));
+        aDlgOpt.SetWindowState(OStringToOUString(m_pAddField->GetWindowState(WindowStateMask::X | WindowStateMask::Y | WindowStateMask::State | WindowStateMask::Minimized), RTL_TEXTENCODING_ASCII_US));
     }
 
     StoreFormEditData( m_pFormulaData );
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 5d021d41aec4..505bbf4230d5 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -255,7 +255,7 @@ bool ScColumn::HasSelectionMatrixFragment(const ScMarkData& rMark) const
                 else if (nEdges & MatrixEdge::Inside)
                     bFound = true;  // inside, all selected?
 
-                if ((((nEdges & MatrixEdge::Left) | MatrixEdge::Right) ^ ((nEdges & MatrixEdge::Right) | MatrixEdge::Left)))
+                if (((nEdges & MatrixEdge::Left) | MatrixEdge::Right) ^ ((nEdges & MatrixEdge::Right) | MatrixEdge::Left))
                     // either left or right, but not both.
                     bFound = true;  // only left/right edge, all selected?
 
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx
index b6eae5e10b63..da9dab6e2077 100644
--- a/sd/source/ui/tools/PreviewRenderer.cxx
+++ b/sd/source/ui/tools/PreviewRenderer.cxx
@@ -284,7 +284,7 @@ void PreviewRenderer::PaintPage (
     {
         pOutliner = &mpDocShellOfView->GetDoc()->GetDrawOutliner();
         nSavedControlWord = pOutliner->GetControlWord();
-        pOutliner->SetControlWord((nSavedControlWord & ~EEControlBits::ONLINESPELLING));
+        pOutliner->SetControlWord(nSavedControlWord & ~EEControlBits::ONLINESPELLING);
     }
 
     // Use a special redirector to prevent PresObj shapes from being painted.
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index 1f76f3f2d16f..6ec64d83ba83 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -2564,7 +2564,7 @@ BaseStorageStream* UCBStorage::OpenStream( const OUString& rEleName, StreamMode
     if ( !pElement )
     {
         // element does not exist, check if creation is allowed
-        if( ( nMode & StreamMode::NOCREATE ) )
+        if( nMode & StreamMode::NOCREATE )
         {
             SetError( ( nMode & StreamMode::WRITE ) ? SVSTREAM_CANNOT_MAKE : SVSTREAM_FILE_NOT_FOUND );
             OUString aName( pImp->m_aURL );
@@ -2659,7 +2659,7 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const OUString& rEleName, StreamMode
     if ( !pElement )
     {
         // element does not exist, check if creation is allowed
-        if( ( nMode & StreamMode::NOCREATE ) )
+        if( nMode & StreamMode::NOCREATE )
         {
             SetError( ( nMode & StreamMode::WRITE ) ? SVSTREAM_CANNOT_MAKE : SVSTREAM_FILE_NOT_FOUND );
             OUString aName( pImp->m_aURL );
diff --git a/svtools/source/contnr/iconviewimpl.cxx b/svtools/source/contnr/iconviewimpl.cxx
index 4f36e04ae4a6..87a8ceb09827 100644
--- a/svtools/source/contnr/iconviewimpl.cxx
+++ b/svtools/source/contnr/iconviewimpl.cxx
@@ -440,7 +440,7 @@ void IconViewImpl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan
 
 void IconViewImpl::InvalidateEntry( long nId ) const
 {
-    if( (nFlags & LBoxFlags::InPaint ))
+    if( nFlags & LBoxFlags::InPaint )
         return;
 
     tools::Rectangle aRect( GetVisibleArea() );
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index a3cbd9a8914a..daa06402ebdc 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -3358,7 +3358,7 @@ SvLBoxTab* SvTreeListBox::GetFirstTab( SvLBoxTabFlags nFlagMask, sal_uInt16& rPo
     for( sal_uInt16 nPos = 0; nPos < nTabCount; nPos++ )
     {
         SvLBoxTab* pTab = aTabs[ nPos ];
-        if( (pTab->nFlags & nFlagMask) )
+        if( pTab->nFlags & nFlagMask )
         {
             rPos = nPos;
             return pTab;
@@ -3375,7 +3375,7 @@ void SvTreeListBox::GetLastTab( SvLBoxTabFlags nFlagMask, sal_uInt16& rTabPos )
     {
         --nPos;
         SvLBoxTab* pTab = aTabs[ nPos ];
-        if( (pTab->nFlags & nFlagMask) )
+        if( pTab->nFlags & nFlagMask )
         {
             rTabPos = nPos;
             return;
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 4174c5705781..504c52f2de4e 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -1680,14 +1680,14 @@ void SvxSearchDialog::EnableControls_Impl( const SearchOptionFlags nFlags )
         bNoSearch = false;
 
 
-    if ( ( SearchOptionFlags::SEARCHALL & nOptions ) )
+    if ( SearchOptionFlags::SEARCHALL & nOptions )
     {
         m_pSearchAllBtn->Enable();
         bNoSearch = false;
     }
     else
         m_pSearchAllBtn->Disable();
-    if ( ( SearchOptionFlags::REPLACE & nOptions ) )
+    if ( SearchOptionFlags::REPLACE & nOptions )
     {
         m_pReplaceBtn->Enable();
         m_pReplaceFrame->get_label_widget()->Enable();
@@ -1702,7 +1702,7 @@ void SvxSearchDialog::EnableControls_Impl( const SearchOptionFlags nFlags )
         m_pReplaceLB->Disable();
         m_pReplaceTmplLB->Disable();
     }
-    if ( ( SearchOptionFlags::REPLACE_ALL & nOptions ) )
+    if ( SearchOptionFlags::REPLACE_ALL & nOptions )
     {
         m_pReplaceAllBtn->Enable();
         bNoSearch = false;
@@ -1716,11 +1716,11 @@ void SvxSearchDialog::EnableControls_Impl( const SearchOptionFlags nFlags )
     m_pSearchLB->Enable( !bNoSearch );
     m_pNotesBtn->Enable();
 
-    if ( ( SearchOptionFlags::WHOLE_WORDS & nOptions ) )
+    if ( SearchOptionFlags::WHOLE_WORDS & nOptions )
         m_pWordBtn->Enable();
     else
         m_pWordBtn->Disable();
-    if ( ( SearchOptionFlags::BACKWARDS & nOptions ) )
+    if ( SearchOptionFlags::BACKWARDS & nOptions )
     {
         m_pBackSearchBtn->Enable();
         m_pReplaceBackwardsCB->Enable();
@@ -1730,27 +1730,27 @@ void SvxSearchDialog::EnableControls_Impl( const SearchOptionFlags nFlags )
         m_pBackSearchBtn->Disable();
         m_pReplaceBackwardsCB->Disable();
     }
-    if ( ( SearchOptionFlags::REG_EXP & nOptions ) )
+    if ( SearchOptionFlags::REG_EXP & nOptions )
         m_pRegExpBtn->Enable();
     else
         m_pRegExpBtn->Disable();
-    if ( ( SearchOptionFlags::WILDCARD & nOptions ) )
+    if ( SearchOptionFlags::WILDCARD & nOptions )
         m_pWildcardBtn->Enable();
     else
         m_pWildcardBtn->Disable();
-    if ( ( SearchOptionFlags::EXACT & nOptions ) )
+    if ( SearchOptionFlags::EXACT & nOptions )
         m_pMatchCaseCB->Enable();
     else
         m_pMatchCaseCB->Disable();
-    if ( ( SearchOptionFlags::SELECTION & nOptions ) )
+    if ( SearchOptionFlags::SELECTION & nOptions )
         m_pSelectionBtn->Enable();
     else
         m_pSelectionBtn->Disable();
-    if ( ( SearchOptionFlags::FAMILIES & nOptions ) )
+    if ( SearchOptionFlags::FAMILIES & nOptions )
         m_pLayoutBtn->Enable();
     else
         m_pLayoutBtn->Disable();
-    if ( ( SearchOptionFlags::FORMAT & nOptions ) )
+    if ( SearchOptionFlags::FORMAT & nOptions )
     {
         m_pAttributeBtn->Enable();
         m_pFormatBtn->Enable();
@@ -1763,7 +1763,7 @@ void SvxSearchDialog::EnableControls_Impl( const SearchOptionFlags nFlags )
         m_pNoFormatBtn->Disable();
     }
 
-    if ( ( SearchOptionFlags::SIMILARITY & nOptions ) )
+    if ( SearchOptionFlags::SIMILARITY & nOptions )
     {
         m_pSimilarityBox->Enable();
         m_pSimilarityBtn->Enable();
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index a364e7ef5204..e0c763f0f37c 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -664,7 +664,7 @@ namespace
 
         // redline mode RedlineFlags::Ignore|RedlineFlags::On; save old mode
         RedlineFlags eOld = pDoc->getIDocumentRedlineAccess().GetRedlineFlags();
-        pDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( (( eOld & ~RedlineFlags::Ignore) | RedlineFlags::On ));
+        pDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( ( eOld & ~RedlineFlags::Ignore) | RedlineFlags::On );
 
         // iterate over relevant redlines and decide for each whether it should
         // be saved, or split + saved
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index b1f08ca7fd8e..51370b19b021 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -5236,7 +5236,7 @@ void SwFrame::PaintBorder( const SwRect& rRect, const SwPageFrame *pPage,
                          const SwBorderAttrs &rAttrs ) const
 {
     // There's nothing (Row,Body,Footnote,Root,Column,NoText) need to do here
-    if ((GetType() & (SwFrameType::NoTxt|SwFrameType::Row|SwFrameType::Body|SwFrameType::Ftn|SwFrameType::Column|SwFrameType::Root)))
+    if (GetType() & (SwFrameType::NoTxt|SwFrameType::Row|SwFrameType::Body|SwFrameType::Ftn|SwFrameType::Column|SwFrameType::Root))
         return;
 
     if (IsCellFrame() && !gProp.pSGlobalShell->GetViewOptions()->IsTable())
diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx
index 07adc94c39b6..6016c46374a5 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -647,7 +647,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat,
 
     // The spacing must be considered for the size, if the corresponding flag
     // is set.
-    if( (nFrameOpts & HtmlFrmOpts::MarginSize) )
+    if( nFrameOpts & HtmlFrmOpts::MarginSize )
     {
         aTwipSpc.Width() *= -2;
         aTwipSpc.Height() *= -2;
@@ -912,7 +912,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma
 
     // The spacing must be considered for the size, if the corresponding flag
     // is set.
-    if( (nFrameOptions & HtmlFrmOpts::MarginSize) )
+    if( nFrameOptions & HtmlFrmOpts::MarginSize )
     {
         aTwipSpc.Width() *= -2;
         aTwipSpc.Height() *= -2;
diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx
index a1149ca11a32..7d7830b09ccb 100644
--- a/sw/source/filter/xml/xmlexpit.cxx
+++ b/sw/source/filter/xml/xmlexpit.cxx
@@ -299,7 +299,7 @@ void SvXMLExportItemMapper::exportXML( SvXMLExport& rExport,
 
     if( rExport.GetAttrList().getLength() > 0 || !aIndexArray.empty() )
     {
-        if( (nFlags & SvXmlExportFlags::IGN_WS) )
+        if( nFlags & SvXmlExportFlags::IGN_WS )
         {
             rExport.IgnorableWhitespace();
         }
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 41625b23fbfc..f4c8de1812b6 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -2197,7 +2197,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
                         const SelectionType nSelectionType = rSh.GetSelectionType();
                         if(nSelectionType & SelectionType::Frame)
                             eKeyState = SwKeyState::GoIntoFly;
-                        else if((nSelectionType & SelectionType::DrawObject))
+                        else if(nSelectionType & SelectionType::DrawObject)
                         {
                             eKeyState = SwKeyState::GoIntoDrawing;
                             if (lcl_goIntoTextBox(*this, rSh))
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index 5bba90abea69..389421e36722 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -193,7 +193,7 @@ namespace toolkit
         Any aEffect;
 
         StyleSettings aStyleSettings = _pWindow->GetSettings().GetStyleSettings();
-        if ( (aStyleSettings.GetOptions() & StyleSettingsOptions::Mono) )
+        if ( aStyleSettings.GetOptions() & StyleSettingsOptions::Mono )
             aEffect <<= (sal_Int16)FLAT;
         else
             aEffect <<= (sal_Int16)LOOK3D;
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;
         }
 


More information about the Libreoffice-commits mailing list