diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2013-06-28 11:12:35 +0200 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-07-11 10:46:39 +0100 |
commit | 9b3e229f1d590eb40e5fcc9357f8311b1968bc3a (patch) | |
tree | be696129062bd2e64a4d97acd700212019939d13 /source/pdf/pdf-write.c | |
parent | a9ae5d6ce95295348ece508aa91eddbe4a68482d (diff) | |
download | mupdf-9b3e229f1d590eb40e5fcc9357f8311b1968bc3a.tar.xz |
Implement dynamic page tree lookups.
No more caching a flattened page tree in doc->page_objs/refs.
No more flattening of page resources, rotation and boxes.
Smart page number lookup by following Parent links.
Naive implementation of insert and delet page that doesn't rebalance the trees.
Requires existing page tree to hook into, cannot be used to create a page tree
from scratch.
Diffstat (limited to 'source/pdf/pdf-write.c')
-rw-r--r-- | source/pdf/pdf-write.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/source/pdf/pdf-write.c b/source/pdf/pdf-write.c index 63fab4f1..a1b0caa2 100644 --- a/source/pdf/pdf-write.c +++ b/source/pdf/pdf-write.c @@ -2450,6 +2450,10 @@ void pdf_write_document(pdf_document *doc, char *filename, fz_write_options *fz_ #define KIDS_PER_LEVEL 32 +#if 0 + +// TODO: pdf_rebalance_page_tree(doc); + static pdf_obj * make_page_tree_node(pdf_document *doc, int l, int r, pdf_obj *parent_ref, int root) { @@ -2516,7 +2520,7 @@ make_page_tree_node(pdf_document *doc, int l, int r, pdf_obj *parent_ref, int ro } static void -pdf_rebuild_page_tree(pdf_document *doc) +pdf_rebalance_page_tree(pdf_document *doc) { pdf_obj *catalog; pdf_obj *pages; @@ -2531,10 +2535,16 @@ pdf_rebuild_page_tree(pdf_document *doc) doc->needs_page_tree_rebuild = 0; } +#endif + +static void +pdf_rebalance_page_tree(pdf_document *doc) +{ +} + void pdf_finish_edit(pdf_document *doc) { if (!doc) return; - - pdf_rebuild_page_tree(doc); + pdf_rebalance_page_tree(doc); } |