forked from bartvdbraak/blender
2.5
Two bugfixes, reported by Sebastian Skejo in IRC: - File operator poll wasn't secure, search for it crashed - Knife tool depends on having view3d context, fixed poll for it
This commit is contained in:
parent
785bf413f3
commit
da14738624
@ -748,12 +748,14 @@ void ui_searchbox_autocomplete(bContext *C, ARegion *ar, uiBut *but, char *str)
|
|||||||
{
|
{
|
||||||
uiSearchboxData *data= ar->regiondata;
|
uiSearchboxData *data= ar->regiondata;
|
||||||
|
|
||||||
data->items.autocpl= autocomplete_begin(str, ui_get_but_string_max_length(but));
|
if(str[0]) {
|
||||||
|
data->items.autocpl= autocomplete_begin(str, ui_get_but_string_max_length(but));
|
||||||
|
|
||||||
but->search_func(C, but->search_arg, but->editstr, &data->items);
|
but->search_func(C, but->search_arg, but->editstr, &data->items);
|
||||||
|
|
||||||
autocomplete_end(data->items.autocpl, str);
|
autocomplete_end(data->items.autocpl, str);
|
||||||
data->items.autocpl= NULL;
|
data->items.autocpl= NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ui_searchbox_region_draw(const bContext *C, ARegion *ar)
|
static void ui_searchbox_region_draw(const bContext *C, ARegion *ar)
|
||||||
|
@ -723,7 +723,7 @@ void MESH_OT_knife_cut(wmOperatorType *ot)
|
|||||||
ot->modal= WM_gesture_lines_modal;
|
ot->modal= WM_gesture_lines_modal;
|
||||||
ot->exec= knife_cut_exec;
|
ot->exec= knife_cut_exec;
|
||||||
|
|
||||||
ot->poll= ED_operator_editmesh;
|
ot->poll= EM_view3d_poll;
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||||
|
@ -933,7 +933,7 @@ int file_delete_poll(bContext *C)
|
|||||||
SpaceFile *sfile= CTX_wm_space_file(C);
|
SpaceFile *sfile= CTX_wm_space_file(C);
|
||||||
struct direntry* file;
|
struct direntry* file;
|
||||||
|
|
||||||
if (sfile->params) {
|
if (sfile && sfile->params) {
|
||||||
if (sfile->params->active_file < 0) {
|
if (sfile->params->active_file < 0) {
|
||||||
poll= 0;
|
poll= 0;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user