Kaydet (Commit) 8ffd83de authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SfxModalDialog

Change-Id: I612b92045c3a1cf4a443adf2b35fe7ac6f1aa0bf
Reviewed-on: https://gerrit.libreoffice.org/53868Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 0e2d60f8
......@@ -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;
};
......
......@@ -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();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment