summaryrefslogtreecommitdiff
path: root/source/xps/xps-zip.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/xps/xps-zip.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/xps/xps-zip.c')
-rw-r--r--source/xps/xps-zip.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/xps/xps-zip.c b/source/xps/xps-zip.c
index 70b643af..c9dc9840 100644
--- a/source/xps/xps-zip.c
+++ b/source/xps/xps-zip.c
@@ -683,6 +683,14 @@ xps_meta(xps_document *doc, int key, void *ptr, int size)
}
static void
+xps_rebind(xps_document *doc, fz_context *ctx)
+{
+ doc->ctx = ctx;
+ fz_rebind_stream(doc->file, ctx);
+ fz_rebind_device(doc->dev, ctx);
+}
+
+static void
xps_init_document(xps_document *doc)
{
doc->super.close = (void*)xps_close_document;
@@ -694,4 +702,5 @@ xps_init_document(xps_document *doc)
doc->super.run_page_contents = (void*)xps_run_page;
doc->super.free_page = (void*)xps_free_page;
doc->super.meta = (void*)xps_meta;
+ doc->super.rebind = (void*)xps_rebind;
}