MCPcopy Create free account
hub / github.com/KDE/okular / generateLinkInfos

Method generateLinkInfos

core/textdocumentgenerator.cpp:165–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165QList<TextDocumentGeneratorPrivate::LinkInfo> TextDocumentGeneratorPrivate::generateLinkInfos() const
166{
167 QList<LinkInfo> result;
168
169 for (const LinkPosition &linkPosition : mLinkPositions) {
170 const QList<QRectF> rects = TextDocumentUtils::calculateBoundingRects(mDocument, linkPosition.startPosition, linkPosition.endPosition);
171
172 for (int i = 0; i < rects.count(); ++i) {
173 const QRectF &rect = rects[i];
174
175 LinkInfo info;
176 info.link = linkPosition.link;
177 info.ownsLink = i == 0;
178 info.page = std::floor(rect.y());
179 info.boundingRect = QRectF(rect.x(), rect.y() - info.page, rect.width(), rect.height());
180 result.append(info);
181 }
182 }
183
184 return result;
185}
186
187QList<TextDocumentGeneratorPrivate::AnnotationInfo> TextDocumentGeneratorPrivate::generateAnnotationInfos() const
188{

Callers 1

Calls 5

calculateBoundingRectsFunction · 0.85
appendMethod · 0.80
countMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected