[Bf-blender-cvs] [fc59147] master: Fix T39924: 400 character limit in text fields

Campbell Barton noreply at git.blender.org
Fri May 2 21:23:10 CEST 2014


Commit: fc591473b204ce2449e5d16f7aab480beba7f884
Author: Campbell Barton
Date:   Sat May 3 05:03:55 2014 +1000
https://developer.blender.org/rBfc591473b204ce2449e5d16f7aab480beba7f884

Fix T39924: 400 character limit in text fields

===================================================================

M	source/blender/editors/interface/interface_widgets.c

===================================================================

diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 9c5b160..c207812 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -1233,6 +1233,14 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
 			fstyle->align = UI_STYLE_TEXT_LEFT;
 		}
 	}
+	else {
+		if (but->editstr) {
+			/* max length isn't used in this case,
+			 * we rely on string being NULL terminated. */
+			drawstr_left_len = INT_MAX;
+			drawstr = but->editstr;
+		}
+	}
 
 
 	/* text button selection and cursor */
@@ -1283,7 +1291,9 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
 #endif
 
 	/* cut string in 2 parts - only for menu entries */
-	if ((but->block->flag & UI_BLOCK_LOOP)) {
+	if ((but->block->flag & UI_BLOCK_LOOP) &&
+	    (but->editstr == NULL))
+	{
 		if (but->flag & UI_BUT_HAS_SEP_CHAR) {
 			drawstr_right = strrchr(drawstr, UI_SEP_CHAR);
 			if (drawstr_right) {




More information about the Bf-blender-cvs mailing list