From bc2becdf1a12a1020584ee808c965e41f1837383 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 8 Jun 2015 16:28:40 +0200 Subject: loplugin:cstylecast: deal with remaining pointer casts Change-Id: I94b2fbbb00e9772b668128f31cf08115bdfb16b5 --- svx/source/accessibility/AccessibleShape.cxx | 2 +- .../accessibility/GraphCtlAccessibleContext.cxx | 2 +- .../accessibility/svxrectctaccessiblecontext.cxx | 2 +- .../customshapes/EnhancedCustomShapeGeometry.cxx | 18 ++++++++-------- svx/source/dialog/dlgctl3d.cxx | 2 +- svx/source/dialog/docrecovery.cxx | 4 ++-- svx/source/dialog/imapwnd.cxx | 14 ++++++------- svx/source/fmcomp/fmgridcl.cxx | 2 +- svx/source/fmcomp/fmgridif.cxx | 24 +++++++++++----------- svx/source/fmcomp/gridcols.cxx | 2 +- svx/source/form/fmdpage.cxx | 2 +- svx/source/form/fmshimp.cxx | 12 +++++------ svx/source/form/fmsrcimp.cxx | 4 ++-- svx/source/form/formdispatchinterceptor.cxx | 2 +- svx/source/form/navigatortreemodel.cxx | 10 ++++----- svx/source/gallery2/galbrws2.cxx | 6 +++--- svx/source/gallery2/galtheme.cxx | 16 +++++++-------- svx/source/svdraw/svdcrtv.cxx | 2 +- svx/source/svdraw/svdibrow.cxx | 2 +- svx/source/svdraw/svdobj.cxx | 2 +- svx/source/svdraw/svdoedge.cxx | 6 +++--- svx/source/svdraw/svdograf.cxx | 4 ++-- svx/source/svdraw/svdview.cxx | 6 +++--- svx/source/tbxctrls/tbcontrl.cxx | 2 +- .../chinese_translation_unodialog.hxx | 2 +- svx/source/unodraw/UnoNamespaceMap.cxx | 2 +- svx/source/unodraw/XPropertyTable.cxx | 12 +++++------ svx/source/unodraw/unomod.cxx | 12 +++++------ svx/source/unodraw/unomtabl.cxx | 2 +- svx/source/unodraw/unopage.cxx | 2 +- svx/source/unodraw/unoshape.cxx | 4 ++-- svx/source/unodraw/unoshcol.cxx | 4 ++-- svx/source/unodraw/unoshtxt.cxx | 2 +- 33 files changed, 95 insertions(+), 95 deletions(-) diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index 2f9c3741a50e..ce6335e8a0b9 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -785,7 +785,7 @@ void SAL_CALL AccessibleShape::addAccessibleEventListener ( if (rBHelper.bDisposed || rBHelper.bInDispose) { uno::Reference xThis ( - (lang::XComponent *)this, uno::UNO_QUERY); + static_cast(this), uno::UNO_QUERY); rxListener->disposing (lang::EventObject (xThis)); } else diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx index e0b8fc92e3d0..a833682f5442 100644 --- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx +++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx @@ -352,7 +352,7 @@ sal_Int32 SAL_CALL SvxGraphCtrlAccessibleContext::getAccessibleIndexInParent() t if( xChild.is() ) { Reference< XAccessibleContext > xChildContext = xChild->getAccessibleContext(); - if( xChildContext == ( XAccessibleContext* ) this ) + if( xChildContext == static_cast(this) ) return i; } } diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx index 2c87389ff5e2..35c79d87fd7a 100644 --- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx +++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx @@ -311,7 +311,7 @@ sal_Int32 SAL_CALL SvxRectCtlAccessibleContext::getAccessibleIndexInParent() thr for( sal_Int32 i = 0 ; i < nChildCount ; ++i ) { Reference< XAccessible > xChild( xParentContext->getAccessibleChild( i ) ); - if( xChild.get() == ( XAccessible* ) this ) + if( xChild.get() == static_cast(this) ) return i; } } diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx index a82cffd8a8fe..f4bf7350b0d6 100644 --- a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx @@ -7960,13 +7960,13 @@ static const mso_CustomShape msoStraightConnector1 = { const_cast(mso_sptStraightConnector1Vert), SAL_N_ELEMENTS( mso_sptStraightConnector1Vert ), const_cast(mso_sptStraightConnector1Segm), sizeof( mso_sptStraightConnector1Segm ) >> 1, - (SvxMSDffCalculationData*)NULL, 0, - (sal_Int32*)NULL, + nullptr, 0, + nullptr, NULL, 0, 21600, 21600, MIN_INT32, MIN_INT32, NULL, 0, - (SvxMSDffHandle*)NULL, 0 + nullptr, 0 }; static const SvxMSDffVertPair mso_sptBentConnector2Vert[] = @@ -7981,13 +7981,13 @@ static const mso_CustomShape msoBentConnector2 = { const_cast(mso_sptBentConnector2Vert), SAL_N_ELEMENTS( mso_sptBentConnector2Vert ), const_cast(mso_sptBentConnector2Segm), sizeof( mso_sptBentConnector2Segm ) >> 1, - (SvxMSDffCalculationData*)NULL, 0, - (sal_Int32*)NULL, + nullptr, 0, + nullptr, NULL, 0, 21600, 21600, MIN_INT32, MIN_INT32, NULL, 0, - (SvxMSDffHandle*)NULL, 0 + nullptr, 0 }; static const SvxMSDffVertPair mso_sptBentConnector3Vert[] = @@ -8121,13 +8121,13 @@ static const mso_CustomShape msoCurvedConnector2 = { const_cast(mso_sptCurvedConnector2Vert), SAL_N_ELEMENTS( mso_sptCurvedConnector2Vert ), const_cast(mso_sptCurvedConnector2Segm), sizeof( mso_sptCurvedConnector2Segm ) >> 1, - (SvxMSDffCalculationData*)NULL, 0, - (sal_Int32*)NULL, + nullptr, 0, + nullptr, NULL, 0, 21600, 21600, MIN_INT32, MIN_INT32, NULL, 0, - (SvxMSDffHandle*)NULL, 0 + nullptr, 0 }; static const SvxMSDffVertPair mso_sptCurvedConnector3Vert[] = diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index 11b53ab40a52..b4b8bea78f7d 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -260,7 +260,7 @@ Svx3DLightControl::Svx3DLightControl(vcl::Window* pParent, WinBits nStyle) mpExpansionObject(0), mpLampBottomObject(0), mpLampShaftObject(0), - maLightObjects(MAX_NUMBER_LIGHTS, (E3dObject*)0), + maLightObjects(MAX_NUMBER_LIGHTS, nullptr), mfRotateX(-20.0), mfRotateY(45.0), mfRotateZ(0.0), diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index e3f1ab32cfba..69b0f0bd21a1 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -916,7 +916,7 @@ RecoveryDialog::RecoveryDialog(vcl::Window* pParent, RecoveryCore* pCore) sName += "\t"; sName += impl_getStatusString( rInfo ); SvTreeListEntry* pEntry = m_pFileListLB->InsertEntry(sName, rInfo.StandardImage, rInfo.StandardImage); - pEntry->SetUserData((void*)&rInfo); + pEntry->SetUserData(const_cast(&rInfo)); } // mark first item @@ -1313,7 +1313,7 @@ void BrokenRecoveryDialog::impl_refresh() m_bExecutionNeeded = true; sal_uInt16 nPos = m_pFileListLB->InsertEntry(rInfo.DisplayName, rInfo.StandardImage ); - m_pFileListLB->SetEntryData( nPos, (void*)&rInfo ); + m_pFileListLB->SetEntryData( nPos, const_cast(&rInfo) ); } m_sSavePath.clear(); m_pOkBtn->GrabFocus(); diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index 43304c434fb1..aff8085fd907 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -203,8 +203,8 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj ) // clipped on CanvasPane aDrawRect.Intersection( aClipRect ); - pSdrObj = (SdrObject*) new SdrRectObj( aDrawRect ); - pCloneIMapObj.reset((IMapObject*) new IMapRectangleObject( *pIMapRectObj )); + pSdrObj = static_cast(new SdrRectObj( aDrawRect )); + pCloneIMapObj.reset(static_cast(new IMapRectangleObject( *pIMapRectObj ))); } break; @@ -219,8 +219,8 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj ) // limited to CanvasPane aCircle.Intersection( aClipRect ); - pSdrObj = (SdrObject*) new SdrCircObj( OBJ_CIRC, aCircle, 0, 36000 ); - pCloneIMapObj.reset((IMapObject*) new IMapCircleObject( *pIMapCircleObj )); + pSdrObj = static_cast(new SdrCircObj( OBJ_CIRC, aCircle, 0, 36000 )); + pCloneIMapObj.reset(static_cast(new IMapCircleObject( *pIMapCircleObj ))); } break; @@ -236,7 +236,7 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj ) // clipped on CanvasPane aDrawRect.Intersection( aClipRect ); - pSdrObj = (SdrObject*) new SdrCircObj( OBJ_CIRC, aDrawRect, 0, 36000 ); + pSdrObj = static_cast(new SdrCircObj( OBJ_CIRC, aDrawRect, 0, 36000 )); } else { @@ -248,10 +248,10 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj ) basegfx::B2DPolygon aPolygon; aPolygon.append(aDrawPoly.getB2DPolygon()); - pSdrObj = (SdrObject*)new SdrPathObj(OBJ_POLY, basegfx::B2DPolyPolygon(aPolygon)); + pSdrObj = static_cast(new SdrPathObj(OBJ_POLY, basegfx::B2DPolyPolygon(aPolygon))); } - pCloneIMapObj.reset((IMapObject*) new IMapPolygonObject( *pIMapPolyObj )); + pCloneIMapObj.reset(static_cast(new IMapPolygonObject( *pIMapPolyObj ))); } break; diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index 29378409c3cf..b01c1f5d3c81 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -1131,7 +1131,7 @@ void FmGridControl::DeleteSelectedRows() return; // try to confirm the delete - Reference< ::com::sun::star::frame::XDispatchProvider > xDispatcher = (::com::sun::star::frame::XDispatchProvider*)GetPeer(); + Reference< ::com::sun::star::frame::XDispatchProvider > xDispatcher = static_cast(GetPeer()); if (xDispatcher.is()) { ::com::sun::star::util::URL aUrl; diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 48bd74eccf9d..db32ea8b5868 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -1649,7 +1649,7 @@ void FmXGridPeer::setColumns(const Reference< XIndexContainer >& Columns) throw( Reference< XReset > xColumnReset(m_xColumns, UNO_QUERY); if (xColumnReset.is()) - xColumnReset->removeResetListener((XResetListener*)this); + xColumnReset->removeResetListener(static_cast(this)); } if (Columns.is()) { @@ -1668,7 +1668,7 @@ void FmXGridPeer::setColumns(const Reference< XIndexContainer >& Columns) throw( Reference< XReset > xColumnReset(Columns, UNO_QUERY); if (xColumnReset.is()) - xColumnReset->addResetListener((XResetListener*)this); + xColumnReset->addResetListener(static_cast(this)); } m_xColumns = Columns; if (pGrid) @@ -2411,7 +2411,7 @@ void FmXGridPeer::columnVisible(DbGridColumn* pColumn) sal_Int32 _nIndex = pGrid->GetModelColumnPos(pColumn->GetId()); Reference< ::com::sun::star::awt::XControl > xControl(pColumn->GetCell()); ContainerEvent aEvt; - aEvt.Source = (XContainer*)this; + aEvt.Source = static_cast(this); aEvt.Accessor <<= _nIndex; aEvt.Element <<= xControl; @@ -2426,7 +2426,7 @@ void FmXGridPeer::columnHidden(DbGridColumn* pColumn) sal_Int32 _nIndex = pGrid->GetModelColumnPos(pColumn->GetId()); Reference< ::com::sun::star::awt::XControl > xControl(pColumn->GetCell()); ContainerEvent aEvt; - aEvt.Source = (XContainer*)this; + aEvt.Source = static_cast(this); aEvt.Accessor <<= _nIndex; aEvt.Element <<= xControl; @@ -2489,12 +2489,12 @@ void FmXGridPeer::registerDispatchProviderInterceptor(const Reference< ::com::su else { // it is the first interceptor; set ourself as slave - _xInterceptor->setSlaveDispatchProvider((::com::sun::star::frame::XDispatchProvider*)this); + _xInterceptor->setSlaveDispatchProvider(static_cast(this)); } // we are the master of the chain's first interceptor m_xFirstDispatchInterceptor = _xInterceptor; - m_xFirstDispatchInterceptor->setMasterDispatchProvider((::com::sun::star::frame::XDispatchProvider*)this); + m_xFirstDispatchInterceptor->setMasterDispatchProvider(static_cast(this)); // we have a new interceptor and we're alive ? if (!isDesignMode()) @@ -2539,13 +2539,13 @@ void FmXGridPeer::releaseDispatchProviderInterceptor(const Reference< ::com::sun xMaster->setSlaveDispatchProvider(Reference< ::com::sun::star::frame::XDispatchProvider >::query(xSlave)); else // it's the first interceptor of the chain, set ourself as slave - xMaster->setSlaveDispatchProvider((::com::sun::star::frame::XDispatchProvider*)this); + xMaster->setSlaveDispatchProvider(static_cast(this)); } else { // the chain's first element was removed, set ourself as new master of the second one if (xSlave.is()) - xSlave->setMasterDispatchProvider((::com::sun::star::frame::XDispatchProvider*)this); + xSlave->setMasterDispatchProvider(static_cast(this)); } } @@ -2722,10 +2722,10 @@ void FmXGridPeer::UpdateDispatches() if (xNewDispatch != m_pDispatchers[i]) { if (m_pDispatchers[i].is()) - m_pDispatchers[i]->removeStatusListener((::com::sun::star::frame::XStatusListener*)this, *pSupportedURLs); + m_pDispatchers[i]->removeStatusListener(static_cast(this), *pSupportedURLs); m_pDispatchers[i] = xNewDispatch; if (m_pDispatchers[i].is()) - m_pDispatchers[i]->addStatusListener((::com::sun::star::frame::XStatusListener*)this, *pSupportedURLs); + m_pDispatchers[i]->addStatusListener(static_cast(this), *pSupportedURLs); } if (m_pDispatchers[i].is()) ++nDispatchersGot; @@ -2764,7 +2764,7 @@ void FmXGridPeer::ConnectToDispatcher() m_pDispatchers[i] = queryDispatch(*pSupportedURLs, OUString(), 0); if (m_pDispatchers[i].is()) { - m_pDispatchers[i]->addStatusListener((::com::sun::star::frame::XStatusListener*)this, *pSupportedURLs); + m_pDispatchers[i]->addStatusListener(static_cast(this), *pSupportedURLs); ++nDispatchersGot; } } @@ -2790,7 +2790,7 @@ void FmXGridPeer::DisConnectFromDispatcher() for (sal_Int32 i=0; iremoveStatusListener((::com::sun::star::frame::XStatusListener*)this, *pSupportedURLs); + m_pDispatchers[i]->removeStatusListener(static_cast(this), *pSupportedURLs); } delete[] m_pStateCache; diff --git a/svx/source/fmcomp/gridcols.cxx b/svx/source/fmcomp/gridcols.cxx index 0f4669279431..23f3de93b60c 100644 --- a/svx/source/fmcomp/gridcols.cxx +++ b/svx/source/fmcomp/gridcols.cxx @@ -58,7 +58,7 @@ namespace sal_Int32 lcl_findPos(const OUString& aStr, const Sequence< OUString>& rList) { const OUString* pStrList = rList.getConstArray(); - OUString* pResult = static_cast(bsearch(&aStr, (void*)pStrList, rList.getLength(), sizeof(OUString), + OUString* pResult = static_cast(bsearch(&aStr, static_cast(pStrList), rList.getLength(), sizeof(OUString), &NameCompare)); if (pResult) diff --git a/svx/source/form/fmdpage.cxx b/svx/source/form/fmdpage.cxx index 73bbae161c87..83311247c4a9 100644 --- a/svx/source/form/fmdpage.cxx +++ b/svx/source/form/fmdpage.cxx @@ -84,7 +84,7 @@ SdrObject *SvxFmDrawPage::_CreateSdrObject( const ::com::sun::star::uno::Referen { if( FmFormInventor == pObj->GetObjInventor() ) { - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape = (SvxShape*)new SvxShapeControl( pObj ); + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape = static_cast(new SvxShapeControl( pObj )); return xShape; } else diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 574e935e23a9..0d0312ee0f54 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -768,11 +768,11 @@ void SAL_CALL FmXFormShell::disposing(const lang::EventObject& e) throw( Runtime Reference< runtime::XFormController > xFormController( m_xExternalViewController, UNO_QUERY ); OSL_ENSURE( xFormController.is(), "FmXFormShell::disposing: invalid external view controller!" ); if (xFormController.is()) - xFormController->removeActivateListener((XFormControllerListener*)this); + xFormController->removeActivateListener(static_cast(this)); Reference< ::com::sun::star::lang::XComponent> xComp(m_xExternalViewController, UNO_QUERY); if (xComp.is()) - xComp->removeEventListener((XEventListener*)(XPropertyChangeListener*)this); + xComp->removeEventListener(static_cast(static_cast(this))); m_xExternalViewController = NULL; m_xExternalDisplayedForm = NULL; @@ -1830,9 +1830,9 @@ void FmXFormShell::impl_switchActiveControllerListening( const bool _bListen ) return; if ( _bListen ) - xComp->addEventListener( (XFormControllerListener*)this ); + xComp->addEventListener( static_cast(this) ); else - xComp->removeEventListener( (XFormControllerListener*)this ); + xComp->removeEventListener( static_cast(this) ); } @@ -3195,7 +3195,7 @@ void FmXFormShell::CreateExternalView() m_xExternalViewController = xExternalViewFrame->getController(); Reference< ::com::sun::star::lang::XComponent> xComp(m_xExternalViewController, UNO_QUERY); if (xComp.is()) - xComp->addEventListener((XEventListener*)(XPropertyChangeListener*)this); + xComp->addEventListener(static_cast(static_cast(this))); } } else @@ -3525,7 +3525,7 @@ void FmXFormShell::CreateExternalView() Reference< runtime::XFormController > xFormController( m_xExternalViewController, UNO_QUERY ); OSL_ENSURE( xFormController.is(), "FmXFormShell::CreateExternalView:: invalid external view controller!" ); if (xFormController.is()) - xFormController->addActivateListener((XFormControllerListener*)this); + xFormController->addActivateListener(static_cast(this)); } } #ifdef DBG_UTIL diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx index 9d4db969a7a5..f747bca84fb9 100644 --- a/svx/source/form/fmsrcimp.cxx +++ b/svx/source/form/fmsrcimp.cxx @@ -103,7 +103,7 @@ FmRecordCountListener::FmRecordCountListener(const Reference< ::com::sun::star:: return; } - m_xListening->addPropertyChangeListener(FM_PROP_ROWCOUNT, (::com::sun::star::beans::XPropertyChangeListener*)this); + m_xListening->addPropertyChangeListener(FM_PROP_ROWCOUNT, static_cast(this)); } @@ -128,7 +128,7 @@ FmRecordCountListener::~FmRecordCountListener() void FmRecordCountListener::DisConnect() { if(m_xListening.is()) - m_xListening->removePropertyChangeListener(FM_PROP_ROWCOUNT, (::com::sun::star::beans::XPropertyChangeListener*)this); + m_xListening->removePropertyChangeListener(FM_PROP_ROWCOUNT, static_cast(this)); m_xListening = NULL; } diff --git a/svx/source/form/formdispatchinterceptor.cxx b/svx/source/form/formdispatchinterceptor.cxx index 8e11b18ae175..16e774f20373 100644 --- a/svx/source/form/formdispatchinterceptor.cxx +++ b/svx/source/form/formdispatchinterceptor.cxx @@ -55,7 +55,7 @@ namespace svxform osl_atomic_increment(&m_refCount); if (_rxToIntercept.is()) { - _rxToIntercept->registerDispatchProviderInterceptor((XDispatchProviderInterceptor*)this); + _rxToIntercept->registerDispatchProviderInterceptor(static_cast(this)); // this should make us the top-level dispatch-provider for the component, via a call to our // setDispatchProvider we should have got an fallback for requests we (i.e. our master) cannot fulfill Reference< XComponent> xInterceptedComponent(_rxToIntercept, UNO_QUERY); diff --git a/svx/source/form/navigatortreemodel.cxx b/svx/source/form/navigatortreemodel.cxx index f00b331e84ce..bcd0d654844c 100644 --- a/svx/source/form/navigatortreemodel.cxx +++ b/svx/source/form/navigatortreemodel.cxx @@ -233,7 +233,7 @@ namespace svxform { Reference< css::form::XForms > xForms( GetForms()); if(xForms.is()) - xForms->removeContainerListener((XContainerListener*)m_pPropChangeList); + xForms->removeContainerListener(static_cast(m_pPropChangeList)); // delete RootList @@ -334,7 +334,7 @@ namespace svxform { Reference< XContainer > xContainer(xElement, UNO_QUERY); if (xContainer.is()) - xContainer->addContainerListener((XContainerListener*)m_pPropChangeList); + xContainer->addContainerListener(static_cast(m_pPropChangeList)); } if (pFolder) @@ -471,7 +471,7 @@ namespace svxform Reference< XContainer > xContainer( pFormData->GetContainer() ); if (xContainer.is()) - xContainer->removeContainerListener((XContainerListener*)m_pPropChangeList); + xContainer->removeContainerListener(static_cast(m_pPropChangeList)); } @@ -706,7 +706,7 @@ namespace svxform } // is shell gone? else if ( dynamic_cast(&rHint) && static_cast(&rHint)->GetId() == SFX_HINT_DYING) - UpdateContent((FmFormShell*)NULL); + UpdateContent(nullptr); // changed mark of controls? else if (dynamic_cast(&rHint)) @@ -836,7 +836,7 @@ namespace svxform Clear(); if (xForms.is()) { - xForms->addContainerListener((XContainerListener*)m_pPropChangeList); + xForms->addContainerListener(static_cast(m_pPropChangeList)); FillBranch(NULL); diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index e0328b4f7d7c..90715b7bcfee 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -1207,9 +1207,9 @@ void GalleryBrowser2::Execute( sal_uInt16 nId ) switch( GetMode() ) { - case( GALLERYBROWSERMODE_ICON ): pWindow = (vcl::Window*) mpIconView; break; - case( GALLERYBROWSERMODE_LIST ): pWindow = (vcl::Window*) mpListView; break; - case( GALLERYBROWSERMODE_PREVIEW ): pWindow = (vcl::Window*) mpPreview; break; + case( GALLERYBROWSERMODE_ICON ): pWindow = static_cast(mpIconView); break; + case( GALLERYBROWSERMODE_LIST ): pWindow = static_cast(mpListView); break; + case( GALLERYBROWSERMODE_PREVIEW ): pWindow = static_cast(mpPreview); break; default: pWindow = NULL; diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index d4d44dbf2af2..b63d7fd87d2d 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -535,7 +535,7 @@ void GalleryTheme::Actualize( const Link<>& rActualizeLink, GalleryProgress* pPr const INetURLObject aURL( pEntry->aURL ); - rActualizeLink.Call( (void*) &aURL ); + rActualizeLink.Call( const_cast(&aURL) ); // SvDraw objects will be updated later if( pEntry->eObjKind != SGA_OBJ_SVDRAW ) @@ -558,11 +558,11 @@ void GalleryTheme::Actualize( const Link<>& rActualizeLink, GalleryProgress* pPr boost::scoped_ptr pNewObj; if ( SGA_OBJ_INET == pEntry->eObjKind ) - pNewObj.reset((SgaObject*) new SgaObjectINet( aGraphic, aURL, aFormat )); + pNewObj.reset(static_cast(new SgaObjectINet( aGraphic, aURL, aFormat ))); else if ( aGraphic.IsAnimated() ) - pNewObj.reset((SgaObject*) new SgaObjectAnim( aGraphic, aURL, aFormat )); + pNewObj.reset(static_cast(new SgaObjectAnim( aGraphic, aURL, aFormat ))); else - pNewObj.reset((SgaObject*) new SgaObjectBmp( aGraphic, aURL, aFormat )); + pNewObj.reset(static_cast(new SgaObjectBmp( aGraphic, aURL, aFormat ))); if( !InsertObject( *pNewObj ) ) pEntry->mbDelete = true; @@ -1111,15 +1111,15 @@ bool GalleryTheme::InsertURL( const INetURLObject& rURL, sal_uIntPtr nInsertPos if( nImportRet != GalleryGraphicImportRet::IMPORT_NONE ) { if ( GalleryGraphicImportRet::IMPORT_INET == nImportRet ) - pNewObj.reset((SgaObject*) new SgaObjectINet( aGraphic, rURL, aFormat )); + pNewObj.reset(static_cast(new SgaObjectINet( aGraphic, rURL, aFormat ))); else if ( aGraphic.IsAnimated() ) - pNewObj.reset((SgaObject*) new SgaObjectAnim( aGraphic, rURL, aFormat )); + pNewObj.reset(static_cast(new SgaObjectAnim( aGraphic, rURL, aFormat ))); else - pNewObj.reset((SgaObject*) new SgaObjectBmp( aGraphic, rURL, aFormat )); + pNewObj.reset(static_cast(new SgaObjectBmp( aGraphic, rURL, aFormat ))); } #if HAVE_FEATURE_AVMEDIA else if( ::avmedia::MediaWindow::isMediaURL( rURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ), ""/*TODO?*/ ) ) - pNewObj.reset((SgaObject*) new SgaObjectSound( rURL )); + pNewObj.reset(static_cast(new SgaObjectSound( rURL ))); #endif if( pNewObj && InsertObject( *pNewObj, nInsertPos ) ) bRet = true; diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx index 2e97cb78026c..b5c0d5884ca1 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -702,7 +702,7 @@ bool SdrCreateView::EndCreateObj(SdrCreateCmd eCmd) SdrTextObj* pText=PTR_CAST(SdrTextObj,pObjMerk); if (pText!=NULL && pText->IsTextFrame()) { - SdrBeginTextEdit(pText, pPVMerk, (vcl::Window*)0L, true, (SdrOutliner*)0L, (OutlinerView*)0L); + SdrBeginTextEdit(pText, pPVMerk, nullptr, true, nullptr, nullptr); } } } diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx index 5e0fa262570d..98ac8ee6d9a4 100644 --- a/svx/source/svdraw/svdibrow.cxx +++ b/svx/source/svdraw/svdibrow.cxx @@ -370,7 +370,7 @@ sal_uIntPtr _SdrItemBrowserControl::GetCurrentPos() const { sal_uIntPtr nRet=CONTAINER_ENTRY_NOTFOUND; if (GetSelectRowCount()==1) { - long nPos=((BrowseBox*)this)->FirstSelectedRow(); + long nPos=static_cast(const_cast<_SdrItemBrowserControl *>(this))->FirstSelectedRow(); if (nPos>=0 && (sal_uIntPtr)nPos(pFact.get())); pObj = pFact->pNewObj; i++; } diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index ed8c82003ca0..430518f183f5 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -725,7 +725,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const XPolygon& rTrack0, SdrObjConnection& const SfxItemSet& rSet = GetObjectItemSet(); if (bCon1) { - if (rCon1.pObj==(SdrObject*)this) + if (rCon1.pObj==static_cast(this)) { // check, just in case aBoundRect1=aOutRect; @@ -750,7 +750,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const XPolygon& rTrack0, SdrObjConnection& aBewareRect1=aBoundRect1; } if (bCon2) { - if (rCon2.pObj==(SdrObject*)this) { // check, just in case + if (rCon2.pObj==static_cast(this)) { // check, just in case aBoundRect2=aOutRect; } else @@ -2124,7 +2124,7 @@ bool SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrO no--; SdrObject* pObj=pOL->GetObj(no); if (rVisLayer.IsSet(pObj->GetLayer()) && pObj->IsVisible() && // only visible objects - (pThis==NULL || pObj!=(SdrObject*)pThis) && // don't connect it to itself + (pThis==NULL || pObj!=static_cast(pThis)) && // don't connect it to itself pObj->IsNode()) { Rectangle aObjBound(pObj->GetCurrentBoundRect()); diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 1fe09ee5b237..75e54323fbf9 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -1403,13 +1403,13 @@ Reference< XInputStream > SdrGrafObj::getInputStream() Graphic aGraphic( GetGraphic() ); GfxLink aLink( aGraphic.GetLink() ); sal_uInt32 nSize = aLink.GetDataSize(); - const void* pSourceData = (const void*)aLink.GetData(); + const void* pSourceData = static_cast(aLink.GetData()); if( nSize && pSourceData ) { sal_uInt8 * pBuffer = new sal_uInt8[ nSize ]; memcpy( pBuffer, pSourceData, nSize ); - SvMemoryStream* pStream = new SvMemoryStream( (void*)pBuffer, (sal_Size)nSize, StreamMode::READ ); + SvMemoryStream* pStream = new SvMemoryStream( static_cast(pBuffer), (sal_Size)nSize, StreamMode::READ ); pStream->ObjectOwnsMemory( true ); xStream.set( new utl::OInputStreamWrapper( pStream, true ) ); } diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index d4564c66b69c..bf80995535cc 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -822,7 +822,7 @@ bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt) if (eHit==SDRHIT_TEXTEDIT) { bool bRet2(pActualOutDev && OUTDEV_WINDOW == pActualOutDev->GetOutDevType() && - SdrBeginTextEdit(rVEvt.pObj, rVEvt.pPV, const_cast(static_cast(pActualOutDev.get())), false, (SdrOutliner*)0L)); + SdrBeginTextEdit(rVEvt.pObj, rVEvt.pPV, const_cast(static_cast(pActualOutDev.get())), false, nullptr)); if(bRet2) { @@ -858,7 +858,7 @@ bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt) bUnmark=nCount1GetOutDevType()&& - SdrBeginTextEdit(rVEvt.pObj, rVEvt.pPV, const_cast(static_cast(pActualOutDev.get())), false, (SdrOutliner*)0L); + SdrBeginTextEdit(rVEvt.pObj, rVEvt.pPV, const_cast(static_cast(pActualOutDev.get())), false, nullptr); if(bRet) { diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 2e668f259519..4601f4377dd3 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -2502,7 +2502,7 @@ void SvxFontNameToolBoxControl::StateChanged( if ( SfxItemState::DISABLED == eState ) { pBox->Disable(); - pBox->Update( (const SvxFontItem*)NULL ); + pBox->Update( nullptr ); } else { diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx index 95a3a32a0feb..5f0cbdcac71c 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx @@ -86,7 +86,7 @@ public: static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL create( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext) throw(::com::sun::star::uno::Exception) { - return (::cppu::OWeakObject *)new ChineseTranslation_UnoDialog( xContext ); + return static_cast(new ChineseTranslation_UnoDialog( xContext )); } // lang::XInitialization diff --git a/svx/source/unodraw/UnoNamespaceMap.cxx b/svx/source/unodraw/UnoNamespaceMap.cxx index a3b135350db5..f8f0d41396de 100644 --- a/svx/source/unodraw/UnoNamespaceMap.cxx +++ b/svx/source/unodraw/UnoNamespaceMap.cxx @@ -73,7 +73,7 @@ namespace svx Reference< XInterface > SAL_CALL NamespaceMap_createInstance( sal_uInt16* pWhichIds, SfxItemPool* pPool ) { - return (XWeak*)new NamespaceMap( pWhichIds, pPool ); + return static_cast(new NamespaceMap( pWhichIds, pPool )); } Sequence< OUString > SAL_CALL NamespaceMap_getSupportedServiceNames() diff --git a/svx/source/unodraw/XPropertyTable.cxx b/svx/source/unodraw/XPropertyTable.cxx index aac26c4a4ecc..cda985d819ce 100644 --- a/svx/source/unodraw/XPropertyTable.cxx +++ b/svx/source/unodraw/XPropertyTable.cxx @@ -262,7 +262,7 @@ public: uno::Reference< uno::XInterface > SAL_CALL SvxUnoXColorTable_createInstance( XPropertyList* pList ) throw() { - return (OWeakObject*) new SvxUnoXColorTable( pList ); + return static_cast(new SvxUnoXColorTable( pList )); } // SvxUnoXPropertyTable @@ -324,7 +324,7 @@ public: uno::Reference< uno::XInterface > SAL_CALL SvxUnoXLineEndTable_createInstance( XPropertyList* pTable ) throw() { - return (OWeakObject*)new SvxUnoXLineEndTable( pTable ); + return static_cast(new SvxUnoXLineEndTable( pTable )); } // SvxUnoXPropertyTable @@ -397,7 +397,7 @@ public: uno::Reference< uno::XInterface > SAL_CALL SvxUnoXDashTable_createInstance( XPropertyList* pTable ) throw() { - return (OWeakObject*)new SvxUnoXDashTable( pTable ); + return static_cast(new SvxUnoXDashTable( pTable )); } // SvxUnoXPropertyTable @@ -478,7 +478,7 @@ public: uno::Reference< uno::XInterface > SAL_CALL SvxUnoXHatchTable_createInstance( XPropertyList* pTable ) throw() { - return (OWeakObject*)new SvxUnoXHatchTable( pTable ); + return static_cast(new SvxUnoXHatchTable( pTable )); } // SvxUnoXPropertyTable @@ -554,7 +554,7 @@ public: uno::Reference< uno::XInterface > SAL_CALL SvxUnoXGradientTable_createInstance( XPropertyList* pTable ) throw() { - return (OWeakObject*)new SvxUnoXGradientTable( pTable ); + return static_cast(new SvxUnoXGradientTable( pTable )); } // SvxUnoXPropertyTable @@ -642,7 +642,7 @@ public: uno::Reference< uno::XInterface > SAL_CALL SvxUnoXBitmapTable_createInstance( XPropertyList* pTable ) throw() { - return (OWeakObject*)new SvxUnoXBitmapTable( pTable ); + return static_cast(new SvxUnoXBitmapTable( pTable )); } // SvxUnoXPropertyTable diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx index 661ffa4827d7..2366f55b9a4b 100644 --- a/svx/source/unodraw/unomod.cxx +++ b/svx/source/unodraw/unomod.cxx @@ -177,7 +177,7 @@ css::uno::Reference create( sal_uInt16 nT = (sal_uInt16)(nType & ~E3D_INVENTOR_FLAG); sal_uInt32 nI = (nType & E3D_INVENTOR_FLAG)?E3dInventor:SdrInventor; - return uno::Reference< uno::XInterface >( (drawing::XShape*) SvxDrawPage::CreateShapeByTypeAndInventor( nT, nI, 0, 0, referer ) ); + return uno::Reference< uno::XInterface >( static_cast(SvxDrawPage::CreateShapeByTypeAndInventor( nT, nI, 0, 0, referer )) ); } } else if ( rServiceSpecifier == "com.sun.star.document.ImportGraphicObjectResolver" ) @@ -345,7 +345,7 @@ uno::Reference< drawing::XDrawPages > SAL_CALL SvxUnoDrawingModel::getDrawPages( uno::Reference< drawing::XDrawPages > xDrawPages( mxDrawPagesAccess ); if( !xDrawPages.is() ) - mxDrawPagesAccess = xDrawPages = (drawing::XDrawPages*)new SvxUnoDrawPagesAccess(*this); + mxDrawPagesAccess = xDrawPages = static_cast(new SvxUnoDrawPagesAccess(*this)); return xDrawPages; } @@ -414,7 +414,7 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawingModel::createInstance( c if( aServiceSpecifier == "com.sun.star.text.TextField.DateTime" ) { - return (::cppu::OWeakObject * )new SvxUnoTextField(text::textfield::Type::DATE); + return static_cast(new SvxUnoTextField(text::textfield::Type::DATE)); } uno::Reference< uno::XInterface > xRet; @@ -504,7 +504,7 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawingModel::createInstance( c if( pShape ) pShape->SetShapeType(aServiceSpecifier); - xRet = (uno::XWeak*)pShape; + xRet = static_cast(pShape); } else { @@ -621,9 +621,9 @@ uno::Any SAL_CALL SvxUnoDrawPagesAccess::getByIndex( sal_Int32 Index ) if( !xPage.is() ) { if( PTR_CAST( FmFormModel, mrModel.mpDoc ) ) - xPage = (drawing::XDrawPage*)new SvxFmDrawPage( pPage ); + xPage = static_cast(new SvxFmDrawPage( pPage )); else - xPage = (drawing::XDrawPage*)new SvxDrawPage( pPage ); + xPage = static_cast(new SvxDrawPage( pPage )); pPage->mxUnoPage = xPage; } diff --git a/svx/source/unodraw/unomtabl.cxx b/svx/source/unodraw/unomtabl.cxx index 054755145755..67c3998bde6f 100644 --- a/svx/source/unodraw/unomtabl.cxx +++ b/svx/source/unodraw/unomtabl.cxx @@ -93,7 +93,7 @@ public: SvxUnoMarkerTable::SvxUnoMarkerTable( SdrModel* pModel ) throw() : mpModel( pModel ), - mpModelPool( pModel ? &pModel->GetItemPool() : (SfxItemPool*)NULL ) + mpModelPool( pModel ? &pModel->GetItemPool() : nullptr ) { if( pModel ) StartListening( *pModel ); diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index 97e93817f94b..f0a125e7704c 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -141,7 +141,7 @@ void SvxDrawPage::dispose() // Create an event with this as sender try { - uno::Reference< uno::XInterface > xSource( uno::Reference< uno::XInterface >::query( (lang::XComponent *)this ) ); + uno::Reference< uno::XInterface > xSource( uno::Reference< uno::XInterface >::query( static_cast(this) ) ); ::com::sun::star::document::EventObject aEvt; aEvt.Source = xSource; // inform all listeners to release this object diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index c24737d9251b..f516aaf6d61d 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -652,7 +652,7 @@ void SvxShape::ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet) if(mpObj.is() && rPropSet.AreThereOwnUsrAnys() && mpModel) { SfxItemSet aSet( mpModel->GetItemPool(), SDRATTR_START, SDRATTR_END); - Reference< beans::XPropertySet > xShape( (OWeakObject*)this, UNO_QUERY ); + Reference< beans::XPropertySet > xShape( static_cast(this), UNO_QUERY ); SvxItemPropertySet_ObtainSettingsFromPropertySet(rPropSet, aSet, xShape, &mpPropSet->getPropertyMap() ); mpObj->SetMergedItemSetAndBroadcast(aSet); @@ -1303,7 +1303,7 @@ void SAL_CALL SvxShape::dispose() throw(uno::RuntimeException, std::exception) mpImpl->mbDisposing = true; lang::EventObject aEvt; - aEvt.Source = *(OWeakAggObject*) this; + aEvt.Source = *static_cast(this); mpImpl->maDisposeListeners.disposeAndClear(aEvt); mpImpl->maPropertyNotifier.disposing(); diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx index ac932c2572a2..20133ca6faf1 100644 --- a/svx/source/unodraw/unoshcol.cxx +++ b/svx/source/unodraw/unoshcol.cxx @@ -102,7 +102,7 @@ void SvxShapeCollection::release() throw() { if (! mrBHelper.bDisposed) { - uno::Reference< uno::XInterface > xHoldAlive( (uno::XWeak*)this ); + uno::Reference< uno::XInterface > xHoldAlive( static_cast(this) ); // First dispose try { @@ -159,7 +159,7 @@ void SvxShapeCollection::dispose() // Create an event with this as sender try { - uno::Reference< uno::XInterface > xSource( uno::Reference< uno::XInterface >::query( (lang::XComponent *)this ) ); + uno::Reference< uno::XInterface > xSource( uno::Reference< uno::XInterface >::query( static_cast(this) ) ); document::EventObject aEvt; aEvt.Source = xSource; // inform all listeners to release this object diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx index 348f9a0c7791..b6577ae08648 100644 --- a/svx/source/unodraw/unoshtxt.cxx +++ b/svx/source/unodraw/unoshtxt.cxx @@ -820,7 +820,7 @@ SvxEditViewForwarder* SvxTextEditSourceImpl::GetEditViewForwarder( bool bCreate // enter edit mode mpView->SdrEndTextEdit(); - if(mpView->SdrBeginTextEdit(mpObject, 0L, 0L, false, (SdrOutliner*)0L, 0L, false, false)) + if(mpView->SdrBeginTextEdit(mpObject, 0L, 0L, false, nullptr, 0L, false, false)) { SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, mpObject ); if (pTextObj && pTextObj->IsTextEditActive()) -- cgit