← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2397: rectify splitter asserts not to choke on null widgets

 

------------------------------------------------------------
revno: 2397
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Tue 2011-01-18 19:39:48 +0100
message:
  rectify splitter asserts not to choke on null widgets
modified:
  dwt/include/dwt/widgets/Splitter.h


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dwt/include/dwt/widgets/Splitter.h'
--- dwt/include/dwt/widgets/Splitter.h	2011-01-02 17:12:02 +0000
+++ dwt/include/dwt/widgets/Splitter.h	2011-01-18 18:39:48 +0000
@@ -72,16 +72,16 @@
 		return first;
 	}
 	void setFirst(Widget* first_) {
-		dwtassert(first_->getParent() == getParent(), _T("A splitter and its siblings must have the same parent"));
 		first = first_;
+		dwtassert(!first || first->getParent() == getParent(), _T("A splitter and its siblings must have the same parent"));
 	}
 
 	Widget* getSecond() {
 		return second;
 	}
 	void setSecond(Widget* second_) {
-		dwtassert(second_->getParent() == getParent(), _T("A splitter and its siblings must have the same parent"));
 		second = second_;
+		dwtassert(!second || second->getParent() == getParent(), _T("A splitter and its siblings must have the same parent"));
 	}
 
 	void create(const Seed& cs = Seed());