diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-15 11:41:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-17 10:16:35 +0200 |
commit | a264b4c896a8249c1f4bd63adb5e7de7b13a8d74 (patch) | |
tree | 877cd09b1ee1afb029ba879ac779acbe2301e0b2 | |
parent | 89a214536373886f1d9262eac3ecefb6cc1a2a35 (diff) |
loplugin:useuniqueptr in VectorGraphicData
Change-Id: I73badcdf544b1c3508c9eb9e489b049a9fa12928
-rw-r--r-- | include/vcl/vectorgraphicdata.hxx | 3 | ||||
-rw-r--r-- | vcl/source/gdi/vectorgraphicdata.cxx | 6 |
2 files changed, 3 insertions, 6 deletions
diff --git a/include/vcl/vectorgraphicdata.hxx b/include/vcl/vectorgraphicdata.hxx index 66541616b41c..c258182bc120 100644 --- a/include/vcl/vectorgraphicdata.hxx +++ b/include/vcl/vectorgraphicdata.hxx @@ -26,6 +26,7 @@ #include <vcl/wmfexternal.hxx> #include <rtl/ustring.hxx> #include <deque> +#include <memory> typedef css::uno::Sequence<sal_Int8> VectorGraphicDataArray; @@ -65,7 +66,7 @@ private: VectorGraphicDataType meVectorGraphicDataType; // extra: - WmfExternal* mpExternalHeader; + std::unique_ptr<WmfExternal> mpExternalHeader; // on demand creators void ensureReplacement(); diff --git a/vcl/source/gdi/vectorgraphicdata.cxx b/vcl/source/gdi/vectorgraphicdata.cxx index e59d87495e5d..24aea9c34ffc 100644 --- a/vcl/source/gdi/vectorgraphicdata.cxx +++ b/vcl/source/gdi/vectorgraphicdata.cxx @@ -129,7 +129,7 @@ void VectorGraphicData::setWmfExternalHeader(const WmfExternal& aExtHeader) { if (!mpExternalHeader) { - mpExternalHeader = new WmfExternal; + mpExternalHeader.reset( new WmfExternal ); } *mpExternalHeader = aExtHeader; @@ -269,10 +269,6 @@ VectorGraphicData::VectorGraphicData( VectorGraphicData::~VectorGraphicData() { - if (mpExternalHeader) - { - delete mpExternalHeader; - }; } const basegfx::B2DRange& VectorGraphicData::getRange() const |