diff options
author | Timothy Pearson <[email protected]> | 2012-07-28 15:50:52 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-07-28 15:50:52 -0500 |
commit | ebcb1d80bf517aceb69778e1e9f67e5f4da8c484 (patch) | |
tree | 2b17bdf68dd5a96e5ef742207426f65010aedac6 /src/table/qtable.cpp | |
parent | b129c37241b8777665c2c063713d496e43e934b2 (diff) | |
download | qt3-ebcb1d80bf517aceb69778e1e9f67e5f4da8c484.tar.gz qt3-ebcb1d80bf517aceb69778e1e9f67e5f4da8c484.zip |
Fix build warnings
Thanks to Bruce Sass for the patch!
Diffstat (limited to 'src/table/qtable.cpp')
-rw-r--r-- | src/table/qtable.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/table/qtable.cpp b/src/table/qtable.cpp index 8b93f94..9a9a66b 100644 --- a/src/table/qtable.cpp +++ b/src/table/qtable.cpp @@ -2824,9 +2824,9 @@ void QTable::drawContents( QPainter *p, int cx, int cy, int cw, int ch ) QTableItem *itm = item( r, c ); if ( itm && ( itm->colSpan() > 1 || itm->rowSpan() > 1 ) ) { - bool goon = r == itm->row() && c == itm->col() || - r == rowfirst && c == itm->col() || - r == itm->row() && c == colfirst; + bool goon = (r == itm->row() && c == itm->col()) || + (r == rowfirst && c == itm->col()) || + (r == itm->row() && c == colfirst); if ( !goon ) continue; rowp = rowPos( itm->row() ); @@ -3680,7 +3680,7 @@ void QTable::contentsMousePressEventEx( QMouseEvent* e ) } else if ( ( e->state() & ControlButton ) == ControlButton ) { setCurrentCell( tmpRow, tmpCol, FALSE, TRUE ); if ( selMode != NoSelection ) { - if ( selMode == Single || selMode == SingleRow && !isSelected( tmpRow, tmpCol, FALSE ) ) + if ( selMode == Single || ( selMode == SingleRow && !isSelected( tmpRow, tmpCol, FALSE ) ) ) clearSelection(); if ( !(selMode == SingleRow && isSelected( tmpRow, tmpCol, FALSE )) ) { currentSel = new QTableSelection(); @@ -4033,7 +4033,7 @@ bool QTable::eventFilter( QObject *o, QEvent *e ) } if ( ( edMode == Replacing || - itm && itm->editType() == QTableItem::WhenCurrent ) && + ( itm && itm->editType() == QTableItem::WhenCurrent ) ) && ( ke->key() == Key_Up || ke->key() == Key_Prior || ke->key() == Key_Home || ke->key() == Key_Down || ke->key() == Key_Next || ke->key() == Key_End || @@ -4218,7 +4218,7 @@ void QTable::keyPressEvent( QKeyEvent* e ) QWidget *w = beginEdit( tmpRow, tmpCol, itm ? itm->isReplaceable() : TRUE ); if ( w ) { - setEditMode( ( !itm || itm && itm->isReplaceable() + setEditMode( ( !itm || ( itm && itm->isReplaceable() ) ? Replacing : Editing ), tmpRow, tmpCol ); QApplication::sendEvent( w, e ); return; @@ -4725,7 +4725,7 @@ QRect QTable::cellGeometry( int row, int col ) const { QTableItem *itm = item( row, col ); - if ( !itm || itm->rowSpan() == 1 && itm->colSpan() == 1 ) + if ( !itm || ( itm->rowSpan() == 1 && itm->colSpan() == 1 ) ) return QRect( columnPos( col ), rowPos( row ), columnWidth( col ), rowHeight( row ) ); @@ -6706,8 +6706,8 @@ void QTableHeader::paintEvent( QPaintEvent *e ) } paintSection( &p, i, r ); p.restore(); - if ( orientation() == Horizontal && r. right() >= e->rect().right() || - orientation() == Vertical && r. bottom() >= e->rect().bottom() ) + if ( ( orientation() == Horizontal && r. right() >= e->rect().right() ) || + ( orientation() == Vertical && r. bottom() >= e->rect().bottom() ) ) return; } if ( !reg.isEmpty() ) @@ -6728,7 +6728,7 @@ void QTableHeader::paintSection( QPainter *p, int index, const QRect& fr ) return; if ( sectionState( index ) != Selected || - orientation() == Horizontal && isRowSelection( table->selectionMode() ) ) { + ( orientation() == Horizontal && isRowSelection( table->selectionMode() ) ) ) { QHeader::paintSection( p, index, fr ); } else { QStyle::SFlags flags = QStyle::Style_Off | ( orient == Horizontal ? QStyle::Style_Horizontal : 0 ); @@ -6817,8 +6817,8 @@ bool QTableHeader::doSelection( QMouseEvent *e ) if ( startPos == -1 ) { int secAt = sectionAt( p ); - if ( ( e->state() & ControlButton ) != ControlButton && - ( e->state() & ShiftButton ) != ShiftButton || + if ( ( ( e->state() & ControlButton ) != ControlButton && + ( e->state() & ShiftButton ) != ShiftButton ) || table->selectionMode() == QTable::Single || table->selectionMode() == QTable::SingleRow ) { startPos = p; @@ -6853,8 +6853,8 @@ bool QTableHeader::doSelection( QMouseEvent *e ) table->setCurrentCell( 0, secAt ); } - if ( orientation() == Horizontal && table->isColumnSelected(secAt) || - orientation() == Vertical && table->isRowSelected(secAt)) { + if ( ( orientation() == Horizontal && table->isColumnSelected(secAt) ) || + ( orientation() == Vertical && table->isRowSelected(secAt) ) ) { setSectionState( secAt, Selected ); } |