Tk Source Code

Check-in [b03f0c62]
Login

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

Overview
Comment:[Bug 3535362]: Changed name of 'unshare' internal function to avoid clash with some libc versions.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: b03f0c626364dadcc5f2ea562b498e5901482772
User & Date: dkf 2012-06-15 07:55:16
Context
2012-06-19
10:29
SetOptions.3: minor doc fix make various other tables const (all backported from Tk 8.6) check-in: 2335ee4e user: jan.nijtmans tags: core-8-5-branch
2012-06-15
07:57
[Bug 3535362]: Changed name of 'unshare' internal function to avoid clash with some libc versions. check-in: da0349c6 user: dkf tags: trunk
07:55
[Bug 3535362]: Changed name of 'unshare' internal function to avoid clash with some libc versions. check-in: b03f0c62 user: dkf tags: core-8-5-branch
05:43
Backport of [Bug 3532186] fix check-in: 15e3ff22 user: jan.nijtmans tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.






1
2
3
4
5
6
7





2012-06-12  Donal K. Fellows  <[email protected]>

	* unix/tkUnixRFont.c (Tk_DrawChars, TkUnixSetXftClipRegion): Add some
	* generic/ttk/ttkEntry.c (EntryDisplay): special magic to make the
	* generic/ttk/ttkLabel.c (TextDraw): text clipping work right with the
	Xft-based renderer (which doesn't use the standard Tk GC except to
	supply the color).
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
2012-06-15  Donal K. Fellows  <[email protected]>

	* generic/ttk/ttkTreeview.c (unshareObj): [Bug 3535362]: Changed name
	of 'unshare' internal function to avoid clash with some libc versions.

2012-06-12  Donal K. Fellows  <[email protected]>

	* unix/tkUnixRFont.c (Tk_DrawChars, TkUnixSetXftClipRegion): Add some
	* generic/ttk/ttkEntry.c (EntryDisplay): special magic to make the
	* generic/ttk/ttkLabel.c (TextDraw): text clipping work right with the
	Xft-based renderer (which doesn't use the standard Tk GC except to
	supply the color).

Changes to generic/ttk/ttkTreeview.c.

481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
    Tcl_HashEntry *entryPtr = Tcl_FirstHashEntry(ht, &search);
    while (entryPtr != NULL) {
	func(Tcl_GetHashValue(entryPtr));
	entryPtr = Tcl_NextHashEntry(&search);
    }
}

/* + unshare(objPtr) --
 * 	Ensure that a Tcl_Obj * has refcount 1 -- either return objPtr
 * 	itself,	or a duplicated copy.
 */
static Tcl_Obj *unshare(Tcl_Obj *objPtr)
{
    if (Tcl_IsShared(objPtr)) {
	Tcl_Obj *newObj = Tcl_DuplicateObj(objPtr);
	Tcl_DecrRefCount(objPtr);
	Tcl_IncrRefCount(newObj);
	return newObj;
    }







|



|







481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
    Tcl_HashEntry *entryPtr = Tcl_FirstHashEntry(ht, &search);
    while (entryPtr != NULL) {
	func(Tcl_GetHashValue(entryPtr));
	entryPtr = Tcl_NextHashEntry(&search);
    }
}

/* + unshareObj(objPtr) --
 * 	Ensure that a Tcl_Obj * has refcount 1 -- either return objPtr
 * 	itself,	or a duplicated copy.
 */
static Tcl_Obj *unshareObj(Tcl_Obj *objPtr)
{
    if (Tcl_IsShared(objPtr)) {
	Tcl_Obj *newObj = Tcl_DuplicateObj(objPtr);
	Tcl_DecrRefCount(objPtr);
	Tcl_IncrRefCount(newObj);
	return newObj;
    }
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
	    result = Tcl_NewStringObj("",0);
	}
	Tcl_SetObjResult(interp, result);
	return TCL_OK;
    } else {		/* set column */
	int length;

	item->valuesObj = unshare(item->valuesObj);

	/* Make sure -values is fully populated:
	 */
	Tcl_ListObjLength(interp, item->valuesObj, &length);
	while (length < tv->tree.nColumns) {
	    Tcl_Obj *empty = Tcl_NewStringObj("",0);
	    Tcl_ListObjAppendElement(interp, item->valuesObj, empty);







|







2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
	    result = Tcl_NewStringObj("",0);
	}
	Tcl_SetObjResult(interp, result);
	return TCL_OK;
    } else {		/* set column */
	int length;

	item->valuesObj = unshareObj(item->valuesObj);

	/* Make sure -values is fully populated:
	 */
	Tcl_ListObjLength(interp, item->valuesObj, &length);
	while (length < tv->tree.nColumns) {
	    Tcl_Obj *empty = Tcl_NewStringObj("",0);
	    Tcl_ListObjAppendElement(interp, item->valuesObj, empty);
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
	return TCL_ERROR;
    }

    /* Make sure all ancestors are open:
     */
    for (parent = item->parent; parent; parent = parent->parent) {
	if (!(parent->state & TTK_STATE_OPEN)) {
	    parent->openObj = unshare(parent->openObj);
	    Tcl_SetBooleanObj(parent->openObj, 1);
	    parent->state |= TTK_STATE_OPEN;
	    TtkRedisplayWidget(&tv->core);
	}
    }

    /* Make sure item is visible:







|







2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
	return TCL_ERROR;
    }

    /* Make sure all ancestors are open:
     */
    for (parent = item->parent; parent; parent = parent->parent) {
	if (!(parent->state & TTK_STATE_OPEN)) {
	    parent->openObj = unshareObj(parent->openObj);
	    Tcl_SetBooleanObj(parent->openObj, 1);
	    parent->state |= TTK_STATE_OPEN;
	    TtkRedisplayWidget(&tv->core);
	}
    }

    /* Make sure item is visible: