summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogelnew1@free.fr <fvogel>2016-01-18 10:08:58 (GMT)
committerfvogelnew1@free.fr <fvogel>2016-01-18 10:08:58 (GMT)
commit067e0dfbcd57115889077a5373d86f34222437e9 (patch)
tree9fd1929420bac3ed202522b0cedc0ddf61aa395a /generic
parent502964176ce24f28612d0a42bcffe401851a6010 (diff)
downloadtk-067e0dfbcd57115889077a5373d86f34222437e9.zip
tk-067e0dfbcd57115889077a5373d86f34222437e9.tar.gz
tk-067e0dfbcd57115889077a5373d86f34222437e9.tar.bz2
Use GetMaxOffset when possible to reduce code duplication. The change in ListboxScanTo is not exactly equivalent but I believe the previous version was a bug.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkListbox.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/generic/tkListbox.c b/generic/tkListbox.c
index ee6941e..795ec0f 100644
--- a/generic/tkListbox.c
+++ b/generic/tkListbox.c
@@ -2887,9 +2887,7 @@ ChangeListboxOffset(
*/
offset += listPtr->xScrollUnit / 2;
- maxOffset = listPtr->maxWidth - (Tk_Width(listPtr->tkwin) -
- 2*listPtr->inset - 2*listPtr->selBorderWidth)
- + listPtr->xScrollUnit - 1;
+ maxOffset = GetMaxOffset(listPtr);
if (offset > maxOffset) {
offset = maxOffset;
}
@@ -2930,9 +2928,7 @@ ListboxScanTo(
int newTopIndex, newOffset, maxIndex, maxOffset;
maxIndex = listPtr->nElements - listPtr->fullLines;
- maxOffset = listPtr->maxWidth + (listPtr->xScrollUnit - 1)
- - (Tk_Width(listPtr->tkwin) - 2*listPtr->inset
- - 2*listPtr->selBorderWidth - listPtr->xScrollUnit);
+ maxOffset = GetMaxOffset(listPtr);
/*
* Compute new top line for screen by amplifying the difference between