]> www.fi.muni.cz Git - evince.git/commitdiff
[xps] Fix internal links that point to a source that is not a document
authorCarlos Garcia Campos <carlosgc@gnome.org>
Mon, 6 Sep 2010 09:29:05 +0000 (11:29 +0200)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Mon, 6 Sep 2010 09:33:08 +0000 (11:33 +0200)
Some documents have internal links pointing to a source that is not a
document, like FixedDocSeq.fdseq. In this case we can just try to see
wether the current document has the anchor in its link target list.

backend/xps/xps-document.c

index 4e290b0faea3f7658d15d7173977d2ec3c516f8d..6e34f077d9f1ab7f9c001b4ed61edb0da5994cfe 100644 (file)
@@ -319,6 +319,13 @@ ev_link_from_target (XPSDocument    *xps_document,
 
                        dest = ev_link_dest_new_named (anchor);
                        ev_action = ev_link_action_new_dest (dest);
+               } else if (doc == -1 && anchor &&
+                          gxps_document_get_page_for_anchor (xps_document->doc, anchor) >= 0) {
+                       /* Internal, but source is not a doc,
+                        * let's try with doc = 0
+                        */
+                       dest = ev_link_dest_new_named (anchor);
+                       ev_action = ev_link_action_new_dest (dest);
                } else {
                        gchar *filename;