diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-15 11:38:08 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-15 11:38:08 +0300 |
commit | 2bd375dd5214ac09a14f53733faea0f58397ae7f (patch) | |
tree | 0cbf635a64e0c332832ca890fd641a1689e44b4d /source/blender/editors/curve/editfont.c | |
parent | b65a56ccb52e656cbdc9033180c26fb56d5c5ffd (diff) |
fix for crash with textbox add poll function, missing NULL check.
Diffstat (limited to 'source/blender/editors/curve/editfont.c')
-rw-r--r-- | source/blender/editors/curve/editfont.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 798a9d0f7cd..2f6bd0abcef 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -1373,16 +1373,6 @@ void FONT_OT_text_insert(wmOperatorType *ot) /*********************** textbox add operator *************************/ -static int textbox_poll(bContext *C) -{ - Object *ob = CTX_data_active_object(C); - - if (!ED_operator_object_active_editable(C) ) return 0; - if (ob->type != OB_FONT) return 0; - - return 1; -} - static int textbox_add_exec(bContext *C, wmOperator *UNUSED(op)) { Object *obedit= CTX_data_active_object(C); @@ -1409,8 +1399,8 @@ void FONT_OT_textbox_add(wmOperatorType *ot) /* api callbacks */ ot->exec= textbox_add_exec; - ot->poll= textbox_poll; - + ot->poll= ED_operator_object_active_editable_font; + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1452,7 +1442,7 @@ void FONT_OT_textbox_remove(wmOperatorType *ot) /* api callbacks */ ot->exec= textbox_remove_exec; - ot->poll= textbox_poll; + ot->poll= ED_operator_object_active_editable_font; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; |