summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2018-02-14 14:43:04 +0100
committerMichael Stahl <mstahl@redhat.com>2018-02-15 15:54:51 +0100
commit0310430ed0455418cfe85e150f14496aff724897 (patch)
tree681ecdb2bc85978cd14cfab81fb9805df5ba4e79
parentc4b23192b4ab1f3ea75df7e48da36b6b17de248b (diff)
sw: replace DELETEZ with unique_ptr in SwXFrame
Change-Id: I93043bd17a685a82f9365c3eeb27d4288291e2f3 Reviewed-on: https://gerrit.libreoffice.org/49731 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--sw/inc/unoframe.hxx2
-rw-r--r--sw/source/core/unocore/unoframe.cxx9
2 files changed, 4 insertions, 7 deletions
diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx
index f913fb708cd2..de5c9b8ac71a 100644
--- a/sw/inc/unoframe.hxx
+++ b/sw/inc/unoframe.hxx
@@ -71,7 +71,7 @@ private:
bool bIsDescriptor;
OUString m_sName;
- SwPaM* m_pCopySource;
+ std::unique_ptr<SwPaM> m_pCopySource;
sal_Int64 m_nDrawAspect;
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 9b886f7e1682..0ab6c8c26aa1 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -1199,7 +1199,6 @@ SwXFrame::SwXFrame(FlyCntType eSet, const ::SfxItemPropertySet* pSet, SwDoc *pDo
, m_pDoc(pDoc)
, eType(eSet)
, bIsDescriptor(true)
- , m_pCopySource(nullptr)
, m_nDrawAspect(embed::Aspects::MSOLE_CONTENT)
{
// Register ourselves as a listener to the document (via the page descriptor)
@@ -1253,7 +1252,6 @@ SwXFrame::SwXFrame(SwFrameFormat& rFrameFormat, FlyCntType eSet, const ::SfxItem
, m_pDoc(nullptr)
, eType(eSet)
, bIsDescriptor(false)
- , m_pCopySource(nullptr)
, m_nDrawAspect(embed::Aspects::MSOLE_CONTENT)
{
}
@@ -1261,7 +1259,7 @@ SwXFrame::SwXFrame(SwFrameFormat& rFrameFormat, FlyCntType eSet, const ::SfxItem
SwXFrame::~SwXFrame()
{
SolarMutexGuard aGuard;
- delete m_pCopySource;
+ m_pCopySource.reset();
m_pProps.reset();
EndListeningAll();
}
@@ -1352,8 +1350,7 @@ uno::Reference< beans::XPropertySetInfo > SwXFrame::getPropertySetInfo()
void SwXFrame::SetSelection(SwPaM& rCopySource)
{
- delete m_pCopySource;
- m_pCopySource = new SwPaM( *rCopySource.Start() );
+ m_pCopySource.reset(new SwPaM(*rCopySource.Start()));
m_pCopySource->SetMark();
*m_pCopySource->GetMark() = *rCopySource.End();
}
@@ -2785,7 +2782,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
pDoc->SetFlyFrameAttr( *pFormat, aAnchorSet );
delete pAnchorItem;
}
- DELETEZ( m_pCopySource );
+ m_pCopySource.reset();
}
else
{