diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-06-13 11:20:36 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-06-13 11:20:36 +0200 |
commit | a109a9ef744a7ed36c5084cb26f033ba52b3c3ad (patch) | |
tree | 03a2cce215ffbcbabbd23983a1602a7662e43bb5 /editeng | |
parent | d57c9d81aab1e02d257738a82bddeca78db46da8 (diff) |
Use unique_ptr for ImpEditEngine::pEmptyItemSet
Change-Id: I1d7757eafb52fc3cc7d7e1cb02cced0a6004a304
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 4 |
2 files changed, 2 insertions, 4 deletions
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 ); |