From f3947006fb98c72d06b52c36317585d757cc984c Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sat, 1 Oct 2016 12:54:47 +0800 Subject: Open document file in fz_open_document(). This relieves all document formats from reimplementing opening a fz_stream unless the format wants to do something more than just opening the raw file. --- source/svg/svg-doc.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'source/svg') diff --git a/source/svg/svg-doc.c b/source/svg/svg-doc.c index 2216ad48..bd0b2dd1 100644 --- a/source/svg/svg-doc.c +++ b/source/svg/svg-doc.c @@ -124,23 +124,6 @@ svg_open_document_with_stream(fz_context *ctx, fz_stream *file) return doc; } -static fz_document * -svg_open_document(fz_context *ctx, const char *filename) -{ - fz_stream *file; - fz_document *doc; - - file = fz_open_file(ctx, filename); - fz_try(ctx) - doc = svg_open_document_with_stream(ctx, file); - fz_always(ctx) - fz_drop_stream(ctx, file); - fz_catch(ctx) - fz_rethrow(ctx); - - return doc; -} - static int svg_recognize(fz_context *ctx, const char *magic) { @@ -193,6 +176,6 @@ fz_new_image_from_svg(fz_context *ctx, fz_buffer *buf) fz_document_handler svg_document_handler = { &svg_recognize, - &svg_open_document, + NULL, &svg_open_document_with_stream }; -- cgit v1.2.3