diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-28 20:33:02 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-28 20:33:02 +0400 |
commit | 74e4ad20c9e8d19f85aaa2995652e3f65bdfc0c9 (patch) | |
tree | 7f20ead7facacb69f02ab9384bcd855598878133 /source/blender/editors/space_buttons/buttons_header.c | |
parent | f4f3a9b08b04077e6e9272e4fdd4cd550b47be02 (diff) |
2.5: code cleanup, added CTX_wm_space_* for each space type,
instead of casting everywhere.
Diffstat (limited to 'source/blender/editors/space_buttons/buttons_header.c')
-rw-r--r-- | source/blender/editors/space_buttons/buttons_header.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c index b5af1ab598c..a1041bc5106 100644 --- a/source/blender/editors/space_buttons/buttons_header.c +++ b/source/blender/editors/space_buttons/buttons_header.c @@ -65,7 +65,10 @@ static void do_buttons_buttons(bContext *C, void *arg, int event) { - SpaceButs *sbuts= (SpaceButs*)CTX_wm_space_data(C); + SpaceButs *sbuts= CTX_wm_space_buts(C); + + if(!sbuts) /* window type switch */ + return; switch(event) { case B_CONTEXT_SWITCH: @@ -87,7 +90,7 @@ static void do_buttons_buttons(bContext *C, void *arg, int event) void buttons_header_buttons(const bContext *C, ARegion *ar) { - SpaceButs *sbuts= (SpaceButs*)CTX_wm_space_data(C); + SpaceButs *sbuts= CTX_wm_space_buts(C); uiBlock *block; int xco, yco= 3; |