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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-09-05 01:02:43 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-09-05 01:02:43 +0400
commit5dd9f7635afeda66ca4475288b1eb7ad621486f4 (patch)
tree731ca793fb25b3ee986abaca0c08b4f90c74a06d /source/blender/editors/space_text
parent670296dabe9c4c5444c696af54e1b4ef07a8e60b (diff)
2.5
Make local and make single user are back for ID template. Internally these calls got unified, id_make_local and id_copy are now used to do these operations for all types that support it. Also reveals that for some ID types the implementation is still missing. Further, some small changes: * unlink_text is now in blenkernel. * copy_group was implemented. * ID template now has an open operator again. * fix preview to not change material reference count, even if temporary it shows up with threaded preview. * id_unlink unifies unlink for text, object and group.
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r--source/blender/editors/space_text/text_intern.h2
-rw-r--r--source/blender/editors/space_text/text_ops.c44
2 files changed, 3 insertions, 43 deletions
diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h
index cb425274fc0..4847f2f0741 100644
--- a/source/blender/editors/space_text/text_intern.h
+++ b/source/blender/editors/space_text/text_intern.h
@@ -83,8 +83,6 @@ typedef struct FlattenString {
int flatten_string(struct SpaceText *st, FlattenString *fs, char *in);
void flatten_string_free(FlattenString *fs);
-void unlink_text(struct Text *text);
-
int wrap_width(struct SpaceText *st, struct ARegion *ar);
void wrap_offset(struct SpaceText *st, struct ARegion *ar, struct TextLine *linein, int cursin, int *offl, int *offc);
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index a8ef72e3273..7751355a14d 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -273,48 +273,9 @@ void TEXT_OT_reload(wmOperatorType *ot)
/******************* delete operator *********************/
-static void text_unlink(Main *bmain, Text *text)
-{
- bScreen *scr;
- ScrArea *area;
- SpaceLink *sl;
-
- /* XXX this ifdef is in fact dangerous, if python is
- * disabled it will leave invalid pointers in files! */
-
-#ifndef DISABLE_PYTHON
- // XXX BPY_free_pyconstraint_links(text);
- // XXX free_text_controllers(text);
- // XXX free_dome_warp_text(text);
-
- /* equivalently for pynodes: */
- if(0) // XXX nodeDynamicUnlinkText ((ID*)text))
- ; // XXX notifier: allqueue(REDRAWNODE, 0);
-#endif
-
- for(scr= bmain->screen.first; scr; scr= scr->id.next) {
- for(area= scr->areabase.first; area; area= area->next) {
- for(sl= area->spacedata.first; sl; sl= sl->next) {
- if(sl->spacetype==SPACE_TEXT) {
- SpaceText *st= (SpaceText*) sl;
-
- if(st->text==text) {
- st->text= NULL;
- st->top= 0;
-
- if(st==area->spacedata.first)
- ED_area_tag_redraw(area);
- }
- }
- }
- }
- }
-
- free_libblock(&bmain->text, text);
-}
-
static int unlink_exec(bContext *C, wmOperator *op)
{
+ Main *bmain= CTX_data_main(C);
SpaceText *st= CTX_wm_space_text(C);
Text *text= CTX_data_edit_text(C);
@@ -330,7 +291,8 @@ static int unlink_exec(bContext *C, wmOperator *op)
}
}
- text_unlink(CTX_data_main(C), text);
+ unlink_text(bmain, text);
+ free_libblock(&bmain->text, text);
WM_event_add_notifier(C, NC_TEXT|NA_REMOVED, text);
return OPERATOR_FINISHED;