diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-17 17:21:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-18 08:49:37 +0200 |
commit | eea6d3951b66f85df60574e10f19a81bfd7529cc (patch) | |
tree | 0509297cd8fb5e59750f45099e04bbea7be968cc | |
parent | 0501869949b65b27303a41fd235a6ec32a4c90a7 (diff) |
loplugin:unnecessaryparen
look for statements like
return (function());
Change-Id: I906cf2183489f87225b99b987caca67e39b26cc3
Reviewed-on: https://gerrit.libreoffice.org/41260
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
36 files changed, 88 insertions, 56 deletions
diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx index 78f709850861..4ddb201ee72a 100644 --- a/avmedia/source/viewer/mediawindow_impl.cxx +++ b/avmedia/source/viewer/mediawindow_impl.cxx @@ -302,7 +302,7 @@ const OUString& MediaWindowImpl::getURL() const bool MediaWindowImpl::isValid() const { - return( mxPlayer.is() ); + return mxPlayer.is(); } Size MediaWindowImpl::getPreferredSize() const diff --git a/compilerplugins/clang/unnecessaryparen.cxx b/compilerplugins/clang/unnecessaryparen.cxx index 4abfd69e3b7c..1e01c41d5893 100644 --- a/compilerplugins/clang/unnecessaryparen.cxx +++ b/compilerplugins/clang/unnecessaryparen.cxx @@ -55,6 +55,7 @@ public: bool VisitDoStmt(const DoStmt *); bool VisitWhileStmt(const WhileStmt *); bool VisitSwitchStmt(const SwitchStmt *); + bool VisitReturnStmt(const ReturnStmt* ); bool VisitCallExpr(const CallExpr *); bool TraverseUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *); bool TraverseCaseStmt(CaseStmt *); @@ -162,6 +163,37 @@ bool UnnecessaryParen::VisitSwitchStmt(const SwitchStmt* switchStmt) return true; } +bool UnnecessaryParen::VisitReturnStmt(const ReturnStmt* returnStmt) +{ + if (ignoreLocation(returnStmt)) + return true; + if (returnStmt->getLocStart().isMacroID()) + return true; + + if (!returnStmt->getRetValue()) + return true; + auto parenExpr = dyn_cast<ParenExpr>(returnStmt->getRetValue()->IgnoreImpCasts()); + if (!parenExpr) + return true; + if (parenExpr->getLocStart().isMacroID()) + return true; + // assignments need extra parentheses or they generate a compiler warning + auto binaryOp = dyn_cast<BinaryOperator>(parenExpr->getSubExpr()); + if (binaryOp && binaryOp->getOpcode() == BO_Assign) + return true; + + // only non-operator-calls for now + auto subExpr = parenExpr->getSubExpr(); + if (isa<CallExpr>(subExpr) && !isa<CXXOperatorCallExpr>(subExpr)) + { + report( + DiagnosticsEngine::Warning, "parentheses immediately inside return statement", + parenExpr->getLocStart()) + << parenExpr->getSourceRange(); + } + return true; +} + void UnnecessaryParen::VisitSomeStmt(const Stmt *parent, const Expr* cond, StringRef stmtName) { if (ignoreLocation(parent)) diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 5618aef7e764..287867626123 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -3504,7 +3504,7 @@ OUString SvxIconReplacementDialog::ReplaceIconName( const OUString& rMessage ) sal_uInt16 SvxIconReplacementDialog::ShowDialog() { Execute(); - return ( GetCurButtonId() ); + return GetCurButtonId(); } /******************************************************************************* * diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx index 5ee18ede6045..104eadf95bf7 100644 --- a/cui/source/tabpages/tabarea.cxx +++ b/cui/source/tabpages/tabarea.cxx @@ -226,7 +226,7 @@ short SvxAreaTabDialog::Ok() // RET_OK is returned, if at least one // TabPage returns sal_True in FillItemSet(). // This happens by default at the moment. - return( SfxTabDialog::Ok() ); + return SfxTabDialog::Ok(); } diff --git a/cui/source/tabpages/tabline.cxx b/cui/source/tabpages/tabline.cxx index 070c4b4de64e..adade3557343 100644 --- a/cui/source/tabpages/tabline.cxx +++ b/cui/source/tabpages/tabline.cxx @@ -173,7 +173,7 @@ short SvxLineTabDialog::Ok() // We return RET_OK if at least one TabPage in FillItemSet() returns sal_True. // We do this by default at the moment. - return( SfxTabDialog::Ok() ); + return SfxTabDialog::Ok(); } diff --git a/dbaccess/source/core/dataaccess/ModelImpl.hxx b/dbaccess/source/core/dataaccess/ModelImpl.hxx index 0a19884d568c..130bb5493a10 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.hxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.hxx @@ -244,7 +244,7 @@ public: /** determines whether the database document has an embedded data storage */ - bool isEmbeddedDatabase() const { return ( m_sConnectURL.startsWith("sdbc:embedded:") ); } + bool isEmbeddedDatabase() const { return m_sConnectURL.startsWith("sdbc:embedded:"); } /** stores the embedded storage ("database") diff --git a/drawinglayer/source/primitive2d/baseprimitive2d.cxx b/drawinglayer/source/primitive2d/baseprimitive2d.cxx index 849fb1493379..bdb96f96d423 100644 --- a/drawinglayer/source/primitive2d/baseprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/baseprimitive2d.cxx @@ -231,7 +231,7 @@ namespace drawinglayer return false; } - return (pA->operator==(*pB)); + return pA->operator==(*pB); } bool Primitive2DContainer::operator==(const Primitive2DContainer& rB) const diff --git a/drawinglayer/source/primitive3d/baseprimitive3d.cxx b/drawinglayer/source/primitive3d/baseprimitive3d.cxx index 02ba16fda68c..d9d5804c69ff 100644 --- a/drawinglayer/source/primitive3d/baseprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/baseprimitive3d.cxx @@ -178,7 +178,7 @@ namespace drawinglayer return false; } - return (pA->operator==(*pB)); + return pA->operator==(*pB); } bool Primitive3DContainer::operator==(const Primitive3DContainer& rB) const diff --git a/drawinglayer/source/primitive3d/textureprimitive3d.cxx b/drawinglayer/source/primitive3d/textureprimitive3d.cxx index ee126a15c77e..fb8987f51f44 100644 --- a/drawinglayer/source/primitive3d/textureprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/textureprimitive3d.cxx @@ -197,7 +197,7 @@ namespace drawinglayer bool TransparenceTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const { - return (GradientTexturePrimitive3D::operator==(rPrimitive)); + return GradientTexturePrimitive3D::operator==(rPrimitive); } // provide unique ID diff --git a/editeng/source/accessibility/AccessibleSelectionBase.cxx b/editeng/source/accessibility/AccessibleSelectionBase.cxx index b08aac51c420..cc819b46db09 100644 --- a/editeng/source/accessibility/AccessibleSelectionBase.cxx +++ b/editeng/source/accessibility/AccessibleSelectionBase.cxx @@ -49,7 +49,7 @@ namespace accessibility sal_Bool SAL_CALL AccessibleSelectionBase::isAccessibleChildSelected( sal_Int32 nChildIndex ) { ::osl::MutexGuard aGuard( implGetMutex() ); - return( OCommonAccessibleSelection::isAccessibleChildSelected( nChildIndex ) ); + return OCommonAccessibleSelection::isAccessibleChildSelected( nChildIndex ); } @@ -70,7 +70,7 @@ namespace accessibility sal_Int32 SAL_CALL AccessibleSelectionBase::getSelectedAccessibleChildCount( ) { ::osl::MutexGuard aGuard( implGetMutex() ); - return( OCommonAccessibleSelection::getSelectedAccessibleChildCount() ); + return OCommonAccessibleSelection::getSelectedAccessibleChildCount(); } diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx index c8b5f574055c..98a3a7faa729 100644 --- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx @@ -1244,7 +1244,7 @@ sal_Bool SAL_CALL UIConfigurationManager::hasStorage() if ( m_bDisposed ) throw DisposedException(); - return ( m_xDocConfigStorage.is() ); + return m_xDocConfigStorage.is(); } // XUIConfigurationPersistence diff --git a/i18npool/source/transliteration/transliteration_commonclass.cxx b/i18npool/source/transliteration/transliteration_commonclass.cxx index 28c0ec66a13f..6f4081a1eb2f 100644 --- a/i18npool/source/transliteration/transliteration_commonclass.cxx +++ b/i18npool/source/transliteration/transliteration_commonclass.cxx @@ -101,7 +101,7 @@ transliteration_commonclass::compareSubstring( sal_Int32 SAL_CALL transliteration_commonclass::compareString( const OUString& str1, const OUString& str2 ) { - return( compareSubstring(str1, 0, str1.getLength(), str2, 0, str2.getLength())); + return compareSubstring(str1, 0, str1.getLength(), str2, 0, str2.getLength()); } OUString SAL_CALL diff --git a/include/osl/module.hxx b/include/osl/module.hxx index d0bc0ff6c14a..ef5065a297c6 100644 --- a/include/osl/module.hxx +++ b/include/osl/module.hxx @@ -123,7 +123,7 @@ public: void* SAL_CALL getSymbol( const ::rtl::OUString& strSymbolName) { - return ( osl_getSymbol( m_Module, strSymbolName.pData ) ); + return osl_getSymbol( m_Module, strSymbolName.pData ); } /** Get function address by the function name in the module. @@ -140,7 +140,7 @@ public: */ oslGenericFunction SAL_CALL getFunctionSymbol( const ::rtl::OUString& ustrFunctionSymbolName ) const { - return ( osl_getFunctionSymbol( m_Module, ustrFunctionSymbolName.pData ) ); + return osl_getFunctionSymbol( m_Module, ustrFunctionSymbolName.pData ); } /// @since LibreOffice 3.5 diff --git a/include/osl/thread.hxx b/include/osl/thread.hxx index 389739c70aa7..a459f12bf48d 100644 --- a/include/osl/thread.hxx +++ b/include/osl/thread.hxx @@ -208,7 +208,7 @@ public: */ bool SAL_CALL setData(void *pData) { - return (osl_setThreadKeyData(m_hKey, pData)); + return osl_setThreadKeyData(m_hKey, pData); } /** Get the data associated with the data key. diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index 7f34c284b2e5..164e88f144ce 100644 --- a/lotuswordpro/source/filter/lwplayout.cxx +++ b/lotuswordpro/source/filter/lwplayout.cxx @@ -659,7 +659,7 @@ double LwpMiddleLayout::GetGeometryHeight() LwpLayoutGeometry* pGeo = GetGeometry(); if(pGeo) { - return ( LwpTools::ConvertFromUnitsToMetric( pGeo->GetHeight() ) ); + return LwpTools::ConvertFromUnitsToMetric( pGeo->GetHeight() ); } else return -1; @@ -674,7 +674,7 @@ double LwpMiddleLayout::GetGeometryWidth() LwpLayoutGeometry* pGeo = GetGeometry(); if(pGeo) { - return ( LwpTools::ConvertFromUnitsToMetric( pGeo->GetWidth() ) ); + return LwpTools::ConvertFromUnitsToMetric( pGeo->GetWidth() ); } else return -1; diff --git a/lotuswordpro/source/filter/lwppara.cxx b/lotuswordpro/source/filter/lwppara.cxx index 3b5f4957ceba..17b1708ceee8 100644 --- a/lotuswordpro/source/filter/lwppara.cxx +++ b/lotuswordpro/source/filter/lwppara.cxx @@ -904,8 +904,8 @@ XFContentContainer* LwpPara::AddBulletList(XFContentContainer* pCont) m_nLevel = nLevel;//for get para level } - return ( pBulletStyleMgr->AddBulletList(pCont, bOrdered, m_aBulletStyleName, - nLevel, m_pBullOver->IsSkip()) ); + return pBulletStyleMgr->AddBulletList(pCont, bOrdered, m_aBulletStyleName, + nLevel, m_pBullOver->IsSkip()); } LwpNumberingOverride* LwpPara::GetParaNumbering() diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx index eb2172d1c512..944226234a5a 100644 --- a/registry/source/keyimpl.cxx +++ b/registry/source/keyimpl.cxx @@ -201,7 +201,7 @@ RegError ORegKey::getKeyNames(const OUString& keyName, RegError ORegKey::closeKey(RegKeyHandle hKey) { - return (m_pRegistry->closeKey(hKey)); + return m_pRegistry->closeKey(hKey); } @@ -209,7 +209,7 @@ RegError ORegKey::closeKey(RegKeyHandle hKey) RegError ORegKey::deleteKey(const OUString& keyName) { - return (m_pRegistry->deleteKey(this, keyName)); + return m_pRegistry->deleteKey(this, keyName); } diff --git a/sc/inc/addincol.hxx b/sc/inc/addincol.hxx index bd2a48ec04c2..ae857f8613ac 100644 --- a/sc/inc/addincol.hxx +++ b/sc/inc/addincol.hxx @@ -219,7 +219,7 @@ public: FormulaError GetErrCode() const { return nErrCode; } bool HasString() const { return bHasString; } bool HasMatrix() const { return xMatrix.get(); } - bool HasVarRes() const { return ( xVarRes.is() ); } + bool HasVarRes() const { return xVarRes.is(); } double GetValue() const { return fValue; } const OUString& GetString() const { return aString; } const ScMatrixRef& GetMatrix() const { return xMatrix;} diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index b05d88c05e2e..d431917597da 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -1022,7 +1022,7 @@ uno::Reference<XAccessible> ScShapeChildren::GetBackgroundShapeAt(const awt::Poi ::accessibility::AccessibleShape* ScShapeChildren::GetAccShape(const ScShapeChildVec& rShapes, sal_Int32 nIndex) const { - return (GetAccShape(rShapes[nIndex])); + return GetAccShape(rShapes[nIndex]); } void ScShapeChildren::FillShapes(const tools::Rectangle& aPixelPaintRect, const MapMode& aMapMode, sal_uInt8 nRangeId) diff --git a/sc/source/ui/inc/fupoor.hxx b/sc/source/ui/inc/fupoor.hxx index 5c3ba4fbf03d..3bbbdf4a4fc0 100644 --- a/sc/source/ui/inc/fupoor.hxx +++ b/sc/source/ui/inc/fupoor.hxx @@ -90,7 +90,7 @@ public: void SetWindow(vcl::Window* pWin) { pWindow = pWin; } - sal_uInt16 GetSlotID() const { return( aSfxRequest.GetSlot() ); } + sal_uInt16 GetSlotID() const { return aSfxRequest.GetSlot(); } bool IsDetectiveHit( const Point& rLogicPos ); diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index cbf3475fd9a1..4275663e8ed3 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -272,7 +272,7 @@ SfxItemSet& SdStyleSheet::GetItemSet() if (pSdSheet) { - return(pSdSheet->GetItemSet()); + return pSdSheet->GetItemSet(); } else { diff --git a/sd/source/ui/dlg/ins_paste.cxx b/sd/source/ui/dlg/ins_paste.cxx index 2b4a592ef63f..09f5d54297d0 100644 --- a/sd/source/ui/dlg/ins_paste.cxx +++ b/sd/source/ui/dlg/ins_paste.cxx @@ -42,7 +42,7 @@ void SdInsertPasteDlg::dispose() bool SdInsertPasteDlg::IsInsertBefore() const { - return( m_pRbBefore->IsChecked() ); + return m_pRbBefore->IsChecked(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/dlg/inspagob.cxx b/sd/source/ui/dlg/inspagob.cxx index 80379f718023..ce291508083c 100644 --- a/sd/source/ui/dlg/inspagob.cxx +++ b/sd/source/ui/dlg/inspagob.cxx @@ -116,7 +116,7 @@ std::vector<OUString> SdInsertPagesObjsDlg::GetList( const sal_uInt16 nType ) */ bool SdInsertPagesObjsDlg::IsLink() { - return( m_pCbxLink->IsChecked() ); + return m_pCbxLink->IsChecked(); } /** @@ -124,7 +124,7 @@ bool SdInsertPagesObjsDlg::IsLink() */ bool SdInsertPagesObjsDlg::IsRemoveUnnessesaryMasterPages() const { - return( m_pCbxMasters->IsChecked() ); + return m_pCbxMasters->IsChecked(); } /** diff --git a/sfx2/inc/srchdlg.hxx b/sfx2/inc/srchdlg.hxx index b6e8d2ae7588..2dfab6612abc 100644 --- a/sfx2/inc/srchdlg.hxx +++ b/sfx2/inc/srchdlg.hxx @@ -65,10 +65,10 @@ public: OUString GetSearchText() const { return m_pSearchEdit->GetText(); } void SetSearchText( const OUString& _rText ) { m_pSearchEdit->SetText( _rText ); } - bool IsOnlyWholeWords() const { return ( m_pWholeWordsBox->IsChecked() ); } - bool IsMarchCase() const { return ( m_pMatchCaseBox->IsChecked() ); } - bool IsWrapAround() const { return ( m_pWrapAroundBox->IsChecked() ); } - bool IsSearchBackwards() const { return ( m_pBackwardsBox->IsChecked() ); } + bool IsOnlyWholeWords() const { return m_pWholeWordsBox->IsChecked(); } + bool IsMarchCase() const { return m_pMatchCaseBox->IsChecked(); } + bool IsWrapAround() const { return m_pWrapAroundBox->IsChecked(); } + bool IsSearchBackwards() const { return m_pBackwardsBox->IsChecked(); } void SetFocusOnEdit(); diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index b07117339f40..3255b03f3dfd 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -401,7 +401,7 @@ isPartOfType(struct DocumentMetadataAccess_Impl const & i_rImpl, getURI<rdf::URIs::RDF_TYPE>(i_rImpl.m_xContext), i_xType.get()), uno::UNO_SET_THROW); - return (xEnum->hasMoreElements()); + return xEnum->hasMoreElements(); } catch (const uno::RuntimeException &) { throw; } catch (const uno::Exception & e) { diff --git a/store/source/storpage.hxx b/store/source/storpage.hxx index 3893af5e6c85..17f28b24da7d 100644 --- a/store/source/storpage.hxx +++ b/store/source/storpage.hxx @@ -142,7 +142,7 @@ private: inline bool OStorePageManager::isValid() const { - return (base::isValid() /* @@@ NYI && (m_aRoot.is()) */); + return base::isValid() /* @@@ NYI && (m_aRoot.is()) */; } template<> inline OStorePageManager* diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index d1913d795e4a..42941ec644bb 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -639,7 +639,7 @@ void TransferableHelper::ClearFormats() bool TransferableHelper::SetAny( const Any& rAny ) { maAny = rAny; - return( maAny.hasValue() ); + return maAny.hasValue(); } @@ -661,7 +661,7 @@ bool TransferableHelper::SetString( const OUString& rString, const DataFlavor& r else maAny <<= rString; - return( maAny.hasValue() ); + return maAny.hasValue(); } @@ -689,7 +689,7 @@ bool TransferableHelper::SetBitmapEx( const BitmapEx& rBitmapEx, const DataFlavo maAny <<= Sequence< sal_Int8 >( static_cast< const sal_Int8* >( aMemStm.GetData() ), aMemStm.Seek( STREAM_SEEK_TO_END ) ); } - return( maAny.hasValue() ); + return maAny.hasValue(); } @@ -703,7 +703,7 @@ bool TransferableHelper::SetGDIMetaFile( const GDIMetaFile& rMtf ) maAny <<= Sequence< sal_Int8 >( static_cast< const sal_Int8* >( aMemStm.GetData() ), aMemStm.Seek( STREAM_SEEK_TO_END ) ); } - return( maAny.hasValue() ); + return maAny.hasValue(); } @@ -719,7 +719,7 @@ bool TransferableHelper::SetGraphic( const Graphic& rGraphic ) maAny <<= Sequence< sal_Int8 >( static_cast< const sal_Int8* >( aMemStm.GetData() ), aMemStm.Seek( STREAM_SEEK_TO_END ) ); } - return( maAny.hasValue() ); + return maAny.hasValue(); } @@ -731,7 +731,7 @@ bool TransferableHelper::SetImageMap( const ImageMap& rIMap ) rIMap.Write( aMemStm ); maAny <<= Sequence< sal_Int8 >( static_cast< const sal_Int8* >( aMemStm.GetData() ), aMemStm.Seek( STREAM_SEEK_TO_END ) ); - return( maAny.hasValue() ); + return maAny.hasValue(); } @@ -744,7 +744,7 @@ bool TransferableHelper::SetTransferableObjectDescriptor( const TransferableObje WriteTransferableObjectDescriptor( aMemStm, rDesc ); maAny <<= Sequence< sal_Int8 >( static_cast< const sal_Int8* >( aMemStm.GetData() ), aMemStm.Tell() ); - return( maAny.hasValue() ); + return maAny.hasValue(); } @@ -833,7 +833,7 @@ bool TransferableHelper::SetINetBookmark( const INetBookmark& rBmk, break; } - return( maAny.hasValue() ); + return maAny.hasValue(); } @@ -847,7 +847,7 @@ bool TransferableHelper::SetINetImage( const INetImage& rINtImg, maAny <<= Sequence< sal_Int8 >( static_cast< const sal_Int8* >( aMemStm.GetData() ), aMemStm.Seek( STREAM_SEEK_TO_END ) ); - return( maAny.hasValue() ); + return maAny.hasValue(); } @@ -877,7 +877,7 @@ bool TransferableHelper::SetObject( void* pUserObject, SotClipboardFormatId nUse maAny <<= aSeq; } - return( maAny.hasValue() ); + return maAny.hasValue(); } diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index 60b494366f3b..616fc808e2fb 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -382,12 +382,12 @@ void GalleryIconView::KeyInput(const KeyEvent& rKEvt) sal_Int8 GalleryIconView::AcceptDrop(const AcceptDropEvent& /*rEvt*/) { - return(static_cast<GalleryBrowser2*>(GetParent())->AcceptDrop(*this)); + return static_cast<GalleryBrowser2*>(GetParent())->AcceptDrop(*this); } sal_Int8 GalleryIconView::ExecuteDrop(const ExecuteDropEvent& rEvt) { - return(static_cast<GalleryBrowser2*>(GetParent())->ExecuteDrop(rEvt)); + return static_cast<GalleryBrowser2*>(GetParent())->ExecuteDrop(rEvt); } void GalleryIconView::StartDrag(sal_Int8, const Point&) @@ -592,7 +592,7 @@ sal_Int8 GalleryListView::ExecuteDrop( const BrowserExecuteDropEvent& rEvt ) aEvt.maPosPixel.Y() += GetTitleHeight(); - return( static_cast<GalleryBrowser2*>( GetParent() )->ExecuteDrop( aEvt ) ); + return static_cast<GalleryBrowser2*>( GetParent() )->ExecuteDrop( aEvt ); } void GalleryListView::StartDrag( sal_Int8, const Point& rPosPixel ) diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 89ad4b249376..1d5b495dde7b 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -856,7 +856,7 @@ inline SwPaM* SwCursorShell::GetStackCursor() const { return m_pStackCursor; } inline void SwCursorShell::SetMark() { m_pCurrentCursor->SetMark(); } -inline bool SwCursorShell::HasMark() { return( m_pCurrentCursor->HasMark() ); } +inline bool SwCursorShell::HasMark() { return m_pCurrentCursor->HasMark(); } inline bool SwCursorShell::IsSelection() const { diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx index 8831ced9a45a..aa5ed07a583f 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -627,7 +627,7 @@ bool SwView::IsFormMode() const { if (GetDrawFuncPtr() && GetDrawFuncPtr()->IsCreateObj()) { - return (GetDrawFuncPtr()->IsInsertForm()); + return GetDrawFuncPtr()->IsInsertForm(); } return AreOnlyFormsSelected(); diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index deccc10960ee..db5e47fe3fdb 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -507,8 +507,8 @@ extern "C" { static int SAL_CALL ComponentInfoCompare( const void* pFirst, const void* pSecond) { - return( strcmp( static_cast<ComponentInfo const *>(pFirst)->pName, - static_cast<ComponentInfo const *>(pSecond)->pName ) ); + return strcmp( static_cast<ComponentInfo const *>(pFirst)->pName, + static_cast<ComponentInfo const *>(pSecond)->pName ); } } diff --git a/ucb/source/ucp/webdav-neon/ContentProperties.cxx b/ucb/source/ucp/webdav-neon/ContentProperties.cxx index 551d91080b93..a010a85623c3 100644 --- a/ucb/source/ucp/webdav-neon/ContentProperties.cxx +++ b/ucb/source/ucp/webdav-neon/ContentProperties.cxx @@ -353,7 +353,7 @@ bool ContentProperties::containsAllNames( } } - return ( rNamesNotContained.empty() ); + return rNamesNotContained.empty(); } diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx index 7842820cfcf2..2f2f57956a5e 100644 --- a/unotools/source/config/eventcfg.cxx +++ b/unotools/source/config/eventcfg.cxx @@ -308,7 +308,7 @@ Type SAL_CALL GlobalEventConfig_Impl::getElementType( ) bool SAL_CALL GlobalEventConfig_Impl::hasElements( ) { - return ( m_eventBindingHash.empty() ); + return m_eventBindingHash.empty(); } // and now the wrapper diff --git a/vcl/source/edit/txtattr.cxx b/vcl/source/edit/txtattr.cxx index f1a6e1ea6b0c..006c77b99160 100644 --- a/vcl/source/edit/txtattr.cxx +++ b/vcl/source/edit/txtattr.cxx @@ -87,7 +87,7 @@ TextAttrib* TextAttribProtect::Clone() const bool TextAttribProtect::operator==( const TextAttrib& rAttr ) const { - return ( TextAttrib::operator==(rAttr ) ); + return TextAttrib::operator==(rAttr ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx index 70e31776c137..135ba2dbb69f 100644 --- a/vcl/source/gdi/gfxlink.cxx +++ b/vcl/source/gdi/gfxlink.cxx @@ -73,7 +73,7 @@ const sal_uInt8* GfxLink::GetData() const if( IsSwappedOut() ) const_cast<GfxLink*>(this)->SwapIn(); - return( mpSwapInData.get() ); + return mpSwapInData.get(); } diff --git a/vcl/source/outdev/nativecontrols.cxx b/vcl/source/outdev/nativecontrols.cxx index 2a9eee180e43..81acddfe2f12 100644 --- a/vcl/source/outdev/nativecontrols.cxx +++ b/vcl/source/outdev/nativecontrols.cxx @@ -163,7 +163,7 @@ bool OutputDevice::IsNativeControlSupported( ControlType nType, ControlPart nPar if ( !AcquireGraphics() ) return false; - return( mpGraphics->IsNativeControlSupported(nType, nPart) ); + return mpGraphics->IsNativeControlSupported(nType, nPart); } bool OutputDevice::HitTestNativeScrollbar( |