From: Carlos Garcia Campos Date: Mon, 6 Sep 2010 09:29:05 +0000 (+0200) Subject: [xps] Fix internal links that point to a source that is not a document X-Git-Tag: EVINCE_2_91_0~54 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=e5ff2614f59b0076f8a379e490d387efbf0a1cbc;p=evince.git [xps] Fix internal links that point to a source that is not a document 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. --- diff --git a/backend/xps/xps-document.c b/backend/xps/xps-document.c index 4e290b0f..6e34f077 100644 --- a/backend/xps/xps-document.c +++ b/backend/xps/xps-document.c @@ -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;