From 5b920bc2ff1e78767842b13f6997298b7e438204 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 19 Apr 2011 06:59:49 +0000 Subject: Some strings to store ID names were too small, could cause stack corruption. corrected these and replaced 'sizeof(((ID *)NULL)->name)-2' with 'MAX_ID_NAME-2'. --- source/blender/editors/space_outliner/outliner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/space_outliner') diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 765cd360f96..ed26440d37d 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -5665,7 +5665,7 @@ static void outliner_buttons(const bContext *C, uiBlock *block, ARegion *ar, Spa if(tselem->type==TSE_EBONE) len = sizeof(((EditBone*) 0)->name); else if (tselem->type==TSE_MODIFIER) len = sizeof(((ModifierData*) 0)->name); else if(tselem->id && GS(tselem->id->name)==ID_LI) len = sizeof(((Library*) 0)->name); - else len= sizeof(((ID*) 0)->name)-2; + else len= MAX_ID_NAME-2; dx= (int)UI_GetStringWidth(te->name); -- cgit v1.2.3 From a8185f4cc8a162e2bdb4c9da211af65f2821ec2b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 19 Apr 2011 10:35:24 +0000 Subject: patch [#26978] Minor Spelling Mistakes in Editor Operators + some errors I noticed. --- source/blender/editors/space_outliner/outliner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/space_outliner') diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index ed26440d37d..8fdd62f7412 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -1729,7 +1729,7 @@ void OUTLINER_OT_renderability_toggle(wmOperatorType *ot) /* identifiers */ ot->name= "Toggle Renderability"; ot->idname= "OUTLINER_OT_renderability_toggle"; - ot->description= "Toggle the renderbility of selected items"; + ot->description= "Toggle the renderability of selected items"; /* callbacks */ ot->exec= outliner_toggle_renderability_exec; -- cgit v1.2.3 From 5bd110c6baca4ec080190967a9503121eaef541e Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 20 Apr 2011 16:19:49 +0000 Subject: Bugfix #27026 Outliner objects showed "active" or "selected" in confusing ways. Now the display is simply binary, and more in line with how other items in outliner draw: - text is white = item is active - color circle behind icon: shows selection state --- source/blender/editors/space_outliner/outliner.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/space_outliner') diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 8fdd62f7412..fce9c883c84 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -4667,16 +4667,24 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene Object *ob= (Object *)tselem->id; if(ob==OBACT || (ob->flag & SELECT)) { - char col[4]; + char col[4]= {0, 0, 0, 0}; - active= 2; + /* outliner active ob: always white text, circle color now similar to view3d */ + + active= 2; /* means it draws a color circle */ if(ob==OBACT) { - UI_GetThemeColorType4ubv(TH_ACTIVE, SPACE_VIEW3D, col); - /* so black text is drawn when active and not selected */ - if (ob->flag & SELECT) active= 1; + if(ob->flag & SELECT) { + UI_GetThemeColorType4ubv(TH_ACTIVE, SPACE_VIEW3D, col); + col[3]= 100; + } + + active= 1; /* means it draws white text */ } - else UI_GetThemeColorType4ubv(TH_SELECT, SPACE_VIEW3D, col); - col[3]= 100; + else if(ob->flag & SELECT) { + UI_GetThemeColorType4ubv(TH_SELECT, SPACE_VIEW3D, col); + col[3]= 100; + } + glColor4ubv((GLubyte *)col); } -- cgit v1.2.3 From f9f771cd01b626be30a85a533ea622bcedd981f5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 21 Apr 2011 15:53:30 +0000 Subject: converted more mixed tab/space indentations to tabs. only whitespace changes. --- source/blender/editors/space_outliner/outliner.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/space_outliner') diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index fce9c883c84..0e574ca5ffb 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -1340,8 +1340,8 @@ static void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops) int show_opened= (soops->treestore==NULL); /* on first view, we open scenes */ if(soops->tree.first && (soops->storeflag & SO_TREESTORE_REDRAW)) - return; - + return; + outliner_free_tree(&soops->tree); outliner_storage_cleanup(soops); @@ -3533,8 +3533,8 @@ static EnumPropertyItem prop_group_op_types[] = { {2, "LOCAL", 0, "Make Local", ""}, {3, "LINK", 0, "Link Group Objects to Scene", ""}, {4, "TOGVIS", 0, "Toggle Visible", ""}, - {5, "TOGSEL", 0, "Toggle Selectable", ""}, - {6, "TOGREN", 0, "Toggle Renderable", ""}, + {5, "TOGSEL", 0, "Toggle Selectable", ""}, + {6, "TOGREN", 0, "Toggle Renderable", ""}, {0, NULL, 0, NULL, NULL} }; @@ -3561,7 +3561,7 @@ static int outliner_group_operation_exec(bContext *C, wmOperator *op) else if(event==3) { outliner_do_libdata_operation(C, scene, soops, &soops->tree, group_linkobs2scene_cb); ED_undo_push(C, "Link Group Objects to Scene"); - } + } WM_event_add_notifier(C, NC_GROUP, NULL); @@ -5255,7 +5255,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar if(tselem->type==0 && te->idcode==ID_GR){ int restrict_bool; gr = (Group *)tselem->id; - + uiBlockSetEmboss(block, UI_EMBOSSN); restrict_bool= group_restrict_flag(gr, OB_RESTRICT_VIEW); @@ -5271,7 +5271,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar uiButSetFunc(bt, restrictbutton_gr_restrict_render, scene, gr); uiBlockSetEmboss(block, UI_EMBOSS); - } + } /* scene render layers and passes have toggle-able flags too! */ else if(tselem->type==TSE_R_LAYER) { uiBlockSetEmboss(block, UI_EMBOSSN); -- cgit v1.2.3