Hello Sebastian,

Sebastian Ramacher writes:
> [...] 
> Could you send an updated patch against zathura-pdf-mupdf's develop branch?
> Ideally something easily git am-able.
Sure! I'll attach the patch in this mail (please let me know if I missed
something or if the format isn't good).


Thank you very much!
Ciao,
L.
From 4e6aa88e7968e948bcbc2d5eed48dabf37d12d93 Mon Sep 17 00:00:00 2001
From: Leonardo Taccari <iaml...@gmail.com>
Date: Fri, 13 May 2016 12:41:23 +0200
Subject: [PATCH] document.c: pass NULL as the 4th argument to
 pdf_save_document()

Passing a `{ 0 }' as 4th argument to pdf_save_document() is no longer needed.
Just pass NULL and get rid of opts.

At least in recent mupdf (version 1.9a) `*in_opts' (the 4th argument of
pdf_save_document()) is checked if NULL and in that case the default options are
used.
---
 document.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/document.c b/document.c
index 548f4ff..8d0aae4 100644
--- a/document.c
+++ b/document.c
@@ -109,12 +109,7 @@ pdf_document_save_as(zathura_document_t* document, mupdf_document_t*
   }
 
   fz_try (mupdf_document->ctx) {
-    /* pdf_save_document claims to accepts NULL as third argument but doesn't.
-     * pdf_write_document does not check if the third arguments is NULL for some
-     * options. */
-
-    pdf_write_options opts = { 0 }; /* just use the default options */
-    pdf_save_document(mupdf_document->ctx, (pdf_document*) mupdf_document->document, (char*) path, &opts);
+    pdf_save_document(mupdf_document->ctx, (pdf_document*) mupdf_document->document, (char*) path, NULL);
   } fz_catch (mupdf_document->ctx) {
     return ZATHURA_ERROR_UNKNOWN;
   }
-- 
2.8.2

_______________________________________________
zathura mailing list
zathura@lists.pwmt.org
https://lists.pwmt.org/mailman/listinfo/zathura

Reply via email to