aboutsummaryrefslogtreecommitdiffstats
path: root/testing/zathura-pdf-mupdf/c7f341addb76d5e6fd8c24c666d8fe97c451a4cb.patch
blob: eae81bcb1dc96af497baa3a905d0454a8ba0475a (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
From c7f341addb76d5e6fd8c24c666d8fe97c451a4cb Mon Sep 17 00:00:00 2001
From: Moritz Lipp <mail@mlq.me>
Date: Thu, 7 May 2020 20:42:01 +0200
Subject: [PATCH] Update to mupdf 1.17

---
 zathura-pdf-mupdf/index.c | 4 +++-
 zathura-pdf-mupdf/links.c | 5 +++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/zathura-pdf-mupdf/index.c b/zathura-pdf-mupdf/index.c
index c421f5c..cbbe978 100644
--- a/zathura-pdf-mupdf/index.c
+++ b/zathura-pdf-mupdf/index.c
@@ -65,9 +65,11 @@ build_index(fz_context* ctx, fz_document* document, fz_outline* outline, girara_
       float x = 0;
       float y = 0;
 
+      fz_location location = fz_resolve_link(ctx, document, outline->uri, &x, &y);
+
       type                    = ZATHURA_LINK_GOTO_DEST;
       target.destination_type = ZATHURA_LINK_DESTINATION_XYZ;
-      target.page_number      = fz_resolve_link(ctx, document, outline->uri, &x, &y);
+      target.page_number      = location.page;
       target.left  = x;
       target.top   = y;
       target.zoom  = 0.0;
diff --git a/zathura-pdf-mupdf/links.c b/zathura-pdf-mupdf/links.c
index 99c5715..157f039 100644
--- a/zathura-pdf-mupdf/links.c
+++ b/zathura-pdf-mupdf/links.c
@@ -54,10 +54,11 @@ pdf_page_links_get(zathura_page_t* page, void* data, zathura_error_t* error)
       float x = 0;
       float y = 0;
 
+      fz_location location = fz_resolve_link(mupdf_document->ctx, mupdf_document->document, link->uri, &x, &y);
+
       type                    = ZATHURA_LINK_GOTO_DEST;
       target.destination_type = ZATHURA_LINK_DESTINATION_XYZ;
-      target.page_number      = fz_resolve_link(mupdf_document->ctx,
-          mupdf_document->document, link->uri, &x, &y);
+      target.page_number      = location.page;
       target.left  = x;
       target.top   = y;
       target.zoom  = 0.0;
-- 
2.26.0