diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-24 11:02:42 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-05-24 11:02:42 +0200 |
commit | 95d20a3799998b9816bd2e8aebdbc96c61cead3e (patch) | |
tree | 8206ecc848631432cb8b027d5e780483734f808a /extensions | |
parent | 3caf31b05d7bbf3d50a1bbda6c8b95982cb5c2b5 (diff) |
Revert "remove some manual ref-counting"
until I have a better understanding of the UNO reference
counting.
This reverts commit 111de438ea3e512a541281dc0716cc728ea8d152.
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/bibliography/framectr.cxx | 22 | ||||
-rw-r--r-- | extensions/source/bibliography/framectr.hxx | 2 |
2 files changed, 13 insertions, 11 deletions
diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx index 0e06fed4b1b1..ad713bd538cb 100644 --- a/extensions/source/bibliography/framectr.cxx +++ b/extensions/source/bibliography/framectr.cxx @@ -178,13 +178,15 @@ BibFrameController_Impl::BibFrameController_Impl( const uno::Reference< awt::XWi pParent->SetUniqueId(UID_BIB_FRAME_WINDOW); bDisposing=false; bHierarchical=true; - mxImpl = new BibFrameCtrl_Impl; - mxImpl->pController = this; + pImp = new BibFrameCtrl_Impl; + pImp->pController = this; + pImp->acquire(); } BibFrameController_Impl::~BibFrameController_Impl() { - mxImpl->pController = nullptr; + pImp->pController = nullptr; + pImp->release(); delete pDatMan; if(pBibMod) CloseBibModul(pBibMod); @@ -211,7 +213,7 @@ css::uno::Sequence< OUString > SAL_CALL BibFrameController_Impl::getSupportedSer void BibFrameController_Impl::attachFrame( const uno::Reference< XFrame > & xArg ) throw (css::uno::RuntimeException, std::exception) { xFrame = xArg; - xFrame->addFrameActionListener( mxImpl ); + xFrame->addFrameActionListener( pImp ); } sal_Bool BibFrameController_Impl::attachModel( const uno::Reference< XModel > & /*xModel*/ ) throw (css::uno::RuntimeException, std::exception) @@ -222,9 +224,9 @@ sal_Bool BibFrameController_Impl::attachModel( const uno::Reference< XModel > & sal_Bool BibFrameController_Impl::suspend( sal_Bool bSuspend ) throw (css::uno::RuntimeException, std::exception) { if ( bSuspend ) - getFrame()->removeFrameActionListener( mxImpl ); + getFrame()->removeFrameActionListener( pImp ); else - getFrame()->addFrameActionListener( mxImpl ); + getFrame()->addFrameActionListener( pImp ); return true; } @@ -252,7 +254,7 @@ void BibFrameController_Impl::dispose() throw (css::uno::RuntimeException, std:: bDisposing = true; lang::EventObject aObject; aObject.Source = static_cast<XController*>(this); - mxImpl->aLC.disposeAndClear(aObject); + pImp->aLC.disposeAndClear(aObject); m_xDatMan = nullptr; pDatMan = nullptr; aStatusListeners.clear(); @@ -260,12 +262,12 @@ void BibFrameController_Impl::dispose() throw (css::uno::RuntimeException, std:: void BibFrameController_Impl::addEventListener( const uno::Reference< lang::XEventListener > & aListener ) throw (css::uno::RuntimeException, std::exception) { - mxImpl->aLC.addInterface( cppu::UnoType<lang::XEventListener>::get(), aListener ); + pImp->aLC.addInterface( cppu::UnoType<lang::XEventListener>::get(), aListener ); } void BibFrameController_Impl::removeEventListener( const uno::Reference< lang::XEventListener > & aListener ) throw (css::uno::RuntimeException, std::exception) { - mxImpl->aLC.removeInterface( cppu::UnoType<lang::XEventListener>::get(), aListener ); + pImp->aLC.removeInterface( cppu::UnoType<lang::XEventListener>::get(), aListener ); } uno::Reference< frame::XDispatch > BibFrameController_Impl::queryDispatch( const util::URL& aURL, const OUString& /*aTarget*/, sal_Int32 /*nSearchFlags*/ ) throw (css::uno::RuntimeException, std::exception) @@ -556,7 +558,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen bLeft = xCursor->isLast() && nCount > 1; bRight= !xCursor->isLast(); // ask for confirmation - Reference< frame::XController > xCtrl = mxImpl->pController; + Reference< frame::XController > xCtrl = pImp->pController; Reference< form::XConfirmDeleteListener > xConfirm(pDatMan->GetFormController(),UNO_QUERY); if (xConfirm.is()) { diff --git a/extensions/source/bibliography/framectr.hxx b/extensions/source/bibliography/framectr.hxx index bcc574e3208b..feb94c37c383 100644 --- a/extensions/source/bibliography/framectr.hxx +++ b/extensions/source/bibliography/framectr.hxx @@ -60,7 +60,7 @@ class BibFrameController_Impl : public cppu::WeakImplHelper < > { friend class BibFrameCtrl_Impl; - css::uno::Reference<BibFrameCtrl_Impl> mxImpl; + BibFrameCtrl_Impl* pImp; BibStatusDispatchArr aStatusListeners; css::uno::Reference< css::awt::XWindow > xWindow; css::uno::Reference< css::frame::XFrame > xFrame; |