summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Shachnev <mitya57@gmail.com>2022-04-10 21:10:47 +0300
committerDmitry Shachnev <mitya57@gmail.com>2022-04-28 22:06:32 +0300
commit189bcbea07cf640aeb4ce0937b86ee1b936a9425 (patch)
tree319716d87c638857734818edcb908d6412800c94
parentbfd10af24569a7d864d50819e9b004acfee0011b (diff)
downloadqtbase-189bcbea07cf640aeb4ce0937b86ee1b936a9425.tar.gz
QPdfEnginePrivate: generate link only when there is a href
Otherwise, when anchor is just something that can be linked to (not a link itself), it will result in a PDF link pointing to an empty URI. See https://github.com/retext-project/retext/issues/580. Pick-to: 6.3 Change-Id: Ib3c71797b09579783d74505601bad08c84856719 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r--src/gui/painting/qpdf.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 29fa644e9d..9b42783b18 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -2983,7 +2983,7 @@ void QPdfEnginePrivate::drawTextItem(const QPointF &p, const QTextItemInt &ti)
{
Q_Q(QPdfEngine);
- if (ti.charFormat.isAnchor()) {
+ if (ti.charFormat.hasProperty(QTextFormat::AnchorHref)) {
qreal size = ti.fontEngine->fontDef.pixelSize;
int synthesized = ti.fontEngine->synthesized();
qreal stretch = synthesized & QFontEngine::SynthesizedStretch ? ti.fontEngine->fontDef.stretch/100. : 1.;