Kaydet (Commit) 177f92a9 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SfxChildWindow

Change-Id: I6c9db4cd4f46790295f37c620e2efea4f61870bf
Reviewed-on: https://gerrit.libreoffice.org/48741Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 53d21a31
...@@ -148,7 +148,7 @@ class SFX2_DLLPUBLIC SfxChildWindow ...@@ -148,7 +148,7 @@ class SFX2_DLLPUBLIC SfxChildWindow
VclPtr<vcl::Window> pWindow; // actual contents VclPtr<vcl::Window> pWindow; // actual contents
SfxChildAlignment eChildAlignment; // Current css::drawing::Alignment SfxChildAlignment eChildAlignment; // Current css::drawing::Alignment
std::unique_ptr< SfxChildWindow_Impl> pImpl; // Implementation data std::unique_ptr< SfxChildWindow_Impl> pImpl; // Implementation data
SfxChildWindowContext* pContext; // With context-sensitive ChildWindows: std::unique_ptr<SfxChildWindowContext> pContext; // With context-sensitive ChildWindows:
// Another window in pWindow // Another window in pWindow
SAL_DLLPRIVATE void ClearWorkwin(); SAL_DLLPRIVATE void ClearWorkwin();
...@@ -206,7 +206,7 @@ public: ...@@ -206,7 +206,7 @@ public:
SAL_DLLPRIVATE SfxChildWindowContext* SAL_DLLPRIVATE SfxChildWindowContext*
GetContext_Impl() const GetContext_Impl() const
{ return pContext; } { return pContext.get(); }
SAL_DLLPRIVATE void SetFactory_Impl( SfxChildWinFactory* ); SAL_DLLPRIVATE void SetFactory_Impl( SfxChildWinFactory* );
}; };
......
...@@ -193,8 +193,7 @@ void SfxChildWindow::ClearWorkwin() ...@@ -193,8 +193,7 @@ void SfxChildWindow::ClearWorkwin()
SfxChildWindow::~SfxChildWindow() SfxChildWindow::~SfxChildWindow()
{ {
delete pContext; pContext.reset();
pContext = nullptr;
ClearWorkwin(); ClearWorkwin();
pWindow.disposeAndClear(); pWindow.disposeAndClear();
} }
...@@ -495,8 +494,7 @@ void SfxChildWindow::CreateContext( sal_uInt16 nContextId, SfxBindings& rBinding ...@@ -495,8 +494,7 @@ void SfxChildWindow::CreateContext( sal_uInt16 nContextId, SfxBindings& rBinding
return; return;
} }
delete pContext; pContext.reset(pCon);
pContext = pCon;
pContext->GetWindow()->SetSizePixel( pWindow->GetOutputSizePixel() ); pContext->GetWindow()->SetSizePixel( pWindow->GetOutputSizePixel() );
pContext->GetWindow()->Show(); pContext->GetWindow()->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