diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkTextImage.c | 4 | ||||
-rw-r--r-- | generic/tkTextIndex.c | 16 | ||||
-rw-r--r-- | generic/tkTextWind.c | 4 |
3 files changed, 21 insertions, 3 deletions
diff --git a/generic/tkTextImage.c b/generic/tkTextImage.c index 771347d..bc2b7c4 100644 --- a/generic/tkTextImage.c +++ b/generic/tkTextImage.c @@ -779,6 +779,10 @@ TkTextImageIndex( Tcl_HashEntry *hPtr; TkTextSegment *eiPtr; + if (textPtr == NULL) { + return 0; + } + hPtr = Tcl_FindHashEntry(&textPtr->sharedTextPtr->imageTable, name); if (hPtr == NULL) { return 0; diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index a9b0bed..70c94db 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -758,9 +758,11 @@ GetIndex( /* *--------------------------------------------------------------------- - * Stage 1: check to see if the index consists of nothing but a mark name. - * We do this check now even though it's also done later, in order to - * allow mark names that include funny characters such as spaces or "+1c". + * Stage 1: check to see if the index consists of nothing but a mark + * name, an embedded window or an embedded image. We do this check + * now even though it's also done later, in order to allow mark names, + * embedded window names or image names that include funny characters + * such as spaces or "+1c". *--------------------------------------------------------------------- */ @@ -768,6 +770,14 @@ GetIndex( goto done; } + if (TkTextWindowIndex(textPtr, string, indexPtr) != 0) { + return TCL_OK; + } + + if (TkTextImageIndex(textPtr, string, indexPtr) != 0) { + return TCL_OK; + } + /* *------------------------------------------------ * Stage 2: start again by parsing the base index. diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c index ecafd4e..5dc8feb 100644 --- a/generic/tkTextWind.c +++ b/generic/tkTextWind.c @@ -1329,6 +1329,10 @@ TkTextWindowIndex( Tcl_HashEntry *hPtr; TkTextSegment *ewPtr; + if (textPtr == NULL) { + return 0; + } + hPtr = Tcl_FindHashEntry(&textPtr->sharedTextPtr->windowTable, name); if (hPtr == NULL) { return 0; |