summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-06-01 16:22:29 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-06 07:01:34 +0000
commit0323253a7c67316cb96e4a64792ab4fe74aac1ca (patch)
tree81787c4ae44ff778aa41e12574cd60a624c9277b /extensions
parent4d666f5092d7c4f2ece9702dda4d874e44cdc6f7 (diff)
remove some manual ref-counting
triggered when I noticed a class doing acquire() in the constructor and then release() in the destructor. found mostly by git grep -n -B5 -e '->release()' Change-Id: I96e43a3d30ffd9ae9a34275f24cd914d8f7b026f Reviewed-on: https://gerrit.libreoffice.org/25806 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/bibliography/framectr.cxx22
-rw-r--r--extensions/source/bibliography/framectr.hxx2
2 files changed, 11 insertions, 13 deletions
diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx
index df541538dee4..6da8c22c8a1e 100644
--- a/extensions/source/bibliography/framectr.cxx
+++ b/extensions/source/bibliography/framectr.cxx
@@ -176,15 +176,13 @@ BibFrameController_Impl::BibFrameController_Impl( const uno::Reference< awt::XWi
{
bDisposing=false;
bHierarchical=true;
- pImp = new BibFrameCtrl_Impl;
- pImp->pController = this;
- pImp->acquire();
+ mxImpl = new BibFrameCtrl_Impl;
+ mxImpl->pController = this;
}
BibFrameController_Impl::~BibFrameController_Impl()
{
- pImp->pController = nullptr;
- pImp->release();
+ mxImpl->pController = nullptr;
delete pDatMan;
if(pBibMod)
CloseBibModul(pBibMod);
@@ -211,7 +209,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( pImp );
+ xFrame->addFrameActionListener( mxImpl.get() );
}
sal_Bool BibFrameController_Impl::attachModel( const uno::Reference< XModel > & /*xModel*/ ) throw (css::uno::RuntimeException, std::exception)
@@ -222,9 +220,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( pImp );
+ getFrame()->removeFrameActionListener( mxImpl.get() );
else
- getFrame()->addFrameActionListener( pImp );
+ getFrame()->addFrameActionListener( mxImpl.get() );
return true;
}
@@ -252,7 +250,7 @@ void BibFrameController_Impl::dispose() throw (css::uno::RuntimeException, std::
bDisposing = true;
lang::EventObject aObject;
aObject.Source = static_cast<XController*>(this);
- pImp->aLC.disposeAndClear(aObject);
+ mxImpl->aLC.disposeAndClear(aObject);
m_xDatMan = nullptr;
pDatMan = nullptr;
aStatusListeners.clear();
@@ -260,12 +258,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)
{
- pImp->aLC.addInterface( cppu::UnoType<lang::XEventListener>::get(), aListener );
+ mxImpl->aLC.addInterface( cppu::UnoType<lang::XEventListener>::get(), aListener );
}
void BibFrameController_Impl::removeEventListener( const uno::Reference< lang::XEventListener > & aListener ) throw (css::uno::RuntimeException, std::exception)
{
- pImp->aLC.removeInterface( cppu::UnoType<lang::XEventListener>::get(), aListener );
+ mxImpl->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 +554,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 = pImp->pController;
+ Reference< frame::XController > xCtrl = mxImpl->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 feb94c37c383..a68b4b933dfe 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;
- BibFrameCtrl_Impl* pImp;
+ rtl::Reference<BibFrameCtrl_Impl> mxImpl;
BibStatusDispatchArr aStatusListeners;
css::uno::Reference< css::awt::XWindow > xWindow;
css::uno::Reference< css::frame::XFrame > xFrame;