Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/curve/editfont.c')
-rw-r--r--source/blender/editors/curve/editfont.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index ef1c53c9f5d..37cc135a6a8 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -25,6 +25,11 @@
* ***** END GPL LICENSE BLOCK *****
*/
+/** \file blender/editors/curve/editfont.c
+ * \ingroup edcurve
+ */
+
+
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
@@ -611,7 +616,7 @@ static EnumPropertyItem style_items[]= {
{CU_CHINFO_SMALLCAPS, "SMALL_CAPS", 0, "Small Caps", ""},
{0, NULL, 0, NULL, NULL}};
-static int set_style(bContext *C, int style, int clear)
+static int set_style(bContext *C, const int style, const int clear)
{
Object *obedit= CTX_data_edit_object(C);
Curve *cu= obedit->data;
@@ -636,10 +641,8 @@ static int set_style(bContext *C, int style, int clear)
static int set_style_exec(bContext *C, wmOperator *op)
{
- int style, clear;
-
- style= RNA_enum_get(op->ptr, "style");
- clear= RNA_enum_get(op->ptr, "clear");
+ const int style= RNA_enum_get(op->ptr, "style");
+ const int clear= RNA_boolean_get(op->ptr, "clear");
return set_style(C, style, clear);
}
@@ -1090,7 +1093,7 @@ static int line_break_exec(bContext *C, wmOperator *op)
Object *obedit= CTX_data_edit_object(C);
Curve *cu= obedit->data;
EditFont *ef= cu->editfont;
- int ctrl= RNA_enum_get(op->ptr, "ctrl");
+ const int ctrl= RNA_boolean_get(op->ptr, "ctrl");
if(ctrl) {
insert_into_textbuf(obedit, 1);
@@ -1368,16 +1371,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);
@@ -1404,8 +1397,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;
@@ -1447,7 +1440,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;