summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-01-09 09:52:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-01-09 11:04:42 +0100
commit3c97782c7e1ea437511249d750bf882bff17ef09 (patch)
tree0dde4f603c3d58bf00fce332cc20605f689b2878
parent54515a6a01a372729bf8a7f9e992c51f214ec9a6 (diff)
use unique_ptr in pGlobalOLEExcludeList
Change-Id: Ib52e594b469818a0567c9c6b5cd460375d997abc Reviewed-on: https://gerrit.libreoffice.org/65994 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/inc/init.hxx2
-rw-r--r--sw/source/core/bastyp/init.cxx6
-rw-r--r--sw/source/core/doc/docdesc.cxx6
3 files changed, 6 insertions, 8 deletions
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;