diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-03 14:05:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-07 08:31:32 +0200 |
commit | 8ffd83de107adfcc7a18bde6e8337c90924b89b7 (patch) | |
tree | 0f3aa6bcf7ea04d873943bff20fce72a3e4e62eb | |
parent | 0e2d60f8565c2619807900244b3238ea23c4d962 (diff) |
loplugin:useuniqueptr in SfxModalDialog
Change-Id: I612b92045c3a1cf4a443adf2b35fe7ac6f1aa0bf
Reviewed-on: https://gerrit.libreoffice.org/53868
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/sfx2/basedlgs.hxx | 6 | ||||
-rw-r--r-- | sfx2/source/dialog/basedlgs.cxx | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx index e5110415dcf4..58657fc58e8b 100644 --- a/include/sfx2/basedlgs.hxx +++ b/include/sfx2/basedlgs.hxx @@ -47,7 +47,7 @@ class SFX2_DLLPUBLIC SfxModalDialog: public ModalDialog { OUString aExtraData; const SfxItemSet* pInputSet; - SfxItemSet* pOutputSet; + std::unique_ptr<SfxItemSet> pOutputSet; private: SfxModalDialog(SfxModalDialog &) = delete; @@ -62,13 +62,13 @@ protected: OUString& GetExtraData() { return aExtraData; } void CreateOutputItemSet( const SfxItemSet& rInput ); void SetInputSet( const SfxItemSet* pInSet ) { pInputSet = pInSet; } - SfxItemSet* GetOutputSetImpl() { return pOutputSet; } + SfxItemSet* GetOutputSetImpl() { return pOutputSet.get(); } public: virtual ~SfxModalDialog() override; virtual void dispose() override; - const SfxItemSet* GetOutputItemSet() const { return pOutputSet; } + const SfxItemSet* GetOutputItemSet() const { return pOutputSet.get(); } const SfxItemSet* GetInputItemSet() const { return pInputSet; } void StateChanged( StateChangedType nStateChange ) override; }; diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index beb615a60d60..9aa81f460a2a 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -138,7 +138,7 @@ SfxModalDialog::~SfxModalDialog() void SfxModalDialog::dispose() { SetDialogData_Impl(); - delete pOutputSet; + pOutputSet.reset(); ModalDialog::dispose(); } @@ -148,7 +148,7 @@ void SfxModalDialog::CreateOutputItemSet( const SfxItemSet& rSet ) DBG_ASSERT( !pOutputSet, "Double creation of OutputSet!" ); if (!pOutputSet) { - pOutputSet = new SfxItemSet( rSet ); + pOutputSet.reset(new SfxItemSet( rSet )); pOutputSet->ClearItem(); } } |