Kaydet (Commit) 7aa7f4d9 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:unnecessaryparen include c++ casts

Change-Id: I132d3c66f0562e2c37a02eaf4c168d06c2b473eb
Reviewed-on: https://gerrit.libreoffice.org/41874Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 6f511a5d
......@@ -55,7 +55,7 @@ enum PropertyHandle // values represent index in PropertyArray
FrameControl::FrameControl( const Reference< XComponentContext >& rxContext)
: BaseControl ( rxContext )
, OBroadcastHelper ( m_aMutex )
, OPropertySetHelper ( *(static_cast< OBroadcastHelper * >(this)) )
, OPropertySetHelper ( *static_cast< OBroadcastHelper * >(this) )
, m_aConnectionPointContainer ( new OConnectionPointContainerHelper(m_aMutex) )
{
}
......
......@@ -902,7 +902,7 @@ SdrObject* DlgEdObj::getFullDragClone() const
// no need to really add the clone for dragging, it's a temporary
// object
SdrObject* pObj = new SdrUnoObj(OUString());
*pObj = *(static_cast<const SdrUnoObj*>(this));
*pObj = *static_cast<const SdrUnoObj*>(this);
return pObj;
}
......
......@@ -549,7 +549,7 @@ void SchAttribTabDlg::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
{
bool bShowStaggeringControls = m_pParameter->CanAxisLabelsBeStaggered();
static_cast<SchAxisLabelTabPage&>(rPage).ShowStaggeringControls( bShowStaggeringControls );
( dynamic_cast< SchAxisLabelTabPage& >( rPage ) ).SetComplexCategories( m_pParameter->IsComplexCategoriesAxis() );
dynamic_cast< SchAxisLabelTabPage& >( rPage ).SetComplexCategories( m_pParameter->IsComplexCategoriesAxis() );
break;
}
......
......@@ -582,7 +582,7 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
m_bRangePosUnique = ( aState != SfxItemState::DONTCARE );
if( aState == SfxItemState::SET )
{
OUString sRangePositive = (static_cast< const SfxStringItem * >( pPoolItem ))->GetValue();
OUString sRangePositive = static_cast< const SfxStringItem * >( pPoolItem )->GetValue();
m_pEdRangePositive->SetText( sRangePositive );
}
......@@ -590,7 +590,7 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
m_bRangeNegUnique = ( aState != SfxItemState::DONTCARE );
if( aState == SfxItemState::SET )
{
OUString sRangeNegative = (static_cast< const SfxStringItem * >( pPoolItem ))->GetValue();
OUString sRangeNegative = static_cast< const SfxStringItem * >( pPoolItem )->GetValue();
m_pEdRangeNegative->SetText( sRangeNegative );
if( m_eErrorKind == SvxChartKindError::Range &&
!sRangeNegative.isEmpty() &&
......
......@@ -520,8 +520,8 @@ bool GraphicPropertyItemConverter::ApplySpecialItem(
? OUString( "GradientStepCount" )
: OUString( "FillGradientStepCount" );
sal_Int16 nStepCount = ( static_cast< const XGradientStepCountItem & >(
rItemSet.Get( nWhichId ))).GetValue();
sal_Int16 nStepCount = static_cast< const XGradientStepCountItem & >(
rItemSet.Get( nWhichId )).GetValue();
aValue <<= nStepCount;
if( aValue != GetPropertySet()->getPropertyValue( aPropName ))
......
......@@ -1557,7 +1557,7 @@ sal_Int16 lcl_getDefaultWritingModeFromPool( const std::shared_ptr<DrawModelWrap
const SfxPoolItem* pItem = &(pDrawModelWrapper->GetItemPool().GetDefaultItem( EE_PARA_WRITINGDIR ));
if( pItem )
nWritingMode = static_cast< sal_Int16 >((static_cast< const SvxFrameDirectionItem * >( pItem ))->GetValue());
nWritingMode = static_cast< sal_Int16 >(static_cast< const SvxFrameDirectionItem * >( pItem )->GetValue());
return nWritingMode;
}
......
......@@ -32,6 +32,9 @@ int main()
// lots of our code uses this style, which I'm loathe to bulk-fix as yet
int z = (y) ? 1 : 0;
(void)z;
int v1 = (static_cast<short>(1)) + 1; // expected-error {{unnecessary parentheses around cast [loplugin:unnecessaryparen]}}
(void)v1;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
......@@ -109,8 +109,10 @@ bool UnnecessaryParen::VisitParenExpr(const ParenExpr* parenExpr)
if (insideConditionalOperator && parenExpr == insideConditionalOperator)
return true;
auto subParenExpr = dyn_cast<ParenExpr>(parenExpr->getSubExpr()->IgnoreImpCasts());
if (subParenExpr) {
auto subExpr = parenExpr->getSubExpr()->IgnoreImpCasts();
if (auto subParenExpr = dyn_cast<ParenExpr>(subExpr))
{
if (subParenExpr->getLocStart().isMacroID())
return true;
report(
......@@ -119,8 +121,7 @@ bool UnnecessaryParen::VisitParenExpr(const ParenExpr* parenExpr)
<< parenExpr->getSourceRange();
}
auto declRefExpr = dyn_cast<DeclRefExpr>(parenExpr->getSubExpr()->IgnoreImpCasts());
if (declRefExpr) {
if (auto declRefExpr = dyn_cast<DeclRefExpr>(subExpr)) {
if (declRefExpr->getLocStart().isMacroID())
return true;
......@@ -136,6 +137,17 @@ bool UnnecessaryParen::VisitParenExpr(const ParenExpr* parenExpr)
parenExpr->getLocStart())
<< parenExpr->getSourceRange();
}
if (auto cxxNamedCastExpr = dyn_cast<CXXNamedCastExpr>(subExpr)) {
if (cxxNamedCastExpr->getLocStart().isMacroID())
return true;
report(
DiagnosticsEngine::Warning, "unnecessary parentheses around cast",
parenExpr->getLocStart())
<< parenExpr->getSourceRange();
}
return true;
}
......
......@@ -70,7 +70,7 @@ struct AlignSize_Impl
#endif
// the value of the maximal alignment
static sal_Int32 nMaxAlignment = (sal_Int32)( reinterpret_cast<sal_Size>(&(reinterpret_cast<AlignSize_Impl *>(16))->dDouble) - 16);
static sal_Int32 nMaxAlignment = (sal_Int32)( reinterpret_cast<sal_Size>(&reinterpret_cast<AlignSize_Impl *>(16)->dDouble) - 16);
static inline sal_Int32 adjustAlignment( sal_Int32 nRequestedAlignment )
{
......
......@@ -74,7 +74,7 @@ struct AlignSize_Impl
#endif
// the value of the maximal alignment
static sal_Int32 nMaxAlignment = (sal_Int32)( reinterpret_cast<sal_Size>(&(reinterpret_cast<AlignSize_Impl *>(16))->dDouble) - 16);
static sal_Int32 nMaxAlignment = (sal_Int32)( reinterpret_cast<sal_Size>(&reinterpret_cast<AlignSize_Impl *>(16)->dDouble) - 16);
static inline sal_Int32 adjustAlignment( sal_Int32 nRequestedAlignment )
{
......
......@@ -425,7 +425,7 @@ inline bool _assignData(
typelib_TypeDescription * pTD = pSourceTypeDescr;
while (pTD && !_type_equals( pTD->pWeakRef, pDestType ))
{
pTD = &(reinterpret_cast<typelib_InterfaceTypeDescription *>(pTD))->pBaseTypeDescription->aBase;
pTD = &reinterpret_cast<typelib_InterfaceTypeDescription *>(pTD)->pBaseTypeDescription->aBase;
}
if (pTD) // is base of dest
{
......
......@@ -238,7 +238,7 @@ css::uno::Sequence< css::uno::Type > OPropertySetHelper::getTypes()
void OPropertySetHelper::disposing()
{
// Create an event with this as sender
Reference < XPropertySet > rSource( (static_cast< XPropertySet * >(this)) , UNO_QUERY );
Reference < XPropertySet > rSource( static_cast< XPropertySet * >(this), UNO_QUERY );
EventObject aEvt;
aEvt.Source = rSource;
......
......@@ -1372,7 +1372,7 @@ namespace svx
rLoseFocusHdl.Call( *this );
m_pScrollBar->SetThumbPos( m_pScrollBar->GetThumbPos() + ( _bUp? -1 : 1 ) );
( static_cast< HangulHanjaEditDictDialog* >( GetParentDialog() ) )->UpdateScrollbar();
static_cast< HangulHanjaEditDictDialog* >( GetParentDialog() )->UpdateScrollbar();
}
SuggestionEdit::SuggestionEdit( vcl::Window* pParent, WinBits nBits )
......
......@@ -142,7 +142,7 @@ SvxDefaultColorOptPage::SvxDefaultColorOptPage(vcl::Window* pParent, const SfxIt
const SfxPoolItem* pItem = nullptr;
if ( rInAttrs.GetItemState( SID_SCH_EDITOPTIONS, false, &pItem ) == SfxItemState::SET )
{
pColorConfig = (static_cast< SvxChartColorTableItem* >(pItem->Clone()) );
pColorConfig = static_cast< SvxChartColorTableItem* >(pItem->Clone());
}
else
{
......@@ -199,7 +199,7 @@ VclPtr<SfxTabPage> SvxDefaultColorOptPage::Create( vcl::Window* pParent, const S
bool SvxDefaultColorOptPage::FillItemSet( SfxItemSet* rOutAttrs )
{
if( pColorConfig )
rOutAttrs->Put( *(static_cast< SfxPoolItem* >(pColorConfig)));
rOutAttrs->Put( *static_cast< SfxPoolItem* >(pColorConfig) );
return true;
}
......
......@@ -809,7 +809,7 @@ bool SvxTabStopItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
case MID_STD_TAB:
{
const SvxTabStop &rTab = maTabStops.front();
rVal <<= (static_cast<sal_Int32>(bConvert ? convertTwipToMm100(rTab.GetTabPos()) : rTab.GetTabPos()));
rVal <<= static_cast<sal_Int32>(bConvert ? convertTwipToMm100(rTab.GetTabPos()) : rTab.GetTabPos());
break;
}
}
......
......@@ -272,7 +272,7 @@ SvxXMLTextExportComponent::SvxXMLTextExportComponent(
const ESelection& rSel,
const OUString& rFileName,
const css::uno::Reference< css::xml::sax::XDocumentHandler > & xHandler)
: SvXMLExport( xContext, "", rFileName, xHandler, (static_cast<frame::XModel*>(new SvxSimpleUnoModel())), FUNIT_CM,
: SvXMLExport( xContext, "", rFileName, xHandler, static_cast<frame::XModel*>(new SvxSimpleUnoModel()), FUNIT_CM,
SvXMLExportFlags::OASIS | SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::CONTENT )
{
SvxEditEngineSource aEditSource( pEditEngine );
......
......@@ -398,7 +398,7 @@ void OleEmbeddedObject::InsertVisualCache_Impl( const uno::Reference< io::XStrea
// write 0xFFFFFFFF at the beginning
uno::Sequence< sal_Int8 > aData( 4 );
*( reinterpret_cast<sal_uInt32*>(aData.getArray()) ) = 0xFFFFFFFF;
* reinterpret_cast<sal_uInt32*>(aData.getArray()) = 0xFFFFFFFF;
xTempOutStream->writeBytes( aData );
......@@ -429,7 +429,7 @@ void OleEmbeddedObject::InsertVisualCache_Impl( const uno::Reference< io::XStrea
xTempOutStream->writeBytes( aData );
// write l-index
*( reinterpret_cast<sal_uInt32*>(aData.getArray()) ) = 0xFFFFFFFF;
* reinterpret_cast<sal_uInt32*>(aData.getArray()) = 0xFFFFFFFF;
xTempOutStream->writeBytes( aData );
// write adv. flags
......@@ -437,7 +437,7 @@ void OleEmbeddedObject::InsertVisualCache_Impl( const uno::Reference< io::XStrea
xTempOutStream->writeBytes( aData );
// write compression
*( reinterpret_cast<sal_uInt32*>(aData.getArray()) ) = 0x0;
* reinterpret_cast<sal_uInt32*>(aData.getArray()) = 0x0;
xTempOutStream->writeBytes( aData );
// get the size
......
......@@ -412,7 +412,7 @@ void CGM::ImplDoClass4()
if ( mbFigure )
{
tools::Rectangle aBoundingBox( Point( (long)( aCenterPoint.X - fRadius ), long( aCenterPoint.Y - fRadius ) ),
Size( ( static_cast< long >( 2 * fRadius ) ), (long)( 2 * fRadius) ) );
Size( static_cast< long >( 2 * fRadius ), (long)( 2 * fRadius) ) );
tools::Polygon aPolygon( aBoundingBox, Point( (long)aStartingPoint.X, (long)aStartingPoint.Y ) ,Point( (long)aEndingPoint.X, (long)aEndingPoint.Y ), PolyStyle::Arc );
if ( nSwitch )
mpOutAct->RegPolyLine( aPolygon, true );
......
......@@ -102,10 +102,10 @@ void CGM::ImplDoClass7()
case 0x320 : /*AppData - TEXT*/
{
TextEntry* pTextEntry = new TextEntry;
pTextEntry->nTypeOfText = *(reinterpret_cast<sal_uInt16*>( pAppData ) );
pTextEntry->nRowOrLineNum = *(reinterpret_cast<sal_uInt16*>( pAppData + 2 ) );
pTextEntry->nColumnNum = *(reinterpret_cast<sal_uInt16*>( pAppData + 4 ) );
sal_uInt16 nAttributes = *( reinterpret_cast<sal_uInt16*>( pAppData + 6 ) );
pTextEntry->nTypeOfText = *reinterpret_cast<sal_uInt16*>( pAppData );
pTextEntry->nRowOrLineNum = *reinterpret_cast<sal_uInt16*>( pAppData + 2 );
pTextEntry->nColumnNum = *reinterpret_cast<sal_uInt16*>( pAppData + 4 );
sal_uInt16 nAttributes = *reinterpret_cast<sal_uInt16*>( pAppData + 6 );
pTextEntry->nZoneSize = nAttributes & 0xff;
pTextEntry->nLineType = ( nAttributes >> 8 ) & 0xf;
nAttributes >>= 12;
......
......@@ -173,8 +173,8 @@ ImageProducer::~ImageProducer()
css::uno::Any ImageProducer::queryInterface( const css::uno::Type & rType )
{
css::uno::Any aRet = ::cppu::queryInterface( rType,
(static_cast< css::lang::XInitialization* >(this)),
(static_cast< css::awt::XImageProducer* >(this)) );
static_cast< css::lang::XInitialization* >(this),
static_cast< css::awt::XImageProducer* >(this) );
return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ));
}
......
......@@ -46,9 +46,9 @@ Any SAL_CALL ActionTriggerContainer::queryInterface( const Type& aType )
{
Any a = ::cppu::queryInterface(
aType ,
(static_cast< XMultiServiceFactory* >(this)),
(static_cast< XServiceInfo* >(this)),
(static_cast< XTypeProvider* >(this)));
static_cast< XMultiServiceFactory* >(this),
static_cast< XServiceInfo* >(this),
static_cast< XTypeProvider* >(this));
if( a.hasValue() )
{
......
......@@ -53,7 +53,7 @@ namespace framework
ActionTriggerPropertySet::ActionTriggerPropertySet()
: OBroadcastHelper ( m_aMutex )
, OPropertySetHelper ( *(static_cast< OBroadcastHelper * >(this)))
, OPropertySetHelper ( *static_cast< OBroadcastHelper * >(this) )
, OWeakObject ()
, m_xBitmap ( nullptr )
, m_xActionTriggerContainer( nullptr )
......@@ -69,8 +69,8 @@ Any SAL_CALL ActionTriggerPropertySet::queryInterface( const Type& aType )
{
Any a = ::cppu::queryInterface(
aType,
(static_cast< XServiceInfo* >(this)),
(static_cast< XTypeProvider* >(this)));
static_cast< XServiceInfo* >(this),
static_cast< XTypeProvider* >(this));
if( a.hasValue() )
return a;
......
......@@ -47,8 +47,8 @@ namespace framework
ActionTriggerSeparatorPropertySet::ActionTriggerSeparatorPropertySet()
: OBroadcastHelper ( m_aMutex )
, OPropertySetHelper ( *(static_cast< OBroadcastHelper * >(this)) )
, OWeakObject ( )
, OPropertySetHelper ( *static_cast< OBroadcastHelper * >(this) )
, OWeakObject ()
, m_nSeparatorType( 0 )
{
}
......@@ -62,8 +62,8 @@ Any SAL_CALL ActionTriggerSeparatorPropertySet::queryInterface( const Type& aTyp
{
Any a = ::cppu::queryInterface(
aType,
(static_cast< XServiceInfo* >(this)),
(static_cast< XTypeProvider* >(this)));
static_cast< XServiceInfo* >(this),
static_cast< XTypeProvider* >(this));
if( a.hasValue() )
return a;
......
......@@ -60,11 +60,11 @@ Any SAL_CALL RootActionTriggerContainer::queryInterface( const Type& aType )
{
Any a = ::cppu::queryInterface(
aType ,
(static_cast< XMultiServiceFactory* >(this)),
(static_cast< XServiceInfo* >(this)),
(static_cast< XUnoTunnel* >(this)),
(static_cast< XTypeProvider* >(this)),
(static_cast< XNamed* >(this)));
static_cast< XMultiServiceFactory* >(this),
static_cast< XServiceInfo* >(this),
static_cast< XUnoTunnel* >(this),
static_cast< XTypeProvider* >(this),
static_cast< XNamed* >(this));
if( a.hasValue() )
{
......
......@@ -59,10 +59,10 @@ Any SAL_CALL PropertySetContainer::queryInterface( const Type& rType )
{
Any a = ::cppu::queryInterface(
rType ,
(static_cast< XIndexContainer* >(this)),
(static_cast< XIndexReplace* >(this)),
(static_cast< XIndexAccess* >(this)),
(static_cast< XElementAccess* >(this)) );
static_cast< XIndexContainer* >(this),
static_cast< XIndexReplace* >(this),
static_cast< XIndexAccess* >(this),
static_cast< XElementAccess* >(this) );
if( a.hasValue() )
{
......
......@@ -47,13 +47,13 @@ namespace framework
RootItemContainer::RootItemContainer()
: ::cppu::OBroadcastHelperVar< ::cppu::OMultiTypeInterfaceContainerHelper, ::cppu::OMultiTypeInterfaceContainerHelper::keyType >( m_aMutex )
, ::cppu::OPropertySetHelper ( *(static_cast< ::cppu::OBroadcastHelper* >(this)) )
, ::cppu::OPropertySetHelper ( *static_cast< ::cppu::OBroadcastHelper* >(this) )
{
}
RootItemContainer::RootItemContainer( const Reference< XIndexAccess >& rSourceContainer )
: ::cppu::OBroadcastHelperVar< ::cppu::OMultiTypeInterfaceContainerHelper, ::cppu::OMultiTypeInterfaceContainerHelper::keyType >( m_aMutex )
, ::cppu::OPropertySetHelper ( *(static_cast< ::cppu::OBroadcastHelper* >(this)) )
, ::cppu::OPropertySetHelper ( *static_cast< ::cppu::OBroadcastHelper* >(this) )
{
// We also have to copy the UIName property
try
......
......@@ -60,7 +60,7 @@ namespace framework
UIConfigElementWrapperBase::UIConfigElementWrapperBase( sal_Int16 nType )
: ::cppu::OBroadcastHelperVar< ::cppu::OMultiTypeInterfaceContainerHelper, ::cppu::OMultiTypeInterfaceContainerHelper::keyType >( m_aMutex )
, ::cppu::OPropertySetHelper ( *(static_cast< ::cppu::OBroadcastHelper* >(this)) )
, ::cppu::OPropertySetHelper ( *static_cast< ::cppu::OBroadcastHelper* >(this) )
, m_nType ( nType )
, m_bPersistent ( true )
, m_bInitialized ( false )
......
......@@ -45,7 +45,7 @@ namespace framework
UIElementWrapperBase::UIElementWrapperBase( sal_Int16 nType )
: ::cppu::OBroadcastHelperVar< ::cppu::OMultiTypeInterfaceContainerHelper, ::cppu::OMultiTypeInterfaceContainerHelper::keyType >( m_aMutex )
, ::cppu::OPropertySetHelper ( *(static_cast< ::cppu::OBroadcastHelper* >(this)) )
, ::cppu::OPropertySetHelper ( *static_cast< ::cppu::OBroadcastHelper* >(this) )
, m_aListenerContainer ( m_aMutex )
, m_nType ( nType )
, m_bInitialized ( false )
......
......@@ -102,7 +102,7 @@ IMPLEMENT_FORWARD_XINTERFACE2( LayoutManager, LayoutManager_Base, LayoutManager_
LayoutManager::LayoutManager( const Reference< XComponentContext >& xContext ) : LayoutManager_Base()
, ::cppu::OBroadcastHelperVar< ::cppu::OMultiTypeInterfaceContainerHelper, ::cppu::OMultiTypeInterfaceContainerHelper::keyType >(m_aMutex)
, LayoutManager_PBase( *(static_cast< ::cppu::OBroadcastHelper* >(this)) )
, LayoutManager_PBase( *static_cast< ::cppu::OBroadcastHelper* >(this) )
, m_xContext( xContext )
, m_xURLTransformer( URLTransformer::create(xContext) )
, m_nLockCount( 0 )
......@@ -750,7 +750,7 @@ void LayoutManager::implts_updateUIElementsVisibleState( bool bSetVisible )
pMenuBar = static_cast<MenuBar *>(xInplaceMenuBar->GetMenuBar());
else
{
MenuBarWrapper* pMenuBarWrapper = (static_cast< MenuBarWrapper* >(xMenuBar.get()) );
MenuBarWrapper* pMenuBarWrapper = static_cast< MenuBarWrapper* >(xMenuBar.get());
pMenuBar = static_cast<MenuBar *>(pMenuBarWrapper->GetMenuBarManager()->GetMenuBar());
}
......@@ -1166,7 +1166,7 @@ void LayoutManager::implts_resetInplaceMenuBar()
if ( m_xContainerWindow.is() )
{
SolarMutexGuard aGuard;
MenuBarWrapper* pMenuBarWrapper = (static_cast< MenuBarWrapper* >(m_xMenuBar.get()) );
MenuBarWrapper* pMenuBarWrapper = static_cast< MenuBarWrapper* >(m_xMenuBar.get());
SystemWindow* pSysWindow = getTopSystemWindow( m_xContainerWindow );
if ( pSysWindow )
{
......
......@@ -94,9 +94,9 @@ void SAL_CALL ToolbarLayoutManager::release() throw()
uno::Any SAL_CALL ToolbarLayoutManager::queryInterface( const uno::Type & rType )
{
uno::Any a = ::cppu::queryInterface( rType,
(static_cast< awt::XDockableWindowListener* >(this)),
(static_cast< ui::XUIConfigurationListener* >(this)),
(static_cast< awt::XWindowListener* >(this)));
static_cast< awt::XDockableWindowListener* >(this),
static_cast< ui::XUIConfigurationListener* >(this),
static_cast< awt::XWindowListener* >(this));
if ( a.hasValue() )
return a;
......
......@@ -82,7 +82,7 @@ DEFINE_INIT_SERVICE ( TabWindow, {} )
TabWindow::TabWindow( const css::uno::Reference< css::uno::XComponentContext >& xContext )
: ::cppu::OBroadcastHelperVar< ::cppu::OMultiTypeInterfaceContainerHelper, ::cppu::OMultiTypeInterfaceContainerHelper::keyType >( m_aMutex )
, ::cppu::OPropertySetHelper ( *(static_cast< ::cppu::OBroadcastHelper* >(this)) )
, ::cppu::OPropertySetHelper ( *static_cast< ::cppu::OBroadcastHelper* >(this) )
, m_bInitialized( false )
, m_bDisposed( false )
, m_nNextTabID( 1 )
......
......@@ -342,8 +342,8 @@ void SAL_CALL ControlMenuController::updatePopupMenu()
Reference< XDispatch > xDispatch = xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 );
if ( xDispatch.is() )
{
xDispatch->addStatusListener( (static_cast< XStatusListener* >(this)), aTargetURL );
xDispatch->removeStatusListener( (static_cast< XStatusListener* >(this)), aTargetURL );
xDispatch->addStatusListener( static_cast< XStatusListener* >(this), aTargetURL );
xDispatch->removeStatusListener( static_cast< XStatusListener* >(this), aTargetURL );
m_aURLToDispatchMap.emplace( aTargetURL.Complete, xDispatch );
}
}
......
......@@ -208,8 +208,8 @@ void SAL_CALL FontMenuController::updatePopupMenu()
if ( xDispatch.is() )
{
xDispatch->addStatusListener( (static_cast< XStatusListener* >(this)), aTargetURL );
xDispatch->removeStatusListener( (static_cast< XStatusListener* >(this)), aTargetURL );
xDispatch->addStatusListener( static_cast< XStatusListener* >(this), aTargetURL );
xDispatch->removeStatusListener( static_cast< XStatusListener* >(this), aTargetURL );
}
}
......
......@@ -301,8 +301,8 @@ void SAL_CALL FontSizeMenuController::updatePopupMenu()
if ( xDispatch.is() )
{
xDispatch->addStatusListener( (static_cast< XStatusListener* >(this)), aTargetURL );
xDispatch->removeStatusListener( (static_cast< XStatusListener* >(this)), aTargetURL );
xDispatch->addStatusListener( static_cast< XStatusListener* >(this), aTargetURL );
xDispatch->removeStatusListener( static_cast< XStatusListener* >(this), aTargetURL );
}
svt::PopupMenuControllerBase::updatePopupMenu();
......
......@@ -252,8 +252,8 @@ void SAL_CALL LanguageSelectionMenuController::updatePopupMenu()
if ( xDispatch.is() )
{
xDispatch->addStatusListener( (static_cast< XStatusListener* >(this)), aTargetURL );
xDispatch->removeStatusListener( (static_cast< XStatusListener* >(this)), aTargetURL );
xDispatch->addStatusListener( static_cast< XStatusListener* >(this), aTargetURL );
xDispatch->removeStatusListener( static_cast< XStatusListener* >(this), aTargetURL );
}
// TODO: Fill menu with the information retrieved by the status update
......
......@@ -713,8 +713,8 @@ void SAL_CALL ToolbarsMenuController::itemActivated( const css::awt::MenuEvent&
Reference< XDispatch > xDispatch = xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 );
if ( xDispatch.is() )
{
xDispatch->addStatusListener( (static_cast< XStatusListener* >(this)), aTargetURL );
xDispatch->removeStatusListener( (static_cast< XStatusListener* >(this)), aTargetURL );
xDispatch->addStatusListener( static_cast< XStatusListener* >(this), aTargetURL );
xDispatch->removeStatusListener( static_cast< XStatusListener* >(this), aTargetURL );
}
}
else if ( aCmdVector[i] == CMD_RESTOREVISIBILITY )
......
......@@ -78,7 +78,7 @@ uno::Any SAL_CALL ToolBarWrapper::queryInterface( const uno::Type & rType )
{
Any a = ::cppu::queryInterface(
rType ,
(static_cast< css::ui::XUIFunctionListener* >(this)) );
static_cast< css::ui::XUIFunctionListener* >(this) );
if( a.hasValue() )
return a;
......
......@@ -193,7 +193,7 @@ bool AstService::dump(RegistryKey& rKey)
case NT_service_member:
if (getNodeType() == NT_singleton) {
OSL_ASSERT(superName.isEmpty());
superName = (static_cast<AstServiceMember *>(*i))->
superName = static_cast<AstServiceMember *>(*i)->
getRealService()->getRelativName();
break;
}
......
......@@ -77,7 +77,7 @@ typename enumrange<T>::Iterator begin( enumrange<T> )
template< typename T >
typename enumrange<T>::Iterator end( enumrange<T> )
{
return typename enumrange<T>::Iterator( (static_cast<int>(T::LAST)) + 1 );
return typename enumrange<T>::Iterator( static_cast<int>(T::LAST) + 1 );
}
}; // namespace o3tl
......
......@@ -1591,7 +1591,7 @@ public:
// private use.
extern "C" inline void SAL_CALL onDirectoryCreated(void* pData, rtl_uString* aDirectoryUrl)
{
(static_cast<DirectoryCreationObserver*>(pData))->DirectoryCreated(aDirectoryUrl);
static_cast<DirectoryCreationObserver*>(pData)->DirectoryCreated(aDirectoryUrl);
}
/** The directory class object provides a enumeration of DirectoryItems.
......
......@@ -106,7 +106,7 @@ public:
const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
{
assert( dynamic_cast <FastAttributeList *> ( xAttrList.get() ) != nullptr );
return ( static_cast <FastAttributeList *> ( xAttrList.get() ) );
return static_cast <FastAttributeList *> ( xAttrList.get() );
}
/// Use for fast iteration and conversion of attributes
......
......@@ -384,7 +384,7 @@ void ODataInputStream::setSuccessor( const Reference < XConnectable > &r )
if( m_succ.is() ) {
/// set this instance as the sink !
m_succ->setPredecessor( Reference< XConnectable > (
(static_cast< XConnectable * >(this)) ) );
static_cast< XConnectable * >(this) ) );
}
}
}
......@@ -402,7 +402,7 @@ void ODataInputStream::setPredecessor( const Reference < XConnectable > &r )
m_pred = r;
if( m_pred.is() ) {