summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-05-01 17:57:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-05-02 08:27:05 +0200
commite43764452e3e2a8b0acb197d6eff2cb9fc76772a (patch)
treeca2c06f445ea1b69ed31ef59bed140a524b8cbbc /svx
parent18b5b3ae444209b2e4476411194896ae917a2beb (diff)
loplugin:useuniqueptr in GalleryBrowser1
Change-Id: I0b95beed2c056e10cb40d09bf1040143778724ca Reviewed-on: https://gerrit.libreoffice.org/53710 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/gallery2/galbrws1.cxx10
-rw-r--r--svx/source/gallery2/galbrws1.hxx4
2 files changed, 6 insertions, 8 deletions
diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index 7a8525c25990..4958e41f3ae5 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -150,8 +150,7 @@ void GalleryBrowser1::dispose()
EndListening( *mpGallery );
mpThemePropertiesDialog.clear();
mpThemes.disposeAndClear();
- delete mpExchangeData;
- mpExchangeData = nullptr;
+ mpExchangeData.reset();
maNewTheme.disposeAndClear();
Control::dispose();
}
@@ -259,14 +258,14 @@ void GalleryBrowser1::ImplGetExecuteVector(std::vector<OString>& o_aExec)
void GalleryBrowser1::ImplGalleryThemeProperties( const OUString & rThemeName, bool bCreateNew )
{
DBG_ASSERT(!mpThemePropsDlgItemSet, "mpThemePropsDlgItemSet already set!");
- mpThemePropsDlgItemSet = new SfxItemSet( SfxGetpApp()->GetPool() );
+ mpThemePropsDlgItemSet.reset(new SfxItemSet( SfxGetpApp()->GetPool() ));
GalleryTheme* pTheme = mpGallery->AcquireTheme( rThemeName, *this );
ImplFillExchangeData( pTheme, *mpExchangeData );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
assert(pFact && "Got no AbstractDialogFactory!");
- mpThemePropertiesDialog = pFact->CreateGalleryThemePropertiesDialog(this, mpExchangeData, mpThemePropsDlgItemSet);
+ mpThemePropertiesDialog = pFact->CreateGalleryThemePropertiesDialog(this, mpExchangeData.get(), mpThemePropsDlgItemSet.get());
assert(mpThemePropertiesDialog && "Got no GalleryThemePropertiesDialog!");
if ( bCreateNew )
@@ -336,8 +335,7 @@ IMPL_LINK( GalleryBrowser1, EndThemePropertiesDlgHdl, Dialog&, /*rDialog*/, void
IMPL_LINK( GalleryBrowser1, DestroyThemePropertiesDlgHdl, void*, /*p*/, void )
{
mpThemePropertiesDialog.disposeAndClear();
- delete mpThemePropsDlgItemSet;
- mpThemePropsDlgItemSet = nullptr;
+ mpThemePropsDlgItemSet.reset();
}
void GalleryBrowser1::ImplExecute(const OString &rIdent)
diff --git a/svx/source/gallery2/galbrws1.hxx b/svx/source/gallery2/galbrws1.hxx
index 858a9559c17a..24f6ada7aade 100644
--- a/svx/source/gallery2/galbrws1.hxx
+++ b/svx/source/gallery2/galbrws1.hxx
@@ -78,8 +78,8 @@ private:
VclPtr<GalleryThemeListBox> mpThemes;
VclPtr<VclAbstractDialog2> mpThemePropertiesDialog; // to keep it alive during execution
Gallery* mpGallery;
- ExchangeData* mpExchangeData;
- SfxItemSet* mpThemePropsDlgItemSet;
+ std::unique_ptr<ExchangeData> mpExchangeData;
+ std::unique_ptr<SfxItemSet> mpThemePropsDlgItemSet;
Image aImgNormal;
Image aImgDefault;