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.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index 470de8a205d..296f25e303e 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -362,7 +362,7 @@ int BKE_text_reload(Text *text)
return 1;
}
-Text *BKE_text_load(Main *bmain, const char *file, const char *relpath)
+Text *BKE_text_load_ex(Main *bmain, const char *file, const char *relpath, const bool is_internal)
{
FILE *fp;
int i, llen, len;
@@ -392,8 +392,13 @@ Text *BKE_text_load(Main *bmain, const char *file, const char *relpath)
len = ftell(fp);
fseek(fp, 0L, SEEK_SET);
- ta->name = MEM_mallocN(strlen(file) + 1, "text_name");
- strcpy(ta->name, file);
+ if (is_internal == false) {
+ ta->name = MEM_mallocN(strlen(file) + 1, "text_name");
+ strcpy(ta->name, file);
+ }
+ else {
+ ta->flags |= TXT_ISMEM | TXT_ISDIRTY;
+ }
init_undo_text(ta);
@@ -460,6 +465,11 @@ Text *BKE_text_load(Main *bmain, const char *file, const char *relpath)
return ta;
}
+Text *BKE_text_load(Main *bmain, const char *file, const char *relpath)
+{
+ return BKE_text_load_ex(bmain, file, relpath, false);
+}
+
Text *BKE_text_copy(Text *ta)
{
Text *tan;