summaryrefslogtreecommitdiff
path: root/source/cbz/mucbz.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-12-13 16:54:29 +0000
committerRobin Watts <robin.watts@artifex.com>2014-01-02 20:04:44 +0000
commitfc5bcdc79a12fb01b6cd07aa142c01ef11430b34 (patch)
tree547ed060a16453df001ffcb34657de46418872ff /source/cbz/mucbz.c
parent651f13408c67a8392ad93adda079c096d8a6118c (diff)
downloadmupdf-fc5bcdc79a12fb01b6cd07aa142c01ef11430b34.tar.xz
Add rebinding for fz_devices and fz_documents
The SVG device needs rebinding as it holds a file. The PDF device needs to rebind the underlying pdf document. All documents need to rebind their underlying streams.
Diffstat (limited to 'source/cbz/mucbz.c')
-rw-r--r--source/cbz/mucbz.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/cbz/mucbz.c b/source/cbz/mucbz.c
index 5247a4ee..4ebb623a 100644
--- a/source/cbz/mucbz.c
+++ b/source/cbz/mucbz.c
@@ -413,6 +413,13 @@ cbz_meta(cbz_document *doc, int key, void *ptr, int size)
}
static void
+cbz_rebind(cbz_document *doc, fz_context *ctx)
+{
+ doc->ctx = ctx;
+ fz_rebind_stream(doc->file, ctx);
+}
+
+static void
cbz_init_document(cbz_document *doc)
{
doc->super.close = (void*)cbz_close_document;
@@ -422,4 +429,5 @@ cbz_init_document(cbz_document *doc)
doc->super.run_page_contents = (void*)cbz_run_page;
doc->super.free_page = (void*)cbz_free_page;
doc->super.meta = (void*)cbz_meta;
+ doc->super.rebind = (void *)cbz_rebind;
}