diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-04-13 09:26:12 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-04-13 10:28:00 +0100 |
commit | f17489f80020dfd7a9de66c0d580dcf23f7d3c09 (patch) | |
tree | 1e02138d914507e5fc84b8883e5ffcb510063404 /svx/source/sdr | |
parent | 291ec5e9708352a1d98c54814dad8db7ce38fdb9 (diff) |
ofz: fix leak
this is still an ugly beast, but at least its new/delete on the same
type now
Change-Id: I7560eb30c2a43f2cf56a956144fbec66d7d163a6
Diffstat (limited to 'svx/source/sdr')
-rw-r--r-- | svx/source/sdr/properties/itemsettools.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/svx/source/sdr/properties/itemsettools.cxx b/svx/source/sdr/properties/itemsettools.cxx index 942b5715ce68..b3cc64875edc 100644 --- a/svx/source/sdr/properties/itemsettools.cxx +++ b/svx/source/sdr/properties/itemsettools.cxx @@ -24,7 +24,6 @@ #include <svl/whiter.hxx> #include <svx/svdogrp.hxx> #include <svx/svditer.hxx> -#include <vcl/region.hxx> #include <vcl/outdev.hxx> #include <memory> @@ -53,18 +52,18 @@ namespace sdr } } - mnCount = static_cast<RectangleVector*>(mpData)->size(); + mbSingleRect = false; } else { mpData = new tools::Rectangle(rObj.GetLastBoundRect()); - mnCount = 1L; + mbSingleRect = true; } } ItemChangeBroadcaster::~ItemChangeBroadcaster() { - if(mnCount > 1) + if (!mbSingleRect) { delete static_cast<RectangleVector*>(mpData); } @@ -74,10 +73,9 @@ namespace sdr } } - const tools::Rectangle& ItemChangeBroadcaster::GetRectangle(sal_uInt32 nIndex) const { - if(mnCount > 1) + if (!mbSingleRect) { return (*static_cast<RectangleVector*>(mpData))[nIndex]; } |