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

Stephan Bergmann sbergman at redhat.com
Tue Jun 13 09:21:04 UTC 2017


 editeng/source/editeng/impedit.hxx  |    2 +-
 editeng/source/editeng/impedit2.cxx |    4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

New commits:
commit a109a9ef744a7ed36c5084cb26f033ba52b3c3ad
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jun 13 11:20:36 2017 +0200

    Use unique_ptr for ImpEditEngine::pEmptyItemSet
    
    Change-Id: I1d7757eafb52fc3cc7d7e1cb02cced0a6004a304

diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 6b2b28ad6680..ecf51531c585 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -427,7 +427,7 @@ private:
     svtools::ColorConfig maColorConfig;
     mutable SvtCTLOptions*  pCTLOptions;
 
-    SfxItemSet*         pEmptyItemSet;
+    std::unique_ptr<SfxItemSet> pEmptyItemSet;
     EditUndoManager*    pUndoManager;
     ESelection*         pUndoMarkSelection;
 
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index d649b88e7a12..048f330e18c8 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -113,7 +113,6 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) :
     pEditEngine         = pEE;
     pRefDev             = nullptr;
     pVirtDev            = nullptr;
-    pEmptyItemSet       = nullptr;
     pActiveView         = nullptr;
     pSpellInfo          = nullptr;
     pConvInfo           = nullptr;
@@ -194,7 +193,6 @@ ImpEditEngine::~ImpEditEngine()
     SetUpdateMode( false );
 
     Dispose();
-    delete pEmptyItemSet;
     // it's only legal to delete the pUndoManager if it was created by
     // ImpEditEngine; if it was set by SetUndoManager() it must be cleared
     // before destroying the ImpEditEngine!
@@ -701,7 +699,7 @@ const SfxItemSet& ImpEditEngine::GetEmptyItemSet()
 {
     if ( !pEmptyItemSet )
     {
-        pEmptyItemSet = new SfxItemSet( aEditDoc.GetItemPool(), EE_ITEMS_START, EE_ITEMS_END );
+        pEmptyItemSet = o3tl::make_unique<SfxItemSet>( aEditDoc.GetItemPool(), EE_ITEMS_START, EE_ITEMS_END );
         for ( sal_uInt16 nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; nWhich++)
         {
             pEmptyItemSet->ClearItem( nWhich );


More information about the Libreoffice-commits mailing list