summaryrefslogtreecommitdiffstats
path: root/src/kernel
diff options
context:
space:
mode:
authorDarrell Anderson <[email protected]>2012-08-03 08:49:35 -0500
committerDarrell Anderson <[email protected]>2012-08-03 08:49:35 -0500
commit92b8aca467ad650f9b77a5b6a0f56c27ecbfe80a (patch)
tree3de07468347367bdef8e6c0d765bdb209585a189 /src/kernel
parentda067173fd2ab6bca5943294a439c4992323227a (diff)
parentebcb1d80bf517aceb69778e1e9f67e5f4da8c484 (diff)
downloadqt3-92b8aca467ad650f9b77a5b6a0f56c27ecbfe80a.tar.gz
qt3-92b8aca467ad650f9b77a5b6a0f56c27ecbfe80a.zip
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/qt3
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/qapplication_x11.cpp21
-rw-r--r--src/kernel/qcursor_x11.cpp2
-rw-r--r--src/kernel/qdnd_x11.cpp2
-rw-r--r--src/kernel/qdragobject.cpp6
-rw-r--r--src/kernel/qmngio.cpp12
-rw-r--r--src/kernel/qprinter_unix.cpp8
-rw-r--r--src/kernel/qrichtext.cpp48
7 files changed, 51 insertions, 48 deletions
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() ) ) ) {