[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16917] trunk/blender/source/blender/src/ drawtext.c: Bugfix #17750

Ton Roosendaal ton at blender.org
Sat Oct 4 15:42:45 CEST 2008


Revision: 16917
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16917
Author:   ton
Date:     2008-10-04 15:42:45 +0200 (Sat, 04 Oct 2008)

Log Message:
-----------
Bugfix #17750

Texteditor misses NULL checks in 'wrap text' code, moving cursur while
text is selected.

Modified Paths:
--------------
    trunk/blender/source/blender/src/drawtext.c

Modified: trunk/blender/source/blender/src/drawtext.c
===================================================================
--- trunk/blender/source/blender/src/drawtext.c	2008-10-04 12:31:54 UTC (rev 16916)
+++ trunk/blender/source/blender/src/drawtext.c	2008-10-04 13:42:45 UTC (rev 16917)
@@ -2134,7 +2134,7 @@
 		if (toline<fromline) text->sell= text->sell->prev;
 		if (c>text->sell->len) c= text->sell->len;
 		text->selc= c;
-	} else {
+	} else if(text->curl) {
 		txt_undo_add_toop(text, UNDO_CTO, fromline, text->curc, toline, c);
 		if (toline<fromline) text->curl= text->curl->prev;
 		if (c>text->curl->len) c= text->curl->len;
@@ -2175,10 +2175,10 @@
 		if (toline>fromline) text->sell= text->sell->next;
 		if (c>text->sell->len) c= text->sell->len;
 		text->selc= c;
-	} else {
+	} else if(text->curl) {
 		txt_undo_add_toop(text, UNDO_CTO, fromline, text->curc, toline, c);
 		if (toline>fromline) text->curl= text->curl->next;
-		if (c>text->curl->len) c= text->curl->len;
+		if (c > text->curl->len) c= text->curl->len;
 		text->curc= c;
 		txt_pop_sel(text);
 	}





More information about the Bf-blender-cvs mailing list