diff options
| author | Cho <cho@lindenlab.com> | 2013-02-08 02:03:28 +0000 | 
|---|---|---|
| committer | Cho <cho@lindenlab.com> | 2013-02-08 02:03:28 +0000 | 
| commit | c55e4a61242cd3cf94e0a28398fd33a4eb8ea683 (patch) | |
| tree | abf3e7749d69de6ae0fc6d21fef7f428abc8bc69 /indra/llui | |
| parent | 3016afcd0623d8c086cfee36ebf5a0b3210c6fa5 (diff) | |
CHUI-703 FIX Notification buttons: "Join","Decline","Info" are duplicated after relogin while group invitation
Changed LLPersistentNotificationStorage::saveNotification() to use notification->asLLSD(true) to skip duplicates
Changed LLDockControl::mDockWidget to be a LLHandle<LLView> instead of a LLView* to fix crash (from accessing deleted LLView)
Diffstat (limited to 'indra/llui')
| -rw-r--r-- | indra/llui/lldockcontrol.cpp | 31 | ||||
| -rw-r--r-- | indra/llui/lldockcontrol.h | 4 | 
2 files changed, 20 insertions, 15 deletions
| diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp index af39e41fa6..602113432e 100644 --- a/indra/llui/lldockcontrol.cpp +++ b/indra/llui/lldockcontrol.cpp @@ -31,7 +31,6 @@  LLDockControl::LLDockControl(LLView* dockWidget, LLFloater* dockableFloater,  		const LLUIImagePtr& dockTongue, DocAt dockAt, get_allowed_rect_callback_t get_allowed_rect_callback) : -		mDockWidget(dockWidget),  		mDockableFloater(dockableFloater),  		mDockTongue(dockTongue),  		mDockTongueX(0), @@ -39,6 +38,11 @@ LLDockControl::LLDockControl(LLView* dockWidget, LLFloater* dockableFloater,  {  	mDockAt = dockAt; +	if (dockWidget != NULL) +	{ +		mDockWidget = dockWidget->getHandle(); +	} +  	if (dockableFloater->isDocked())  	{  		on(); @@ -62,7 +66,7 @@ LLDockControl::LLDockControl(LLView* dockWidget, LLFloater* dockableFloater,  		repositionDockable();  	} -	if (mDockWidget != NULL) +	if (getDock() != NULL)  	{  		mDockWidgetVisible = isDockVisible();  	} @@ -78,14 +82,15 @@ LLDockControl::~LLDockControl()  void LLDockControl::setDock(LLView* dockWidget)  { -	mDockWidget = dockWidget; -	if (mDockWidget != NULL) +	if (dockWidget != NULL)  	{ +		mDockWidget = dockWidget->getHandle();  		repositionDockable();  		mDockWidgetVisible = isDockVisible();  	}  	else  	{ +		mDockWidget = LLHandle<LLView>();  		mDockWidgetVisible = false;  	}  } @@ -97,8 +102,8 @@ void LLDockControl::getAllowedRect(LLRect& rect)  void LLDockControl::repositionDockable()  { -	if (!mDockWidget) return; -	LLRect dockRect = mDockWidget->calcScreenRect(); +	if (!getDock()) return; +	LLRect dockRect = getDock()->calcScreenRect();  	LLRect rootRect;  	LLRect floater_rect = mDockableFloater->calcScreenRect();  	mGetAllowedRectCallback(rootRect); @@ -150,13 +155,13 @@ bool LLDockControl::isDockVisible()  {  	bool res = true; -	if (mDockWidget != NULL) +	if (getDock() != NULL)  	{  		//we should check all hierarchy -		res = mDockWidget->isInVisibleChain(); +		res = getDock()->isInVisibleChain();  		if (res)  		{ -			LLRect dockRect = mDockWidget->calcScreenRect(); +			LLRect dockRect = getDock()->calcScreenRect();  			switch (mDockAt)  			{ @@ -169,7 +174,7 @@ bool LLDockControl::isDockVisible()  				// assume that parent for all dockable floaters  				// is the root view  				LLRect dockParentRect = -						mDockWidget->getRootView()->calcScreenRect(); +						getDock()->getRootView()->calcScreenRect();  				if (dockRect.mRight <= dockParentRect.mLeft  						|| dockRect.mLeft >= dockParentRect.mRight)  				{ @@ -189,7 +194,7 @@ bool LLDockControl::isDockVisible()  void LLDockControl::moveDockable()  {  	// calculate new dockable position -	LLRect dockRect = mDockWidget->calcScreenRect(); +	LLRect dockRect = getDock()->calcScreenRect();  	LLRect rootRect;  	mGetAllowedRectCallback(rootRect); @@ -263,7 +268,7 @@ void LLDockControl::moveDockable()  		// calculate dock tongue position -		dockParentRect = mDockWidget->getParent()->calcScreenRect(); +		dockParentRect = getDock()->getParent()->calcScreenRect();  		if (dockRect.getCenterX() < dockParentRect.mLeft)  		{  			mDockTongueX = dockParentRect.mLeft - mDockTongue->getWidth() / 2; @@ -299,7 +304,7 @@ void LLDockControl::moveDockable()  		}  		// calculate dock tongue position -		dockParentRect = mDockWidget->getParent()->calcScreenRect(); +		dockParentRect = getDock()->getParent()->calcScreenRect();  		if (dockRect.getCenterX() < dockParentRect.mLeft)  		{  			mDockTongueX = dockParentRect.mLeft - mDockTongue->getWidth() / 2; diff --git a/indra/llui/lldockcontrol.h b/indra/llui/lldockcontrol.h index c9602011f6..a1cfa0072c 100644 --- a/indra/llui/lldockcontrol.h +++ b/indra/llui/lldockcontrol.h @@ -63,7 +63,7 @@ public:  	void setDock(LLView* dockWidget);  	LLView* getDock()  	{ -		return mDockWidget; +		return mDockWidget.get();  	}  	void repositionDockable();  	void drawToungue(); @@ -83,7 +83,7 @@ private:  	bool mRecalculateDockablePosition;  	bool mDockWidgetVisible;  	DocAt mDockAt; -	LLView* mDockWidget; +	LLHandle<LLView> mDockWidget;  	LLRect mPrevDockRect;  	LLRect mRootRect;  	LLRect mFloaterRect; | 
