[Libreoffice-commits] core.git: sw/inc sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jan 9 10:05:11 UTC 2019


 sw/inc/init.hxx                |    2 +-
 sw/source/core/bastyp/init.cxx |    6 ++----
 sw/source/core/doc/docdesc.cxx |    6 +++---
 3 files changed, 6 insertions(+), 8 deletions(-)

New commits:
commit 3c97782c7e1ea437511249d750bf882bff17ef09
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Jan 9 09:52:37 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Jan 9 11:04:42 2019 +0100

    use unique_ptr in pGlobalOLEExcludeList
    
    Change-Id: Ib52e594b469818a0567c9c6b5cd460375d997abc
    Reviewed-on: https://gerrit.libreoffice.org/65994
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/inc/init.hxx b/sw/inc/init.hxx
index 4047d6bb0fb7..b357864109cd 100644
--- a/sw/inc/init.hxx
+++ b/sw/inc/init.hxx
@@ -68,7 +68,7 @@ void TextFinit();
 // about printer changes. Thereby saving loading a lot of objects (luckily all foreign
 // objects are mapped to one ID).
 // Initialisation and deinitialisation can be found in init.cxx
-extern std::vector<SvGlobalName*> *pGlobalOLEExcludeList;
+extern std::vector<SvGlobalName> *pGlobalOLEExcludeList;
 
 #endif
 
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 780d11595ef8..f8aa2f91e9f9 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -430,7 +430,7 @@ SfxItemInfo aSlotTab[] =
     { 0, true }                            // RES_UNKNOWNATR_CONTAINER
 };
 
-std::vector<SvGlobalName*> *pGlobalOLEExcludeList = nullptr;
+std::vector<SvGlobalName> *pGlobalOLEExcludeList = nullptr;
 
 SwAutoCompleteWord* SwDoc::mpACmpltWords = nullptr;
 
@@ -648,7 +648,7 @@ void InitCore()
     SwSelPaintRects::s_pMapMode = new MapMode;
     SwFntObj::pPixMap = new MapMode;
 
-    pGlobalOLEExcludeList = new std::vector<SvGlobalName*>;
+    pGlobalOLEExcludeList = new std::vector<SvGlobalName>;
 
     if (!utl::ConfigManager::IsFuzzing())
     {
@@ -733,8 +733,6 @@ void FinitCore()
         delete pHt;
     }
 
-    for (SvGlobalName* p : *pGlobalOLEExcludeList)
-        delete p;
     delete pGlobalOLEExcludeList;
 }
 
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index f391fc323b11..da6df6321fc3 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -752,11 +752,11 @@ void SwDoc::PrtOLENotify( bool bAll )
                 }
 
                 bool bFound = false;
-                for ( std::vector<SvGlobalName*>::size_type j = 0;
+                for ( std::vector<SvGlobalName>::size_type j = 0;
                       j < pGlobalOLEExcludeList->size() && !bFound;
                       ++j )
                 {
-                    bFound = *(*pGlobalOLEExcludeList)[j] == aName;
+                    bFound = (*pGlobalOLEExcludeList)[j] == aName;
                 }
                 if ( bFound )
                     continue;
@@ -765,7 +765,7 @@ void SwDoc::PrtOLENotify( bool bAll )
                 // If it doesn't want to be informed
                 if ( xObj.is() )
                 {
-                        pGlobalOLEExcludeList->push_back( new SvGlobalName( aName ) );
+                    pGlobalOLEExcludeList->push_back( aName );
                 }
             }
             delete pNodes;


More information about the Libreoffice-commits mailing list