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
VclPtr<vcl::Window> pWindow; // actual contents
SfxChildAlignment eChildAlignment; // Current css::drawing::Alignment
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
SAL_DLLPRIVATE void ClearWorkwin();
......@@ -206,7 +206,7 @@ public:
SAL_DLLPRIVATE SfxChildWindowContext*
GetContext_Impl() const
{ return pContext; }
{ return pContext.get(); }
SAL_DLLPRIVATE void SetFactory_Impl( SfxChildWinFactory* );
};
......
......@@ -193,8 +193,7 @@ void SfxChildWindow::ClearWorkwin()
SfxChildWindow::~SfxChildWindow()
{
delete pContext;
pContext = nullptr;
pContext.reset();
ClearWorkwin();
pWindow.disposeAndClear();
}
......@@ -495,8 +494,7 @@ void SfxChildWindow::CreateContext( sal_uInt16 nContextId, SfxBindings& rBinding
return;
}
delete pContext;
pContext = pCon;
pContext.reset(pCon);
pContext->GetWindow()->SetSizePixel( pWindow->GetOutputSizePixel() );
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