diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-18 13:57:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-19 09:35:21 +0000 |
commit | 0415cb335b953b9c10075fa524d7707db4aa55e5 (patch) | |
tree | f714106565c6c58a4711b21f966ecc09c8b83157 /toolkit | |
parent | c3e6d12301b42a44bd0d4584005686e324533b60 (diff) |
new loplugin: useuniqueptr: sot..tools
Change-Id: Ided435d016ae28e7c3f2726e41eedd981572ae10
Reviewed-on: https://gerrit.libreoffice.org/33263
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxfont.cxx | 6 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindow.cxx | 10 |
2 files changed, 7 insertions, 9 deletions
diff --git a/toolkit/source/awt/vclxfont.cxx b/toolkit/source/awt/vclxfont.cxx index aa42cf64272e..1df5b56ee233 100644 --- a/toolkit/source/awt/vclxfont.cxx +++ b/toolkit/source/awt/vclxfont.cxx @@ -40,15 +40,13 @@ VCLXFont::VCLXFont() VCLXFont::~VCLXFont() { - delete mpFontMetric; } void VCLXFont::Init( css::awt::XDevice& rxDev, const vcl::Font& rFont ) { mxDevice = &rxDev; - delete mpFontMetric; - mpFontMetric = nullptr; + mpFontMetric.reset(); maFont = rFont; } @@ -62,7 +60,7 @@ bool VCLXFont::ImplAssertValidFontMetric() { vcl::Font aOldFont = pOutDev->GetFont(); pOutDev->SetFont( maFont ); - mpFontMetric = new FontMetric( pOutDev->GetFontMetric() ); + mpFontMetric.reset( new FontMetric( pOutDev->GetFontMetric() ) ); pOutDev->SetFont( aOldFont ); } } diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 00852e085968..9d862e26c0ec 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -118,11 +118,12 @@ public: bool mbSynthesizingVCLEvent : 1; bool mbWithDefaultProps : 1; - sal_uLong mnListenerLockLevel; + sal_uLong mnListenerLockLevel; sal_Int16 mnWritingMode; sal_Int16 mnContextWritingMode; - UnoPropertyArrayHelper* mpPropHelper; + std::unique_ptr<UnoPropertyArrayHelper> + mpPropHelper; css::uno::Reference< css::awt::XPointer > mxPointer; @@ -224,7 +225,6 @@ VCLXWindowImpl::VCLXWindowImpl( VCLXWindow& _rAntiImpl, bool _bWithDefaultProps VCLXWindowImpl::~VCLXWindowImpl() { - delete mpPropHelper; } @@ -2551,9 +2551,9 @@ VCLXWindow::GetPropHelper() { std::vector< sal_uInt16 > aIDs; GetPropertyIds( aIDs ); - mpImpl->mpPropHelper = new UnoPropertyArrayHelper( aIDs ); + mpImpl->mpPropHelper.reset( new UnoPropertyArrayHelper( aIDs ) ); } - return mpImpl->mpPropHelper; + return mpImpl->mpPropHelper.get(); } css::uno::Sequence< css::beans::Property > SAL_CALL |