From 5f4366236537b7e44afd5b559c826db8ce35d404 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 19 Feb 2018 11:27:51 +0100 Subject: sw: DELETEZ to unique_ptr in DocumentLinksAdministrationManager Change-Id: I428848c48c2d265e82db9d3666492d50b01a221d --- sw/source/core/doc/DocumentLinksAdministrationManager.cxx | 14 +++++++------- sw/source/core/inc/DocumentLinksAdministrationManager.hxx | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'sw') diff --git a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx index a66b29ec3ab0..2d275359f57b 100644 --- a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx +++ b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx @@ -169,10 +169,11 @@ namespace namespace sw { -DocumentLinksAdministrationManager::DocumentLinksAdministrationManager( SwDoc& i_rSwdoc ) : mbVisibleLinks(true), - mbLinksUpdated( false ), //#i38810# - mpLinkMgr( new sfx2::LinkManager( nullptr ) ), - m_rDoc( i_rSwdoc ) +DocumentLinksAdministrationManager::DocumentLinksAdministrationManager( SwDoc& i_rSwdoc ) + : mbVisibleLinks(true) + , mbLinksUpdated( false ) //#i38810# + , m_pLinkMgr( new sfx2::LinkManager(nullptr) ) + , m_rDoc( i_rSwdoc ) { } @@ -188,12 +189,12 @@ void DocumentLinksAdministrationManager::SetVisibleLinks(bool bFlag) sfx2::LinkManager& DocumentLinksAdministrationManager::GetLinkManager() { - return *mpLinkMgr; + return *m_pLinkMgr; } const sfx2::LinkManager& DocumentLinksAdministrationManager::GetLinkManager() const { - return *mpLinkMgr; + return *m_pLinkMgr; } // #i42634# Moved common code of SwReader::Read() and SwDocShell::UpdateLinks() @@ -439,7 +440,6 @@ bool DocumentLinksAdministrationManager::LinksUpdated() const DocumentLinksAdministrationManager::~DocumentLinksAdministrationManager() { - DELETEZ( mpLinkMgr ); } bool DocumentLinksAdministrationManager::SelectServerObj( const OUString& rStr, SwPaM*& rpPam, SwNodeRange*& rpRange ) const diff --git a/sw/source/core/inc/DocumentLinksAdministrationManager.hxx b/sw/source/core/inc/DocumentLinksAdministrationManager.hxx index 43dc9a91c1a1..8294eaf86f4d 100644 --- a/sw/source/core/inc/DocumentLinksAdministrationManager.hxx +++ b/sw/source/core/inc/DocumentLinksAdministrationManager.hxx @@ -22,6 +22,7 @@ #include +#include namespace sfx2 { class LinkManager; } class SwDoc; @@ -71,7 +72,7 @@ private: bool mbVisibleLinks; //< TRUE: Links are inserted visibly. bool mbLinksUpdated; //< #i38810# flag indicating, that the links have been updated. - sfx2::LinkManager *mpLinkMgr; //< List of linked stuff (graphics/DDE/OLE). + std::unique_ptr m_pLinkMgr; //< List of linked stuff (graphics/DDE/OLE). SwDoc& m_rDoc; }; -- cgit