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:
authorAlexander Ewering <blender@instinctive.de>2005-11-11 18:19:15 +0300
committerAlexander Ewering <blender@instinctive.de>2005-11-11 18:19:15 +0300
commit3d6564740af62a3faf65bc0198dc18f6b0d7d3dc (patch)
tree51a1f0796a94947a156f8d4d0b725e82a2ad32c6 /source/blender/src/editfont.c
parent6a2413cbb4d4e6e88674b6e92885a2fc81409bcf (diff)
Fix "Copy Attributes -> Font Settings" to copy the new vars (wordspace,
underline stuff) as well. Attempt at fixing editmode undo, but not successful. I'll create a bug- report and assign it to Mika, because I only understand "train station" (German saying :-) when looking at the code.
Diffstat (limited to 'source/blender/src/editfont.c')
-rw-r--r--source/blender/src/editfont.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/source/blender/src/editfont.c b/source/blender/src/editfont.c
index 8d1aa5818fd..35b9f8fd7c4 100644
--- a/source/blender/src/editfont.c
+++ b/source/blender/src/editfont.c
@@ -1226,16 +1226,18 @@ static void undoFont_to_editFont(void *strv)
{
Curve *cu= G.obedit->data;
char *str= strv;
-
- utf8towchar_(textbuf, str);
-
+
cu->pos= *((short *)str);
- cu->len= wcslen(textbuf);
+ cu->len= *((short *)(str+2));
- memcpy(textbufinfo, str+2+cu->len+1, cu->len*sizeof(CharInfo));
+ memcpy(textbuf, str+4, cu->len+1);
+ memcpy(textbufinfo, str+4+cu->len+1, cu->len*sizeof(CharInfo));
+
cu->selstart = cu->selend = 0;
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
+ update_string(cu);
+
allqueue(REDRAWVIEW3D, 0);
}
@@ -1244,12 +1246,13 @@ static void *editFont_to_undoFont(void)
Curve *cu= G.obedit->data;
char *str;
- str= MEM_callocN(MAXTEXT+4+(MAXTEXT+4)*sizeof(CharInfo), "string undo");
-
- wcs2utf8s(str, textbuf);
+ str= MEM_callocN(MAXTEXT+6+(MAXTEXT+4)*sizeof(CharInfo), "string undo");
+ memcpy(str+4, textbuf, cu->len+1);
+ memcpy(str+4+cu->len+1, textbufinfo, cu->len*sizeof(CharInfo));
+
*((short *)str)= cu->pos;
- memcpy(str+2+cu->len+1, textbufinfo, cu->len*sizeof(CharInfo));
+ *((short *)(str+2))= cu->len;
return str;
}