summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-02-08 20:13:20 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-02-08 20:13:20 (GMT)
commit47fa51915781b8ceb0ad65f72b06b6d4814dbde7 (patch)
tree8a1d42fdc842eba46c53531c751a9151299f71e8
parent6fcac7ae49122cfb95054e673f24cd82835d4116 (diff)
downloadtk-47fa51915781b8ceb0ad65f72b06b6d4814dbde7.zip
tk-47fa51915781b8ceb0ad65f72b06b6d4814dbde7.tar.gz
tk-47fa51915781b8ceb0ad65f72b06b6d4814dbde7.tar.bz2
More comments in FindDLine, with slightly optimized code to achieve the same functionality.
-rw-r--r--generic/tkTextDisp.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index c5ad36b..d45ac73 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -6618,17 +6618,25 @@ FindDLine(
/*
* We're past the last display line, either because the desired
* index lies past the visible text, or because the desired index
- * is on the last display line showing the last logical line.
+ * is on the last display line.
*/
indexPtr2 = dlPtrPrev->index;
TkTextIndexForwBytes(textPtr, &indexPtr2, dlPtrPrev->byteCount,
&indexPtr2);
if (TkTextIndexCmp(&indexPtr2,indexPtr) > 0) {
+ /*
+ * The desired index is on the last display line.
+ * --> return this display line.
+ */
dlPtr = dlPtrPrev;
- break;
} else {
- return NULL;
+ /*
+ * The desired index is past the visible text. There is no
+ * display line displaying something at the desired index
+ * --> return NULL.
+ */
}
+ break;
}
if (TkTextIndexCmp(&dlPtr->index,indexPtr) > 0) {
dlPtr = dlPtrPrev;