diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-05-14 11:00:52 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-05-14 11:00:52 +0300 |
commit | b1e2f8be2371eeeed3300d42e796f6cf7901e8d9 (patch) | |
tree | 8181be409c9333e55c29b07ceb2abef241081c0b /source/blender/editors/mesh | |
parent | ede742917a175319dcfdb63703126ed688f948bf (diff) |
Fix T48426: Use same length for all header message strings.
Some languages like Chinese or Japanese take three or four bytes per char...
Also fixed some missing translation markers for UI header messages.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/editmesh_bevel.c | 8 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_inset.c | 8 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_loopcut.c | 4 |
3 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c index 37e9a0edd00..242cbf79a83 100644 --- a/source/blender/editors/mesh/editmesh_bevel.c +++ b/source/blender/editors/mesh/editmesh_bevel.c @@ -44,6 +44,8 @@ #include "WM_api.h" #include "WM_types.h" +#include "UI_interface.h" + #include "ED_mesh.h" #include "ED_numinput.h" #include "ED_screen.h" @@ -72,14 +74,12 @@ typedef struct { float segments; /* Segments as float so smooth mouse pan works in small increments */ } BevelData; -#define HEADER_LENGTH 180 - static void edbm_bevel_update_header(bContext *C, wmOperator *op) { const char *str = IFACE_("Confirm: (Enter/LMB), Cancel: (Esc/RMB), Mode: %s (M), Clamp Overlap: %s (C), " "Vertex Only: %s (V), Offset: %s, Segments: %d"); - char msg[HEADER_LENGTH]; + char msg[UI_MAX_DRAW_STR]; ScrArea *sa = CTX_wm_area(C); Scene *sce = CTX_data_scene(C); @@ -98,7 +98,7 @@ static void edbm_bevel_update_header(bContext *C, wmOperator *op) RNA_property_enum_name_gettexted(C, op->ptr, prop, RNA_property_enum_get(op->ptr, prop), &type_str); - BLI_snprintf(msg, HEADER_LENGTH, str, type_str, + BLI_snprintf(msg, sizeof(msg), str, type_str, WM_bool_as_string(RNA_boolean_get(op->ptr, "clamp_overlap")), WM_bool_as_string(RNA_boolean_get(op->ptr, "vertex_only")), offset_str, RNA_int_get(op->ptr, "segments")); diff --git a/source/blender/editors/mesh/editmesh_inset.c b/source/blender/editors/mesh/editmesh_inset.c index 097117cce6b..3e0747f055f 100644 --- a/source/blender/editors/mesh/editmesh_inset.c +++ b/source/blender/editors/mesh/editmesh_inset.c @@ -44,6 +44,8 @@ #include "WM_api.h" #include "WM_types.h" +#include "UI_interface.h" + #include "ED_mesh.h" #include "ED_numinput.h" #include "ED_screen.h" @@ -54,8 +56,6 @@ #include "mesh_intern.h" /* own include */ -#define HEADER_LENGTH 180 - typedef struct { float old_thickness; float old_depth; @@ -83,7 +83,7 @@ static void edbm_inset_update_header(wmOperator *op, bContext *C) const char *str = IFACE_("Confirm: Enter/LClick, Cancel: (Esc/RClick), Thickness: %s, " "Depth (Ctrl to tweak): %s (%s), Outset (O): (%s), Boundary (B): (%s), Individual (I): (%s)"); - char msg[HEADER_LENGTH]; + char msg[UI_MAX_DRAW_STR]; ScrArea *sa = CTX_wm_area(C); Scene *sce = CTX_data_scene(C); @@ -95,7 +95,7 @@ static void edbm_inset_update_header(wmOperator *op, bContext *C) BLI_snprintf(flts_str, NUM_STR_REP_LEN, "%f", RNA_float_get(op->ptr, "thickness")); BLI_snprintf(flts_str + NUM_STR_REP_LEN, NUM_STR_REP_LEN, "%f", RNA_float_get(op->ptr, "depth")); } - BLI_snprintf(msg, HEADER_LENGTH, str, + BLI_snprintf(msg, sizeof(msg), str, flts_str, flts_str + NUM_STR_REP_LEN, WM_bool_as_string(opdata->modify_depth), diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c index 31e1a22fe74..f1c1e4105d0 100644 --- a/source/blender/editors/mesh/editmesh_loopcut.c +++ b/source/blender/editors/mesh/editmesh_loopcut.c @@ -47,6 +47,8 @@ #include "BIF_gl.h" +#include "UI_interface.h" + #include "ED_screen.h" #include "ED_space_api.h" #include "ED_view3d.h" @@ -780,7 +782,7 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event) if (show_cuts) { Scene *sce = CTX_data_scene(C); - char buf[64 + NUM_STR_REP_LEN * 2]; + char buf[UI_MAX_DRAW_STR]; char str_rep[NUM_STR_REP_LEN * 2]; if (hasNumInput(&lcd->num)) { outputNumInput(&lcd->num, str_rep, &sce->unit); |