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:
authorCampbell Barton <ideasman42@gmail.com>2013-07-09 10:21:45 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-07-09 10:21:45 +0400
commitd4ff53b760f51d791860b25385f2f9716740d586 (patch)
tree6849d8fe81f9352b10d3e113d64e5057040cf7ea /source/blender/blenkernel/intern/text.c
parent750b30c7dda4b46eb41f0ad611bae0a739b34610 (diff)
fix [#36066] crash when Tab out text object
the way Curve.len is used at the moment is really stupid, calculate string size on save for now, but should really store the length in bytes and total number of characters.
Diffstat (limited to 'source/blender/blenkernel/intern/text.c')
-rw-r--r--source/blender/blenkernel/intern/text.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index 296f25e303e..aec924e15b3 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -847,19 +847,6 @@ int txt_utf8_column_to_offset(const char *str, int column)
return offset;
}
-/* returns the real number of characters in string */
-/* not the same as BLI_strlen_utf8, which returns length for wide characters */
-static int txt_utf8_len(const char *src)
-{
- int len;
-
- for (len = 0; *src; len++) {
- src += BLI_str_utf8_size(src);
- }
-
- return len;
-}
-
void txt_move_up(Text *text, short sel)
{
TextLine **linep;
@@ -2059,7 +2046,7 @@ void txt_do_undo(Text *text)
text->undo_pos--;
}
buf[i] = 0;
- linep = txt_utf8_len(buf);
+ linep = BLI_strlen_utf8(buf);
MEM_freeN(buf);
/* skip over the length that was stored again */