summaryrefslogtreecommitdiffstats
path: root/src/kernel/qrichtext.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-07-28 15:50:52 -0500
committerSlávek Banko <slavek.banko@axis.cz>2012-08-04 14:53:35 +0200
commit5ae82a06c308960c66757b0a956500b05b83f002 (patch)
treee73bef929c230d306f377880042ce09894812ccd /src/kernel/qrichtext.cpp
parente9fed234b762ffe73037d70bf29ce90ea7ab8d37 (diff)
downloadqt3-5ae82a06c308960c66757b0a956500b05b83f002.tar.gz
qt3-5ae82a06c308960c66757b0a956500b05b83f002.zip
Fix build warningsv3.5.13.1
Thanks to Bruce Sass for the patch! (cherry picked from commit ebcb1d80bf517aceb69778e1e9f67e5f4da8c484)
Diffstat (limited to 'src/kernel/qrichtext.cpp')
-rw-r--r--src/kernel/qrichtext.cpp48
1 files changed, 25 insertions, 23 deletions
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() ) ) ) {