summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-05 14:30:39 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-06 08:31:30 +0200
commita1ead1a0281a369087f1b2cce09431542c29bece (patch)
treedcc7dd8dc2fee88d4f125a7e1c8dd265b64030d5
parentee96ea7236958a89b60c87f688070412835ead3f (diff)
loplugin unnecessaryparan improvements
Change-Id: I73e945d6ec53537a0da45f6b6291018c7f251a7e Reviewed-on: https://gerrit.libreoffice.org/39587 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--compilerplugins/clang/unnecessaryparen.cxx11
-rw-r--r--editeng/source/items/svxfont.cxx2
-rw-r--r--filter/source/graphicfilter/itiff/ccidecom.cxx2
-rw-r--r--filter/source/msfilter/mstoolbar.cxx2
-rw-r--r--linguistic/source/dlistimp.cxx4
-rw-r--r--lotuswordpro/source/filter/xfilter/xffont.cxx6
-rw-r--r--oox/source/export/drawingml.cxx2
-rw-r--r--package/source/xstor/owriteablestream.cxx2
-rw-r--r--package/source/xstor/xfactory.cxx2
-rw-r--r--package/source/xstor/xstorage.cxx2
-rw-r--r--sal/rtl/ustring.cxx2
-rw-r--r--sc/source/core/data/table4.cxx4
-rw-r--r--sc/source/filter/lotus/tool.cxx2
-rw-r--r--sc/source/ui/view/dbfunc3.cxx6
-rw-r--r--sc/source/ui/view/formatsh.cxx10
-rw-r--r--sfx2/source/appl/lnkbase2.cxx2
-rw-r--r--svl/source/fsstor/fsstorage.cxx6
-rw-r--r--svtools/source/contnr/imivctl1.cxx2
-rw-r--r--svx/source/svdraw/svdoole2.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx2
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx4
-rw-r--r--ucb/source/ucp/file/bc.cxx2
-rw-r--r--vcl/source/control/button.cxx2
-rw-r--r--vcl/source/control/imp_listbox.cxx2
-rw-r--r--vcl/source/control/prgsbar.cxx2
-rw-r--r--vcl/source/control/tabctrl.cxx6
-rw-r--r--vcl/source/filter/sgvspln.cxx2
-rw-r--r--vcl/source/window/accessibility.cxx2
-rw-r--r--vcl/source/window/brdwin.cxx4
-rw-r--r--vcl/source/window/window.cxx6
-rw-r--r--vcl/unx/generic/app/saldisp.cxx6
-rw-r--r--vcl/unx/generic/window/salframe.cxx4
-rw-r--r--vcl/unx/gtk/gtksalframe.cxx14
-rw-r--r--vcl/unx/gtk3/gtk3gtkframe.cxx16
-rw-r--r--xmloff/source/style/csmaphdl.cxx2
-rw-r--r--xmlsecurity/source/xmlsec/xmlstreamio.cxx2
36 files changed, 78 insertions, 71 deletions
diff --git a/compilerplugins/clang/unnecessaryparen.cxx b/compilerplugins/clang/unnecessaryparen.cxx
index 7c64b7077bee..cf65ecbabacf 100644
--- a/compilerplugins/clang/unnecessaryparen.cxx
+++ b/compilerplugins/clang/unnecessaryparen.cxx
@@ -31,6 +31,13 @@ public:
virtual void run() override
{
+ StringRef fn( compiler.getSourceManager().getFileEntryForID(
+ compiler.getSourceManager().getMainFileID())->getName() );
+ // fixing this makes the source in the .y files look horrible
+ if (loplugin::hasPathnamePrefix(fn, WORKDIR "/YaccTarget/unoidl/source/sourceprovider-parser.cxx"))
+ return;
+ if (loplugin::hasPathnamePrefix(fn, WORKDIR "/YaccTarget/idlc/source/parser.cxx"))
+ return;
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
}
@@ -45,7 +52,7 @@ bool UnnecessaryParen::VisitParenExpr(const ParenExpr* parenExpr)
if (parenExpr->getLocStart().isMacroID())
return true;
- auto subParenExpr = dyn_cast<ParenExpr>(parenExpr->getSubExpr());
+ auto subParenExpr = dyn_cast<ParenExpr>(parenExpr->getSubExpr()->IgnoreImpCasts());
if (subParenExpr) {
if (subParenExpr->getLocStart().isMacroID())
return true;
@@ -62,7 +69,7 @@ bool UnnecessaryParen::VisitIfStmt(const IfStmt* ifStmt)
if (ignoreLocation(ifStmt))
return true;
- if (auto parenExpr = dyn_cast<ParenExpr>(ifStmt->getCond())) {
+ if (auto parenExpr = dyn_cast<ParenExpr>(ifStmt->getCond()->IgnoreImpCasts())) {
if (parenExpr->getLocStart().isMacroID())
return true;
// assignments need extra parentheses or they generate a compiler warning
diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx
index eede74c3d3bf..fb6384045a38 100644
--- a/editeng/source/items/svxfont.cxx
+++ b/editeng/source/items/svxfont.cxx
@@ -255,7 +255,7 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo) const
while( nPos < nTxtLen )
{
sal_uInt32 nCharacterType = aCharClass.getCharacterType( aCharString, 0 );
- if ( ( nCharacterType & css::i18n::KCharacterType::UPPER ) )
+ if ( nCharacterType & css::i18n::KCharacterType::UPPER )
break;
if ( aCharString == " " )
break;
diff --git a/filter/source/graphicfilter/itiff/ccidecom.cxx b/filter/source/graphicfilter/itiff/ccidecom.cxx
index c57813e98046..c567774b8dc7 100644
--- a/filter/source/graphicfilter/itiff/ccidecom.cxx
+++ b/filter/source/graphicfilter/itiff/ccidecom.cxx
@@ -835,7 +835,7 @@ sal_uInt8 CCIDecompressor::ReadBlackOrWhite()
nInputBitsBufSize=8;
}
nInputBitsBufSize--;
- if ( ((nInputBitsBuf>>nInputBitsBufSize)&0x0001) ) return 0xff;
+ if ( (nInputBitsBuf>>nInputBitsBufSize) & 0x0001 ) return 0xff;
else return 0x00;
}
diff --git a/filter/source/msfilter/mstoolbar.cxx b/filter/source/msfilter/mstoolbar.cxx
index e12a71ac7499..35bfecb37dae 100644
--- a/filter/source/msfilter/mstoolbar.cxx
+++ b/filter/source/msfilter/mstoolbar.cxx
@@ -469,7 +469,7 @@ TBCGeneralInfo::Print( FILE* fp )
void
TBCGeneralInfo::ImportToolBarControlData( CustomToolBarImportHelper& helper, std::vector< beans::PropertyValue >& sControlData )
{
- if ( ( bFlags & 0x5 ) )
+ if ( bFlags & 0x5 )
{
beans::PropertyValue aProp;
// probably access to the header would be a better test than seeing if there is an action, e.g.
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index 02bd690bd314..7c39c8316813 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -181,11 +181,11 @@ void SAL_CALL DicEvtListenerHelper::processDictionaryEvent(
| DictionaryListEventFlags::ACTIVATE_NEG_DIC :
DictionaryListEventFlags::DEACTIVATE_POS_DIC
| DictionaryListEventFlags::ACTIVATE_POS_DIC;
- if ((rDicEvent.nEvent & DictionaryEventFlags::ACTIVATE_DIC))
+ if (rDicEvent.nEvent & DictionaryEventFlags::ACTIVATE_DIC)
nCondensedEvt |= eDicType == DictionaryType_NEGATIVE ?
DictionaryListEventFlags::ACTIVATE_NEG_DIC :
DictionaryListEventFlags::ACTIVATE_POS_DIC;
- if ((rDicEvent.nEvent & DictionaryEventFlags::DEACTIVATE_DIC))
+ if (rDicEvent.nEvent & DictionaryEventFlags::DEACTIVATE_DIC)
nCondensedEvt |= eDicType == DictionaryType_NEGATIVE ?
DictionaryListEventFlags::DEACTIVATE_NEG_DIC :
DictionaryListEventFlags::DEACTIVATE_POS_DIC;
diff --git a/lotuswordpro/source/filter/xfilter/xffont.cxx b/lotuswordpro/source/filter/xfilter/xffont.cxx
index 6a6d0f16177c..799df220a350 100644
--- a/lotuswordpro/source/filter/xfilter/xffont.cxx
+++ b/lotuswordpro/source/filter/xfilter/xffont.cxx
@@ -309,7 +309,7 @@ void XFFont::ToXml(IXFStream *pStrm)
if( (m_nFlag & XFFONT_FLAG_UNDERLINE) && m_eUnderline )
{
pAttrList->AddAttribute("style:text-underline", GetUnderlineName(m_eUnderline) );
- if( (m_nFlag & XFFONT_FLAG_UNDERLINECOLOR) )
+ if( m_nFlag & XFFONT_FLAG_UNDERLINECOLOR )
{
pAttrList->AddAttribute( "style:text-underline-color", m_aUnderlineColor.ToString() );
}
@@ -392,12 +392,12 @@ void XFFont::ToXml(IXFStream *pStrm)
}
//Color:
- if( (m_nFlag & XFFONT_FLAG_COLOR) )
+ if( m_nFlag & XFFONT_FLAG_COLOR )
{
pAttrList->AddAttribute( "fo:color", m_aColor.ToString() );
}
- if( (m_nFlag & XFFONT_FLAG_BGCOLOR) )
+ if( m_nFlag & XFFONT_FLAG_BGCOLOR )
{
if (m_bTransparent)
pAttrList->AddAttribute( "style:text-background-color", "transparent");
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 6270b30b8b2d..e3615e6bb5de 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1656,7 +1656,7 @@ void DrawingML::WriteRun( const Reference< XTextRange >& rRun,
}
else
{
- if( ( bWriteField ) )
+ if( bWriteField )
{
OString sUUID(GetUUID());
mpFS->startElementNS( XML_a, XML_fld,
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index e072c0b58b8d..2cc0f85f96f8 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -483,7 +483,7 @@ void OWriteStream_Impl::DisposeWrappers()
for ( InputStreamsList_Impl::iterator pStreamIter = m_aInputStreamsList.begin();
pStreamIter != m_aInputStreamsList.end(); ++pStreamIter )
{
- if ( (*pStreamIter) )
+ if ( *pStreamIter )
{
(*pStreamIter)->InternalDispose();
(*pStreamIter) = nullptr;
diff --git a/package/source/xstor/xfactory.cxx b/package/source/xstor/xfactory.cxx
index 24dcc03e5cb3..2747a5c0a8ed 100644
--- a/package/source/xstor/xfactory.cxx
+++ b/package/source/xstor/xfactory.cxx
@@ -239,7 +239,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr
if ( xInputStream.is() )
{
// if xInputStream is set the storage should be open from it
- if ( ( nStorageMode & embed::ElementModes::WRITE ) )
+ if ( nStorageMode & embed::ElementModes::WRITE )
throw uno::Exception(); // TODO: access denied
uno::Reference< io::XSeekable > xSeekable( xInputStream, uno::UNO_QUERY );
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 89dae3f7bfdc..bb473a090cda 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -2408,7 +2408,7 @@ uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement(
// and since there is no AntiImpl nobody should be notified about it
pElement->m_xStorage->m_nStorageMode = nStorageMode | embed::ElementModes::READ;
- if ( ( nStorageMode & embed::ElementModes::TRUNCATE ) )
+ if ( nStorageMode & embed::ElementModes::TRUNCATE )
{
for ( SotElementList_Impl::iterator pElementIter = pElement->m_xStorage->m_aChildrenList.begin();
pElementIter != pElement->m_xStorage->m_aChildrenList.end(); )
diff --git a/sal/rtl/ustring.cxx b/sal/rtl/ustring.cxx
index ff466ff72724..80832e71e089 100644
--- a/sal/rtl/ustring.cxx
+++ b/sal/rtl/ustring.cxx
@@ -543,7 +543,7 @@ void SAL_CALL rtl_uString_newFromAscii( rtl_uString** ppThis,
*ppThis = rtl_uString_ImplAlloc( nLen );
OSL_ASSERT(*ppThis != nullptr);
- if ( (*ppThis) )
+ if ( *ppThis )
{
sal_Unicode* pBuffer = (*ppThis)->buffer;
do
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index bd9dd0385773..b181a1c25dcd 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -230,7 +230,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
rMinDigits = 0;
rListData = nullptr;
rCmd = FILL_SIMPLE;
- if ( (nScFillModeMouseModifier & KEY_MOD1) )
+ if ( nScFillModeMouseModifier & KEY_MOD1 )
return ; // Ctrl-key: Copy
SCCOL nAddX;
@@ -1339,7 +1339,7 @@ void ScTable::FillAutoSimple(
{
SCCOLROW nSource = nISrcStart;
double nDelta;
- if ( (nScFillModeMouseModifier & KEY_MOD1) )
+ if ( nScFillModeMouseModifier & KEY_MOD1 )
nDelta = 0.0;
else if ( bPositive )
nDelta = 1.0;
diff --git a/sc/source/filter/lotus/tool.cxx b/sc/source/filter/lotus/tool.cxx
index 8a758c75f1cf..91c321c11c82 100644
--- a/sc/source/filter/lotus/tool.cxx
+++ b/sc/source/filter/lotus/tool.cxx
@@ -142,7 +142,7 @@ double Snum32ToDouble( sal_uInt32 nValue )
fValue *= pow((double)10, temp);
}
- if ((nValue & 0x00000020))
+ if (nValue & 0x00000020)
fValue = -fValue;
return fValue;
}
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index e813f1cbebd9..52f7e68bd48e 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -1458,7 +1458,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString )
nErrorId = STR_INVALIDNAME;
}
}
- else if ((aPosData.Flags & MemberResultFlags::GRANDTOTAL))
+ else if (aPosData.Flags & MemberResultFlags::GRANDTOTAL)
{
aData.SetGrandTotalName(rString);
bChange = true;
@@ -1472,7 +1472,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString )
// data dimension
do
{
- if ((aPosData.Flags & MemberResultFlags::SUBTOTAL))
+ if (aPosData.Flags & MemberResultFlags::SUBTOTAL)
break;
ScDPSaveDimension* pDim = aData.GetDimensionByName(aPosData.MemberName);
@@ -1513,7 +1513,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString )
if (!pMem)
break;
- if ((aPosData.Flags & MemberResultFlags::SUBTOTAL))
+ if (aPosData.Flags & MemberResultFlags::SUBTOTAL)
{
// Change subtotal only when the table has one data dimension.
if (aData.GetDataDimensionCount() > 1)
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 6895e17c064b..8475c7c400e0 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1050,7 +1050,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
}
break;
case SID_NUMBER_SCIENTIFIC:
- if ((nType & css::util::NumberFormat::SCIENTIFIC))
+ if (nType & css::util::NumberFormat::SCIENTIFIC)
pTabViewShell->SetNumberFormat( css::util::NumberFormat::NUMBER );
else
pTabViewShell->SetNumberFormat( css::util::NumberFormat::SCIENTIFIC );
@@ -1059,7 +1059,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
rReq.Done();
break;
case SID_NUMBER_DATE:
- if ((nType & css::util::NumberFormat::DATE))
+ if (nType & css::util::NumberFormat::DATE)
pTabViewShell->SetNumberFormat( css::util::NumberFormat::NUMBER );
else
pTabViewShell->SetNumberFormat( css::util::NumberFormat::DATE );
@@ -1068,7 +1068,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
rReq.Done();
break;
case SID_NUMBER_TIME:
- if ((nType & css::util::NumberFormat::TIME))
+ if (nType & css::util::NumberFormat::TIME)
pTabViewShell->SetNumberFormat( css::util::NumberFormat::NUMBER );
else
pTabViewShell->SetNumberFormat( css::util::NumberFormat::TIME );
@@ -1109,7 +1109,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
}
else
{
- if ( ( nType & css::util::NumberFormat::CURRENCY ) )
+ if ( nType & css::util::NumberFormat::CURRENCY )
pTabViewShell->SetNumberFormat( css::util::NumberFormat::NUMBER );
else
pTabViewShell->SetNumberFormat( css::util::NumberFormat::CURRENCY );
@@ -1118,7 +1118,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
rReq.Done();
break;
case SID_NUMBER_PERCENT:
- if ((nType & css::util::NumberFormat::PERCENT))
+ if (nType & css::util::NumberFormat::PERCENT)
pTabViewShell->SetNumberFormat( css::util::NumberFormat::NUMBER );
else
pTabViewShell->SetNumberFormat( css::util::NumberFormat::PERCENT );
diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx
index c4bd1ac7382c..7f9139cfe769 100644
--- a/sfx2/source/appl/lnkbase2.cxx
+++ b/sfx2/source/appl/lnkbase2.cxx
@@ -387,7 +387,7 @@ void SvBaseLink::GetRealObject_( bool bConnect)
xObj = sfx2::LinkManager::CreateObj( this );
}
}
- else if( (OBJECT_CLIENT_SO & nObjType) )
+ else if( OBJECT_CLIENT_SO & nObjType )
xObj = sfx2::LinkManager::CreateObj( this );
if( bConnect && ( !xObj.is() || !xObj->Connect( this ) ) )
diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx
index 01df7112802a..705405fe8c25 100644
--- a/svl/source/fsstor/fsstorage.cxx
+++ b/svl/source/fsstor/fsstorage.cxx
@@ -393,7 +393,7 @@ uno::Reference< io::XStream > SAL_CALL FSStorage::openStreamElement(
if ( !xResult.is() )
throw io::IOException();
- if ( ( nOpenMode & embed::ElementModes::TRUNCATE ) )
+ if ( nOpenMode & embed::ElementModes::TRUNCATE )
{
uno::Reference< io::XTruncate > xTrunc( xResult->getOutputStream(), uno::UNO_QUERY_THROW );
xTrunc->truncate();
@@ -495,7 +495,7 @@ uno::Reference< embed::XStorage > SAL_CALL FSStorage::openStorageElement(
MakeFolderNoUI( aFolderURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); // TODO: not atomic :(
}
}
- else if ( ( nStorageMode & embed::ElementModes::TRUNCATE ) )
+ else if ( nStorageMode & embed::ElementModes::TRUNCATE )
throw io::IOException(); // TODO: access denied
if ( !bFolderExists )
@@ -1235,7 +1235,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL FSStorage::openStreamEl
if ( !xResult.is() )
throw io::IOException();
- if ( ( nOpenMode & embed::ElementModes::TRUNCATE ) )
+ if ( nOpenMode & embed::ElementModes::TRUNCATE )
{
uno::Reference< io::XTruncate > xTrunc( xResult->getOutputStream(), uno::UNO_QUERY_THROW );
xTrunc->truncate();
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index 133e378502a8..0eaecb450291 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -239,7 +239,7 @@ void SvxIconChoiceCtrl_Impl::SetStyle( WinBits nWinStyle )
eSelectionMode = SelectionMode::NONE;
if( !(nWinStyle & (WB_ALIGN_TOP | WB_ALIGN_LEFT)))
nWinBits |= WB_ALIGN_LEFT;
- if( (nWinStyle & WB_DETAILS))
+ if( nWinStyle & WB_DETAILS )
{
if (!m_pColumns)
SetColumn( 0, SvxIconChoiceCtrlColumnInfo() );
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 00f89070dd9c..f74de525e3b4 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -1343,7 +1343,7 @@ void SdrOle2Obj::SetObjRef( const css::uno::Reference < css::embed::XEmbeddedObj
{
mpImpl->mxGraphic.reset();
- if ( (mpImpl->mxObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
+ if ( mpImpl->mxObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::EMBED_NEVERRESIZE )
SetResizeProtect(true);
// For math objects, set closed state to transparent
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 53c0550386d6..95ce60bf6f69 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -999,7 +999,7 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes)
else
return aF.nLen;
case eF_ResT::TAGIGN:
- if( ( m_nFieldTagBad[nI] & nMask ) ) // Flag: Tag bad
+ if ( m_nFieldTagBad[nI] & nMask ) // Flag: Tag bad
return Read_F_Tag( &aF ); // Tag it
return aF.nLen; // or ignore
case eF_ResT::READ_FSPA:
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 0b6ee64aa11d..deccc10960ee 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -1821,8 +1821,8 @@ bool VCLXToolkit::callKeyHandlers(::VclSimpleEvent const * pEvent,
i, css::uno::UNO_QUERY);
try
{
- if ((bPressed ? xHandler->keyPressed(aAwtEvent)
- : xHandler->keyReleased(aAwtEvent)))
+ if (bPressed ? xHandler->keyPressed(aAwtEvent)
+ : xHandler->keyReleased(aAwtEvent))
return true;
}
catch (const css::uno::RuntimeException & rEx)
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index 197402d160c5..557ddc5d4b60 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -915,7 +915,7 @@ BaseContent::open(
{
Reference< XDynamicResultSet > retValue( nullptr );
- if( ( m_nState & Deleted ) )
+ if( m_nState & Deleted )
{
m_pMyShell->installError( nMyCommandIdentifier,
TASKHANDLING_DELETED_STATE_IN_OPEN_COMMAND );
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index e9f048b19dd3..c8e62b9a2592 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -3176,7 +3176,7 @@ void CheckBox::ImplCheck()
meState = eNewState;
VclPtr<vcl::Window> xWindow = this;
- if( (GetStyle() & WB_EARLYTOGGLE) )
+ if( GetStyle() & WB_EARLYTOGGLE )
Toggle();
Invalidate();
Update();
diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx
index 56593d372e7c..649a593abae9 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -732,7 +732,7 @@ sal_Int32 ImplListBoxWindow::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEnt
ImplClearLayoutData();
sal_Int32 nNewPos = mpEntryList->InsertEntry( nPos, pNewEntry, mbSort );
- if( (GetStyle() & WB_WORDBREAK) )
+ if( GetStyle() & WB_WORDBREAK )
pNewEntry->mnFlags |= ListBoxEntryFlags::MultiLine;
ImplUpdateEntryMetrics( *pNewEntry );
diff --git a/vcl/source/control/prgsbar.cxx b/vcl/source/control/prgsbar.cxx
index 5a34d2fd1628..0f2a624ce9c1 100644
--- a/vcl/source/control/prgsbar.cxx
+++ b/vcl/source/control/prgsbar.cxx
@@ -77,7 +77,7 @@ void ProgressBar::ImplInitSettings( bool bFont,
if( !IsControlBackground() &&
IsNativeControlSupported( ControlType::Progress, ControlPart::Entire ) )
{
- if( (GetStyle() & WB_BORDER) )
+ if( GetStyle() & WB_BORDER )
SetBorderStyle( WindowBorderStyle::REMOVEBORDER );
EnableChildTransparentMode();
SetPaintTransparent( true );
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index e8b70ec389be..d35551011eaf 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -100,7 +100,7 @@ void TabControl::ImplInit( vcl::Window* pParent, WinBits nStyle )
ImplInitSettings( true );
- if( (nStyle & WB_DROPDOWN) )
+ if( nStyle & WB_DROPDOWN )
{
mpTabCtrlData->mpListBox = VclPtr<ListBox>::Create( this, WB_DROPDOWN );
mpTabCtrlData->mpListBox->SetPosSizePixel( Point( 0, 0 ), Size( 200, 20 ) );
@@ -628,7 +628,7 @@ void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId )
if ( pPage )
{
- if ( ( GetStyle() & WB_NOBORDER ) )
+ if ( GetStyle() & WB_NOBORDER )
{
tools::Rectangle aRectNoTab(Point(0, 0), GetSizePixel());
pPage->SetPosSizePixel( aRectNoTab.TopLeft(), aRectNoTab.GetSize() );
@@ -680,7 +680,7 @@ bool TabControl::ImplPosCurTabPage()
ImplTabItem* pItem = ImplGetItem( GetCurPageId() );
if ( pItem && pItem->mpTabPage )
{
- if ( ( GetStyle() & WB_NOBORDER ) )
+ if ( GetStyle() & WB_NOBORDER )
{
tools::Rectangle aRectNoTab(Point(0, 0), GetSizePixel());
pItem->mpTabPage->SetPosSizePixel( aRectNoTab.TopLeft(), aRectNoTab.GetSize() );
diff --git a/vcl/source/filter/sgvspln.cxx b/vcl/source/filter/sgvspln.cxx
index 021d70399c6e..f3dcc57aa352 100644
--- a/vcl/source/filter/sgvspln.cxx
+++ b/vcl/source/filter/sgvspln.cxx
@@ -400,7 +400,7 @@ sal_uInt16 NaturalSpline(sal_uInt16 n, const double* x, const double* y,
sal_uInt16 error;
if (n<2) return 1;
- if ( (MargCond & ~3) ) return 2;
+ if ( MargCond & ~3 ) return 2;
a.reset(new double[n+1]);
h.reset(new double[n+1]);
for (i=0;i<n;i++) {
diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx
index 2e7e315f9005..8829ab19c20a 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -162,7 +162,7 @@ bool Window::ImplIsAccessibleNativeFrame() const
{
if( mpWindowImpl->mbFrame )
// #101741 do not check for WB_CLOSEABLE because undecorated floaters (like menus!) are closeable
- if( (mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE)) )
+ if( mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE) )
return true;
else
return false;
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 4c22740b0b72..85f790b53523 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -1583,13 +1583,13 @@ void ImplBorderWindow::ImplInit( vcl::Window* pParent,
mbSmallOutBorder = false;
if ( nTypeStyle & BorderWindowStyle::Frame )
{
- if( (nStyle & WB_SYSTEMCHILDWINDOW) )
+ if( nStyle & WB_SYSTEMCHILDWINDOW )
{
mpWindowImpl->mbOverlapWin = true;
mpWindowImpl->mbFrame = true;
mbFrameBorder = false;
}
- else if( (nStyle & (WB_OWNERDRAWDECORATION | WB_POPUP)) )
+ else if( nStyle & (WB_OWNERDRAWDECORATION | WB_POPUP) )
{
mpWindowImpl->mbOverlapWin = true;
mpWindowImpl->mbFrame = true;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 5d30f4f54fda..8ce275cef20a 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -962,7 +962,7 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p
&& (nStyle & (WB_BORDER | WB_SYSTEMCHILDWINDOW) ) )
{
BorderWindowStyle nBorderTypeStyle = BorderWindowStyle::NONE;
- if( (nStyle & WB_SYSTEMCHILDWINDOW) )
+ if( nStyle & WB_SYSTEMCHILDWINDOW )
{
// handle WB_SYSTEMCHILDWINDOW
// these should be analogous to a top level frame; meaning they
@@ -1985,9 +1985,9 @@ void Window::SetExtendedStyle( WinBits nExtendedStyle )
if( pWindow->mpWindowImpl->mbFrame )
{
SalExtStyle nExt = 0;
- if( (nExtendedStyle & WB_EXT_DOCUMENT) )
+ if( nExtendedStyle & WB_EXT_DOCUMENT )
nExt |= SAL_FRAME_EXT_STYLE_DOCUMENT;
- if( (nExtendedStyle & WB_EXT_DOCMODIFIED) )
+ if( nExtendedStyle & WB_EXT_DOCMODIFIED )
nExt |= SAL_FRAME_EXT_STYLE_DOCMODIFIED;
pWindow->ImplGetFrame()->SetExtendedFrameStyle( nExt );
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index 9d64d665648a..facbcef4ea28 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -729,11 +729,11 @@ KeyIndicatorState SalDisplay::GetIndicatorState() const
KeyIndicatorState nState = KeyIndicatorState::NONE;
XkbGetIndicatorState(pDisp_, XkbUseCoreKbd, &_state);
- if ((_state & 0x00000001))
+ if (_state & 0x00000001)
nState |= KeyIndicatorState::CAPSLOCK;
- if ((_state & 0x00000002))
+ if (_state & 0x00000002)
nState |= KeyIndicatorState::NUMLOCK;
- if ((_state & 0x00000004))
+ if (_state & 0x00000004)
nState |= KeyIndicatorState::SCROLLLOCK;
return nState;
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index 180958e0321c..e269c763829a 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -626,7 +626,7 @@ void X11SalFrame::Init( SalFrameStyleFlags nSalFrameStyle, SalX11Screen nXScreen
pFrame->GetShellWindow() );
if( pWMHints )
{
- if( (pWMHints->flags & WindowGroupHint) )
+ if( pWMHints->flags & WindowGroupHint )
{
Hints.flags |= WindowGroupHint;
Hints.window_group = pWMHints->window_group;
@@ -2543,7 +2543,7 @@ static sal_uInt16 sal_GetCode( int state )
// Map Meta/Super modifier to MOD3 on all Unix systems
// except Mac OS X
- if( (state & Mod3Mask) )
+ if( state & Mod3Mask )
nCode |= KEY_MOD3;
return nCode;
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index c23157d76785..802d3c3d0267 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -97,11 +97,11 @@ static GDBusConnection* pSessionBus = nullptr;
static sal_uInt16 GetKeyModCode( guint state )
{
sal_uInt16 nCode = 0;
- if( (state & GDK_SHIFT_MASK) )
+ if( state & GDK_SHIFT_MASK )
nCode |= KEY_SHIFT;
- if( (state & GDK_CONTROL_MASK) )
+ if( state & GDK_CONTROL_MASK )
nCode |= KEY_MOD1;
- if( (state & GDK_MOD1_MASK) )
+ if( state & GDK_MOD1_MASK )
nCode |= KEY_MOD2;
// Map Meta/Super keys to MOD3 modifier on all Unix systems
@@ -114,11 +114,11 @@ static sal_uInt16 GetKeyModCode( guint state )
static sal_uInt16 GetMouseModCode( guint state )
{
sal_uInt16 nCode = GetKeyModCode( state );
- if( (state & GDK_BUTTON1_MASK) )
+ if( state & GDK_BUTTON1_MASK )
nCode |= MOUSE_LEFT;
- if( (state & GDK_BUTTON2_MASK) )
+ if( state & GDK_BUTTON2_MASK )
nCode |= MOUSE_MIDDLE;
- if( (state & GDK_BUTTON3_MASK) )
+ if( state & GDK_BUTTON3_MASK )
nCode |= MOUSE_RIGHT;
return nCode;
@@ -1852,7 +1852,7 @@ bool GtkSalFrame::GetWindowState( SalFrameState* pState )
pState->mnState = WindowStateState::Normal;
pState->mnMask = WindowStateMask::State;
// rollup ? gtk 2.2 does not seem to support the shaded state
- if( (m_nState & GDK_WINDOW_STATE_ICONIFIED) )
+ if( m_nState & GDK_WINDOW_STATE_ICONIFIED )
pState->mnState |= WindowStateState::Minimized;
if( m_nState & GDK_WINDOW_STATE_MAXIMIZED )
{
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index a5d05e40bc21..78fba5ec4d62 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -115,13 +115,13 @@ static GDBusConnection* pSessionBus = nullptr;
static sal_uInt16 GetKeyModCode( guint state )
{
sal_uInt16 nCode = 0;
- if( (state & GDK_SHIFT_MASK) )
+ if( state & GDK_SHIFT_MASK )
nCode |= KEY_SHIFT;
- if( (state & GDK_CONTROL_MASK) )
+ if( state & GDK_CONTROL_MASK )
nCode |= KEY_MOD1;
- if( (state & GDK_MOD1_MASK) )
+ if( state & GDK_MOD1_MASK )
nCode |= KEY_MOD2;
- if( (state & GDK_SUPER_MASK) )
+ if( state & GDK_SUPER_MASK )
nCode |= KEY_MOD3;
return nCode;
}
@@ -129,11 +129,11 @@ static sal_uInt16 GetKeyModCode( guint state )
static sal_uInt16 GetMouseModCode( guint state )
{
sal_uInt16 nCode = GetKeyModCode( state );
- if( (state & GDK_BUTTON1_MASK) )
+ if( state & GDK_BUTTON1_MASK )
nCode |= MOUSE_LEFT;
- if( (state & GDK_BUTTON2_MASK) )
+ if( state & GDK_BUTTON2_MASK )
nCode |= MOUSE_MIDDLE;
- if( (state & GDK_BUTTON3_MASK) )
+ if( state & GDK_BUTTON3_MASK )
nCode |= MOUSE_RIGHT;
return nCode;
@@ -1781,7 +1781,7 @@ bool GtkSalFrame::GetWindowState( SalFrameState* pState )
pState->mnState = WindowStateState::Normal;
pState->mnMask = WindowStateMask::State;
// rollup ? gtk 2.2 does not seem to support the shaded state
- if( (m_nState & GDK_WINDOW_STATE_ICONIFIED) )
+ if( m_nState & GDK_WINDOW_STATE_ICONIFIED )
pState->mnState |= WindowStateState::Minimized;
if( m_nState & GDK_WINDOW_STATE_MAXIMIZED )
{
diff --git a/xmloff/source/style/csmaphdl.cxx b/xmloff/source/style/csmaphdl.cxx
index c583802b4806..613cffdeac84 100644
--- a/xmloff/source/style/csmaphdl.cxx
+++ b/xmloff/source/style/csmaphdl.cxx
@@ -48,7 +48,7 @@ bool XMLCaseMapPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValu
sal_uInt16 nVal;
bool bRet = SvXMLUnitConverter::convertEnum(
nVal, rStrImpValue, pXML_Casemap_Enum );
- if( ( bRet ) )
+ if( bRet )
rValue <<= nVal;
return bRet;
diff --git a/xmlsecurity/source/xmlsec/xmlstreamio.cxx b/xmlsecurity/source/xmlsec/xmlstreamio.cxx
index 32d86269cd7e..52d66b1d0e4d 100644
--- a/xmlsecurity/source/xmlsec/xmlstreamio.cxx
+++ b/xmlsecurity/source/xmlsec/xmlstreamio.cxx
@@ -199,7 +199,7 @@ XSECXMLSEC_DLLPUBLIC int xmlRegisterStreamInputCallbacks(
XSECXMLSEC_DLLPUBLIC int xmlUnregisterStreamInputCallbacks()
{
- if( ( enableXmlStreamIO & XMLSTREAMIO_REGISTERED ) ) {
+ if( enableXmlStreamIO & XMLSTREAMIO_REGISTERED ) {
//Clear the uri-stream binding
m_xUriBinding.clear() ;