[evince] [xps] Fix internal links that point to a source that is not a document



commit e5ff2614f59b0076f8a379e490d387efbf0a1cbc
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Mon Sep 6 11:29:05 2010 +0200

    [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 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/backend/xps/xps-document.c b/backend/xps/xps-document.c
index 4e290b0..6e34f07 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;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]