]> www.fi.muni.cz Git - evince.git/blobdiff - backend/xps/xps-document.c
[xps] Fix internal links that point to a source that is not a document
[evince.git] / 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;