diff options
author | Tor Andersson <tor@ghostscript.com> | 2005-03-31 13:19:46 +0200 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2005-03-31 13:19:46 +0200 |
commit | 627d99c6c24666173b66cc3588119a62f211169d (patch) | |
tree | 7f60901ba850a01c28f30cdeb8f44e12a5fb70da | |
parent | 9a66d290b823080fe559e53bfd80785184e6fc27 (diff) | |
download | mupdf-627d99c6c24666173b66cc3588119a62f211169d.tar.xz |
unchained dependency between xref and resource/font/render modules
-rw-r--r-- | Jamfile | 55 | ||||
-rw-r--r-- | mupdf/pdf_resources.c | 11 | ||||
-rw-r--r-- | mupdf/pdf_xref.c | 10 |
3 files changed, 46 insertions, 30 deletions
@@ -205,45 +205,56 @@ Library libfonts : SubDir TOP mupdf ; Library libmupdf : - pdf_annot.c - pdf_build.c - pdf_cmap.c - pdf_colorspace1.c - pdf_colorspace2.c + + # syntax layer pdf_crypt.c pdf_debug.c pdf_doctor.c - pdf_font.c + pdf_lex.c + pdf_nametree.c + pdf_open.c + pdf_parse.c + pdf_repair.c + pdf_save.c + pdf_stream.c + pdf_xref.c + + # metadata layer + pdf_annot.c + pdf_outline.c + + # fonts pdf_fontagl.c pdf_fontenc.c + pdf_cmap.c + pdf_unicode.c + pdf_font.c + pdf_type3.c pdf_fontfile.c # use builtin fonts # pdf_fontfilefc.c # use fontconfig # pdf_fontfilems.c # scan $WINDIR/Fonts + + # other resources pdf_function.c + pdf_colorspace1.c + pdf_colorspace2.c pdf_image.c - pdf_interpret.c - pdf_lex.c - pdf_nametree.c - pdf_open.c - pdf_outline.c - pdf_page.c - pdf_pagetree.c - pdf_parse.c pdf_pattern.c - pdf_repair.c - pdf_resources.c - pdf_save.c pdf_shade.c pdf_shade1.c pdf_shade2.c pdf_shade3.c pdf_shade4.c - pdf_store.c - pdf_stream.c - pdf_type3.c - pdf_unicode.c pdf_xobject.c - pdf_xref.c + + # pages, resource dictionaries, ... + pdf_build.c + pdf_interpret.c + pdf_page.c + pdf_pagetree.c + pdf_resources.c + pdf_store.c + ; diff --git a/mupdf/pdf_resources.c b/mupdf/pdf_resources.c index 73d7cc8a..ebcd02ff 100644 --- a/mupdf/pdf_resources.c +++ b/mupdf/pdf_resources.c @@ -267,6 +267,17 @@ pdf_loadresources(fz_obj **rdbp, pdf_xref *xref, fz_obj *orig) fz_obj *obj; int i; + /* + * We need a store for resources. + */ + + if (!xref->store) + { + error = pdf_newstore(&xref->store); + if (error) + return error; + } + pdf_logrsrc("load resources {\n"); /* diff --git a/mupdf/pdf_xref.c b/mupdf/pdf_xref.c index 01b3dbf8..7095850c 100644 --- a/mupdf/pdf_xref.c +++ b/mupdf/pdf_xref.c @@ -9,7 +9,6 @@ fz_error * pdf_newxref(pdf_xref **xrefp) { - fz_error *error; pdf_xref *xref; xref = fz_malloc(sizeof(pdf_xref)); @@ -34,12 +33,7 @@ pdf_newxref(pdf_xref **xrefp) xref->len = 0; xref->table = nil; - error = pdf_newstore(&xref->store); - if (error) - { - pdf_closexref(xref); - return error; - } + xref->store = nil; /* you need to create this if you want to render */ *xrefp = xref; return nil; @@ -51,7 +45,7 @@ pdf_closexref(pdf_xref *xref) pdf_logxref("closexref %p\n", xref); if (xref->store) - pdf_dropstore(xref->store); + fz_warn("someone forgot to empty the store before freeing xref!"); if (xref->table) { |