diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-07-28 15:50:52 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-07-28 15:50:52 -0500 |
commit | ebcb1d80bf517aceb69778e1e9f67e5f4da8c484 (patch) | |
tree | 2b17bdf68dd5a96e5ef742207426f65010aedac6 /src | |
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')
38 files changed, 135 insertions, 128 deletions
diff --git a/src/codecs/qjpunicode.cpp b/src/codecs/qjpunicode.cpp index 2d9033f..4b3beaf 100644 --- a/src/codecs/qjpunicode.cpp +++ b/src/codecs/qjpunicode.cpp @@ -10555,7 +10555,7 @@ uint QJpUnicodeConv::unicodeToSjisibmvdc(uint h, uint l) const if (!sjis208ibmvdc_unicode[i]) return 0; if (u==sjis208ibmvdc_unicode[i]){ - return ((0x00fa +(i/189))<<8 | 0x0040+(i%189)); + return ((0x00fa +(i/189))<<8 | (0x0040+(i%189))); } } } @@ -10660,7 +10660,7 @@ uint QJpUnicodeConv::unicodeToCp932(uint h, uint l) const if (!cp932_ed_ee_unicode[j]) return 0; if (u==cp932_ed_ee_unicode[j]){ - return ((0x00ed +(j/189))<<8 | 0x0040+(j%189)); + return ((0x00ed +(j/189))<<8 | (0x0040+(j%189))); } } } diff --git a/src/codecs/qtextcodec.cpp b/src/codecs/qtextcodec.cpp index 1a4fb32..80d0093 100644 --- a/src/codecs/qtextcodec.cpp +++ b/src/codecs/qtextcodec.cpp @@ -2844,7 +2844,7 @@ static void setupLocaleMapper() localeMapper = checkForCodec( lang ); // 5. "@euro" - if ( !localeMapper && ctype && strstr( ctype, "@euro" ) || lang && strstr( lang, "@euro" ) ) + if ( ( !localeMapper && ctype && strstr( ctype, "@euro" ) ) || (lang && strstr( lang, "@euro" ) ) ) localeMapper = QTextCodec::codecForName( "ISO 8859-15" ); // 6. guess locale from ctype unless ctype is "C" diff --git a/src/codecs/qutfcodec.cpp b/src/codecs/qutfcodec.cpp index bc1abce..4e02fe5 100644 --- a/src/codecs/qutfcodec.cpp +++ b/src/codecs/qutfcodec.cpp @@ -254,8 +254,8 @@ const char* QUtf16Codec::name() const int QUtf16Codec::heuristicContentMatch(const char* chars, int len) const { uchar* uchars = (uchar*)chars; - if ( len >= 2 && (uchars[0] == 0xff && uchars[1] == 0xfe || - uchars[1] == 0xff && uchars[0] == 0xfe) ) + if ( len >= 2 && ((uchars[0] == 0xff && uchars[1] == 0xfe) || + (uchars[1] == 0xff && uchars[0] == 0xfe)) ) return len; else return 0; diff --git a/src/dialogs/qdialog.cpp b/src/dialogs/qdialog.cpp index a80f509..04f72a2 100644 --- a/src/dialogs/qdialog.cpp +++ b/src/dialogs/qdialog.cpp @@ -1077,13 +1077,14 @@ void QDialog::showExtension( bool showIt ) /*! \reimp */ QSize QDialog::sizeHint() const { - if ( d->extension ) + if ( d->extension ) { if ( d->orientation == Horizontal ) return QSize( QWidget::sizeHint().width(), QMAX( QWidget::sizeHint().height(),d->extension->sizeHint().height() ) ); else return QSize( QMAX( QWidget::sizeHint().width(), d->extension->sizeHint().width() ), QWidget::sizeHint().height() ); + } return QWidget::sizeHint(); } @@ -1092,13 +1093,14 @@ QSize QDialog::sizeHint() const /*! \reimp */ QSize QDialog::minimumSizeHint() const { - if ( d->extension ) + if ( d->extension ) { if (d->orientation == Horizontal ) return QSize( QWidget::minimumSizeHint().width(), QMAX( QWidget::minimumSizeHint().height(), d->extension->minimumSizeHint().height() ) ); else return QSize( QMAX( QWidget::minimumSizeHint().width(), d->extension->minimumSizeHint().width() ), QWidget::minimumSizeHint().height() ); + } return QWidget::minimumSizeHint(); } diff --git a/src/dialogs/qfiledialog.cpp b/src/dialogs/qfiledialog.cpp index 7d08986..7666770 100644 --- a/src/dialogs/qfiledialog.cpp +++ b/src/dialogs/qfiledialog.cpp @@ -1453,7 +1453,7 @@ void QFileListBox::viewportDropEvent( QDropEvent *e ) bool QFileListBox::acceptDrop( const QPoint &pnt, QWidget *source ) { QListBoxItem *item = itemAt( pnt ); - if ( !item || item && !itemRect( item ).contains( pnt ) ) { + if ( !item || ( item && !itemRect( item ).contains( pnt ) ) ) { if ( source == viewport() && startDragDir == filedialog->dirPath() ) return FALSE; return TRUE; @@ -1872,7 +1872,7 @@ void QFileDialogQFileListView::viewportDropEvent( QDropEvent *e ) bool QFileDialogQFileListView::acceptDrop( const QPoint &pnt, QWidget *source ) { QListViewItem *item = itemAt( pnt ); - if ( !item || item && !itemRect( item ).contains( pnt ) ) { + if ( !item || ( item && !itemRect( item ).contains( pnt ) ) ) { if ( source == viewport() && startDragDir == filedialog->dirPath() ) return FALSE; return TRUE; @@ -3753,8 +3753,8 @@ void QFileDialog::okClicked() = (QFileDialogPrivate::File *)files->currentItem(); QFileDialogPrivate::MCItem * m = (QFileDialogPrivate::MCItem *)d->moreFiles->item( d->moreFiles->currentItem() ); - if ( c && files->isVisible() && files->hasFocus() || - m && d->moreFiles->isVisible() && d->moreFiles->hasFocus() ) { + if ( ( c && files->isVisible() && files->hasFocus() ) || + ( m && d->moreFiles->isVisible() && d->moreFiles->hasFocus() ) ) { if ( c && files->isVisible() ) f = c->info; else @@ -5480,8 +5480,8 @@ bool QFileDialog::eventFilter( QObject * o, QEvent * e ) return TRUE; } else if ( ( o == d->moreFiles || o == d->moreFiles->viewport() ) && e->type() == QEvent::FocusIn ) { - if ( o == d->moreFiles->viewport() && !d->moreFiles->viewport()->hasFocus() || - o == d->moreFiles && !d->moreFiles->hasFocus() ) + if ( ( o == d->moreFiles->viewport() && !d->moreFiles->viewport()->hasFocus() ) || + ( o == d->moreFiles && !d->moreFiles->hasFocus() ) ) ((QWidget*)o)->setFocus(); return FALSE; } @@ -6015,7 +6015,7 @@ void QFileDialog::insertEntry( const QValueList<QUrlInfo> &lst, QNetworkOperatio i = new QFileDialogPrivate::File( d, &inf, files ); i2 = new QFileDialogPrivate::MCItem( d->moreFiles, i ); - if ( d->mode == ExistingFiles && inf.isDir() || + if ( ( d->mode == ExistingFiles && inf.isDir() ) || ( isDirectoryMode( d->mode ) && inf.isFile() ) ) { i->setSelectable( FALSE ); i2->setSelectable( FALSE ); @@ -6297,7 +6297,7 @@ void QFileDialog::resortDir() item2 = new QFileDialogPrivate::MCItem( d->moreFiles, item, item2 ); item->i = item2; d->pendingItems.append( item ); - if ( d->mode == ExistingFiles && item->info.isDir() || + if ( ( d->mode == ExistingFiles && item->info.isDir() ) || ( isDirectoryMode( d->mode ) && item->info.isFile() ) ) { item->setSelectable( FALSE ); item2->setSelectable( FALSE ); diff --git a/src/dialogs/qprogressdialog.cpp b/src/dialogs/qprogressdialog.cpp index bdae310..d90b46e 100644 --- a/src/dialogs/qprogressdialog.cpp +++ b/src/dialogs/qprogressdialog.cpp @@ -573,7 +573,7 @@ int QProgressDialog::progress() const void QProgressDialog::setProgress( int progress ) { if ( progress == bar()->progress() || - bar()->progress() == -1 && progress == bar()->totalSteps() ) + ( bar()->progress() == -1 && progress == bar()->totalSteps() ) ) return; bar()->setProgress(progress); diff --git a/src/kernel/qapplication_x11.cpp b/src/kernel/qapplication_x11.cpp index 990f437..cd1573b 100644 --- a/src/kernel/qapplication_x11.cpp +++ b/src/kernel/qapplication_x11.cpp @@ -3772,7 +3772,7 @@ int QApplication::x11ProcessEvent( XEvent* event ) case SelectionClear: { XSelectionClearEvent *req = &event->xselectionclear; // don't deliver dnd events to the clipboard, it gets confused - if (! req || qt_xdnd_selection && req->selection == qt_xdnd_selection) + if (! req || ( qt_xdnd_selection && req->selection ) == qt_xdnd_selection) break; if (qt_clipboard) { @@ -3785,7 +3785,7 @@ int QApplication::x11ProcessEvent( XEvent* event ) case SelectionNotify: { XSelectionEvent *req = &event->xselection; // don't deliver dnd events to the clipboard, it gets confused - if (! req || qt_xdnd_selection && req->selection == qt_xdnd_selection) + if (! req || ( qt_xdnd_selection && req->selection ) == qt_xdnd_selection) break; if (qt_clipboard) { @@ -4200,7 +4200,7 @@ bool QETWidget::translateMouseEvent( const XEvent *event ) // backward rotation respectively. int btn = event->xbutton.button; delta *= 120 * ( (btn == Button4 || btn == 6) ? 1 : -1 ); - bool hor = ( (btn == Button4 || btn == Button5) && (state&AltButton) || + bool hor = ( ( (btn == Button4 || btn == Button5) && (state&AltButton) ) || (btn == 6 || btn == 7) ); translateWheelEvent( globalPos.x(), globalPos.y(), delta, state, (hor)?Horizontal:Vertical ); } @@ -5336,7 +5336,7 @@ bool QETWidget::translateKeyEventInternal( const XEvent *event, int& count, // (to figure out whether the Ctrl modifier is held while Shift is pressed, // or Shift is held while Ctrl is pressed) since the 'state' doesn't tell // us whether the modifier held is Left or Right. - if ( qt_use_rtl_extensions && type == QEvent::KeyPress && statefulTranslation ) + if ( qt_use_rtl_extensions && type == QEvent::KeyPress && statefulTranslation ) { if (key == XK_Control_L || key == XK_Control_R || key == XK_Shift_L || key == XK_Shift_R) { if (!directionKeyEvent) { directionKeyEvent = key; @@ -5349,6 +5349,7 @@ bool QETWidget::translateKeyEventInternal( const XEvent *event, int& count, // if any other key was pressed. directionKeyEvent = Key_Space; } + } // Commentary in X11/keysymdef says that X codes match ASCII, so it // is safe to use the locale functions to process X codes in ISO8859-1. @@ -5410,11 +5411,11 @@ bool QETWidget::translateKeyEventInternal( const XEvent *event, int& count, if ( qt_use_rtl_extensions && type == QEvent::KeyPress && statefulTranslation ) { if ( directionKeyEvent && lastWinId == winId() ) { - if ( key == XK_Shift_L && directionKeyEvent == XK_Control_L || - key == XK_Control_L && directionKeyEvent == XK_Shift_L ) { + if ( ( key == XK_Shift_L && directionKeyEvent == XK_Control_L ) || + ( key == XK_Control_L && directionKeyEvent == XK_Shift_L ) ) { directionKeyEvent = Key_Direction_L; - } else if ( key == XK_Shift_R && directionKeyEvent == XK_Control_R || - key == XK_Control_R && directionKeyEvent == XK_Shift_R ) { + } else if ( ( key == XK_Shift_R && directionKeyEvent == XK_Control_R ) || + ( key == XK_Control_R && directionKeyEvent == XK_Shift_R ) ) { directionKeyEvent = Key_Direction_R; } } @@ -5735,8 +5736,8 @@ static Bool isPaintOrScrollDoneEvent( Display *, XEvent *ev, XPointer a ) { PaintEventInfo *info = (PaintEventInfo *)a; if ( ev->type == Expose || ev->type == GraphicsExpose - || ev->type == ClientMessage - && ev->xclient.message_type == qt_qt_scrolldone ) + || ( ev->type == ClientMessage + && ev->xclient.message_type == qt_qt_scrolldone ) ) { if ( ev->xexpose.window == info->window ) return True; diff --git a/src/kernel/qcursor_x11.cpp b/src/kernel/qcursor_x11.cpp index 7d359a3..de246a5 100644 --- a/src/kernel/qcursor_x11.cpp +++ b/src/kernel/qcursor_x11.cpp @@ -704,7 +704,7 @@ void QCursor::update() const forbidden_bits, forbiddenm_bits }; - if ( d->cshape >= SizeVerCursor && d->cshape < SizeAllCursor || + if ( ( d->cshape >= SizeVerCursor && d->cshape < SizeAllCursor ) || d->cshape == BlankCursor ) { XColor bg, fg; bg.red = 255 << 8; diff --git a/src/kernel/qdnd_x11.cpp b/src/kernel/qdnd_x11.cpp index 607a358..be72799 100644 --- a/src/kernel/qdnd_x11.cpp +++ b/src/kernel/qdnd_x11.cpp @@ -611,7 +611,7 @@ void qt_handle_xdnd_position( QWidget *w, const XEvent * xe, bool passive ) if (!passive && checkEmbedded(c, xe)) return; - if ( !c || !c->acceptDrops() && c->isDesktop() ) { + if ( !c || ( !c->acceptDrops() && c->isDesktop() ) ) { return; } diff --git a/src/kernel/qdragobject.cpp b/src/kernel/qdragobject.cpp index 44e340f..4f3353b 100644 --- a/src/kernel/qdragobject.cpp +++ b/src/kernel/qdragobject.cpp @@ -1464,10 +1464,10 @@ QCString QUriDrag::unicodeUriToUri(const QString& uuri) int n = utf8.length(); bool isFile = uuri.startsWith("file://"); for (int i=0; i<n; i++) { - if ( utf8[i] >= 'a' && utf8[i] <= 'z' + if ( (utf8[i] >= 'a' && utf8[i] <= 'z') || utf8[i] == '/' - || utf8[i] >= '0' && utf8[i] <= '9' - || utf8[i] >= 'A' && utf8[i] <= 'Z' + || (utf8[i] >= '0' && utf8[i] <= '9') + || (utf8[i] >= 'A' && utf8[i] <= 'Z') || utf8[i] == '-' || utf8[i] == '_' || utf8[i] == '.' || utf8[i] == '!' diff --git a/src/kernel/qmngio.cpp b/src/kernel/qmngio.cpp index 2644270..d9d085b 100644 --- a/src/kernel/qmngio.cpp +++ b/src/kernel/qmngio.cpp @@ -258,31 +258,31 @@ QImageFormat* QMNGFormatType::decoderFor( const uchar* buffer, int length ) { if (length < 8) return 0; - if (buffer[0]==138 // MNG signature + if ((buffer[0]==138 // MNG signature && buffer[1]=='M' && buffer[2]=='N' && buffer[3]=='G' && buffer[4]==13 && buffer[5]==10 && buffer[6]==26 - && buffer[7]==10 - || buffer[0]==139 // JNG signature + && buffer[7]==10) + || (buffer[0]==139 // JNG signature && buffer[1]=='J' && buffer[2]=='N' && buffer[3]=='G' && buffer[4]==13 && buffer[5]==10 && buffer[6]==26 - && buffer[7]==10 + && buffer[7]==10) #ifdef QT_NO_IMAGEIO_PNG // if we don't have native PNG support use libmng - || buffer[0]==137 // PNG signature + || (buffer[0]==137 // PNG signature && buffer[1]=='P' && buffer[2]=='N' && buffer[3]=='G' && buffer[4]==13 && buffer[5]==10 && buffer[6]==26 - && buffer[7]==10 + && buffer[7]==10) #endif ) return new QMNGFormat; diff --git a/src/kernel/qprinter_unix.cpp b/src/kernel/qprinter_unix.cpp index 5dcfa93..643f2d0 100644 --- a/src/kernel/qprinter_unix.cpp +++ b/src/kernel/qprinter_unix.cpp @@ -412,15 +412,15 @@ bool QPrinter::cmd( int c, QPainter *paint, QPDevCmdParam *p ) lphack.append(pr); } char ** lpargs = new char *[lphack.size()+6]; - lpargs[0] = "lp"; + lpargs[0] = (char *)"lp"; uint i; for (i = 0; i < lphack.size(); ++i) lpargs[i+1] = (char *)lphack[i].ascii(); #ifndef Q_OS_OSF if (psToStr[page_size]) { - lpargs[++i] = "-o"; + lpargs[++i] = (char *)"-o"; lpargs[++i] = (char *)psToStr[page_size]; - lpargs[++i] = "-o"; + lpargs[++i] = (char *)"-o"; media = "media="; media += psToStr[page_size]; lpargs[++i] = (char *)media.ascii(); @@ -428,7 +428,7 @@ bool QPrinter::cmd( int c, QPainter *paint, QPDevCmdParam *p ) #endif lpargs[++i] = 0; char **lprargs = new char *[lprhack.size()+1]; - lprargs[0] = "lpr"; + lprargs[0] = (char *)"lpr"; for (uint x = 0; x < lprhack.size(); ++x) lprargs[x+1] = (char *)lprhack[x].ascii(); lprargs[lprhack.size() + 1] = 0; diff --git a/src/kernel/qrichtext.cpp b/src/kernel/qrichtext.cpp index eb43f3c..71095a3 100644 --- a/src/kernel/qrichtext.cpp +++ b/src/kernel/qrichtext.cpp @@ -177,7 +177,7 @@ bool QTextCommandHistory::isUndoAvailable() bool QTextCommandHistory::isRedoAvailable() { - return current > -1 && current < (int)history.count() - 1 || current == -1 && history.count() > 0; + return ( current > -1 && current < (int)history.count() - 1 ) || ( current == -1 && history.count() > 0 ); } // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -2127,11 +2127,12 @@ void QTextDocument::setRichTextMarginsInternal( QPtrList< QPtrVector<QStyleSheet stylesPar->utm = 0; } else { m = QMAX(0, item->margin( QStyleSheetItem::MarginTop ) ); - if ( stylesPar->ldepth ) + if ( stylesPar->ldepth ) { if ( item->displayMode() == QStyleSheetItem::DisplayListItem ) m /= stylesPar->ldepth * stylesPar->ldepth; else m = 0; + } } for ( i = (int)curStyle->size() - 2 ; i >= 0; --i ) { item = (*curStyle)[ i ]; @@ -2155,11 +2156,12 @@ void QTextDocument::setRichTextMarginsInternal( QPtrList< QPtrVector<QStyleSheet stylesPar->ubm = 0; } else { m = QMAX(0, item->margin( QStyleSheetItem::MarginBottom ) ); - if ( stylesPar->ldepth ) + if ( stylesPar->ldepth ) { if ( item->displayMode() == QStyleSheetItem::DisplayListItem ) m /= stylesPar->ldepth * stylesPar->ldepth; else m = 0; + } } for ( i = (int)curStyle->size() - 2 ; i >= 0; --i ) { item = (*curStyle)[ i ]; @@ -2243,7 +2245,7 @@ void QTextDocument::setText( const QString &text, const QString &context ) { focusIndicator.parag = 0; selections.clear(); - if ( txtFormat == Qt::AutoText && QStyleSheet::mightBeRichText( text ) || + if ( ( txtFormat == Qt::AutoText && QStyleSheet::mightBeRichText( text ) ) || txtFormat == Qt::RichText ) setRichText( text, context ); else @@ -2459,7 +2461,7 @@ QString QTextDocument::richText() const QString QTextDocument::text() const { - if ( txtFormat == Qt::AutoText && preferRichText || txtFormat == Qt::RichText ) + if ( ( txtFormat == Qt::AutoText && preferRichText ) || txtFormat == Qt::RichText ) return richText(); return plainText(); } @@ -2470,7 +2472,7 @@ QString QTextDocument::text( int parag ) const if ( !p ) return QString::null; - if ( txtFormat == Qt::AutoText && preferRichText || txtFormat == Qt::RichText ) + if ( ( txtFormat == Qt::AutoText && preferRichText ) || txtFormat == Qt::RichText ) return p->richText(); else return p->string()->toString(); @@ -2609,12 +2611,12 @@ bool QTextDocument::setSelectionEnd( int id, const QTextCursor &cursor ) hadOldEnd = TRUE; if ( !sel.swapped && - ( hadEnd && !hadStart || - hadEnd && hadStart && start.paragraph() == end.paragraph() && start.index() > end.index() ) ) + ( ( hadEnd && !hadStart ) || + ( hadEnd && hadStart && start.paragraph() == end.paragraph() && start.index() > end.index() ) ) ) sel.swapped = TRUE; - if ( c == end && hadStartParag || - c == start && hadEndParag ) { + if ( ( c == end && hadStartParag ) || + ( c == start && hadEndParag ) ) { QTextCursor tmp = c; tmp.restoreState(); if ( tmp.paragraph() != c.paragraph() ) { @@ -2625,7 +2627,7 @@ bool QTextDocument::setSelectionEnd( int id, const QTextCursor &cursor ) } if ( inSelection && - ( c == end && hadStart || c == start && hadEnd ) ) + ( ( c == end && hadStart ) || ( c == start && hadEnd ) ) ) leftSelection = TRUE; else if ( !leftSelection && !inSelection && ( hadStart || hadEnd ) ) inSelection = TRUE; @@ -3253,7 +3255,7 @@ void QTextDocument::drawParagraph( QPainter *p, QTextParagraph *parag, int cx, i QTextParagraph *QTextDocument::draw( QPainter *p, int cx, int cy, int cw, int ch, const QColorGroup &cg, bool onlyChanged, bool drawCursor, QTextCursor *cursor, bool resetChanged ) { - if ( withoutDoubleBuffer || par && par->withoutDoubleBuffer ) { + if ( withoutDoubleBuffer || ( par && par->withoutDoubleBuffer ) ) { withoutDoubleBuffer = TRUE; QRect r; draw( p, r, cg ); @@ -4754,7 +4756,7 @@ void QTextParagraph::drawString( QPainter &painter, const QString &str, int star bool plainText = hasdoc ? document()->textFormat() == Qt::PlainText : FALSE; QTextFormat* format = formatChar->format(); - if ( !plainText || hasdoc && format->color() != document()->formatCollection()->defaultFormat()->color() ) + if ( !plainText || ( hasdoc && format->color() != document()->formatCollection()->defaultFormat()->color() ) ) painter.setPen( QPen( format->color() ) ); else painter.setPen( cg.text() ); @@ -4848,9 +4850,9 @@ void QTextParagraph::drawString( QPainter &painter, const QString &str, int star } if (selStart < real_selEnd || - selWrap && fullSelectionWidth && extendRight && + (selWrap && fullSelectionWidth && extendRight && // don't draw the standard selection on a printer= - (it.key() != QTextDocument::Standard || !is_printer( &painter))) { + (it.key() != QTextDocument::Standard || !is_printer( &painter)))) { int selection = it.key(); QColor color; setColorForSelection( color, painter, cg, selection ); @@ -4904,10 +4906,10 @@ void QTextParagraph::drawString( QPainter &painter, const QString &str, int star if ( hasdoc && formatChar->isAnchor() && !formatChar->anchorHref().isEmpty() && document()->focusIndicator.parag == this && - ( document()->focusIndicator.start >= start && - document()->focusIndicator.start + document()->focusIndicator.len <= start + len || - document()->focusIndicator.start <= start && - document()->focusIndicator.start + document()->focusIndicator.len >= start + len ) ) + ( ( document()->focusIndicator.start >= start && + document()->focusIndicator.start + document()->focusIndicator.len <= start + len ) || + ( document()->focusIndicator.start <= start && + document()->focusIndicator.start + document()->focusIndicator.len >= start + len ) ) ) painter.drawWinFocusRect( QRect( xstart, y, w, h ) ); } @@ -5652,8 +5654,8 @@ int QTextFormatterBreakInWords::format( QTextDocument *doc,QTextParagraph *parag #endif if ( wrapEnabled && - ( wrapAtColumn() == -1 && x + ww > w || - wrapAtColumn() != -1 && col >= wrapAtColumn() ) ) { + ( ( wrapAtColumn() == -1 && x + ww > w ) || + ( wrapAtColumn() != -1 && col >= wrapAtColumn() ) ) ) { x = doc ? parag->document()->flow()->adjustLMargin( y + parag->rect().y(), parag->rect().height(), left, 4 ) : left; w = dw; y += h; @@ -5798,7 +5800,7 @@ int QTextFormatterBreakWords::format( QTextDocument *doc, QTextParagraph *parag, x -= rb; } - if ( i > 0 && (x > curLeft || ww == 0) || lastWasNonInlineCustom ) { + if ( ( i > 0 && (x > curLeft || ww == 0) ) || lastWasNonInlineCustom ) { c->lineStart = 0; } else { c->lineStart = 1; @@ -7733,7 +7735,7 @@ void QTextTable::draw(QPainter* p, int x, int y, int cx, int cy, int cw, int ch, } for (QTextTableCell* cell = cells.first(); cell; cell = cells.next() ) { - if ( cx < 0 && cy < 0 || + if ( ( cx < 0 && cy < 0 ) || QRect( cx, cy, cw, ch ).intersects( QRect( x + outerborder + cell->geometry().x(), y + outerborder + cell->geometry().y(), cell->geometry().width(), cell->geometry().height() ) ) ) { diff --git a/src/network/qdns.cpp b/src/network/qdns.cpp index 3cc4d76..33f6d2e 100644 --- a/src/network/qdns.cpp +++ b/src/network/qdns.cpp @@ -1167,7 +1167,7 @@ void QDnsManager::transmitQuery( int i ) return; } - if ( q && !q->dns || q->dns->isEmpty() ) + if ( ( q && !q->dns ) || q->dns->isEmpty() ) // noone currently wants the answer, so there's no point in // retransmitting the query. we keep it, though. an answer may // arrive for an earlier query transmission, and if it does we diff --git a/src/styles/qcommonstyle.cpp b/src/styles/qcommonstyle.cpp index faf3649..6e89845 100644 --- a/src/styles/qcommonstyle.cpp +++ b/src/styles/qcommonstyle.cpp @@ -1019,7 +1019,7 @@ void QCommonStyle::drawControl( ControlElement element, if (! toolbutton->isEnabled()) mode = QIconSet::Disabled; else if (flags & (Style_Down | Style_On) || - (flags & Style_Raised) && (flags & Style_AutoRaise)) + ((flags & Style_Raised) && (flags & Style_AutoRaise))) mode = QIconSet::Active; else mode = QIconSet::Normal; 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 ); } diff --git a/src/tools/qdatetime.cpp b/src/tools/qdatetime.cpp index d0c21dc..abf2dcd 100644 --- a/src/tools/qdatetime.cpp +++ b/src/tools/qdatetime.cpp @@ -1178,7 +1178,7 @@ bool QDate::isValid( int y, int m, int d ) bool QDate::leapYear( int y ) { - return y % 4 == 0 && y % 100 != 0 || y % 400 == 0; + return (y % 4 == 0 && y % 100 != 0) || y % 400 == 0; } /*! diff --git a/src/tools/qsettings.cpp b/src/tools/qsettings.cpp index 006deb7..1ce2675 100644 --- a/src/tools/qsettings.cpp +++ b/src/tools/qsettings.cpp @@ -1051,7 +1051,7 @@ bool QSettings::sync() if ( success ) { QDir dir( QFileInfo( file ).dir( TRUE ) ); - if ( dir.exists( filename ) && !dir.remove( filename ) || + if ( ( dir.exists( filename ) && !dir.remove( filename ) ) || !dir.rename( file.name(), filename, TRUE ) ) { #ifdef QT_CHECK_STATE diff --git a/src/widgets/qaction.cpp b/src/widgets/qaction.cpp index 1e68de0..3dd6b27 100644 --- a/src/widgets/qaction.cpp +++ b/src/widgets/qaction.cpp @@ -287,11 +287,12 @@ void QActionPrivate::update( uint upd ) if ( upd & Visibility ) mi->popup->setItemVisible( mi->id, visible ); - if ( upd & Icons ) + if ( upd & Icons ) { if ( iconset ) mi->popup->changeItem( mi->id, *iconset, t ); else mi->popup->changeItem( mi->id, QIconSet(), t ); + } if ( upd & EverythingElse ) { mi->popup->changeItem( mi->id, t ); if ( !whatsthis.isEmpty() ) diff --git a/src/widgets/qbutton.cpp b/src/widgets/qbutton.cpp index 57178fb..044ccf9 100644 --- a/src/widgets/qbutton.cpp +++ b/src/widgets/qbutton.cpp @@ -998,8 +998,8 @@ bool QButton::isExclusiveToggle() const { #ifndef QT_NO_BUTTONGROUP return group() && ( group()->isExclusive() || - group()->isRadioButtonExclusive() && - ::qt_cast<QRadioButton*>(this) ); + ( group()->isRadioButtonExclusive() && + ::qt_cast<QRadioButton*>(this) ) ); #else return FALSE; #endif diff --git a/src/widgets/qbuttongroup.cpp b/src/widgets/qbuttongroup.cpp index ebcc580..8737804 100644 --- a/src/widgets/qbuttongroup.cpp +++ b/src/widgets/qbuttongroup.cpp @@ -434,7 +434,7 @@ void QButtonGroup::buttonClicked() void QButtonGroup::buttonToggled( bool on ) { // introduce a QButtonListIt if calling anything - if ( !on || !excl_grp && !radio_excl ) + if ( !on || ( !excl_grp && !radio_excl ) ) return; QButton *bt = ::qt_cast<QButton*>(sender()); // object that sent the signal #if defined(QT_CHECK_NULL) diff --git a/src/widgets/qdatetimeedit.cpp b/src/widgets/qdatetimeedit.cpp index 6f6ca71..dfd8353 100644 --- a/src/widgets/qdatetimeedit.cpp +++ b/src/widgets/qdatetimeedit.cpp @@ -624,7 +624,7 @@ bool QDateTimeEditor::eventFilter( QObject *o, QEvent *e ) QWidget *w = this; bool hadDateEdit = FALSE; while ( w ) { - if ( ::qt_cast<QDateTimeSpinWidget*>(w) && qstrcmp( w->name(), "qt_spin_widget" ) != 0 || + if ( ( ::qt_cast<QDateTimeSpinWidget*>(w) && qstrcmp( w->name(), "qt_spin_widget" ) != 0 ) || ::qt_cast<QDateTimeEdit*>(w) ) break; hadDateEdit = hadDateEdit || ::qt_cast<QDateEdit*>(w); diff --git a/src/widgets/qdockarea.cpp b/src/widgets/qdockarea.cpp index 2d4d957..663c3d9 100644 --- a/src/widgets/qdockarea.cpp +++ b/src/widgets/qdockarea.cpp @@ -691,7 +691,7 @@ void QDockArea::moveDockWindow( QDockWindow *w, const QPoint &p, const QRect &r, QRect lr = *lines.at( lineOf( dockWindowIndex ) ); if ( dockWindowIndex != -1 ) { if ( lineStarts.find( w ) != -1 && - ( dockWindowIndex < (int)dockWindows->count() - 1 && lineStarts.find( dockWindows->at( dockWindowIndex + 1 ) ) != -1 || + ( ( dockWindowIndex < (int)dockWindows->count() - 1 && lineStarts.find( dockWindows->at( dockWindowIndex + 1 ) ) != -1 ) || dockWindowIndex == (int)dockWindows->count() - 1 ) ) wasAloneInLine = TRUE; dockWindow = dockWindows->take( dockWindowIndex ); diff --git a/src/widgets/qdockwindow.cpp b/src/widgets/qdockwindow.cpp index 8646ec9..8cdbe17 100644 --- a/src/widgets/qdockwindow.cpp +++ b/src/widgets/qdockwindow.cpp @@ -1620,8 +1620,8 @@ void QDockWindow::setCloseMode( int m ) bool QDockWindow::isCloseEnabled() const { - return ( ( cMode & Docked ) == Docked && place() == InDock || - ( cMode & Undocked ) == Undocked && place() == OutsideDock ); + return ( ( ( cMode & Docked ) == Docked && place() == InDock ) || + ( ( cMode & Undocked ) == Undocked && place() == OutsideDock ) ); } int QDockWindow::closeMode() const diff --git a/src/widgets/qheader.cpp b/src/widgets/qheader.cpp index 82fd012..a22e299 100644 --- a/src/widgets/qheader.cpp +++ b/src/widgets/qheader.cpp @@ -602,10 +602,10 @@ void QHeader::keyPressEvent( QKeyEvent *e ) repaint( sRect( handleIdx ) ); emit pressed( d->i2s[i] ); } - } else if ( orientation() == Horizontal && - (e->key() == Key_Right || e->key() == Key_Left) - || orientation() == Vertical && - (e->key() == Key_Up || e->key() == Key_Down) ) { + } else if ( ( orientation() == Horizontal && + (e->key() == Key_Right || e->key() == Key_Left) ) + || ( orientation() == Vertical && + (e->key() == Key_Up || e->key() == Key_Down) ) ) { int dir = e->key() == Key_Right || e->key() == Key_Down ? 1 : -1; int s = d->i2s[i]; if ( e->state() & ControlButton && d->resize[s] ) { @@ -1638,8 +1638,8 @@ void QHeader::paintEvent( QPaintEvent *e ) style().drawPrimitive( QStyle::PE_FocusRect, &p, fr, colorGroup() ); } - if ( orient == Horizontal && r. right() >= e->rect().right() || - orient == Vertical && r. bottom() >= e->rect().bottom() ) + if ( ( orient == Horizontal && r. right() >= e->rect().right() ) || + ( orient == Vertical && r. bottom() >= e->rect().bottom() ) ) return; } } diff --git a/src/widgets/qlistbox.cpp b/src/widgets/qlistbox.cpp index f5e0057..1083cab 100644 --- a/src/widgets/qlistbox.cpp +++ b/src/widgets/qlistbox.cpp @@ -2191,7 +2191,7 @@ void QListBox::mouseReleaseEvent( QMouseEvent *e ) } QListBoxItem * i = itemAt( e->pos() ); - bool emitClicked = d->mousePressColumn != -1 && d->mousePressRow != -1 || !d->pressedItem; + bool emitClicked = ( d->mousePressColumn != -1 && d->mousePressRow != -1 ) || !d->pressedItem; emitClicked = emitClicked && d->pressedItem == i; d->pressedItem = 0; d->mousePressRow = -1; @@ -2261,7 +2261,7 @@ void QListBox::mouseMoveEvent( QMouseEvent *e ) // move outside the listbox without having seen a press, discard // it. if ( !QRect( 0, 0, visibleWidth(), visibleHeight() ).contains( e->pos() ) && - ( d->mousePressColumn < 0 && d->mousePressRow < 0 || + ( (d->mousePressColumn < 0 && d->mousePressRow < 0) || (e->state() == NoButton && !d->pressedItem) ) ) return; @@ -4647,7 +4647,7 @@ void QListBox::selectRange( QListBoxItem *from, QListBoxItem *to, bool invert, b } } else { bool sel = !i->s; - if ( (bool)i->s != sel && sel && i->isSelectable() || !sel ) { + if ( ( (bool)i->s != sel && sel && i->isSelectable() ) || !sel ) { i->s = sel; changed = TRUE; updateItem( i ); diff --git a/src/widgets/qlistview.cpp b/src/widgets/qlistview.cpp index d441a59..304ad18 100644 --- a/src/widgets/qlistview.cpp +++ b/src/widgets/qlistview.cpp @@ -1739,7 +1739,7 @@ void QListViewItem::setExpandable( bool enable ) void QListViewItem::enforceSortOrder() const { QListView *lv = listView(); - if ( !lv || lv && (lv->d->clearing || lv->d->sortcolumn == Unsorted) ) + if ( !lv || (lv && (lv->d->clearing || lv->d->sortcolumn == Unsorted)) ) return; if ( parentItem && (parentItem->lsc != lsc || parentItem->lso != lso) ) @@ -5178,7 +5178,7 @@ QListViewItem * QListView::itemAt( const QPoint & viewPos ) const while( c && c->i && ( c->y + c->i->height() <= g || !c->i->isVisible() || - c->i->parent() && !c->i->parent()->isVisible() ) ) + ( c->i->parent() && !c->i->parent()->isVisible() ) ) ) c = d->drawables->next(); QListViewItem *i = (c && c->y <= g) ? c->i : 0; @@ -6449,7 +6449,7 @@ void QCheckListItem::activate() { QListView * lv = listView(); - if ( lv && !lv->isEnabled() || !isEnabled() ) + if ( ( lv && !lv->isEnabled() ) || !isEnabled() ) return; QPoint pos; @@ -7200,7 +7200,7 @@ void QListView::contentsDragEnterEvent( QDragEnterEvent *e ) d->focusItem->dragEntered(); d->focusItem->repaint(); } - if ( i && i->dropEnabled() && i->acceptDrop( e ) || acceptDrops() ) + if ( ( i && i->dropEnabled() && i->acceptDrop( e ) ) || acceptDrops() ) e->accept(); else e->ignore(); @@ -7227,7 +7227,7 @@ void QListView::contentsDragMoveEvent( QDragMoveEvent *e ) } else { d->autoopenTimer->stop(); } - if ( i && i->dropEnabled() && i->acceptDrop( e ) || acceptDrops() ) + if ( ( i && i->dropEnabled() && i->acceptDrop( e ) ) || acceptDrops() ) e->accept(); else e->ignore(); @@ -7988,7 +7988,7 @@ void QListView::selectRange( QListViewItem *from, QListViewItem *to, bool invert } } else { bool sel = !i->selected; - if ( (bool)i->selected != sel && sel && i->isSelectable() || !sel ) { + if ( ( (bool)i->selected != sel && sel && i->isSelectable() ) || !sel ) { i->setSelected( sel ); changed = TRUE; } diff --git a/src/widgets/qmainwindow.cpp b/src/widgets/qmainwindow.cpp index 7ad2781..8574866 100644 --- a/src/widgets/qmainwindow.cpp +++ b/src/widgets/qmainwindow.cpp @@ -1626,7 +1626,7 @@ bool QMainWindow::eventFilter( QObject* o, QEvent *e ) setUpLayout(); d->tll->activate(); } else if ( e->type() == QEvent::ContextMenu && d->dockMenu && - ( ::qt_cast<QDockArea*>(o) && dockMainWindow( o ) || o == d->hideDock || o == d->mb ) ) { + ( ( ::qt_cast<QDockArea*>(o) && dockMainWindow( o ) ) || o == d->hideDock || o == d->mb ) ) { if ( showDockMenu( ( (QMouseEvent*)e )->globalPos() ) ) { ( (QContextMenuEvent*)e )->accept(); return TRUE; diff --git a/src/widgets/qmenubar.cpp b/src/widgets/qmenubar.cpp index 45e0ffb..e832fd4 100644 --- a/src/widgets/qmenubar.cpp +++ b/src/widgets/qmenubar.cpp @@ -1240,8 +1240,8 @@ void QMenuBar::mouseReleaseEvent( QMouseEvent *e ) return; mouseBtDn = FALSE; // mouse button up int item = itemAtPos( e->pos() ); - if ( item >= 0 && !mitems->at(item)->isEnabledAndVisible() || - actItem >= 0 && !mitems->at(actItem)->isEnabledAndVisible() ) { + if ( ( item >= 0 && !mitems->at(item)->isEnabledAndVisible() ) || + ( actItem >= 0 && !mitems->at(actItem)->isEnabledAndVisible() ) ) { hidePopups(); setActiveItem( -1 ); return; diff --git a/src/widgets/qpopupmenu.cpp b/src/widgets/qpopupmenu.cpp index 9e1e01c..f20cbfc 100644 --- a/src/widgets/qpopupmenu.cpp +++ b/src/widgets/qpopupmenu.cpp @@ -652,19 +652,19 @@ void QPopupMenu::popup( const QPoint &pos, int indexAtPoint ) int hGuess = qApp->reverseLayout() ? QEffects::LeftScroll : QEffects::RightScroll; int vGuess = QEffects::DownScroll; if ( qApp->reverseLayout() ) { - if ( snapToMouse && ( x + w/2 > mouse.x() ) || + if ( ( snapToMouse && ( x + w/2 > mouse.x() ) ) || ( parentMenu && parentMenu->isPopupMenu && ( x + w/2 > ((QPopupMenu*)parentMenu)->x() ) ) ) hGuess = QEffects::RightScroll; } else { - if ( snapToMouse && ( x + w/2 < mouse.x() ) || + if ( ( snapToMouse && ( x + w/2 < mouse.x() ) ) || ( parentMenu && parentMenu->isPopupMenu && ( x + w/2 < ((QPopupMenu*)parentMenu)->x() ) ) ) hGuess = QEffects::LeftScroll; } #ifndef QT_NO_MENUBAR - if ( snapToMouse && ( y + h/2 < mouse.y() ) || + if ( ( snapToMouse && ( y + h/2 < mouse.y() ) ) || ( parentMenu && parentMenu->isMenuBar && ( y + h/2 < ((QMenuBar*)parentMenu)->mapToGlobal( ((QMenuBar*)parentMenu)->pos() ).y() ) ) ) vGuess = QEffects::UpScroll; diff --git a/src/widgets/qscrollbar.cpp b/src/widgets/qscrollbar.cpp index 9a5e8f4..5ffe7e9 100644 --- a/src/widgets/qscrollbar.cpp +++ b/src/widgets/qscrollbar.cpp @@ -643,7 +643,7 @@ void QScrollBar::mousePressEvent( QMouseEvent *e ) pressedControl == QStyle::SC_ScrollBarSubPage || pressedControl == QStyle::SC_ScrollBarSlider ) && ((midButtonAbsPos && e->button() == MidButton) || - style().styleHint(QStyle::SH_ScrollBar_LeftClickAbsolutePosition) && e->button() == LeftButton)) { + (style().styleHint(QStyle::SH_ScrollBar_LeftClickAbsolutePosition) && e->button() == LeftButton)) ) { QRect sr = style().querySubControlMetrics(QStyle::CC_ScrollBar, this, QStyle::SC_ScrollBarSlider ), diff --git a/src/widgets/qslider.cpp b/src/widgets/qslider.cpp index 1573294..f190f4f 100644 --- a/src/widgets/qslider.cpp +++ b/src/widgets/qslider.cpp @@ -447,8 +447,8 @@ void QSlider::mousePressEvent( QMouseEvent *e ) moveSlider( pos - slideLength / 2 ); state = Dragging; clickOffset = slideLength / 2; - } else if ( orient == Horizontal && e->pos().x() < r.left() //### goodPart - || orient == Vertical && e->pos().y() < r.top() ) { + } else if ( ( orient == Horizontal && e->pos().x() < r.left() ) //### goodPart + || ( orient == Vertical && e->pos().y() < r.top() ) ) { if ( orient == Horizontal && QApplication::reverseLayout() ) { state = TimingUp; addPage(); @@ -460,8 +460,8 @@ void QSlider::mousePressEvent( QMouseEvent *e ) timer = new QTimer( this ); connect( timer, SIGNAL(timeout()), SLOT(repeatTimeout()) ); timer->start( thresholdTime, TRUE ); - } else if ( orient == Horizontal && e->pos().x() > r.right() //### goodPart - || orient == Vertical && e->pos().y() > r.bottom() ) { + } else if ( ( orient == Horizontal && e->pos().x() > r.right() ) //### goodPart + || ( orient == Vertical && e->pos().y() > r.bottom() ) ) { if ( orient == Horizontal && QApplication::reverseLayout() ) { state = TimingDown; subtractPage(); diff --git a/src/widgets/qspinwidget.cpp b/src/widgets/qspinwidget.cpp index 427f710..30cf05e 100644 --- a/src/widgets/qspinwidget.cpp +++ b/src/widgets/qspinwidget.cpp @@ -323,7 +323,7 @@ void QSpinWidget::paintEvent( QPaintEvent * ) QStyle::SFlags flags = QStyle::Style_Default; if (isEnabled()) flags |= QStyle::Style_Enabled; - if (hasFocus() || focusProxy() && focusProxy()->hasFocus()) + if (hasFocus() || (focusProxy() && focusProxy()->hasFocus())) flags |= QStyle::Style_HasFocus; QStyle::SCFlags active; diff --git a/src/widgets/qtextedit.cpp b/src/widgets/qtextedit.cpp index 0908e84..e45e42d 100644 --- a/src/widgets/qtextedit.cpp +++ b/src/widgets/qtextedit.cpp @@ -1395,11 +1395,11 @@ void QTextEdit::keyPressEvent( QKeyEvent *e ) break; default: { if ( e->text().length() && - ( !( e->state() & ControlButton ) && + ( ( !( e->state() & ControlButton ) && #ifndef Q_OS_MACX !( e->state() & AltButton ) && #endif - !( e->state() & MetaButton ) || + !( e->state() & MetaButton ) ) || ( ( (e->state()&ControlButton) | AltButton ) == (ControlButton|AltButton) ) ) && ( !e->ascii() || e->ascii() >= 32 || e->text() == "\t" ) ) { clearUndoRedoInfo = FALSE; @@ -2812,7 +2812,7 @@ void QTextEdit::handleMouseMove( const QPoint& pos ) if ( !mousePressed ) return; - if ( !scrollTimer->isActive() && pos.y() < contentsY() || pos.y() > contentsY() + visibleHeight() ) + if ( (!scrollTimer->isActive() && pos.y() < contentsY()) || pos.y() > contentsY() + visibleHeight() ) scrollTimer->start( 100, FALSE ); else if ( scrollTimer->isActive() && pos.y() >= contentsY() && pos.y() <= contentsY() + visibleHeight() ) scrollTimer->stop(); @@ -7181,7 +7181,7 @@ void QTextEdit::optimDoAutoScroll() repaintContents( contentsX(), y, width(), h, FALSE ); } - if ( !scrollTimer->isActive() && pos.y() < 0 || pos.y() > height() ) + if ( (!scrollTimer->isActive() && pos.y() < 0) || pos.y() > height() ) scrollTimer->start( 100, FALSE ); else if ( scrollTimer->isActive() && pos.y() >= 0 && pos.y() <= height() ) scrollTimer->stop(); diff --git a/src/widgets/qtooltip.cpp b/src/widgets/qtooltip.cpp index c327859..ed1a34e 100644 --- a/src/widgets/qtooltip.cpp +++ b/src/widgets/qtooltip.cpp @@ -262,11 +262,12 @@ void QTipManager::remove( QWidget *w, const QRect & r, bool delayhide ) if ( t == 0 ) return; - if ( t == currentTip ) + if ( t == currentTip ) { if (!delayhide) hideTip(); else currentTip->autoDelete = TRUE; + } if ( t == previousTip ) previousTip = 0; diff --git a/src/workspace/qworkspace.cpp b/src/workspace/qworkspace.cpp index b6699e8..2121adb 100644 --- a/src/workspace/qworkspace.cpp +++ b/src/workspace/qworkspace.cpp @@ -1087,7 +1087,7 @@ void QWorkspace::minimizeWindow( QWidget* w) { QWorkspaceChild* c = findChild( w ); - if ( !w || w && (!w->testWFlags( WStyle_Minimize ) || w->testWFlags( WStyle_Tool) ) ) + if ( !w || ( ( w && (!w->testWFlags( WStyle_Minimize ) ) ) || w->testWFlags( WStyle_Tool) ) ) return; if ( c ) { @@ -1184,7 +1184,7 @@ void QWorkspace::maximizeWindow( QWidget* w) { QWorkspaceChild* c = findChild( w ); - if ( !w || w && (!w->testWFlags( WStyle_Maximize ) || w->testWFlags( WStyle_Tool) ) ) + if ( !w || ( ( w && (!w->testWFlags( WStyle_Maximize ) ) ) || w->testWFlags( WStyle_Tool) ) ) return; if ( c ) { diff --git a/src/xml/qdom.cpp b/src/xml/qdom.cpp index 524c638..a6f2462 100644 --- a/src/xml/qdom.cpp +++ b/src/xml/qdom.cpp @@ -3655,8 +3655,8 @@ static bool isXmlChar(const QChar &c) return uc == 0x9 || uc == 0xA || uc == 0xD - || 0x20 <= uc && uc <= 0xD7FF - || 0xE000 <= uc && uc <= 0xFFFD; + || ( 0x20 <= uc && uc <= 0xD7FF ) + || ( 0xE000 <= uc && uc <= 0xFFFD ); } /* diff --git a/src/xml/qsvgdevice.cpp b/src/xml/qsvgdevice.cpp index 1f184f1..0615871 100644 --- a/src/xml/qsvgdevice.cpp +++ b/src/xml/qsvgdevice.cpp @@ -1433,8 +1433,8 @@ void QSvgDevice::drawPath( const QString &data ) // if possible, reflect last control point if smooth shorthand if ( mode == 6 || mode == 8 ) { // smooth 'S' and 'T' bool cont = mode == lastMode || - mode == 6 && lastMode == 5 || // 'S' and 'C' - mode == 8 && lastMode == 7; // 'T' and 'Q' + ( mode == 6 && lastMode == 5 ) || // 'S' and 'C' + ( mode == 8 && lastMode == 7 ); // 'T' and 'Q' x = cont ? 2*x-controlX : x; y = cont ? 2*y-controlY : y; quad.setPoint( 1, int(x), int(y) ); |