| 4733 | } |
| 4734 | |
| 4735 | const 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 | |
| 4761 | Document::PrintingType Document::printingSupport() const |
| 4762 | { |
no test coverage detected