diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-02-23 09:41:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-02-23 09:25:07 +0100 |
commit | a079e9010398ba2c33cf2509ff511e711b5e5b37 (patch) | |
tree | 70c7513515f3e827694c2084318237131f6ae7c9 /toolkit/source/awt/vclxdevice.cxx | |
parent | 0bbb687d37f6493956259fe8486820618a28af0b (diff) |
loplugin:refcounting in toolkit
Change-Id: I4a65ee848eed7c48340c73d3144b4a1e29ab867c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111370
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit/source/awt/vclxdevice.cxx')
-rw-r--r-- | toolkit/source/awt/vclxdevice.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/toolkit/source/awt/vclxdevice.cxx b/toolkit/source/awt/vclxdevice.cxx index ba382248c0fd..d82e1a6ec905 100644 --- a/toolkit/source/awt/vclxdevice.cxx +++ b/toolkit/source/awt/vclxdevice.cxx @@ -70,7 +70,7 @@ css::uno::Reference< css::awt::XDevice > VCLXDevice::createDevice( sal_Int32 nWi css::uno::Reference< css::awt::XDevice > xRef; if ( GetOutputDevice() ) { - VCLXVirtualDevice* pVDev = new VCLXVirtualDevice; + rtl::Reference<VCLXVirtualDevice> pVDev = new VCLXVirtualDevice; VclPtrInstance<VirtualDevice> pVclVDev( *GetOutputDevice() ); pVclVDev->SetOutputSizePixel( Size( nWidth, nHeight ) ); pVDev->SetVirtualDevice( pVclVDev ); @@ -117,7 +117,7 @@ css::uno::Reference< css::awt::XFont > VCLXDevice::getFont( const css::awt::Font css::uno::Reference< css::awt::XFont > xRef; if( mpOutputDevice ) { - VCLXFont* pMetric = new VCLXFont; + rtl::Reference<VCLXFont> pMetric = new VCLXFont; pMetric->Init( *this, VCLUnoHelper::CreateFont( rDescriptor, mpOutputDevice->GetFont() ) ); xRef = pMetric; } @@ -133,7 +133,7 @@ css::uno::Reference< css::awt::XBitmap > VCLXDevice::createBitmap( sal_Int32 nX, { BitmapEx aBmp = mpOutputDevice->GetBitmapEx( Point( nX, nY ), Size( nWidth, nHeight ) ); - VCLXBitmap* pBmp = new VCLXBitmap; + rtl::Reference<VCLXBitmap> pBmp = new VCLXBitmap; pBmp->SetBitmap( aBmp ); xBmp = pBmp; } @@ -145,10 +145,9 @@ css::uno::Reference< css::awt::XDisplayBitmap > VCLXDevice::createDisplayBitmap( SolarMutexGuard aGuard; BitmapEx aBmp = VCLUnoHelper::GetBitmap( rxBitmap ); - VCLXBitmap* pBmp = new VCLXBitmap; + rtl::Reference<VCLXBitmap> pBmp = new VCLXBitmap; pBmp->SetBitmap( aBmp ); - css::uno::Reference< css::awt::XDisplayBitmap > xDBmp = pBmp; - return xDBmp; + return pBmp; } VCLXVirtualDevice::~VCLXVirtualDevice() |