Use unique_ptr for ImpEditEngine::pEmptyItemSet
Change-Id: I1d7757eafb52fc3cc7d7e1cb02cced0a6004a304
This commit is contained in:
@@ -427,7 +427,7 @@ private:
|
|||||||
svtools::ColorConfig maColorConfig;
|
svtools::ColorConfig maColorConfig;
|
||||||
mutable SvtCTLOptions* pCTLOptions;
|
mutable SvtCTLOptions* pCTLOptions;
|
||||||
|
|
||||||
SfxItemSet* pEmptyItemSet;
|
std::unique_ptr<SfxItemSet> pEmptyItemSet;
|
||||||
EditUndoManager* pUndoManager;
|
EditUndoManager* pUndoManager;
|
||||||
ESelection* pUndoMarkSelection;
|
ESelection* pUndoMarkSelection;
|
||||||
|
|
||||||
|
@@ -113,7 +113,6 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) :
|
|||||||
pEditEngine = pEE;
|
pEditEngine = pEE;
|
||||||
pRefDev = nullptr;
|
pRefDev = nullptr;
|
||||||
pVirtDev = nullptr;
|
pVirtDev = nullptr;
|
||||||
pEmptyItemSet = nullptr;
|
|
||||||
pActiveView = nullptr;
|
pActiveView = nullptr;
|
||||||
pSpellInfo = nullptr;
|
pSpellInfo = nullptr;
|
||||||
pConvInfo = nullptr;
|
pConvInfo = nullptr;
|
||||||
@@ -194,7 +193,6 @@ ImpEditEngine::~ImpEditEngine()
|
|||||||
SetUpdateMode( false );
|
SetUpdateMode( false );
|
||||||
|
|
||||||
Dispose();
|
Dispose();
|
||||||
delete pEmptyItemSet;
|
|
||||||
// it's only legal to delete the pUndoManager if it was created by
|
// it's only legal to delete the pUndoManager if it was created by
|
||||||
// ImpEditEngine; if it was set by SetUndoManager() it must be cleared
|
// ImpEditEngine; if it was set by SetUndoManager() it must be cleared
|
||||||
// before destroying the ImpEditEngine!
|
// before destroying the ImpEditEngine!
|
||||||
@@ -701,7 +699,7 @@ const SfxItemSet& ImpEditEngine::GetEmptyItemSet()
|
|||||||
{
|
{
|
||||||
if ( !pEmptyItemSet )
|
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++)
|
for ( sal_uInt16 nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; nWhich++)
|
||||||
{
|
{
|
||||||
pEmptyItemSet->ClearItem( nWhich );
|
pEmptyItemSet->ClearItem( nWhich );
|
||||||
|
Reference in New Issue
Block a user