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

Method dynamicSourceReference

core/document.cpp:4735–4759  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4733}
4734
4735const SourceReference *Document::dynamicSourceReference(int pageNr, double absX, double absY)
4736{
4737 if (!d->m_synctex_scanner) {
4738 return nullptr;
4739 }
4740
4741 const QSizeF dpi = d->m_generator->dpi();
4742
4743 if (synctex_edit_query(d->m_synctex_scanner, pageNr + 1, absX * 72. / dpi.width(), absY * 72. / dpi.height()) > 0) {
4744 synctex_node_p node;
4745 // TODO what should we do if there is really more than one node?
4746 while ((node = synctex_scanner_next_result(d->m_synctex_scanner))) {
4747 int line = synctex_node_line(node);
4748 int col = synctex_node_column(node);
4749 // column extraction does not seem to be implemented in synctex so far. set the SourceReference default value.
4750 if (col == -1) {
4751 col = 0;
4752 }
4753 const char *name = synctex_scanner_get_name(d->m_synctex_scanner, synctex_node_tag(node));
4754
4755 return new Okular::SourceReference(QFile::decodeName(name), line, col);
4756 }
4757 }
4758 return nullptr;
4759}
4760
4761Document::PrintingType Document::printingSupport() const
4762{

Callers 1

mouseReleaseEventMethod · 0.80

Calls 9

synctex_edit_queryFunction · 0.85
synctex_node_lineFunction · 0.85
synctex_node_columnFunction · 0.85
synctex_scanner_get_nameFunction · 0.85
synctex_node_tagFunction · 0.85
dpiMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected