[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source
Michael Stahl
mstahl at redhat.com
Tue Feb 20 12:03:07 UTC 2018
sw/inc/txtftn.hxx | 4 ++--
sw/source/core/doc/DocumentLinksAdministrationManager.cxx | 14 +++++++-------
sw/source/core/inc/DocumentLinksAdministrationManager.hxx | 3 ++-
sw/source/core/txtnode/atrftn.cxx | 7 +++----
4 files changed, 14 insertions(+), 14 deletions(-)
New commits:
commit 5f4366236537b7e44afd5b559c826db8ce35d404
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Feb 19 11:27:51 2018 +0100
sw: DELETEZ to unique_ptr in DocumentLinksAdministrationManager
Change-Id: I428848c48c2d265e82db9d3666492d50b01a221d
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 <IDocumentLinksAdministration.hxx>
+#include <memory>
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<sfx2::LinkManager> m_pLinkMgr; //< List of linked stuff (graphics/DDE/OLE).
SwDoc& m_rDoc;
};
commit bd9dfec21413fdd5df346e8dfecdffdd7bc30fc6
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Feb 16 23:43:31 2018 +0100
sw: DELETEZ to unique_ptr in SwTextFootnote
Change-Id: Ibd0a566dffca40da37727421c54b50e1d834ef3d
diff --git a/sw/inc/txtftn.hxx b/sw/inc/txtftn.hxx
index 1a7a678b0377..3c830e7ff273 100644
--- a/sw/inc/txtftn.hxx
+++ b/sw/inc/txtftn.hxx
@@ -31,7 +31,7 @@ class SwFrame;
class SW_DLLPUBLIC SwTextFootnote : public SwTextAttr
{
- SwNodeIndex * m_pStartNode;
+ std::unique_ptr<SwNodeIndex> m_pStartNode;
SwTextNode * m_pTextNode;
sal_uInt16 m_nSeqNo;
@@ -39,7 +39,7 @@ public:
SwTextFootnote( SwFormatFootnote& rAttr, sal_Int32 nStart );
virtual ~SwTextFootnote() override;
- SwNodeIndex *GetStartNode() const { return m_pStartNode; }
+ SwNodeIndex *GetStartNode() const { return m_pStartNode.get(); }
void SetStartNode( const SwNodeIndex *pNode, bool bDelNodes = true );
void SetNumber( const sal_uInt16 nNumber, const OUString &sNumStr );
void CopyFootnote(SwTextFootnote & rDest, SwTextNode & rDestNode) const;
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index 799526e60802..d7b3c122f666 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -247,7 +247,6 @@ OUString SwFormatFootnote::GetViewNumStr( const SwDoc& rDoc, bool bInclStrings )
SwTextFootnote::SwTextFootnote( SwFormatFootnote& rAttr, sal_Int32 nStartPos )
: SwTextAttr( rAttr, nStartPos )
- , m_pStartNode( nullptr )
, m_pTextNode( nullptr )
, m_nSeqNo( USHRT_MAX )
{
@@ -266,7 +265,7 @@ void SwTextFootnote::SetStartNode( const SwNodeIndex *pNewNode, bool bDelNode )
{
if ( !m_pStartNode )
{
- m_pStartNode = new SwNodeIndex( *pNewNode );
+ m_pStartNode.reset(new SwNodeIndex(*pNewNode));
}
else
{
@@ -308,7 +307,7 @@ void SwTextFootnote::SetStartNode( const SwNodeIndex *pNewNode, bool bDelNode )
// them (particularly not Undo)
DelFrames( nullptr );
}
- DELETEZ( m_pStartNode );
+ m_pStartNode.reset();
// remove the footnote from the SwDoc's array
for( size_t n = 0; n < pDoc->GetFootnoteIdxs().size(); ++n )
@@ -423,7 +422,7 @@ void SwTextFootnote::MakeNewTextSection( SwNodes& rNodes )
SwStartNode* pSttNd = rNodes.MakeTextSection( SwNodeIndex( rNodes.GetEndOfInserts() ),
SwFootnoteStartNode, pFormatColl );
- m_pStartNode = new SwNodeIndex( *pSttNd );
+ m_pStartNode.reset(new SwNodeIndex(*pSttNd));
}
void SwTextFootnote::DelFrames( const SwFrame* pSib )
More information about the Libreoffice-commits
mailing list