Fix warning from clang.
authorErik Verbruggen <erik.verbruggen@me.com>
Wed, 26 Jun 2013 10:31:06 +0000 (12:31 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 2 Jul 2013 18:57:52 +0000 (20:57 +0200)
items/qquicktext.cpp:2160:49: warning: '&&' within '||' [-Wlogical-op-parentheses]
            || vAlign() != QQuickText::AlignTop && heightChanged) {
            ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
items/qquicktext.cpp:2160:49: note: place parentheses around the '&&' expression to silence this warning
            || vAlign() != QQuickText::AlignTop && heightChanged) {
                                                ^
               (                                                )

Change-Id: Id4bc18642228e7fad6d674bbcdf623446bb6a00f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/quick/items/qquicktext.cpp

index cc2cbb3..37a0c8e 100644 (file)
@@ -2157,7 +2157,7 @@ void QQuickText::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeo
         goto geomChangeDone;
 
     if ((effectiveHAlign() != QQuickText::AlignLeft && widthChanged)
-            || vAlign() != QQuickText::AlignTop && heightChanged) {
+            || (vAlign() != QQuickText::AlignTop && heightChanged)) {
         // If the width has changed and we're not left aligned do an update so the text is
         // repositioned even if a full layout isn't required. And the same for vertical.
         d->updateType = QQuickTextPrivate::UpdatePaintNode;