From 7950288c58522b6bd1c8c804d3a336d1ca388c58 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 21 Oct 2015 14:45:34 +0200 Subject: boost::ptr_vector->std::vector no need to manage uno::Reference via extra heap objects Change-Id: I3092b5103a31fcff8122e4ce9cd1cbb42f5ed910 --- extensions/source/bibliography/toolbar.cxx | 14 ++++++-------- extensions/source/bibliography/toolbar.hxx | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'extensions') diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx index 4bfb4ff562a9..0a47d3bd7e16 100644 --- a/extensions/source/bibliography/toolbar.cxx +++ b/extensions/source/bibliography/toolbar.cxx @@ -277,24 +277,22 @@ void BibToolBar::InitListener() xTrans->parseStrict( aURL ); - BibToolBarListener* pListener=NULL; + BibToolBarListenerRef xListener; if(nId==TBC_LB_SOURCE) { - pListener=new BibTBListBoxListener(this,aURL.Complete,nId); + xListener=new BibTBListBoxListener(this,aURL.Complete,nId); } else if(nId==TBC_ED_QUERY) { - pListener=new BibTBEditListener(this,aURL.Complete,nId); + xListener=new BibTBEditListener(this,aURL.Complete,nId); } else { - pListener=new BibToolBarListener(this,aURL.Complete,nId); + xListener=new BibToolBarListener(this,aURL.Complete,nId); } - BibToolBarListenerRef* pxInsert = new uno::Reference; - (*pxInsert) = pListener; - aListenerArr.push_back( pxInsert ); - xDisp->addStatusListener(uno::Reference< frame::XStatusListener > (pListener),aURL); + aListenerArr.push_back( xListener ); + xDisp->addStatusListener(xListener,aURL); } } } diff --git a/extensions/source/bibliography/toolbar.hxx b/extensions/source/bibliography/toolbar.hxx index fdfd3790ff7c..f195608ec797 100644 --- a/extensions/source/bibliography/toolbar.hxx +++ b/extensions/source/bibliography/toolbar.hxx @@ -30,7 +30,7 @@ #include #include #include -#include +#include class BibDataManager; class BibToolBar; @@ -102,7 +102,7 @@ public: typedef css::uno::Reference< css::frame::XStatusListener> BibToolBarListenerRef; -typedef boost::ptr_vector BibToolBarListenerArr; +typedef std::vector BibToolBarListenerArr; class BibToolBar: public ToolBox { -- cgit