Fix build warnings

Thanks to Bruce Sass for the patch!
(cherry picked from commit ebcb1d80bf)
v3.5.13-sru v3.5.13.1
Timothy Pearson 12 years ago committed by Slávek Banko
parent e9fed234b7
commit 5ae82a06c3

@ -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)));
}
}
}

@ -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"

@ -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;

@ -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();
}

@ -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 );

@ -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);

@ -3746,7 +3746,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) {
@ -3759,7 +3759,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) {
@ -4174,7 +4174,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 );
}
@ -5310,7 +5310,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;
@ -5323,6 +5323,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.
@ -5384,11 +5385,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;
}
}
@ -5709,8 +5710,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;

@ -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;

@ -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;
}

@ -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] == '!'

@ -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;

@ -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;

@ -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() ) ) ) {

@ -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

@ -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;

@ -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 );
}

@ -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;
}
/*!

@ -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

@ -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() )

@ -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

@ -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)

@ -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);

@ -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 );

@ -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

@ -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;
}
}

@ -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 );

@ -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;
}

@ -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;

@ -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;

@ -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;

@ -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 ),

@ -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();

@ -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;

@ -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();

@ -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;

@ -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 ) {

@ -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 );
}
/*

@ -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) );

@ -511,8 +511,8 @@ bool SetPropertyCommand::canMerge( Command *c )
return FALSE;
}
QVariant::Type t = QVariant::nameToType( p->type() );
return ( cmd->propName == propName &&
t == QVariant::String || t == QVariant::CString || t == QVariant::Int || t == QVariant::UInt );
return ( ( cmd->propName == propName &&
t == QVariant::String ) || t == QVariant::CString || t == QVariant::Int || t == QVariant::UInt );
}
void SetPropertyCommand::merge( Command *c )

@ -1632,7 +1632,7 @@ QWidget *FormWindow::designerWidget( QObject *o ) const
if ( !o || !o->isWidgetType() )
return 0;
QWidget *w = (QWidget*)o;
while ( w && !isMainContainer( w ) && !insertedWidgets[ (void*)w ] || isCentralWidget( w ) )
while ( ( w && !isMainContainer( w ) && !insertedWidgets[ (void*)w ] ) || isCentralWidget( w ) )
w = (QWidget*)w->parent();
return w;
}

@ -964,11 +964,12 @@ int Spacer::alignment() const
QSize Spacer::minimumSize() const
{
QSize s = QSize( 20,20 );
if ( sizeType() == Expanding )
if ( sizeType() == Expanding ) {
if ( orient == Vertical )
s.rheight() = 0;
else
s.rwidth() = 0;
}
return s;
}

@ -989,12 +989,12 @@ bool MainWindow::eventFilter( QObject *o, QEvent *e )
( ::qt_cast<MenuBarEditor*>(o) ||
::qt_cast<PopupMenuEditor*>(o) ||
::qt_cast<QDesignerToolBar*>(o) ||
( ::qt_cast<QComboBox*>(o) ||
( ( ::qt_cast<QComboBox*>(o) ||
::qt_cast<QToolButton*>(o) ||
::qt_cast<QDesignerToolBarSeparator*>(o) ) &&
o->parent()
&& ( ::qt_cast<QDesignerToolBar*>(o->parent())
|| ::qt_cast<QDesignerWidgetStack*>(o->parent())) ) ) {
|| ::qt_cast<QDesignerWidgetStack*>(o->parent())) ) ) ) {
QWidget *w = (QWidget*)o;
if ( ::qt_cast<QToolButton*>(w) ||
::qt_cast<QComboBox*>(w) ||
@ -1570,10 +1570,10 @@ void MainWindow::setupRMBProperties( QValueList<uint> &ids, QMap<QString, int> &
if ( pixmap && qstrcmp( pixmap->type(), "QPixmap") != 0 )
pixmap = 0;
if ( text && text->designable(w) ||
title && title->designable(w) ||
pagetitle && pagetitle->designable(w) ||
pixmap && pixmap->designable(w) ) {
if ( ( text && text->designable(w) ) ||
( title && title->designable(w) ) ||
( pagetitle && pagetitle->designable(w) ) ||
( pixmap && pixmap->designable(w) ) ) {
int id = 0;
if ( ids.isEmpty() )
ids << rmbWidgets->insertSeparator(0);
@ -3337,7 +3337,7 @@ void MainWindow::showSourceLine( QObject *o, int line, LineMode lm )
if ( fw->project() != currentProject )
continue;
if ( qstrcmp( fw->name(), o->name() ) == 0 ||
fw->isFake() && currentProject->objectForFakeForm( fw ) == o ) {
( fw->isFake() && currentProject->objectForFakeForm( fw ) == o ) ) {
if ( se ) {
switch ( lm ) {
case Error:

@ -1248,7 +1248,7 @@ void MainWindow::fileOpen( const QString &filter, const QString &extension, cons
setCurrentProject( eProject );
openFormWindow( filename );
addRecentlyOpened( filename, recentlyFiles );
} else if ( !extension.isEmpty() && extension.find( ";" + fi.extension( FALSE ) ) != -1 ||
} else if ( ( !extension.isEmpty() && extension.find( ";" + fi.extension( FALSE ) ) != -1 ) ||
additionalSources.find( fi.extension( FALSE ) ) != additionalSources.end() ) {
SourceFile *sf = project->findSourceFile( project->makeRelative( filename ) );
if ( !sf )
@ -1687,14 +1687,14 @@ void MainWindow::editBreakLayout()
if ( formWindow()->currentWidget() )
w = formWindow()->currentWidget();
if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout ||
w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout ) {
( w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout ) ) {
formWindow()->breakLayout( w );
return;
} else {
QWidgetList widgets = formWindow()->selectedWidgets();
for ( w = widgets.first(); w; w = widgets.next() ) {
if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout ||
w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout )
( w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout ) )
break;
}
if ( w ) {
@ -1705,7 +1705,7 @@ void MainWindow::editBreakLayout()
w = formWindow()->mainContainer();
if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout ||
w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout )
( w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout ) )
formWindow()->breakLayout( w );
}

@ -355,7 +355,7 @@ void MetaDataBase::setMargin( QObject *o, int margin )
QWidget *widget = (QWidget*)o;
if ( widget && !::qt_cast<QLayoutWidget*>(widget) &&
( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ) ) ||
widget && widget->parentWidget() && ::qt_cast<FormWindow*>(widget->parentWidget()) ) )
( widget && widget->parentWidget() && ::qt_cast<FormWindow*>(widget->parentWidget()) ) ) )
isInnerLayout = FALSE;

@ -628,7 +628,7 @@ static void remove_multiline_contents( QString &contents, const QString &s, int
if ( contents[ i ] == '\n' && !lastWasBackspash )
break;
lastWasBackspash = ( contents[ i ] == '\\' ||
lastWasBackspash && ( contents[ i ] == ' ' || contents[ i ] == '\t' ) );
( lastWasBackspash && ( contents[ i ] == ' ' || contents[ i ] == '\t' ) ) );
}
contents.remove( start, i - start + 1 );
}

@ -553,9 +553,9 @@ QString PropertyItem::currentItemFromObject() const
void PropertyItem::setFocus( QWidget *w )
{
if ( !qApp->focusWidget() ||
listview->propertyEditor()->formWindow() &&
( listview->propertyEditor()->formWindow() &&
( !MainWindow::self->isAFormWindowChild( qApp->focusWidget() ) &&
!qApp->focusWidget()->inherits( "Editor" ) ) )
!qApp->focusWidget()->inherits( "Editor" ) ) ) )
w->setFocus();
}
@ -3151,7 +3151,7 @@ void PropertyList::setupProperties()
bool isPropertyObject = w->isA( "PropertyObject" );
if ( ( p->designable(w) ||
isPropertyObject && p->designable( ( (PropertyObject*)w )->widgetList().first() ) ) &&
( isPropertyObject && p->designable( ( (PropertyObject*)w )->widgetList().first() ) ) ) &&
( !isPropertyObject || qstrcmp( p->name(), "name" ) != 0 ) ) {
if ( p->isSetType() ) {
if ( QString( p->name() ) == "alignment" ) {
@ -3733,9 +3733,9 @@ void PropertyList::setPropertyValue( PropertyItem *i )
void PropertyList::setCurrentProperty( const QString &n )
{
if ( currentItem() && currentItem()->text( 0 ) == n ||
currentItem() && ( (PropertyItem*)currentItem() )->propertyParent() &&
( (PropertyItem*)currentItem() )->propertyParent()->text( 0 ) == n )
if ( ( currentItem() && currentItem()->text( 0 ) == n ) ||
( currentItem() && ( (PropertyItem*)currentItem() )->propertyParent() &&
( (PropertyItem*)currentItem() )->propertyParent()->text( 0 ) == n ) )
return;
QListViewItemIterator it( this );

@ -115,8 +115,8 @@ void QCompletionEdit::updateListBox()
if ( compList.isEmpty() )
return;
for ( QStringList::Iterator it = compList.begin(); it != compList.end(); ++it ) {
if ( caseSensitive && (*it).left( text().length() ) == text() ||
!caseSensitive && (*it).left( text().length() ).lower() == text().lower() )
if ( ( caseSensitive && (*it).left( text().length() ) == text() ) ||
( !caseSensitive && (*it).left( text().length() ).lower() == text().lower() ) )
listbox->insertItem( *it );
}
}

@ -1220,8 +1220,8 @@ void Resource::saveItems( QObject *obj, QTextStream &ts, int indent )
bool isDataTable = false;
# endif
for ( i = 0; i < table->horizontalHeader()->count(); ++i ) {
if ( !table->horizontalHeader()->label( i ).isNull() &&
table->horizontalHeader()->label( i ).toInt() != i + 1 ||
if ( ( !table->horizontalHeader()->label( i ).isNull() &&
table->horizontalHeader()->label( i ).toInt() != i + 1 ) ||
table->horizontalHeader()->iconSet( i ) ||
isDataTable ) {
ts << makeIndent( indent ) << "<column>" << endl;
@ -1245,8 +1245,8 @@ void Resource::saveItems( QObject *obj, QTextStream &ts, int indent )
}
}
for ( i = 0; i < table->verticalHeader()->count(); ++i ) {
if ( !table->verticalHeader()->label( i ).isNull() &&
table->verticalHeader()->label( i ).toInt() != i + 1 ||
if ( ( !table->verticalHeader()->label( i ).isNull() &&
table->verticalHeader()->label( i ).toInt() != i + 1 ) ||
table->verticalHeader()->iconSet( i ) ) {
ts << makeIndent( indent ) << "<row>" << endl;
indent++;
@ -1547,7 +1547,7 @@ void Resource::saveProperty( QObject *w, const QString &name, const QVariant &va
uint unum;
double dob;
QString comment;
if ( w && formwindow->widgets()->find( (QWidget*)w ) || formwindow->actionList().find( (QAction*)w ) )
if ( ( w && formwindow->widgets()->find( (QWidget*)w ) ) || formwindow->actionList().find( (QAction*)w ) )
comment = MetaDataBase::propertyComment( w, name );
switch ( t ) {
case QVariant::String:

@ -568,7 +568,7 @@ QLayout *WidgetFactory::createLayout( QWidget *widget, QLayout *layout, LayoutTy
if ( ::qt_cast<QLayoutWidget*>(widget) &&
( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ) ) ||
widget && ::qt_cast<FormWindow*>(widget->parentWidget()) ) )
( widget && ::qt_cast<FormWindow*>(widget->parentWidget()) ) ) )
margin = MainWindow::self->currentLayoutDefaultMargin();
if ( !layout && ::qt_cast<QTabWidget*>(widget) )
@ -883,7 +883,7 @@ QWidget *WidgetFactory::createWidget( const QString &className, QWidget *parent,
MetaDataBase::setPropertyChanged( s, "sizeType", TRUE );
if ( !r )
return s;
if ( !r->isValid() || r->width() < 2 && r->height() < 2 )
if ( !r->isValid() || ( r->width() < 2 && r->height() < 2 ) )
s->setOrientation( orient );
else if ( r->width() < r->height() )
s->setOrientation( Qt::Vertical );
@ -904,7 +904,7 @@ QWidget *WidgetFactory::createWidget( const QString &className, QWidget *parent,
QSlider *s = new QSlider( parent, name );
if ( !r )
return s;
if ( !r->isValid() || r->width() < 2 && r->height() < 2 )
if ( !r->isValid() || ( r->width() < 2 && r->height() < 2 ) )
s->setOrientation( orient );
else if ( r->width() > r->height() )
s->setOrientation( Qt::Horizontal );
@ -915,7 +915,7 @@ QWidget *WidgetFactory::createWidget( const QString &className, QWidget *parent,
QScrollBar *s = new QScrollBar( parent, name );
if ( !r )
return s;
if ( !r->isValid() || r->width() < 2 && r->height() < 2 )
if ( !r->isValid() || ( r->width() < 2 && r->height() < 2 ) )
s->setOrientation( orient );
else if ( r->width() > r->height() )
s->setOrientation( Qt::Horizontal );
@ -936,7 +936,7 @@ QWidget *WidgetFactory::createWidget( const QString &className, QWidget *parent,
MetaDataBase::setPropertyChanged( l, "frameShape", TRUE );
if ( !r )
return l;
if ( !r->isValid() || r->width() < 2 && r->height() < 2 )
if ( !r->isValid() || ( r->width() < 2 && r->height() < 2 ) )
l->setOrientation( orient );
else if ( r->width() < r->height() )
l->setOrientation( Qt::Vertical );
@ -1143,7 +1143,7 @@ QWidget* WidgetFactory::widgetOfContainer( QWidget *w )
while ( w ) {
int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) );
if ( WidgetDatabase::isContainer( id ) ||
w && ::qt_cast<FormWindow*>(w->parentWidget()) )
( w && ::qt_cast<FormWindow*>(w->parentWidget()) ) )
return w;
w = w->parentWidget();
}

@ -363,8 +363,8 @@ bool EditorCompletion::eventFilter( QObject *o, QEvent *e )
}
}
if ( ke->text().length() && !( ke->state() & AltButton ) &&
( !ke->ascii() || ke->ascii() >= 32 ) ||
if ( ( ke->text().length() && !( ke->state() & AltButton ) &&
( !ke->ascii() || ke->ascii() >= 32 ) ) ||
( ke->text() == "\t" && !( ke->state() & ControlButton ) ) ) {
if ( ke->key() == Key_Tab ) {
if ( curEditor->textCursor()->index() == 0 &&
@ -372,13 +372,13 @@ bool EditorCompletion::eventFilter( QObject *o, QEvent *e )
return FALSE;
if ( doCompletion() )
return TRUE;
} else if ( ke->key() == Key_Period &&
} else if ( ( ke->key() == Key_Period &&
( curEditor->textCursor()->index() == 0 ||
curEditor->textCursor()->paragraph()->at( curEditor->textCursor()->index() - 1 )->c != '.' )
curEditor->textCursor()->paragraph()->at( curEditor->textCursor()->index() - 1 )->c != '.' ) )
||
ke->key() == Key_Greater &&
( ke->key() == Key_Greater &&
curEditor->textCursor()->index() > 0 &&
curEditor->textCursor()->paragraph()->at( curEditor->textCursor()->index() - 1 )->c == '-' ) {
curEditor->textCursor()->paragraph()->at( curEditor->textCursor()->index() - 1 )->c == '-' ) ) {
doObjectCompletion();
} else {
if ( !doArgumentHint( ke->text() == "(" ) )
@ -423,7 +423,7 @@ bool EditorCompletion::eventFilter( QObject *o, QEvent *e )
return TRUE;
}
}
if ( o == functionLabel || ::qt_cast<Editor*>(o) && functionLabel->isVisible() ) {
if ( o == functionLabel || ( ::qt_cast<Editor*>(o) && functionLabel->isVisible() ) ) {
if ( e->type() == QEvent::KeyPress ) {
QKeyEvent *ke = (QKeyEvent*)e;
if ( ke->key() == Key_Escape ) {

@ -120,9 +120,9 @@ bool ParenMatcher::checkOpenParen( QTextCursor *cursor )
}
int id = Match;
if ( c == '{' && closedParen.chr != '}' ||
c == '(' && closedParen.chr != ')' ||
c == '[' && closedParen.chr != ']' )
if ( ( c == '{' && closedParen.chr != '}' ) ||
( c == '(' && closedParen.chr != ')' ) ||
( c == '[' && closedParen.chr != ']' ) )
id = Mismatch;
cursor->document()->setSelectionStart( id, *cursor );
int tidx = cursor->index();
@ -194,9 +194,9 @@ bool ParenMatcher::checkClosedParen( QTextCursor *cursor )
}
int id = Match;
if ( c == '}' && openParen.chr != '{' ||
c == ')' && openParen.chr != '(' ||
c == ']' && openParen.chr != '[' )
if ( ( c == '}' && openParen.chr != '{' ) ||
( c == ')' && openParen.chr != '(' ) ||
( c == ']' && openParen.chr != '[' ) )
id = Mismatch;
cursor->document()->setSelectionStart( id, *cursor );
int tidx = cursor->index();

@ -246,9 +246,9 @@ void MainWindowWizardBase::accept()
}
}
for ( QAction *ac = usedActions.first(); ac; ac = usedActions.next() ) {
if ( QString( ac->name() ).find( "file" ) != -1 && checkCreateConnectionsFile->isChecked() ||
QString( ac->name() ).find( "edit" ) != -1 && checkCreateConnectionsEdit->isChecked() ||
QString( ac->name() ).find( "help" ) != -1 && checkCreateConnectionsHelp->isChecked() ) {
if ( ( QString( ac->name() ).find( "file" ) != -1 && checkCreateConnectionsFile->isChecked() ) ||
( QString( ac->name() ).find( "edit" ) != -1 && checkCreateConnectionsEdit->isChecked() ) ||
( QString( ac->name() ).find( "help" ) != -1 && checkCreateConnectionsHelp->isChecked() ) ) {
QString slot = ac->name();
slot.remove( slot.length() - 6, 6 );
slot += "()";

@ -120,7 +120,7 @@ void SqlFormWizard::connectionSelected( const QString &c )
listBoxTable->clear();
QPtrList<DesignerDatabase> databases = proIface->databaseConnections();
for ( DesignerDatabase *d = databases.first(); d; d = databases.next() ) {
if ( d->name() == c || ( d->name() == "(default)" || d->name().isEmpty() ) && c == "(default)")
if ( d->name() == c || ( ( d->name() == "(default)" || d->name().isEmpty() ) && c == "(default)") )
listBoxTable->insertStringList( d->tables() );
}
setNextEnabled( databasePage, ( listBoxTable->currentItem() >= 0 ) );
@ -356,7 +356,7 @@ void SqlFormWizard::accept()
QPtrList<DesignerDatabase> databases = proIface->databaseConnections();
DesignerDatabase *database = 0;
for ( DesignerDatabase *d = databases.first(); d; d = databases.next() ) {
if ( d->name() == listBoxConnection->currentText() || ( d->name() == "(default)" || d->name().isEmpty() ) && listBoxConnection->currentText() == "(default)" ) {
if ( d->name() == listBoxConnection->currentText() || ( ( d->name() == "(default)" || d->name().isEmpty() ) && listBoxConnection->currentText() == "(default)" ) ) {
database = d;
d->open( FALSE );
break;

@ -113,7 +113,7 @@ QString richText( const QString& text )
} else if ( ch == '&' ) {
rich += QString( "&amp;" );
} else if ( ch == ' ' ) {
if ( i == 0 || i == (text.length()-1) || text[i - 1] == ' ' || text[i + 1] == ' ' ) {
if ( i == 0 || i == ((int) text.length()-1) || text[i - 1] == ' ' || text[i + 1] == ' ' ) {
rich += richMeta( MessageEditor::tr("sp") );
} else {
rich += ' ';

@ -573,9 +573,9 @@ static void parse( MetaTranslator *tor, const char *initialContext,
(match(Tok_Comma) &&
matchString(&com) &&
(match(Tok_RightParen) ||
match(Tok_Comma) &&
matchEncoding(&utf8) &&
match(Tok_RightParen))) )
(match(Tok_Comma) &&
matchEncoding(&utf8) &&
match(Tok_RightParen)))) )
tor->insert( MetaTranslatorMessage(context, text, com,
QString::null, utf8) );
}

@ -331,7 +331,7 @@ int main( int argc, char* argv[] )
int orgfile = 1;
int newfile = 2;
if ( argc <= newfile || argc > 1 && argv[1][0] == '-') {
if ( argc <= newfile || ( argc > 1 && argv[1][0] == '-' ) ) {
printf("usage: %s orgfile newfile [outfile]\n", argv[0]);
exit(1);
}

@ -392,7 +392,7 @@ void QAnimationWriter::appendFrame(const QImage& frm, const QPoint& offset)
qDebug("%d,%d %d,%d",minx,miny,offset.x(),offset.y());
d->composeImage(diff,QPoint(minx,miny)+offset);
}
if ( prev.isNull() || prev.size() == frame.size() && offset == QPoint(0,0) ) {
if ( prev.isNull() || ( prev.size() == frame.size() && offset == QPoint(0,0) ) ) {
prev = frame;
} else {
bitBlt(&prev,offset.x(),offset.y(),&frame,0,0,frame.width(),frame.height());

Loading…
Cancel
Save