summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-02-06 11:40:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-17 07:07:15 +0100
commitd4be0bfedf8497ad3b4244aeeb0b761b5c6b128b (patch)
treeea41a9f9ee54f747db0f880447046fc1a32ee389 /svx
parent794066fa1ac67b6e352c17e78245a2698b0c470b (diff)
loplugin:useuniqueptr in FmEntryData
Change-Id: I6356807ad2b4e0e22908d59713de54842e1a0e00 Reviewed-on: https://gerrit.libreoffice.org/49878 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/form/fmexpl.cxx7
-rw-r--r--svx/source/inc/fmexpl.hxx5
2 files changed, 6 insertions, 6 deletions
diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx
index 96166a275440..9e96bd6db2d5 100644
--- a/svx/source/form/fmexpl.cxx
+++ b/svx/source/form/fmexpl.cxx
@@ -176,7 +176,7 @@ void FmEntryDataList::clear()
FmEntryData::FmEntryData( FmEntryData* pParentData, const Reference< XInterface >& _rxIFace )
:pParent( pParentData )
{
- pChildList = new FmEntryDataList();
+ pChildList.reset( new FmEntryDataList() );
newObject( _rxIFace );
}
@@ -184,8 +184,7 @@ FmEntryData::FmEntryData( FmEntryData* pParentData, const Reference< XInterface
FmEntryData::~FmEntryData()
{
- GetChildList()->clear();
- delete pChildList;
+ pChildList->clear();
}
@@ -200,7 +199,7 @@ void FmEntryData::newObject( const css::uno::Reference< css::uno::XInterface >&
FmEntryData::FmEntryData( const FmEntryData& rEntryData )
{
- pChildList = new FmEntryDataList();
+ pChildList.reset( new FmEntryDataList() );
aText = rEntryData.GetText();
m_aNormalImage = rEntryData.GetNormalImage();
pParent = rEntryData.GetParent();
diff --git a/svx/source/inc/fmexpl.hxx b/svx/source/inc/fmexpl.hxx
index a089f10f015d..76142653fe7a 100644
--- a/svx/source/inc/fmexpl.hxx
+++ b/svx/source/inc/fmexpl.hxx
@@ -144,7 +144,8 @@ protected:
Image m_aNormalImage;
OUString aText;
- FmEntryDataList* pChildList;
+ std::unique_ptr<FmEntryDataList>
+ pChildList;
FmEntryData* pParent;
protected:
@@ -163,7 +164,7 @@ public:
const OUString& GetText() const { return aText; }
FmEntryData* GetParent() const { return pParent; }
- FmEntryDataList* GetChildList() const { return pChildList; }
+ FmEntryDataList* GetChildList() const { return pChildList.get(); }
virtual bool IsEqualWithoutChildren( FmEntryData* pEntryData );
virtual FmEntryData* Clone() = 0;