From e5ff2614f59b0076f8a379e490d387efbf0a1cbc Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Mon, 6 Sep 2010 11:29:05 +0200 Subject: [PATCH] [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. --- backend/xps/xps-document.c | 7 +++++++ 1 file changed, 7 insertions(+) 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; -- 2.43.0