From 04b1c44b89086a9521bb478c8e99d024cef8f6a6 Mon Sep 17 00:00:00 2001 From: czeidler Date: Wed, 17 Oct 2012 07:23:00 +0000 Subject: [PATCH] Use a tab BReference as argument in Area::Set{Left, Top, Right, Bottom}. Using a normal pointer is dangerous when creating a new tab directly in the method call because the tab gets deleted to early. --- headers/libs/alm/Area.h | 8 ++++---- src/libs/alm/Area.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/headers/libs/alm/Area.h b/headers/libs/alm/Area.h index 6f471c6431..e5a3c02a3a 100644 --- a/headers/libs/alm/Area.h +++ b/headers/libs/alm/Area.h @@ -56,10 +56,10 @@ public: XTab* Right() const; YTab* Top() const; YTab* Bottom() const; - void SetLeft(XTab* left); - void SetRight(XTab* right); - void SetTop(YTab* top); - void SetBottom(YTab* bottom); + void SetLeft(BReference left); + void SetRight(BReference right); + void SetTop(BReference top); + void SetBottom(BReference bottom); Row* GetRow() const; Column* GetColumn() const; diff --git a/src/libs/alm/Area.cpp b/src/libs/alm/Area.cpp index 9093ea82c6..3d0a79488f 100644 --- a/src/libs/alm/Area.cpp +++ b/src/libs/alm/Area.cpp @@ -78,7 +78,7 @@ Area::Bottom() const * @param left the left tab of the area */ void -Area::SetLeft(XTab* left) +Area::SetLeft(BReference left) { fLeft = left; @@ -97,7 +97,7 @@ Area::SetLeft(XTab* left) * @param right the right tab of the area */ void -Area::SetRight(XTab* right) +Area::SetRight(BReference right) { fRight = right; @@ -114,7 +114,7 @@ Area::SetRight(XTab* right) * Sets the top tab of the area. */ void -Area::SetTop(YTab* top) +Area::SetTop(BReference top) { fTop = top; @@ -131,7 +131,7 @@ Area::SetTop(YTab* top) * Sets the bottom tab of the area. */ void -Area::SetBottom(YTab* bottom) +Area::SetBottom(BReference bottom) { fBottom = bottom;