aboutsummaryrefslogtreecommitdiff
path: root/src/corelib
diff options
context:
space:
mode:
authorJukka Halonen <ext-jukka.a.halonen@nokia.com>2010-12-20 16:56:54 +0200
committerStanislav Ionascu <stanislav.ionascu@nokia.com>2010-12-27 10:03:42 +0200
commit149d823d6bef230be45d2211dec8c43ae4cec2c2 (patch)
tree344b6944e341787f64a7b64253e826fe3c6c72f9 /src/corelib
parentada50151ca1345f381aa8844a284bc0d22dce208 (diff)
Changes: Coverity fixes CID#1407, 1408, 1412, 1413
RevBy: Stanislav Ionascu
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/painting/mscalableimage.cpp9
-rw-r--r--src/corelib/style/mstylesheetattribute.cpp2
2 files changed, 6 insertions, 5 deletions
diff --git a/src/corelib/painting/mscalableimage.cpp b/src/corelib/painting/mscalableimage.cpp
index 17bc7432..1154de2b 100644
--- a/src/corelib/painting/mscalableimage.cpp
+++ b/src/corelib/painting/mscalableimage.cpp
@@ -124,10 +124,11 @@ void MScalableImagePrivate::drawScalable9(qreal x, qreal y, qreal w, qreal h, QP
scaled = QPixmap(requiredSize);
scaled.fill(Qt::transparent);
QPainter p;
- p.begin(&scaled);
- p.setRenderHint(QPainter::SmoothPixmapTransform);
- drawBorderPixmap(&p, QRectF(0, 0, w, h), margins, *m_image);
- p.end();
+ if (p.begin(&scaled)) {
+ p.setRenderHint(QPainter::SmoothPixmapTransform);
+ drawBorderPixmap(&p, QRectF(0, 0, w, h), margins, *m_image);
+ p.end();
+ }
// draw to screen
painter->drawPixmap(x, y, scaled);
diff --git a/src/corelib/style/mstylesheetattribute.cpp b/src/corelib/style/mstylesheetattribute.cpp
index f22209a7..0b6f6321 100644
--- a/src/corelib/style/mstylesheetattribute.cpp
+++ b/src/corelib/style/mstylesheetattribute.cpp
@@ -274,7 +274,7 @@ MStyleSheetAttribute::MStyleSheetAttribute(const MStyleSheetAttribute &other)
{
this->name = other.name;
this->value = other.value;
- this->position = position;
+ this->position = other.position;
}
QByteArray MStyleSheetAttribute::getName()