summaryrefslogtreecommitdiff
path: root/office/zathura-pdf-mupdf/patches/0002-Handle-additional-and-missing-link-types-in-outline.patch
blob: fa62463d3127fea6bf5d6e7fab3f0581ac1fc568 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From 23b5d6f2822bb27ec97de0701aefeed2a539f06a Mon Sep 17 00:00:00 2001
From: Moritz Lipp <mlq@pwmt.org>
Date: Sat, 7 Feb 2015 15:56:59 +0100
Subject: [PATCH 2/6] Handle additional and missing link types in outline

---
 index.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/index.c b/index.c
index 023944f..80c1068 100644
--- a/index.c
+++ b/index.c
@@ -73,17 +73,31 @@ build_index(fz_outline* outline, girara_tree_node_t* root)
           if (gflags & fz_link_flag_t_valid) {
             target.top = outline->dest.ld.gotor.lt.y;
           }
-          if (gflags & fz_link_flag_r_is_zoom) {
-            target.scale = outline->dest.ld.gotor.rb.x;
-          }
+          /* if (gflags & fz_link_flag_r_is_zoom) { */
+          /*   target.scale = outline->dest.ld.gotor.rb.x; */
+          /* } */
         }
         break;
+      case FZ_LINK_LAUNCH:
+        type = ZATHURA_LINK_LAUNCH;
+        target.value = outline->dest.ld.launch.file_spec;
+        break;
+      case FZ_LINK_NAMED:
+        type = ZATHURA_LINK_NAMED;
+        target.value = outline->dest.ld.named.named;
+        break;
+      case FZ_LINK_GOTOR:
+        type = ZATHURA_LINK_GOTO_REMOTE;
+        target.value = outline->dest.ld.gotor.file_spec;
+        break;
       default:
+        outline = outline->next; // TODO: Don't skip unknown type
         continue;
     }
 
     index_element->link = zathura_link_new(type, rect, target);
     if (index_element->link == NULL) {
+      outline = outline->next;
       continue;
     }
 
-- 
1.8.4