Kaydet (Commit) 20b34905 authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz#4592 Direct-leak

regression from

commit 225115af
Date:   Fri Sep 15 09:17:17 2017 +0200

    tdf#62525 tools: use cow_wrapper class for Polygon

Change-Id: Ibd9173bfb005f8a30317d95adea4e5fb25f1df1d
Reviewed-on: https://gerrit.libreoffice.org/46229Reviewed-by: 's avatarAndreas Brandner <Andreas.Brandner@cib.de>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 42c59d7c
......@@ -709,11 +709,11 @@ protected:
class ImplPolygonPointFilter : public ImplPointFilter
{
std::unique_ptr<ImplPolygon> mxPoly;
sal_uInt16 mnSize;
ImplPolygon maPoly;
sal_uInt16 mnSize;
public:
explicit ImplPolygonPointFilter(sal_uInt16 nDestSize)
: mxPoly(new ImplPolygon(nDestSize))
: maPoly(nDestSize)
, mnSize(0)
{
}
......@@ -725,24 +725,24 @@ public:
virtual void LastPoint() override;
virtual void Input( const Point& rPoint ) override;
ImplPolygon* release() { return mxPoly.release(); }
ImplPolygon& get() { return maPoly; }
};
void ImplPolygonPointFilter::Input( const Point& rPoint )
{
if ( !mnSize || (rPoint != mxPoly->mpPointAry[mnSize-1]) )
if ( !mnSize || (rPoint != maPoly.mpPointAry[mnSize-1]) )
{
mnSize++;
if ( mnSize > mxPoly->mnPoints )
mxPoly->ImplSetSize( mnSize );
mxPoly->mpPointAry[mnSize-1] = rPoint;
if ( mnSize > maPoly.mnPoints )
maPoly.ImplSetSize( mnSize );
maPoly.mpPointAry[mnSize-1] = rPoint;
}
}
void ImplPolygonPointFilter::LastPoint()
{
if ( mnSize < mxPoly->mnPoints )
mxPoly->ImplSetSize( mnSize );
if ( mnSize < maPoly.mnPoints )
maPoly.ImplSetSize( mnSize );
};
class ImplEdgePointFilter : public ImplPointFilter
......@@ -1494,7 +1494,7 @@ void Polygon::Clip( const tools::Rectangle& rRect )
else
aPolygon.LastPoint();
mpImplPolygon = ImplType(*aPolygon.release());
mpImplPolygon = ImplType(aPolygon.get());
}
tools::Rectangle Polygon::GetBoundRect() 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