Tk Source Code

Check-in [6892f446]
Login

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

Overview
Comment:Bugfix [46d7a4d153]: erroneous reallocation with NULL instead of bitset.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | revised_text | tip-466
Files: files | file ages | folders
SHA1: 6892f446a1295fb5dd45e93b509a129e967f81a6
User & Date: gcramer 2017-05-27 07:57:44
References
2017-05-27
08:00 Closed ticket [46d7a4d1]: tags not present as intended plus 7 other changes artifact: b65b8d2b user: gcramer
Context
2017-05-28
12:25
Bugfix [df89872c94]: (1) Case "lines" now is based on character position, not byte position as before (2) Test case textIndex-19.14 added (3) Update of manual, with refinment of the concerned descriptions. check-in: d0a7426b user: gcramer tags: revised_text, tip-466
2017-05-27
07:57
Bugfix [46d7a4d153]: erroneous reallocation with NULL instead of bitset. check-in: 6892f446 user: gcramer tags: revised_text, tip-466
2017-05-26
14:53
Bugfix [cda289a8ea]: The old handling/implementation of the selection options is tohubohu, so I used the opportunity to overwork it: (1) I added the tag options -inactivebackground and -inactiveforegound, and these options are tied to widget options -inactiveselectbackground and -inactiveselectforeground. (2) For symmetry reasons I added the tag options -inactiveselectbackground and -inactiveselectforeground, these options will overrule the options -inactivebackground and -inactivebackgound of the "sel" tag, provided that the actual tag has a higher priority. (3) The manual has been updated with new options. Furthermore section "THE SELECTION" has been refined. (4) In legacy widget tag option -selectbackground is tied to widget option -selectbackground if the tag option -selectbackground is not null, otherwise the widget option is tied to tag option "-background", this is very confusing, and not conform to documentation, this binding has been changed. Now the widget option -selectbackground is tied with tag option "-background" (of the "sel" tag), this is conform to (revised and legacy) documentation, it is a clear behavior, and allows more freedom in configuration. The tag options "-selectbackground" and "-selectforeground" now will overrule the options "-background" and "-foreground" of the "sel" tag, provided that the actual tag has a higher priority. (5) I changed test case textTag-5.23 according to (3). Moreover this test case has been extended for testing all bindings. BTW: Test case text-5.24 has been removed, it was a duplicate of prior textTag-5.23. (6) Complete rework of function MakeStyle(), the "sel" tag now will be handled separately, after all other tags have been processed, this makes it easier to follow the flow. (7) The old implementation has an erroneous resource management with the shared (tied) options of the "sel" tag and the selection options of the widget. This has been replaced with a proper implementation. Unfortunately the new implementation for resource management of shared options is a bit tricky, because the option table does not support shared options. (8). DEF_TEXT_INACTIVE_SELECT_BG_COLOR has been set to NULL for Windows, this should finally fix the issue of this bug report. check-in: b2f64dc3 user: gcramer tags: revised_text, tip-466
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tkText.c.

6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
		    TkTextTag *tagPtr;

		    tagInfoPtr = TkTextTagSetResize(NULL, sharedTextPtr->tagInfoSize);

		    for (i = 0; i < numTags; ++i) {
			tagPtr = TkTextCreateTag(textPtr, Tcl_GetString(tagNamePtrs[i]), NULL);
			if (tagPtr->index >= TkTextTagSetSize(tagInfoPtr)) {
			    tagInfoPtr = TkTextTagSetResize(NULL, sharedTextPtr->tagInfoSize);
			}
			tagInfoPtr = TkTextTagSetAddToThis(tagInfoPtr, tagPtr->index);
		    }
		}
	    }

	    InsertChars(textPtr, &index1, &index2, string, length,







|







6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
		    TkTextTag *tagPtr;

		    tagInfoPtr = TkTextTagSetResize(NULL, sharedTextPtr->tagInfoSize);

		    for (i = 0; i < numTags; ++i) {
			tagPtr = TkTextCreateTag(textPtr, Tcl_GetString(tagNamePtrs[i]), NULL);
			if (tagPtr->index >= TkTextTagSetSize(tagInfoPtr)) {
			    tagInfoPtr = TkTextTagSetResize(tagInfoPtr, sharedTextPtr->tagInfoSize);
			}
			tagInfoPtr = TkTextTagSetAddToThis(tagInfoPtr, tagPtr->index);
		    }
		}
	    }

	    InsertChars(textPtr, &index1, &index2, string, length,