diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-04-19 17:13:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-04-19 17:14:37 +0300 |
commit | 4402c2324b81efad8d09a016a7e6838395711158 (patch) | |
tree | db28202b57d1cd4588002eacf2ef7306d3e6a63b /source/blender/editors/space_image/image_ops.c | |
parent | e1acefd45e2365d0163e5fb3d7f8fc34a2749cf0 (diff) |
Cleanup: use 'wmOperator.ptr' in draw functions
Draw functions used RNA_pointer_create to create the pointer,
however this already exists in the operator.
Diffstat (limited to 'source/blender/editors/space_image/image_ops.c')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 83dd5098a30..48e1397601f 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1479,16 +1479,15 @@ static bool image_open_draw_check_prop(PointerRNA *UNUSED(ptr), return !(STR_ELEM(prop_id, "filepath", "directory", "filename")); } -static void image_open_draw(bContext *C, wmOperator *op) +static void image_open_draw(bContext *UNUSED(C), wmOperator *op) { uiLayout *layout = op->layout; - wmWindowManager *wm = CTX_wm_manager(C); ImageOpenData *iod = op->customdata; ImageFormatData *imf = &iod->im_format; PointerRNA imf_ptr, ptr; /* main draw call */ - RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); + RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr); uiDefAutoButsRNA( layout, &ptr, image_open_draw_check_prop, NULL, NULL, UI_BUT_LABEL_ALIGN_NONE, false); @@ -2001,10 +2000,9 @@ static bool image_save_as_draw_check_prop(PointerRNA *ptr, ((STREQ(prop_id, "relative_path")) && RNA_boolean_get(ptr, "copy"))); } -static void image_save_as_draw(bContext *C, wmOperator *op) +static void image_save_as_draw(bContext *UNUSED(C), wmOperator *op) { uiLayout *layout = op->layout; - wmWindowManager *wm = CTX_wm_manager(C); ImageSaveData *isd = op->customdata; PointerRNA imf_ptr, ptr; const bool is_multiview = RNA_boolean_get(op->ptr, "show_multiview"); @@ -2014,7 +2012,7 @@ static void image_save_as_draw(bContext *C, wmOperator *op) uiTemplateImageSettings(layout, &imf_ptr, false); /* main draw call */ - RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); + RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr); uiDefAutoButsRNA( layout, &ptr, image_save_as_draw_check_prop, NULL, NULL, UI_BUT_LABEL_ALIGN_NONE, false); @@ -2614,18 +2612,17 @@ static int image_new_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(e return WM_operator_props_dialog_popup(C, op, 300); } -static void image_new_draw(bContext *C, wmOperator *op) +static void image_new_draw(bContext *UNUSED(C), wmOperator *op) { uiLayout *col; uiLayout *layout = op->layout; - wmWindowManager *wm = CTX_wm_manager(C); PointerRNA ptr; #if 0 Scene *scene = CTX_data_scene(C); const bool is_multiview = (scene->r.scemode & R_MULTIVIEW) != 0; #endif - RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); + RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr); /* copy of WM_operator_props_dialog_popup() layout */ @@ -3991,14 +3988,13 @@ static int tile_add_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(ev return WM_operator_props_dialog_popup(C, op, 300); } -static void tile_add_draw(bContext *C, wmOperator *op) +static void tile_add_draw(bContext *UNUSED(C), wmOperator *op) { uiLayout *col; uiLayout *layout = op->layout; - wmWindowManager *wm = CTX_wm_manager(C); PointerRNA ptr; - RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); + RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr); uiLayoutSetPropSep(layout, true); uiLayoutSetPropDecorate(layout, false); @@ -4128,11 +4124,10 @@ static int tile_fill_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(e return WM_operator_props_dialog_popup(C, op, 300); } -static void tile_fill_draw(bContext *C, wmOperator *op) +static void tile_fill_draw(bContext *UNUSED(C), wmOperator *op) { - wmWindowManager *wm = CTX_wm_manager(C); PointerRNA ptr; - RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); + RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr); draw_fill_tile(&ptr, op->layout); } |