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:
authorTon Roosendaal <ton@blender.org>2009-01-02 22:10:35 +0300
committerTon Roosendaal <ton@blender.org>2009-01-02 22:10:35 +0300
commita6721c60d9bc0897e3ce0dc87264fbc705284397 (patch)
tree12dd77160bcfaa4b37e85a5e8ed29496bb6c0705 /source/blender/blenkernel/intern/font.c
parent16ca4b572e07aa0f83158c187a7c64b27675d4c9 (diff)
2.5
From the anti-globalization department: G.obedit terminated! Wherever possible, use CTX_data_edit_object(C) to get this now. It's stored in scene now, and the screen context has it defined.
Diffstat (limited to 'source/blender/blenkernel/intern/font.c')
-rw-r--r--source/blender/blenkernel/intern/font.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index a8a97742c24..529d4cc5268 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -622,13 +622,11 @@ static void buildchar(Curve *cu, unsigned long character, CharInfo *info, float
}
}
-int getselection(int *start, int *end)
+int getselection(Object *ob, int *start, int *end)
{
- Curve *cu;
+ Curve *cu= ob->data;
- if (G.obedit==NULL || G.obedit->type != OB_FONT) return 0;
-
- cu= G.obedit->data;
+ if (cu->editstr==NULL || ob->type != OB_FONT) return 0;
if (cu->selstart == 0) return 0;
if (cu->selstart <= cu->selend) {
@@ -677,8 +675,8 @@ struct chartrans *text_to_curve(Object *ob, int mode)
cu= (Curve *) ob->data;
vfont= cu->vfont;
- if(cu->str == 0) return 0;
- if(vfont == 0) return 0;
+ if(cu->str == NULL) return 0;
+ if(vfont == NULL) return 0;
// Create unicode string
utf8len = utf8slen(cu->str);
@@ -731,7 +729,7 @@ struct chartrans *text_to_curve(Object *ob, int mode)
if (selboxes) MEM_freeN(selboxes);
selboxes = NULL;
- if (getselection(&selstart, &selend))
+ if (getselection(ob, &selstart, &selend))
selboxes = MEM_callocN((selend-selstart+1)*sizeof(SelBox), "font selboxes");
tb = &(cu->tb[0]);
@@ -1113,7 +1111,7 @@ struct chartrans *text_to_curve(Object *ob, int mode)
}
/* cursor first */
- if(ob==G.obedit) {
+ if(cu->editstr) {
ct= chartransdata+cu->pos;
si= (float)sin(ct->rot);
co= (float)cos(ct->rot);