45 lines
1.7 KiB
Diff
45 lines
1.7 KiB
Diff
From 7a9e876fb2dcd3c82d619316e1cf8959521d4071 Mon Sep 17 00:00:00 2001
|
|
From: ahrm <a.hr.mostafavi@gmail.com>
|
|
Date: Mon, 29 Aug 2022 14:57:02 +0430
|
|
Subject: [PATCH] Fix some compatibility issues with mupdf 1.20.0
|
|
|
|
---
|
|
pdf_viewer/document.cpp | 4 ++--
|
|
pdf_viewer/pdf_renderer.cpp | 2 +-
|
|
2 files changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/pdf_viewer/document.cpp b/pdf_viewer/document.cpp
|
|
index 083e40244..61375d598 100644
|
|
--- a/pdf_viewer/document.cpp
|
|
+++ b/pdf_viewer/document.cpp
|
|
@@ -559,14 +559,14 @@ void Document::convert_toc_tree(fz_outline* root, std::vector<TocNode*>& output)
|
|
current_node->title = utf8_decode(root->title);
|
|
current_node->x = root->x;
|
|
current_node->y = root->y;
|
|
- if (root->page == -1) {
|
|
+ if (root->page.page == -1) {
|
|
float xp, yp;
|
|
fz_location loc = fz_resolve_link(context, doc, root->uri, &xp, &yp);
|
|
int chapter_page = accum_chapter_pages[loc.chapter];
|
|
current_node->page = chapter_page + loc.page;
|
|
}
|
|
else {
|
|
- current_node->page = root->page;
|
|
+ current_node->page = root->page.page;
|
|
}
|
|
convert_toc_tree(root->down, current_node->children);
|
|
|
|
diff --git a/pdf_viewer/pdf_renderer.cpp b/pdf_viewer/pdf_renderer.cpp
|
|
index cc8a89d16..fd17a52c4 100644
|
|
--- a/pdf_viewer/pdf_renderer.cpp
|
|
+++ b/pdf_viewer/pdf_renderer.cpp
|
|
@@ -315,7 +315,7 @@ void PdfRenderer::run_search(int thread_index)
|
|
|
|
const int max_hits_per_page = 20;
|
|
fz_quad hitboxes[max_hits_per_page];
|
|
- int num_results = fz_search_page(mupdf_context, page, utf8_encode(req.search_term).c_str(), hitboxes, max_hits_per_page);
|
|
+ int num_results = fz_search_page(mupdf_context, page, utf8_encode(req.search_term).c_str(), nullptr, hitboxes, max_hits_per_page);
|
|
|
|
if (num_results > 0) {
|
|
req.search_results_mutex->lock();
|