summaryrefslogtreecommitdiffstats
path: root/generic/tkTextMark.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2021-04-24 20:53:10 (GMT)
committerfvogel <fvogelnew1@free.fr>2021-04-24 20:53:10 (GMT)
commit6473e4dfc9b2c58fd9625f4d5ade3acf9b91793d (patch)
tree82f357a486f2070b829e8d4cae10016c9f0ed634 /generic/tkTextMark.c
parentac33a82c8bcfde7c5fc782bfab34c2dfc21cbab5 (diff)
parent8c01d5fea4cbdd448a644bfaf18e9dfc96843b61 (diff)
downloadtk-6473e4dfc9b2c58fd9625f4d5ade3acf9b91793d.zip
tk-6473e4dfc9b2c58fd9625f4d5ade3acf9b91793d.tar.gz
tk-6473e4dfc9b2c58fd9625f4d5ade3acf9b91793d.tar.bz2
merge core-8-6-branch
Diffstat (limited to 'generic/tkTextMark.c')
-rw-r--r--generic/tkTextMark.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c
index dcd7008..f77e6b4 100644
--- a/generic/tkTextMark.c
+++ b/generic/tkTextMark.c
@@ -434,8 +434,6 @@ TkTextMarkNameToIndex(
TkTextIndex *indexPtr) /* Index information gets stored here. */
{
TkTextSegment *segPtr;
- TkTextIndex index;
- int start, end;
if (textPtr == NULL) {
return TCL_ERROR;
@@ -456,28 +454,17 @@ TkTextMarkNameToIndex(
}
TkTextMarkSegToIndex(textPtr, segPtr, indexPtr);
- /* If indexPtr refers to somewhere outside the -startline/-endline
+ /*
+ * If indexPtr refers to somewhere outside the -startline/-endline
* range limits of the widget, error out since the mark indeed is not
* reachable from this text widget (it may be reachable from a peer)
* (bug 1630271).
*/
- if (textPtr->start != NULL) {
- start = TkBTreeLinesTo(NULL, textPtr->start);
- TkTextMakeByteIndex(textPtr->sharedTextPtr->tree, NULL, start, 0,
- &index);
- if (TkTextIndexCmp(indexPtr, &index) < 0) {
- return TCL_ERROR;
- }
- }
- if (textPtr->end != NULL) {
- end = TkBTreeLinesTo(NULL, textPtr->end);
- TkTextMakeByteIndex(textPtr->sharedTextPtr->tree, NULL, end, 0,
- &index);
- if (TkTextIndexCmp(indexPtr, &index) > 0) {
- return TCL_ERROR;
- }
+ if (TkTextIndexAdjustToStartEnd(textPtr, indexPtr, 1) == TCL_ERROR) {
+ return TCL_ERROR;
}
+
return TCL_OK;
}