diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-22 10:01:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-22 11:13:34 +0200 |
commit | ab0f8e61f663acd0bf30469b6abadca078906b64 (patch) | |
tree | 151fd6838a005c8d9e64a7059898a6b99b3112f0 /vcl/unx/generic/gdi/salvd.cxx | |
parent | 582aa81147557ace37b8ad4aea1bd153eb743c66 (diff) |
pass X11SalGraphics around by std::unique_ptr
Change-Id: Id2fcf829e3ca0edcfcdd3d4daf31188ae5317b27
Reviewed-on: https://gerrit.libreoffice.org/59427
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/unx/generic/gdi/salvd.cxx')
-rw-r--r-- | vcl/unx/generic/gdi/salvd.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/vcl/unx/generic/gdi/salvd.cxx b/vcl/unx/generic/gdi/salvd.cxx index d7223df9de8b..46e0fcbdf7f0 100644 --- a/vcl/unx/generic/gdi/salvd.cxx +++ b/vcl/unx/generic/gdi/salvd.cxx @@ -32,24 +32,25 @@ #include <salinst.hxx> +#include <o3tl/make_unique.hxx> #include <vcl/opengl/OpenGLHelper.hxx> #include <opengl/x11/salvd.hxx> std::unique_ptr<SalVirtualDevice> X11SalInstance::CreateX11VirtualDevice(SalGraphics const * pGraphics, long &nDX, long &nDY, DeviceFormat eFormat, const SystemGraphicsData *pData, - X11SalGraphics* pNewGraphics) + std::unique_ptr<X11SalGraphics> pNewGraphics) { assert(pNewGraphics); if (OpenGLHelper::isVCLOpenGLEnabled()) - return std::unique_ptr<SalVirtualDevice>(new X11OpenGLSalVirtualDevice( pGraphics, nDX, nDY, pData, pNewGraphics )); + return std::unique_ptr<SalVirtualDevice>(new X11OpenGLSalVirtualDevice( pGraphics, nDX, nDY, pData, std::move(pNewGraphics) )); else - return std::unique_ptr<SalVirtualDevice>(new X11SalVirtualDevice(pGraphics, nDX, nDY, eFormat, pData, pNewGraphics)); + return std::unique_ptr<SalVirtualDevice>(new X11SalVirtualDevice(pGraphics, nDX, nDY, eFormat, pData, std::move(pNewGraphics))); } std::unique_ptr<SalVirtualDevice> X11SalInstance::CreateVirtualDevice(SalGraphics* pGraphics, long &nDX, long &nDY, DeviceFormat eFormat, const SystemGraphicsData *pData) { - return CreateX11VirtualDevice(pGraphics, nDX, nDY, eFormat, pData, new X11SalGraphics()); + return CreateX11VirtualDevice(pGraphics, nDX, nDY, eFormat, pData, o3tl::make_unique<X11SalGraphics>()); } void X11SalGraphics::Init( X11SalVirtualDevice *pDevice, SalColormap* pColormap, @@ -88,8 +89,8 @@ void X11SalGraphics::Init( X11SalVirtualDevice *pDevice, SalColormap* pColormap, X11SalVirtualDevice::X11SalVirtualDevice(SalGraphics const * pGraphics, long &nDX, long &nDY, DeviceFormat eFormat, const SystemGraphicsData *pData, - X11SalGraphics* pNewGraphics) : - pGraphics_(pNewGraphics), + std::unique_ptr<X11SalGraphics> pNewGraphics) : + pGraphics_(std::move(pNewGraphics)), m_nXScreen(0), bGraphics_(false) { |