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/blenkernel/intern/text.c')
-rw-r--r--source/blender/blenkernel/intern/text.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index 7d5862c1fb6..1d6de646255 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -1289,7 +1289,7 @@ static void txt_delete_sel(Text *text, TextUndoBuf *utxt)
txt_order_cursors(text, false);
if (!undoing) {
- buf = txt_sel_to_buf(text);
+ buf = txt_sel_to_buf(text, NULL);
txt_undo_add_blockop(text, utxt, UNDO_DBLOCK, buf);
MEM_freeN(buf);
}
@@ -1353,13 +1353,17 @@ void txt_sel_line(Text *text)
/* Cut and paste functions */
/***************************/
-char *txt_to_buf(Text *text)
+char *txt_to_buf(Text *text, int *r_buf_strlen)
{
int length;
TextLine *tmp, *linef, *linel;
int charf, charl;
char *buf;
+ if (r_buf_strlen) {
+ *r_buf_strlen = 0;
+ }
+
if (!text->curl) {
return NULL;
}
@@ -1419,6 +1423,10 @@ char *txt_to_buf(Text *text)
buf[length] = 0;
}
+ if (r_buf_strlen) {
+ *r_buf_strlen = length;
+ }
+
return buf;
}
@@ -1475,13 +1483,17 @@ int txt_find_string(Text *text, const char *findstr, int wrap, int match_case)
}
}
-char *txt_sel_to_buf(Text *text)
+char *txt_sel_to_buf(Text *text, int *r_buf_strlen)
{
char *buf;
int length = 0;
TextLine *tmp, *linef, *linel;
int charf, charl;
+ if (r_buf_strlen) {
+ *r_buf_strlen = 0;
+ }
+
if (!text->curl) {
return NULL;
}
@@ -1556,6 +1568,10 @@ char *txt_sel_to_buf(Text *text)
buf[length] = 0;
}
+ if (r_buf_strlen) {
+ *r_buf_strlen = length;
+ }
+
return buf;
}