use unique_ptr for mpWinData

Change-Id: I38a9cedc3041a78160536b40bd369df767101de5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109993
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2021-01-27 07:38:32 +01:00
committed by Noel Grandin
parent b2ebceeaf4
commit ed6765d318
2 changed files with 4 additions and 5 deletions
+1 -1
View File
@@ -221,7 +221,7 @@ public:
WindowImpl( WindowType );
~WindowImpl();
ImplWinData* mpWinData;
std::unique_ptr<ImplWinData> mpWinData;
ImplFrameData* mpFrameData;
SalFrame* mpFrame;
SalObject* mpSysObj;
+3 -4
View File
@@ -517,8 +517,7 @@ void Window::dispose()
}
}
delete mpWindowImpl->mpWinData;
mpWindowImpl->mpWinData = nullptr;
mpWindowImpl->mpWinData.reset();
// remove BorderWindow or Frame window data
mpWindowImpl->mpBorderWindow.disposeAndClear();
@@ -1214,11 +1213,11 @@ ImplWinData* Window::ImplGetWinData() const
{
static const char* pNoNWF = getenv( "SAL_NO_NWF" );
const_cast<vcl::Window*>(this)->mpWindowImpl->mpWinData = new ImplWinData;
const_cast<vcl::Window*>(this)->mpWindowImpl->mpWinData.reset(new ImplWinData);
mpWindowImpl->mpWinData->mbEnableNativeWidget = !(pNoNWF && *pNoNWF); // true: try to draw this control with native theme API
}
return mpWindowImpl->mpWinData;
return mpWindowImpl->mpWinData.get();
}