From 05cec54a399f8b5fde81f04bfc30f60fa4e8afe3 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Mon, 17 Dec 2001 00:36:42 +0000 Subject: Added getLast function --- src/Tab.cc | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/Tab.cc b/src/Tab.cc index 24865c4..32437b2 100644 --- a/src/Tab.cc +++ b/src/Tab.cc @@ -769,10 +769,26 @@ void Tab::motionNotifyEvent(XMotionEvent *me) { // of currentchain. //----------------------------------- Tab *Tab::getFirst(Tab *current) { - if (current==0) + if (!current) return 0; - for (; current->m_prev != 0; current = current->m_prev); - return current; + + Tab *i=current; + + for (; i->m_prev != 0; i = i->m_prev); + return i; +} + +//-------------- getFirst() --------- +// Returns the first Tab in the chain +// of currentchain. +//----------------------------------- +Tab *Tab::getLast(Tab *current) { + if (!current) + return 0; + Tab *i=current; + + for (; i->m_next != 0; i = i->m_next); + return i; } //-------------- insert ------------ -- cgit v0.11.2