summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgunnar <gunnar@trolltech.com>2009-11-04 20:02:10 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-11-06 13:07:36 (GMT)
commitcb356372ff0e8e0e3b4f2969562642b208807cad (patch)
tree8668234bb2c2eb1442e2f2124db2b3c8ce4d07c7
parentcb81b4d699f1d009591fb452f5f8f99a70c51571 (diff)
downloadQt-cb356372ff0e8e0e3b4f2969562642b208807cad.zip
Qt-cb356372ff0e8e0e3b4f2969562642b208807cad.tar.gz
Qt-cb356372ff0e8e0e3b4f2969562642b208807cad.tar.bz2
Made QPen== catch QPen(Qt::NoPen) == QPen(QBrush(Qt::NoBrush))
QSvgDocument uses the latter as default pen so every svg filling command would issue a penChange without this. Reviewed-by: TrustMe
-rw-r--r--src/gui/painting/qpen.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/gui/painting/qpen.cpp b/src/gui/painting/qpen.cpp
index 9746747..1ddadf2 100644
--- a/src/gui/painting/qpen.cpp
+++ b/src/gui/painting/qpen.cpp
@@ -835,16 +835,19 @@ bool QPen::operator==(const QPen &p) const
{
QPenData *dd = static_cast<QPenData *>(d);
QPenData *pdd = static_cast<QPenData *>(p.d);
- return (p.d == d) || (p.d->style == d->style
- && p.d->capStyle == d->capStyle
- && p.d->joinStyle == d->joinStyle
- && p.d->width == d->width
- && pdd->miterLimit == dd->miterLimit
- && (d->style != Qt::CustomDashLine
- || (qFuzzyCompare(pdd->dashOffset, dd->dashOffset) &&
- pdd->dashPattern == dd->dashPattern))
- && p.d->brush == d->brush
- && pdd->cosmetic == dd->cosmetic);
+ return (p.d == d)
+ || (p.d->style == d->style
+ && p.d->capStyle == d->capStyle
+ && p.d->joinStyle == d->joinStyle
+ && p.d->width == d->width
+ && pdd->miterLimit == dd->miterLimit
+ && (d->style != Qt::CustomDashLine
+ || (qFuzzyCompare(pdd->dashOffset, dd->dashOffset) &&
+ pdd->dashPattern == dd->dashPattern))
+ && p.d->brush == d->brush
+ && pdd->cosmetic == dd->cosmetic)
+ || ((p.d->style == Qt::NoPen || p.d->brush.style() == Qt::NoBrush)
+ && (d->style == Qt::NoPen || d->brush.style() == Qt::NoBrush));
}