[Libreoffice-commits] core.git: extensions/source

Noel Grandin noel at peralex.com
Wed Oct 21 05:46:40 PDT 2015


 extensions/source/bibliography/toolbar.cxx |   14 ++++++--------
 extensions/source/bibliography/toolbar.hxx |    4 ++--
 2 files changed, 8 insertions(+), 10 deletions(-)

New commits:
commit 7950288c58522b6bd1c8c804d3a336d1ca388c58
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Oct 21 14:45:34 2015 +0200

    boost::ptr_vector->std::vector
    
    no need to manage uno::Reference via extra heap objects
    
    Change-Id: I3092b5103a31fcff8122e4ce9cd1cbb42f5ed910

diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx
index 4bfb4ff..0a47d3b 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<frame::XStatusListener>;
-            (*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 fdfd379..f195608 100644
--- a/extensions/source/bibliography/toolbar.hxx
+++ b/extensions/source/bibliography/toolbar.hxx
@@ -30,7 +30,7 @@
 #include <vcl/fixed.hxx>
 #include <vcl/timer.hxx>
 #include <cppuhelper/implbase.hxx>
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
 
 class BibDataManager;
 class BibToolBar;
@@ -102,7 +102,7 @@ public:
 
 
 typedef css::uno::Reference< css::frame::XStatusListener> BibToolBarListenerRef;
-typedef boost::ptr_vector<BibToolBarListenerRef> BibToolBarListenerArr;
+typedef std::vector<BibToolBarListenerRef> BibToolBarListenerArr;
 
 class BibToolBar:   public ToolBox
 {


More information about the Libreoffice-commits mailing list