Kaydet (Commit) a264b4c8 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in VectorGraphicData

Change-Id: I73badcdf544b1c3508c9eb9e489b049a9fa12928
üst 89a21453
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <vcl/wmfexternal.hxx> #include <vcl/wmfexternal.hxx>
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
#include <deque> #include <deque>
#include <memory>
typedef css::uno::Sequence<sal_Int8> VectorGraphicDataArray; typedef css::uno::Sequence<sal_Int8> VectorGraphicDataArray;
...@@ -65,7 +66,7 @@ private: ...@@ -65,7 +66,7 @@ private:
VectorGraphicDataType meVectorGraphicDataType; VectorGraphicDataType meVectorGraphicDataType;
// extra: // extra:
WmfExternal* mpExternalHeader; std::unique_ptr<WmfExternal> mpExternalHeader;
// on demand creators // on demand creators
void ensureReplacement(); void ensureReplacement();
......
...@@ -129,7 +129,7 @@ void VectorGraphicData::setWmfExternalHeader(const WmfExternal& aExtHeader) ...@@ -129,7 +129,7 @@ void VectorGraphicData::setWmfExternalHeader(const WmfExternal& aExtHeader)
{ {
if (!mpExternalHeader) if (!mpExternalHeader)
{ {
mpExternalHeader = new WmfExternal; mpExternalHeader.reset( new WmfExternal );
} }
*mpExternalHeader = aExtHeader; *mpExternalHeader = aExtHeader;
...@@ -269,10 +269,6 @@ VectorGraphicData::VectorGraphicData( ...@@ -269,10 +269,6 @@ VectorGraphicData::VectorGraphicData(
VectorGraphicData::~VectorGraphicData() VectorGraphicData::~VectorGraphicData()
{ {
if (mpExternalHeader)
{
delete mpExternalHeader;
};
} }
const basegfx::B2DRange& VectorGraphicData::getRange() const const basegfx::B2DRange& VectorGraphicData::getRange() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment