i18npool/source/localedata/localedata.cxx |   10 +++++-----
 ucb/source/ucp/file/bc.cxx                |    5 ++---
 ucb/source/ucp/file/filnot.cxx            |    4 ++--
 ucb/source/ucp/file/filnot.hxx            |    2 +-
 4 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit 06e2159f3448e9ce00fd521aadd32075ae93f376
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Aug 20 14:01:23 2018 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Aug 21 12:11:40 2018 +0200

    loplugin:useuniqueptr in PropertyChangeNotifier
    
    Change-Id: Ibfbee5d4c9378778ee4a8d70ee1501444f071003
    Reviewed-on: https://gerrit.libreoffice.org/59360
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index b457bc87140f..f42cdf84fd76 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -1260,7 +1260,7 @@ BaseContent::cPCL()
 
     if( length )
     {
-        ListenerMap* listener = new ListenerMap;
+        std::unique_ptr<ListenerMap> listener(new ListenerMap);
         for( sal_Int32 i = 0; i < length; ++i )
         {
             cppu::OInterfaceContainerHelper* pContainer = 
m_pPropertyListener->getContainer(seqNames[i]);
@@ -1269,8 +1269,7 @@ BaseContent::cPCL()
             (*listener)[seqNames[i]] = pContainer->getElements();
         }
 
-        p.reset( new PropertyChangeNotifier( this,
-                                        listener ) );
+        p.reset( new PropertyChangeNotifier( this, std::move(listener) ) );
     }
 
     return p;
diff --git a/ucb/source/ucp/file/filnot.cxx b/ucb/source/ucp/file/filnot.cxx
index de5168617d19..c63dae89dcf6 100644
--- a/ucb/source/ucp/file/filnot.cxx
+++ b/ucb/source/ucp/file/filnot.cxx
@@ -197,9 +197,9 @@ PropertySetInfoChangeNotifier::notifyPropertyRemoved( const 
OUString & aProperty
 
 PropertyChangeNotifier::PropertyChangeNotifier(
     const css::uno::Reference< XContent >& xCreatorContent,
-    ListenerMap* pListeners )
+    std::unique_ptr<ListenerMap> pListeners )
     : m_xCreatorContent( xCreatorContent ),
-      m_pListeners( pListeners )
+      m_pListeners( std::move(pListeners) )
 {
 }
 
diff --git a/ucb/source/ucp/file/filnot.hxx b/ucb/source/ucp/file/filnot.hxx
index daf69d662ada..98f0b8983f0b 100644
--- a/ucb/source/ucp/file/filnot.hxx
+++ b/ucb/source/ucp/file/filnot.hxx
@@ -88,7 +88,7 @@ namespace fileaccess {
     public:
         PropertyChangeNotifier(
             const css::uno::Reference< css::ucb::XContent >& xCreatorContent,
-            ListenerMap* pListeners );
+            std::unique_ptr<ListenerMap> pListeners );
 
         ~PropertyChangeNotifier();
 
commit 5ff6bfeafb9c14d2f0fff4464b970dff11de537b
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Aug 20 13:49:45 2018 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Aug 21 12:11:29 2018 +0200

    loplugin:useuniqueptr in OutlineNumbering
    
    Change-Id: I7413ac32e976ffa965de92f9339f838dec5d543a
    Reviewed-on: https://gerrit.libreoffice.org/59359
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/i18npool/source/localedata/localedata.cxx 
b/i18npool/source/localedata/localedata.cxx
index 3f5cabdc1d97..75427fae14cc 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -1359,7 +1359,7 @@ class OutlineNumbering : public cppu::WeakImplHelper < 
container::XIndexAccess >
     std::unique_ptr<const OutlineNumberingLevel_Impl[]> m_pOutlineLevels;
     sal_Int16                         m_nCount;
 public:
-    OutlineNumbering(const OutlineNumberingLevel_Impl* pOutlineLevels, int 
nLevels);
+    OutlineNumbering(std::unique_ptr<const OutlineNumberingLevel_Impl[]> 
pOutlineLevels, int nLevels);
 
     //XIndexAccess
     virtual sal_Int32 SAL_CALL getCount(  ) override;
@@ -1392,7 +1392,7 @@ LocaleDataImpl::getOutlineNumberingLevels( const 
lang::Locale& rLocale )
         {
             int j;
 
-            OutlineNumberingLevel_Impl* level = new 
OutlineNumberingLevel_Impl[ nLevels+1 ];
+            std::unique_ptr<OutlineNumberingLevel_Impl[]> level(new 
OutlineNumberingLevel_Impl[ nLevels+1 ]);
             sal_Unicode const *** pLevel = pStyle[i];
             for( j = 0;  j < nLevels;  j++ )
             {
@@ -1430,7 +1430,7 @@ LocaleDataImpl::getOutlineNumberingLevels( const 
lang::Locale& rLocale )
             level[j].nFirstLineOffset    = 0;
             level[j].sTransliteration.clear();
             level[j].nNatNum             = 0;
-            aRet[i] = new OutlineNumbering( level, nLevels );
+            aRet[i] = new OutlineNumbering( std::move(level), nLevels );
         }
         return aRet;
     }
@@ -1522,8 +1522,8 @@ using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::style;
 using namespace ::com::sun::star::text;
 
-OutlineNumbering::OutlineNumbering(const OutlineNumberingLevel_Impl* 
pOutlnLevels, int nLevels) :
-    m_pOutlineLevels(pOutlnLevels),
+OutlineNumbering::OutlineNumbering(std::unique_ptr<const 
OutlineNumberingLevel_Impl[]> pOutlnLevels, int nLevels) :
+    m_pOutlineLevels(std::move(pOutlnLevels)),
     m_nCount(sal::static_int_cast<sal_Int16>(nLevels))
 {
 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to