From 9eb83b85cc1d1bde2bb4ad7e106b69415520ef8a Mon Sep 17 00:00:00 2001 From: Paul Gardiner Date: Wed, 28 Aug 2013 10:33:03 +0100 Subject: Fix bad interaction between incremental update and object streams The symptoms were that, created annoations were in some cases not saved. Some updated objects withing the document were not being moved into the incremental-save xref section. That in turn was due to nodes within the hierarchy of those objects not having their parent_num field set. The objects falling foul of this problem were those held in object streams. When any one object from a stream is cached, the whole stream is read and all other objects from that stream are also cached, but only the initial one has its parent_num set. This patch ensures that all objects from a stream are accounted for. In fact, for the initially-requested object, we now set parent_num twice, but that is harmless and the code to avoid doing so wouls be an unnecessary complication. --- source/pdf/pdf-xref.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/pdf/pdf-xref.c') diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c index a8aace68..b1b9abe8 100644 --- a/source/pdf/pdf-xref.c +++ b/source/pdf/pdf-xref.c @@ -1317,6 +1317,8 @@ pdf_load_obj_stm(pdf_document *doc, int num, int gen, pdf_lexbuf *buf) entry = pdf_get_xref_entry(doc, numbuf[i]); + pdf_set_obj_parent(obj, numbuf[i]); + if (entry->type == 'o' && entry->ofs == num) { /* If we already have an entry for this object, -- cgit v1.2.3