QPdf: code tidies

Refactor an if/else chain over an enumerator into a switch.
This unveils that the last else is actually dead code, as there
is no Qt::UniteClip any more (removed 11 years ago in
01b72952c3).

Change-Id: Ib702e3f5bfdc39e580a4d872e54a5239d62204f7
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
This commit is contained in:
Giuseppe D'Angelo 2022-11-07 13:24:31 +01:00
parent 10372c074b
commit 7cfc531382

View File

@ -1216,20 +1216,18 @@ void QPdfEngine::updateClipPath(const QPainterPath &p, Qt::ClipOperation op)
QPainterPath path = d->stroker.matrix.map(p);
//qDebug() << "updateClipPath: " << d->stroker.matrix << p.boundingRect() << path.boundingRect() << op;
if (op == Qt::NoClip) {
switch (op) {
case Qt::NoClip:
d->clipEnabled = false;
d->clips.clear();
} else if (op == Qt::ReplaceClip) {
break;
case Qt::ReplaceClip:
d->clips.clear();
d->clips.append(path);
} else if (op == Qt::IntersectClip) {
d->clips.append(path);
} else { // UniteClip
// ask the painter for the current clipping path. that's the easiest solution
path = painter()->clipPath();
path = d->stroker.matrix.map(path);
d->clips.clear();
break;
case Qt::IntersectClip:
d->clips.append(path);
break;
}
}