diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-30 18:46:04 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-02 08:26:13 +0200 |
commit | cee2ccb38f0b6d223d9c60da6538f06a84ad6192 (patch) | |
tree | 29711b815487a8fa772de1c9a2d2bdedfe3b50e0 /vcl/unx/generic/gdi/salvd.cxx | |
parent | ecf6e884d50c9d6220a95ef1a785e9643fb1f01e (diff) |
loplugin:useuniqueptr in X11SalBitmap
Change-Id: I3fedb4b25683bafbdb7c761387d47a8b30ef8083
Reviewed-on: https://gerrit.libreoffice.org/53706
Tested-by: Jenkins <ci@libreoffice.org>
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 | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/vcl/unx/generic/gdi/salvd.cxx b/vcl/unx/generic/gdi/salvd.cxx index 3bbe0fde016b..d7223df9de8b 100644 --- a/vcl/unx/generic/gdi/salvd.cxx +++ b/vcl/unx/generic/gdi/salvd.cxx @@ -55,8 +55,6 @@ std::unique_ptr<SalVirtualDevice> X11SalInstance::CreateVirtualDevice(SalGraphic void X11SalGraphics::Init( X11SalVirtualDevice *pDevice, SalColormap* pColormap, bool bDeleteColormap ) { - SalColormap *pOrigDeleteColormap = m_pDeleteColormap; - SalDisplay *pDisplay = pDevice->GetDisplay(); m_nXScreen = pDevice->GetXScreenNumber(); @@ -67,15 +65,15 @@ void X11SalGraphics::Init( X11SalVirtualDevice *pDevice, SalColormap* pColormap, { m_pColormap = pColormap; if( bDeleteColormap ) - m_pDeleteColormap = pColormap; + m_pDeleteColormap.reset(pColormap); } else if( nDeviceDepth == nVisualDepth ) m_pColormap = &pDisplay->GetColormap( m_nXScreen ); else if( nDeviceDepth == 1 ) - m_pColormap = m_pDeleteColormap = new SalColormap(); - - if (m_pDeleteColormap != pOrigDeleteColormap) - delete pOrigDeleteColormap; + { + m_pDeleteColormap.reset(new SalColormap()); + m_pColormap = m_pDeleteColormap.get(); + } m_pVDev = pDevice; m_pFrame = nullptr; |