classes.cc
/*
** Delete the current listing line in the window
** and update our view.  The width of our view
** always decreases by one.  If the calling procedure
** adds more lines to the screen, they\'ll have to reset
** lastLine\(\) and/or firstLine\(\), but currLine doesn\'t need to change.
*/
Delete the current listing line in the window
and update our view.  The width of our view
always decreases by one.
Delete the current listing line in the window and update our view . The width of our view always decreases by one .
void DirList::deleteLine()
{
    DirLine *line = currLine();
    if (atBegOfList())
    {
         that is, firstLine\(\) == head\(\)
        _head = _firstLine = _currLine = head()->next();
        _head->_prev = 0;
    }
    else if (atWindowTop())
    {
         but firstLine\(\) != head\(\)
        _firstLine = _currLine = line->next();
        line->_next->_prev = line->prev();
        line->_prev->_next = line->next();
    }
    else if (atEndOfList())
    {
         lastLine\(\) == tail\(\)
        _tail = _lastLine = _currLine = line->prev();
        _tail->_next = 0;
    }
    else
    {
        _currLine = line->next();
        line->_next->_prev = line->prev();
        line->_prev->_next = line->next();
    }
    _nelems--;
    delete line;
}
void DirList :: deleteLine ( ) { DirLine * line = currLine ( ) ; if ( atBegOfList ( ) ) { _head = _firstLine = _currLine = head ( ) -> next ( ) ; _head -> _prev = 0 ; } else if ( atWindowTop ( ) ) { _firstLine = _currLine = line -> next ( ) ; line -> _next -> _prev = line -> prev ( ) ; line -> _prev -> _next = line -> next ( ) ; } else if ( atEndOfList ( ) ) { _tail = _lastLine = _currLine = line -> prev ( ) ; _tail -> _next = 0 ; } else { _currLine = line -> next ( ) ; line -> _next -> _prev = line -> prev ( ) ; line -> _prev -> _next = line -> next ( ) ; } _nelems -- ; delete line ; }
Delete the current listing line in the window
and update our view.
Delete the current listing line in the window and update our view .
// // that is, firstLine\(\) == head\(\) // // // but firstLine\(\) != head\(\) // // // lastLine\(\) == tail\(\) //