[Bf-blender-cvs] [811ce5a] master: Code cleanup: Minor addition to rB254aa8f3a0fbffcbcb886cfaa81b630ae3e9bb78: handle copying of drawflag in ui_but_update_from_old_block()

Bastien Montagne noreply at git.blender.org
Thu Nov 21 20:30:47 CET 2013


Commit: 811ce5a696ae4b7043744a081980c3e77e4bd927
Author: Bastien Montagne
Date:   Thu Nov 21 20:25:31 2013 +0100
http://developer.blender.org/rB811ce5a696ae4b7043744a081980c3e77e4bd927

Code cleanup: Minor addition to rB254aa8f3a0fbffcbcb886cfaa81b630ae3e9bb78: handle copying of drawflag in ui_but_update_from_old_block()

Note that this is not really needed currently, as the only flag being copied here (UI_BUT_REDALERT) remained in but->flag. However, since we'll have more flags in drawflag now, it's better to explicitly handle this situation...
This func could use some cleanup anyway (a bunch of commented code here)...

Thanks to Campbell for noting this!

===================================================================

M	source/blender/editors/interface/interface.c

===================================================================

diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 800fee6..3f48446 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -613,6 +613,7 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut
 {
 	/* flags from the buttons we want to refresh, may want to add more here... */
 	const int flag_copy = UI_BUT_REDALERT;
+	const int drawflag_copy = 0;  /* None currently. */
 
 	uiBlock *oldblock;
 	uiBut *oldbut, *but = *butpp;
@@ -670,8 +671,9 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut
 					SWAP(char *, oldbut->poin, but->poin);
 					SWAP(void *, oldbut->func_argN, but->func_argN);
 				}
-				
+
 				oldbut->flag = (oldbut->flag & ~flag_copy) | (but->flag & flag_copy);
+				oldbut->drawflag = (oldbut->drawflag & ~drawflag_copy) | (but->drawflag & drawflag_copy);
 
 				/* copy hardmin for list rows to prevent 'sticking' highlight to mouse position
 				 * when scrolling without moving mouse (see [#28432]) */




More information about the Bf-blender-cvs mailing list