Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/itemviews/qtableview.cpp

    r651 r769  
    115115    } else if (old_height > span->height()) {
    116116        //remove the span from all the subspans lists that intersect the columns not covered anymore
    117         Index::iterator it_y = index.lowerBound(-span->bottom());
    118         if (it_y == index.end())
    119             it_y = index.find(-span->top());    // This is the only span remaining and we are deleting it.
     117        Index::iterator it_y = index.lowerBound(-qMax(span->bottom(), span->top())); //qMax usefull if height is 0
    120118        Q_ASSERT(it_y != index.end()); //it_y must exist since the span is in the list
    121119        while (-it_y.key() <= span->top() + old_height -1) {
    122120            if (-it_y.key() > span->bottom()) {
    123                 (*it_y).remove(-span->left());
     121                int removed = (*it_y).remove(-span->left());
     122                Q_ASSERT(removed == 1); Q_UNUSED(removed);
    124123                if (it_y->isEmpty()) {
    125                     it_y = index.erase(it_y) - 1;
     124                    it_y = index.erase(it_y);
    126125                }
    127126            }
     
    19091908        }
    19101909    } else { // nothing moved
     1910        const int gridAdjust = showGrid() ? 1 : 0;
    19111911        for (int i = 0; i < selection.count(); ++i) {
    19121912            QItemSelectionRange range = selection.at(i);
     
    19171917            const int rtop = rowViewportPosition(range.top());
    19181918            const int rbottom = rowViewportPosition(range.bottom()) + rowHeight(range.bottom());
    1919             const int rleft = columnViewportPosition(range.left());
    1920             const int rright = columnViewportPosition(range.right()) + columnWidth(range.right());
    1921             selectionRegion += QRect(QPoint(rleft, rtop), QPoint(rright, rbottom));
     1919            int rleft;
     1920            int rright;
     1921            if (isLeftToRight()) {
     1922                rleft = columnViewportPosition(range.left());
     1923                rright = columnViewportPosition(range.right()) + columnWidth(range.right());
     1924            } else {
     1925                rleft = columnViewportPosition(range.right());
     1926                rright = columnViewportPosition(range.left()) + columnWidth(range.left());
     1927            }
     1928            selectionRegion += QRect(QPoint(rleft, rtop), QPoint(rright - 1 - gridAdjust, rbottom - 1 - gridAdjust));
    19221929            if (d->hasSpans()) {
    19231930                foreach (QSpanCollection::Span *s,
     
    25472554    if (!d->isIndexValid(index)
    25482555        || (d->model->parent(index) != d->root)
    2549         || isIndexHidden(index))
     2556        || isRowHidden(index.row()) || isColumnHidden(index.column()))
    25502557        return;
    25512558
Note: See TracChangeset for help on using the changeset viewer.