diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2022-11-07 13:24:31 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2022-11-08 13:12:49 +0000 |
commit | 7cfc531382bfa90135dccfdb06d237c46a481dee (patch) | |
tree | 087a483d2f437555845feb297cb7719f086fec42 /src/gui/painting | |
parent | 10372c074bf2975ccb5e4afd3bba0f2738e0a1d5 (diff) |
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
01b72952c38b9193138eabdab6bdab632cd75ebd).
Change-Id: Ib702e3f5bfdc39e580a4d872e54a5239d62204f7
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qpdf.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index 848769d5b2..1a6770c29a 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -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; } } |