Tk Source Code

Check-in [5325caee]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fixed bug [2f78c7c5ea] - text widget segfault with tablelist
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1:5325caee9710aa62e28792a33276c56401c0985b
User & Date: fvogel 2015-12-26 21:10:45
Context
2016-01-06
20:06
Fixed bug [1288433] - LisboxSelect event triggers when listbox state is disabled check-in: b9395333 user: fvogel tags: core-8-5-branch
15:59
Fixed bug [1927212] - MouseWheel unbound for non-aqua scrollbars check-in: 99cb0584 user: fvogel tags: bug-1927212fff
13:22
Fixed bug [3e3e25f483] - winbutton-1.[12] fails on Win7 Closed-Leaf check-in: 5476931f user: fvogel tags: bug-3e3e25f483
2016-01-05
15:32
Fixed bug [1305128] - Scrollbar doesn't receive event Closed-Leaf check-in: 0d00b144 user: fvogel tags: bug-1305128fff
2016-01-04
17:34
Fixed bug [1510538] - Wrong initial scrollbar width Closed-Leaf check-in: 91be7cbc user: fvogel tags: bug-1510538fff
2015-12-31
13:50
Fixed bug [3102228] - <<ListboxSelect>> doesn't fire when selection lost Closed-Leaf check-in: 4afc37da user: fvogel tags: bug-3102228fff
2015-12-30
22:07
Fixed bug [1288433] - LisboxSelect event triggers when listbox state is disabled Closed-Leaf check-in: cba57e09 user: fvogel tags: bug-1288433fff
2015-12-26
21:23
Merged core-8-5-branch check-in: 078644f1 user: fvogel tags: tip-438
21:19
Fixed bug [2f78c7c5ea] - text widget segfault with tablelist check-in: f9195057 user: fvogel tags: trunk
21:10
Fixed bug [2f78c7c5ea] - text widget segfault with tablelist check-in: 5325caee user: fvogel tags: core-8-5-branch
2015-12-23
17:08
Made test textDisp-16.18 pass again on Win7 after [a4bf73e4b8]: map the text widget earlier check-in: dc97dedc user: fvogel tags: core-8-5-branch
16:43
Better comment about the fix, since the issue is now fully understood. Closed-Leaf check-in: 1847c858 user: fvogel tags: bug-2f78c7c5ea
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tkTextDisp.c.

4799
4800
4801
4802
4803
4804
4805
4806




4807
4808



4809
4810
4811
4812
4813
4814
4815
	}
	TkTextInvalidateLineMetrics(NULL, textPtr, startLine, lineCount,
		TK_TEXT_INVALIDATE_ONLY);
    }

    /*
     * 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).




     */




    dlPtr = dInfoPtr->dLinePtr;
    if (dlPtr == NULL) {
	return;
    }
    if ((index1Ptr == NULL) || (TkTextIndexCmp(&dlPtr->index, index1Ptr)>0)) {
	index1Ptr = &dlPtr->index;
    }







|
>
>
>
>


>
>
>







4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
	}
	TkTextInvalidateLineMetrics(NULL, textPtr, startLine, lineCount,
		TK_TEXT_INVALIDATE_ONLY);
    }

    /*
     * 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). 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;
    }
    if ((index1Ptr == NULL) || (TkTextIndexCmp(&dlPtr->index, index1Ptr)>0)) {
	index1Ptr = &dlPtr->index;
    }

Changes to tests/textDisp.test.

1329
1330
1331
1332
1333
1334
1335
























1336
1337
1338
1339
1340
1341
1342
    .t tag configure hidden -background red
    .t tag configure hidden -elide true
    update
    .t tag configure hidden -elide false
    update
    list $tk_textRelayout $tk_textRedraw
} {{2.0 6.0 7.0} {2.0 6.0 7.0}}

























test textDisp-10.1 {TkTextRelayoutWindow} {
    .t configure -wrap char
    .t delete 1.0 end
    .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4"
    update
    .t configure -bg black







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
    .t tag configure hidden -background red
    .t tag configure hidden -elide true
    update
    .t tag configure hidden -elide false
    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
    .t delete 1.0 end
    .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4"
    update
    .t configure -bg black