summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-12-26 21:10:45 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-12-26 21:10:45 (GMT)
commit1a7d3ba3cabd12bbfac8cf8a06c1cc2b755ce3dc (patch)
treef6904f89fdc70479eab7dfce4572e2c0c7c70b7f
parent72714043437b73af454d18ff6def2c16d810c758 (diff)
parenta9da52862c63ba71773ced3f712e3565c2b3d81b (diff)
downloadtk-1a7d3ba3cabd12bbfac8cf8a06c1cc2b755ce3dc.zip
tk-1a7d3ba3cabd12bbfac8cf8a06c1cc2b755ce3dc.tar.gz
tk-1a7d3ba3cabd12bbfac8cf8a06c1cc2b755ce3dc.tar.bz2
Fixed bug [2f78c7c5ea] - text widget segfault with tablelist
-rw-r--r--generic/tkTextDisp.c9
-rw-r--r--tests/textDisp.test24
2 files changed, 32 insertions, 1 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index ef8d6f4..133a7d7 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -4803,9 +4803,16 @@ TextRedrawTag(
/*
* Round up the starting position if it's before the first line visible on
- * the screen (we only care about what's on the screen).
+ * the screen (we only care about what's on the screen). Beware that the
+ * display info structure might need update, for instance if we arrived
+ * here from an 'after idle' script removing tags in a range whose
+ * display lines (and dInfo) were partially invalidated by a previous
+ * delete operation in the text widget.
*/
+ if (dInfoPtr->flags & DINFO_OUT_OF_DATE) {
+ UpdateDisplayInfo(textPtr);
+ }
dlPtr = dInfoPtr->dLinePtr;
if (dlPtr == NULL) {
return;
diff --git a/tests/textDisp.test b/tests/textDisp.test
index 7aa2fef..ac3aee0 100644
--- a/tests/textDisp.test
+++ b/tests/textDisp.test
@@ -1333,6 +1333,30 @@ test textDisp-9.13 {TkTextRedrawTag} {
update
list $tk_textRelayout $tk_textRedraw
} {{2.0 6.0 7.0} {2.0 6.0 7.0}}
+test textDisp-9.14 {TkTextRedrawTag} {
+ pack [text .tnocrash]
+ for {set i 1} {$i < 6} {incr i} {
+ .tnocrash insert end \nfoo$i
+ }
+ .tnocrash tag configure mytag1 -relief raised
+ .tnocrash tag configure mytag2 -relief solid
+ update
+ proc doit {} {
+ .tnocrash tag add mytag1 4.0 5.0
+ .tnocrash tag add mytag2 4.0 5.0
+ after idle {
+ .tnocrash tag remove mytag1 1.0 end
+ .tnocrash tag remove mytag2 1.0 end
+ }
+ .tnocrash delete 1.0 2.0
+ }
+ doit ; # must not crash
+ after 500 {
+ destroy .tnocrash
+ set done 1
+ }
+ vwait done
+} {}
test textDisp-10.1 {TkTextRelayoutWindow} {
.t configure -wrap char