diff options
41 files changed, 56 insertions, 56 deletions
diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx index deb5ca1c723f..2077fcdf874b 100644 --- a/accessibility/source/standard/vclxaccessiblelist.cxx +++ b/accessibility/source/standard/vclxaccessiblelist.cxx @@ -347,7 +347,7 @@ void VCLXAccessibleList::ProcessWindowEvent (const VclWindowEvent& rVclWindowEve { // Create a reference to this object to prevent an early release of the // listbox (VclEventId::ObjectDying). - Reference< XAccessible > xTemp = this; + Reference< XAccessible > xHoldAlive = this; switch ( rVclWindowEvent.GetId() ) { diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx index 1508cf0b5184..c456b93997b4 100644 --- a/accessibility/source/standard/vclxaccessibletoolbox.cxx +++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx @@ -495,7 +495,7 @@ void VCLXAccessibleToolBox::FillAccessibleStateSet( utl::AccessibleStateSetHelpe void VCLXAccessibleToolBox::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) { // to prevent an early release of the toolbox (VclEventId::ObjectDying) - Reference< XAccessibleContext > xTemp = this; + Reference< XAccessibleContext > xHoldAlive = this; switch ( rVclWindowEvent.GetId() ) { diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 310bc293dfdb..12f2e2bea8c2 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -1835,7 +1835,7 @@ bool StarBASIC::LoadData( SvStream& r, sal_uInt16 nVer ) else if( dynamic_cast<const SbJScriptModule*>( pMod) != nullptr ) { // assign Ref, so that pMod will be deleted - SbModuleRef xRef = pMod; + SbModuleRef xDeleteRef = pMod; } else { diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index e0b85995b406..45a83f4ec18b 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -2055,7 +2055,7 @@ ErrCode SbMethod::Call( SbxValue* pRet, SbxVariable* pCaller ) // Increment the RefCount of the module tools::SvRef<SbModule> pMod_ = static_cast<SbModule*>(GetParent()); - tools::SvRef<StarBASIC> pBasic = static_cast<StarBASIC*>(pMod_->GetParent()); + tools::SvRef<StarBASIC> xHolder = static_cast<StarBASIC*>(pMod_->GetParent()); // Establish the values to get the return value SbxValues aVals; diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 0f9f3dfc4fc1..a663dbed961f 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -3523,7 +3523,7 @@ SbxVariable* SbiRuntime::FindElement( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt } } // assign pElem to a Ref, to delete a temp-var if applicable - SbxVariableRef refTemp = pElem; + SbxVariableRef xDeleteRef = pElem; // remove potential rests of the last call of the SbxMethod // free Write before, so that there's no error @@ -3554,7 +3554,7 @@ SbxVariable* SbiRuntime::FindElement( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt // this if we actually have params following else if( bVBAEnabled && dynamic_cast<const SbUnoProperty*>( pElem) != nullptr && pElem->GetParameters() ) { - SbxVariableRef refTemp = pElem; + SbxVariableRef xDeleteRef = pElem; // dissolve the notify while copying variable SbxVariable* pNew = new SbxVariable( *pElem ); diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx index 431a5ae5e612..68fc41547714 100644 --- a/basic/source/sbx/sbxbase.cxx +++ b/basic/source/sbx/sbxbase.cxx @@ -210,7 +210,7 @@ SbxBase* SbxBase::Load( SvStream& rStrm ) if( !p->LoadCompleted() ) { // Deleting of the object - SbxBaseRef aRef( p ); + SbxBaseRef xDeleteRef( p ); p = nullptr; } } @@ -218,7 +218,7 @@ SbxBase* SbxBase::Load( SvStream& rStrm ) { rStrm.SetError( SVSTREAM_FILEFORMAT_ERROR ); // Deleting of the object - SbxBaseRef aRef( p ); + SbxBaseRef xDeleteRef( p ); p = nullptr; } } diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx index 6fc20984918a..7735c1757e1f 100644 --- a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx +++ b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx @@ -165,7 +165,7 @@ void CreationWizardUnoDlg::createDialogOnDemand() m_xParentWindow = xFrame->getContainerWindow(); } } - uno::Reference< XComponent > xComp( this ); + uno::Reference< XComponent > xKeepAlive( this ); if( m_xChartModel.is() ) { m_xDialog = std::make_unique<CreationWizard>(Application::GetFrameWeld(m_xParentWindow), m_xChartModel, m_xCC); diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx index 44d017618149..f548637e204a 100644 --- a/dbaccess/source/core/dataaccess/documentdefinition.cxx +++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx @@ -206,7 +206,7 @@ namespace dbaccess if ( !m_bInStateChange && nNewState == EmbedStates::RUNNING && nOldState == EmbedStates::ACTIVE && m_pDefinition ) { m_bInStateChange = true; - Reference<XInterface> xInt(static_cast< ::cppu::OWeakObject* >(m_pDefinition),UNO_QUERY); + Reference<XInterface> xHoldAlive(static_cast< ::cppu::OWeakObject* >(m_pDefinition),UNO_QUERY); { Reference<XEmbeddedObject> xEmbeddedObject(aEvent.Source,UNO_QUERY); if ( xEmbeddedObject.is() ) @@ -301,7 +301,7 @@ namespace dbaccess public: static void couple( const Reference< XInterface >& _rxClient, const Reference< XComponent >& _rxActor ) { - Reference< css::lang::XEventListener > xEnsureDelete( new LifetimeCoupler( _rxClient, _rxActor ) ); + new LifetimeCoupler( _rxClient, _rxActor ); } private: diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index df77168765b6..731cb6d4561e 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -568,9 +568,9 @@ bool SVGFilter::implExportImpressOrDraw( const Reference< XOutputStream >& rxOSt // mpSVGExport = new SVGExport( xDocHandler ); mpSVGExport = new SVGExport( xContext, xDocHandler, maFilterData ); - // xSVGExport is set up only to manage the life-time of the object pointed by mpSVGExport, + // xKeepAlive is set up only to manage the life-time of the object pointed by mpSVGExport, // and in order to prevent that it is destroyed when passed to AnimationExporter. - Reference< XInterface > xSVGExport = static_cast< css::document::XFilter* >( mpSVGExport ); + Reference< XInterface > xKeepAlive = static_cast< css::document::XFilter* >( mpSVGExport ); // create an id for each draw page for( const auto& rPage : mSelectedPages ) @@ -657,9 +657,9 @@ bool SVGFilter::implExportWriterOrCalc( const Reference< XOutputStream >& rxOStm // mpSVGExport = new SVGExport( xDocHandler ); mpSVGExport = new SVGExport( xContext, xDocHandler, maFilterData ); - // xSVGExport is set up only to manage the life-time of the object pointed by mpSVGExport, + // xKeepAlive is set up only to manage the life-time of the object pointed by mpSVGExport, // and in order to prevent that it is destroyed when passed to AnimationExporter. - Reference< XInterface > xSVGExport = static_cast< css::document::XFilter* >( mpSVGExport ); + Reference< XInterface > xKeepAlive = static_cast< css::document::XFilter* >( mpSVGExport ); try { diff --git a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx index 5ef1bb064193..6aad2f1f7323 100644 --- a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx +++ b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx @@ -277,7 +277,7 @@ sal_Int16 SAL_CALL XMLFilterDialogComponent::execute() bool bLaunch = false; if (!mxDialog) { - Reference< XComponent > xComp( this ); + Reference< XComponent > xKeepAlive( this ); mxDialog = std::make_shared<XMLFilterSettingsDialog>(Application::GetFrameWeld(mxParent), mxContext); bLaunch = true; } diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 5711fc1d36bc..b1cc795ad112 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -875,7 +875,7 @@ IMPL_LINK( MenuBarManager, Select, Menu *, pMenu, bool ) } // tdf#126054 don't let dispatch destroy this until after function completes - rtl::Reference<MenuBarManager> xRef(this); + rtl::Reference<MenuBarManager> xKeepAlive(this); if (xDispatch.is()) { SolarMutexReleaser aReleaser; diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 9e17204f3b7e..78a5c1198584 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -1610,7 +1610,7 @@ IMPL_LINK( ToolBarManager, MenuSelect, Menu*, pMenu, bool ) { // We have to hold a reference to ourself as it is possible that we will be disposed and // our refcount could be zero (destruction) otherwise. - Reference< XInterface > xInterface( static_cast< OWeakObject* >( this ), UNO_QUERY ); + Reference< XInterface > xKeepAlive( static_cast< OWeakObject* >( this ), UNO_QUERY ); { // The guard must be in its own context as the we can get destroyed when our diff --git a/package/source/xstor/ohierarchyholder.cxx b/package/source/xstor/ohierarchyholder.cxx index 76d8842fb497..58ec912869a2 100644 --- a/package/source/xstor/ohierarchyholder.cxx +++ b/package/source/xstor/ohierarchyholder.cxx @@ -205,7 +205,7 @@ void OHierarchyElement_Impl::RemoveStreamHierarchically( std::vector<OUString>& void OHierarchyElement_Impl::Commit() { - ::rtl::Reference< OHierarchyElement_Impl > aLocker( this ); + ::rtl::Reference< OHierarchyElement_Impl > xKeepAlive( this ); ::rtl::Reference< OHierarchyElement_Impl > aParent; uno::Reference< embed::XStorage > xOwnStor; @@ -226,7 +226,7 @@ void OHierarchyElement_Impl::Commit() void OHierarchyElement_Impl::TestForClosing() { - ::rtl::Reference< OHierarchyElement_Impl > aLocker( this ); + ::rtl::Reference< OHierarchyElement_Impl > xKeepAlive( this ); { ::osl::MutexGuard aGuard( m_aMutex ); diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 2310dc82716e..907cb9a8a7cc 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -150,7 +150,7 @@ void ScDocument::SetPrinter( VclPtr<SfxPrinter> const & pNewPrinter ) } else { - ScopedVclPtr<SfxPrinter> pOld( mpPrinter ); + ScopedVclPtr<SfxPrinter> xKeepAlive( mpPrinter ); mpPrinter = pNewPrinter; UpdateDrawPrinter(); mpPrinter->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() ); diff --git a/sc/source/core/tool/addinlis.cxx b/sc/source/core/tool/addinlis.cxx index 79eda256bb37..f4ff197f9209 100644 --- a/sc/source/core/tool/addinlis.cxx +++ b/sc/source/core/tool/addinlis.cxx @@ -122,7 +122,7 @@ void SAL_CALL ScAddInListener::modified( const css::sheet::ResultEvent& aEvent ) void SAL_CALL ScAddInListener::disposing( const css::lang::EventObject& /* Source */ ) { // hold a ref so this is not deleted at removeResultListener - uno::Reference<sheet::XResultListener> xRef( this ); + uno::Reference<sheet::XResultListener> xKeepAlive( this ); if ( xVolRes.is() ) { diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx index e0f7237c507b..30db54cff5ce 100644 --- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx @@ -60,7 +60,7 @@ ScAccessibleContextBase::~ScAccessibleContextBase() void ScAccessibleContextBase::Init() { // hold reference to make sure that the destructor is not called - uno::Reference< XAccessibleContext > xOwnContext(this); + uno::Reference< XAccessibleContext > xKeepAlive(this); if (mxParent.is()) { @@ -78,7 +78,7 @@ void SAL_CALL ScAccessibleContextBase::disposing() // CommitDefunc(); not necessary and should not be send, because it cost a lot of time // hold reference to make sure that the destructor is not called - uno::Reference< XAccessibleContext > xOwnContext(this); + uno::Reference< XAccessibleContext > xKeepAlive(this); if ( mnClientId ) { diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 8920c1503765..dc1cd9c1e754 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -3310,7 +3310,7 @@ void SAL_CALL ScCellRangesBase::removeModifyListener( const uno::Reference<util: if ( aRanges.empty() ) throw uno::RuntimeException(); - rtl::Reference<ScCellRangesBase> aSelfHold(this); // in case the listeners have the last ref + rtl::Reference<ScCellRangesBase> xSelfHold(this); // in case the listeners have the last ref sal_uInt16 nCount = aValueListeners.size(); for ( sal_uInt16 n=nCount; n--; ) diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 0301ca09a229..ab8ae531690e 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -3212,7 +3212,7 @@ void SAL_CALL ScChart2DataSequence::removeModifyListener( const uno::Reference< if (m_aTokens.empty()) return; - rtl::Reference<ScChart2DataSequence> aSelfHold(this); // in case the listeners have the last ref + rtl::Reference<ScChart2DataSequence> xSelfHold(this); // in case the listeners have the last ref sal_uInt16 nCount = m_aValueListeners.size(); for ( sal_uInt16 n=nCount; n--; ) diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index a0e0f3ea263f..c17908803c50 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -1215,7 +1215,7 @@ void SAL_CALL ScDataPilotTableObj::removeModifyListener( const uno::Reference<ut { SolarMutexGuard aGuard; - rtl::Reference<ScDataPilotTableObj> aSelfHold(this); // in case the listeners have the last ref + rtl::Reference<ScDataPilotTableObj> xSelfHold(this); // in case the listeners have the last ref sal_uInt16 nCount = aModifyListeners.size(); for ( sal_uInt16 n=nCount; n--; ) diff --git a/sd/source/filter/eppt/pptexsoundcollection.cxx b/sd/source/filter/eppt/pptexsoundcollection.cxx index c6ee37ddee2d..34e26bd354d0 100644 --- a/sd/source/filter/eppt/pptexsoundcollection.cxx +++ b/sd/source/filter/eppt/pptexsoundcollection.cxx @@ -93,7 +93,7 @@ void ExSoundEntry::Write( SvStream& rSt, sal_uInt32 nId ) const { try { - ::ucbhelper::Content aCnt( aSoundURL, + ::ucbhelper::Content aLoadContentIfExists( aSoundURL, css::uno::Reference< css::ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() ); diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 18b367aece04..74abf278ffc1 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -835,7 +835,7 @@ bool SlideshowImpl::startPreview( bool SlideshowImpl::startShow( PresentationSettingsEx const * pPresSettings ) { - const rtl::Reference<SlideshowImpl> this_(this); + const rtl::Reference<SlideshowImpl> xKeepAlive(this); DBG_ASSERT( !mxShow.is(), "sd::SlideshowImpl::startShow(), called twice!" ); if( mxShow.is() ) @@ -1661,7 +1661,7 @@ IMPL_LINK_NOARG(SlideshowImpl, updateHdl, Timer *, void) void SlideshowImpl::updateSlideShow() { // prevent me from deletion when recursing (App::EnableYieldMode does) - const rtl::Reference<SlideshowImpl> this_(this); + const rtl::Reference<SlideshowImpl> xKeepAlive(this); Reference< XSlideShow > xShow( mxShow ); if ( ! xShow.is()) diff --git a/sd/source/ui/slideshow/slideshowviewimpl.cxx b/sd/source/ui/slideshow/slideshowviewimpl.cxx index 71a9ddf4fc0b..b1c5fb52fa0c 100644 --- a/sd/source/ui/slideshow/slideshowviewimpl.cxx +++ b/sd/source/ui/slideshow/slideshowviewimpl.cxx @@ -487,7 +487,7 @@ void SlideShowView::updateimpl( ::osl::ClearableMutexGuard& rGuard, SlideshowImp if( !pSlideShow ) return; - ::rtl::Reference< SlideshowImpl > aSLGuard( pSlideShow ); + ::rtl::Reference< SlideshowImpl > xKeepAlive( pSlideShow ); if( mbFirstPaint ) { diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 916e30d306bd..3ac055930198 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -1401,7 +1401,7 @@ void ViewShell::SetCurrentFunction( const rtl::Reference<FuPoor>& xFunction) { if( mxCurrentFunction.is() && (mxOldFunction != mxCurrentFunction) ) mxCurrentFunction->Dispose(); - rtl::Reference<FuPoor> xTemp( mxCurrentFunction ); + rtl::Reference<FuPoor> xDisposeAfterNewOne( mxCurrentFunction ); mxCurrentFunction = xFunction; } @@ -1410,7 +1410,7 @@ void ViewShell::SetOldFunction(const rtl::Reference<FuPoor>& xFunction) if( mxOldFunction.is() && (xFunction != mxOldFunction) && (mxCurrentFunction != mxOldFunction) ) mxOldFunction->Dispose(); - rtl::Reference<FuPoor> xTemp( mxOldFunction ); + rtl::Reference<FuPoor> xDisposeAfterNewOne( mxOldFunction ); mxOldFunction = xFunction; } @@ -1445,7 +1445,7 @@ void ViewShell::DeactivateCurrentFunction( bool bPermanent /* == false */ ) if( mxCurrentFunction != mxOldFunction ) mxCurrentFunction->Dispose(); - rtl::Reference<FuPoor> xTemp( mxCurrentFunction ); + rtl::Reference<FuPoor> xDisposeAfterNewOne( mxCurrentFunction ); mxCurrentFunction.clear(); } } @@ -1462,7 +1462,7 @@ void ViewShell::DisposeFunctions() if(mxOldFunction.is()) { - rtl::Reference<FuPoor> xTemp( mxOldFunction ); + rtl::Reference<FuPoor> xDisposeAfterNewOne( mxOldFunction ); mxOldFunction->Dispose(); mxOldFunction.clear(); } diff --git a/sfx2/source/appl/linksrc.cxx b/sfx2/source/appl/linksrc.cxx index 9bfab2bfa4d8..0e0708f8da68 100644 --- a/sfx2/source/appl/linksrc.cxx +++ b/sfx2/source/appl/linksrc.cxx @@ -53,7 +53,7 @@ SvLinkSourceTimer::SvLinkSourceTimer( SvLinkSource * pOwn ) void SvLinkSourceTimer::Invoke() { // Secure against being destroyed in Handler - SvLinkSourceRef aAdv( pOwner ); + SvLinkSourceRef xHoldAlive( pOwner ); pOwner->SendDataChanged(); } diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx index af28bec53a2a..ab0e95c91039 100644 --- a/sfx2/source/control/statcach.cxx +++ b/sfx2/source/control/statcach.cxx @@ -70,7 +70,7 @@ void SAL_CALL BindDispatch_Impl::statusChanged( const css::frame::FeatureStateE if ( !pCache ) return; - css::uno::Reference< css::frame::XStatusListener > xRef( static_cast<cppu::OWeakObject*>(this), css::uno::UNO_QUERY ); + css::uno::Reference< css::frame::XStatusListener > xKeepAlive( static_cast<cppu::OWeakObject*>(this), css::uno::UNO_QUERY ); if ( aStatus.Requery ) pCache->Invalidate( true ); else diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index af6a722d24d9..fd8fc433c3b2 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -354,7 +354,7 @@ bool SfxObjectShell::Stamp_GetPrintCancelState() const bool SfxObjectShell::Close() { - SfxObjectShellRef aRef(this); + SfxObjectShellRef xKeepAlive(this); return CloseInternal(); } diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 0446ee82ac50..2767c5d0d9d2 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -3194,10 +3194,10 @@ void SfxBaseModel::postEvent_Impl( const OUString& aName, const Reference< frame return; // keep m_pData alive, if notified target would dispose the document - std::shared_ptr<IMPL_SfxBaseModel_DataContainer> pData(m_pData); + std::shared_ptr<IMPL_SfxBaseModel_DataContainer> xKeepAlive(m_pData); // also make sure this object doesn't self-destruct while notifying - rtl::Reference<SfxBaseModel> self(this); + rtl::Reference<SfxBaseModel> xHoldAlive(this); DBG_ASSERT( !aName.isEmpty(), "Empty event name!" ); if (aName.isEmpty()) diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 32150062aba9..4d7f6001526b 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -919,7 +919,7 @@ void SfxBaseController::BorderWidthsChanged_Impl() void SAL_CALL SfxBaseController::dispose() { SolarMutexGuard aGuard; - Reference< XController > xTmp( this ); + Reference< XController > xKeepAlive( this ); m_pData->m_bDisposing = true ; lang::EventObject aEventObject; diff --git a/svtools/source/uno/miscservices.cxx b/svtools/source/uno/miscservices.cxx index e921e55d3dc6..bf638535266d 100644 --- a/svtools/source/uno/miscservices.cxx +++ b/svtools/source/uno/miscservices.cxx @@ -62,7 +62,7 @@ SAL_DLLPUBLIC_EXPORT void * svt_component_getFactory( void * pResult = nullptr; if (_pServiceManager) { - Reference< XMultiServiceFactory > xSMgr(static_cast< XMultiServiceFactory * >(_pServiceManager)); + Reference< XMultiServiceFactory > xHoldAlive(static_cast< XMultiServiceFactory * >(_pServiceManager)); pResult = cppu::component_getFactoryHelper(pImplementationName, _pServiceManager, diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx b/svx/source/accessibility/ChildrenManagerImpl.cxx index 44ba6b1419ac..656db47ffc43 100644 --- a/svx/source/accessibility/ChildrenManagerImpl.cxx +++ b/svx/source/accessibility/ChildrenManagerImpl.cxx @@ -474,7 +474,7 @@ void ChildrenManagerImpl::RemoveShape (const Reference<drawing::XShape>& rxShape if (I != maVisibleChildren.end()) { // Remove descriptor from that list. - Reference<XAccessible> xAccessibleShape (I->mxAccessibleShape); + Reference<XAccessible> xHoldAlive(I->mxAccessibleShape); UnregisterAsDisposeListener (I->mxShape); // Dispose the accessible object. diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx index 9025147d161f..ae6eaf3fa9d6 100644 --- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx +++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx @@ -193,7 +193,7 @@ namespace sdr::overlay IMPL_LINK_NOARG(OverlayManagerBuffered, ImpBufferTimerHandler, Timer*, void) { //Resolves: fdo#46728 ensure this exists until end of scope - rtl::Reference<OverlayManager> xRef(this); + rtl::Reference<OverlayManager> xKeepAlive(this); // stop timer maBufferIdle.Stop(); diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx index 485bc87d64bf..e568c9159945 100644 --- a/sw/source/core/ole/ndole.cxx +++ b/sw/source/core/ole/ndole.cxx @@ -1180,7 +1180,7 @@ void SwOLELRUCache::Load() if (nVal < m_nLRU_InitSize) { - std::shared_ptr<SwOLELRUCache> tmp(g_pOLELRU_Cache); // prevent delete this + std::shared_ptr<SwOLELRUCache> xKeepAlive(g_pOLELRU_Cache); // prevent delete this // size of cache has been changed sal_Int32 nCount = m_OleObjects.size(); sal_Int32 nPos = nCount; @@ -1212,7 +1212,7 @@ void SwOLELRUCache::InsertObj( SwOLEObj& rObj ) } if (it == m_OleObjects.end()) { - std::shared_ptr<SwOLELRUCache> tmp(g_pOLELRU_Cache); // prevent delete this + std::shared_ptr<SwOLELRUCache> xKeepAlive(g_pOLELRU_Cache); // prevent delete this // try to remove objects if necessary sal_Int32 nCount = m_OleObjects.size(); sal_Int32 nPos = nCount-1; diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx index d7e23bf5251a..a27de833846c 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -67,7 +67,7 @@ void SwRenderData::DeletePostItData() // printer needs to remain at the real document m_pPostItShell->GetDoc()->getIDocumentDeviceAccess().setPrinter( nullptr, false, false ); { // avoid destroying layout from SwDoc dtor - rtl::Reference<SwDoc> const pDoc(m_pPostItShell->GetDoc()); + rtl::Reference<SwDoc> const xKeepAlive(m_pPostItShell->GetDoc()); m_pPostItShell.reset(); } m_pPostItFields.reset(); diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index c67078f24619..36e1139d5f2a 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -227,7 +227,7 @@ ErrCode HTMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPam, co } // so nobody steals the document! - rtl::Reference<SwDoc> aHoldRef(&rDoc); + rtl::Reference<SwDoc> xHoldAlive(&rDoc); ErrCode nRet = ERRCODE_NONE; tools::SvRef<SwHTMLParser> xParser = new SwHTMLParser( &rDoc, rPam, *m_pStream, rName, rBaseURL, !m_bInsertMode, m_pMedium, @@ -3240,7 +3240,7 @@ void SwHTMLParser::DeleteAttr( HTMLAttr* pAttr ) HTMLAttr *pNext = pAttr->GetNext(); HTMLAttr *pPrev = pAttr->GetPrev(); //hold ref to xAttrTab until end of scope to ensure *ppHead validity - std::shared_ptr<HTMLAttrTable> xAttrTab(pAttr->m_xAttrTab); + std::shared_ptr<HTMLAttrTable> xKeepAlive(pAttr->m_xAttrTab); delete pAttr; if( pPrev ) diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 9656120f89a7..d8f54b5817e7 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -1340,7 +1340,7 @@ Reference< drawing::XDrawPage > SwXTextDocument::getDrawPage() // object. Otherwise in some corner cases it would get initialized // at ::InitNewDoc -> which would get called during // close() or dispose() -> n#681746 - uno::Reference<lang::XComponent> xComp( mxXDrawPage, uno::UNO_QUERY ); + uno::Reference<lang::XComponent> xTriggerInit( mxXDrawPage, uno::UNO_QUERY ); } return mxXDrawPage; } diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx index eeb01bf62dac..e2349b27ecc9 100644 --- a/toolkit/source/awt/vclxaccessiblecomponent.cxx +++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx @@ -122,7 +122,7 @@ IMPL_LINK( VCLXAccessibleComponent, WindowChildEventListener, VclWindowEvent&, r if( !rEvent.GetWindow()->IsAccessibilityEventsSuppressed() ) { // #103087# to prevent an early release of the component - uno::Reference< accessibility::XAccessibleContext > xTmp = this; + uno::Reference< accessibility::XAccessibleContext > xHoldAlive = this; ProcessWindowChildEvent( rEvent ); } diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index 5a20afa0ed1a..82e2bbc0c08b 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -425,7 +425,7 @@ css::uno::Reference< XAccessible > SvtIconChoiceCtrl::CreateAccessible() css::uno::Reference< XAccessible > xAccParent = pParent->GetAccessible(); if ( xAccParent.is() ) { - css::uno::Reference< css::awt::XWindowPeer > xTemp(GetComponentInterface()); + css::uno::Reference< css::awt::XWindowPeer > xHoldAlive(GetComponentInterface()); xAccessible = _pImpl->GetAccessibleFactory().createAccessibleIconChoiceCtrl( *this, xAccParent ); } } diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index 32e035ffc9d5..901fed2ba4d8 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -3562,7 +3562,7 @@ css::uno::Reference< XAccessible > SvTreeListBox::CreateAccessible() if ( xAccParent.is() ) { // need to be done here to get the vclxwindow later on in the accessible - css::uno::Reference< css::awt::XWindowPeer > xTemp(GetComponentInterface()); + css::uno::Reference< css::awt::XWindowPeer > xHoldAlive(GetComponentInterface()); xAccessible = pImpl->m_aFactoryAccess.getFactory().createAccessibleTreeListBox( *this, xAccParent ); } } diff --git a/vcl/source/window/dndeventdispatcher.cxx b/vcl/source/window/dndeventdispatcher.cxx index 9af6ab6e76c3..47adfcf87d5a 100644 --- a/vcl/source/window/dndeventdispatcher.cxx +++ b/vcl/source/window/dndeventdispatcher.cxx @@ -365,7 +365,7 @@ sal_Int32 DNDEventDispatcher::fireDropEvent( vcl::Window *pWindow, Reference< XDropTarget > xDropTarget = pWindow->GetDropTarget(); // window may be destroyed in drop event handler - VclPtr<vcl::Window> xWindow = pWindow; + VclPtr<vcl::Window> xPreventDelete = pWindow; if( xDropTarget.is() ) { diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 3a54ca66b692..e2a617270af2 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2946,7 +2946,7 @@ sal_uInt16 PopupMenu::ImplExecute( const VclPtr<vcl::Window>& pW, const tools::R } // tdf#126054 hold this until after function completes - VclPtr<PopupMenu> m_xThis(this); + VclPtr<PopupMenu> xThis(this); pWin->SetFocusId( xFocusId ); pWin->SetOutputSizePixel( aSz ); diff --git a/vcl/unx/generic/dtrans/X11_clipboard.cxx b/vcl/unx/generic/dtrans/X11_clipboard.cxx index ee277808d2e8..8740f2418538 100644 --- a/vcl/unx/generic/dtrans/X11_clipboard.cxx +++ b/vcl/unx/generic/dtrans/X11_clipboard.cxx @@ -109,7 +109,7 @@ void X11Clipboard::clearContents() // copy member references on stack so they can be called // without having the mutex Reference< XClipboardOwner > xOwner( m_aOwner ); - Reference< XTransferable > xTrans( m_aContents ); + Reference< XTransferable > xKeepAlive( m_aContents ); // clear members m_aOwner.clear(); m_aContents.clear(); |