Kaydet (Commit) 4516546b authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in TheExtensionManager

Change-Id: Ic45feadb64410b3f7833edd52af118436cd9763d
Reviewed-on: https://gerrit.libreoffice.org/50715Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 28799d30
...@@ -104,7 +104,6 @@ TheExtensionManager::~TheExtensionManager() ...@@ -104,7 +104,6 @@ TheExtensionManager::~TheExtensionManager()
{ {
m_pUpdReqDialog.disposeAndClear(); m_pUpdReqDialog.disposeAndClear();
m_pExtMgrDialog.disposeAndClear(); m_pExtMgrDialog.disposeAndClear();
delete m_pExecuteCmdQueue;
} }
...@@ -117,8 +116,7 @@ void TheExtensionManager::createDialog( const bool bCreateUpdDlg ) ...@@ -117,8 +116,7 @@ void TheExtensionManager::createDialog( const bool bCreateUpdDlg )
if ( !m_pUpdReqDialog ) if ( !m_pUpdReqDialog )
{ {
m_pUpdReqDialog = VclPtr<UpdateRequiredDialog>::Create( nullptr, this ); m_pUpdReqDialog = VclPtr<UpdateRequiredDialog>::Create( nullptr, this );
delete m_pExecuteCmdQueue; m_pExecuteCmdQueue.reset( new ExtensionCmdQueue( m_pUpdReqDialog.get(), this, m_xContext ) );
m_pExecuteCmdQueue = new ExtensionCmdQueue( m_pUpdReqDialog.get(), this, m_xContext );
createPackageList(); createPackageList();
} }
} }
...@@ -128,8 +126,7 @@ void TheExtensionManager::createDialog( const bool bCreateUpdDlg ) ...@@ -128,8 +126,7 @@ void TheExtensionManager::createDialog( const bool bCreateUpdDlg )
m_pExtMgrDialog = VclPtr<ExtMgrDialog>::Create( VCLUnoHelper::GetWindow(m_xParent), this ); m_pExtMgrDialog = VclPtr<ExtMgrDialog>::Create( VCLUnoHelper::GetWindow(m_xParent), this );
else else
m_pExtMgrDialog = VclPtr<ExtMgrDialog>::Create( nullptr, this, Dialog::InitFlag::NoParent ); m_pExtMgrDialog = VclPtr<ExtMgrDialog>::Create( nullptr, this, Dialog::InitFlag::NoParent );
delete m_pExecuteCmdQueue; m_pExecuteCmdQueue.reset( new ExtensionCmdQueue( m_pExtMgrDialog.get(), this, m_xContext ) );
m_pExecuteCmdQueue = new ExtensionCmdQueue( m_pExtMgrDialog.get(), this, m_xContext );
m_pExtMgrDialog->setGetExtensionsURL( m_sGetExtensionsURL ); m_pExtMgrDialog->setGetExtensionsURL( m_sGetExtensionsURL );
createPackageList(); createPackageList();
} }
......
...@@ -55,7 +55,7 @@ private: ...@@ -55,7 +55,7 @@ private:
css::uno::Reference< css::awt::XWindow > m_xParent; css::uno::Reference< css::awt::XWindow > m_xParent;
VclPtr<ExtMgrDialog> m_pExtMgrDialog; VclPtr<ExtMgrDialog> m_pExtMgrDialog;
VclPtr<UpdateRequiredDialog> m_pUpdReqDialog; VclPtr<UpdateRequiredDialog> m_pUpdReqDialog;
ExtensionCmdQueue *m_pExecuteCmdQueue; std::unique_ptr<ExtensionCmdQueue> m_pExecuteCmdQueue;
OUString m_sGetExtensionsURL; OUString m_sGetExtensionsURL;
bool m_bModified; bool m_bModified;
...@@ -85,7 +85,7 @@ public: ...@@ -85,7 +85,7 @@ public:
return m_pExtMgrDialog.get(); return m_pExtMgrDialog.get();
return m_pUpdReqDialog.get(); return m_pUpdReqDialog.get();
} }
ExtensionCmdQueue* getCmdQueue() const { return m_pExecuteCmdQueue; } ExtensionCmdQueue* getCmdQueue() const { return m_pExecuteCmdQueue.get(); }
void SetText( const OUString &rTitle ); void SetText( const OUString &rTitle );
void Show(); void Show();
......
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