summaryrefslogtreecommitdiff
path: root/svx/source/sdr/overlay
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2017-01-23 09:01:42 +0100
committerJochen Nitschke <j.nitschke+logerrit@ok.de>2017-01-23 13:50:45 +0000
commitabc8057ab1a1189ff7f88d42b13b363ceb228d16 (patch)
tree20145fa90c9a1bf91dea3489d384fe6d28ac2ec0 /svx/source/sdr/overlay
parent5f1bc19a9a0dbdf88e11ef81cc8c2f302748632c (diff)
pass ownership by pointer
to show the intend of the code. assert on invalid objects. remove useless OSL_ENSURE. make sure list of owning pointers can't be copied. Change-Id: I3cccf8ea87585ec9fe62921203a4d12e617ce15c Reviewed-on: https://gerrit.libreoffice.org/33393 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'svx/source/sdr/overlay')
-rw-r--r--svx/source/sdr/overlay/overlayobjectlist.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/svx/source/sdr/overlay/overlayobjectlist.cxx b/svx/source/sdr/overlay/overlayobjectlist.cxx
index eef8cf5a7ee5..ba72794a8193 100644
--- a/svx/source/sdr/overlay/overlayobjectlist.cxx
+++ b/svx/source/sdr/overlay/overlayobjectlist.cxx
@@ -60,13 +60,18 @@ namespace sdr
maVector.clear();
}
+ void OverlayObjectList::append(OverlayObject* pOverlayObject)
+ {
+ assert(pOverlayObject && "tried to add invalid OverlayObject to OverlayObjectList");
+ maVector.push_back(pOverlayObject);
+ }
+
bool OverlayObjectList::isHitLogic(const basegfx::B2DPoint& rLogicPosition, double fLogicTolerance) const
{
if(!maVector.empty())
{
OverlayObjectVector::const_iterator aStart(maVector.begin());
sdr::overlay::OverlayObject* pFirst = *aStart;
- OSL_ENSURE(pFirst, "Corrupt OverlayObjectList (!)");
OverlayManager* pManager = pFirst->getOverlayManager();
if(pManager)
@@ -97,7 +102,6 @@ namespace sdr
for(; aStart != maVector.end(); ++aStart)
{
sdr::overlay::OverlayObject* pCandidate = *aStart;
- OSL_ENSURE(pCandidate, "Corrupt OverlayObjectList (!)");
if(pCandidate->isHittable())
{