diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2017-11-26 13:03:18 +1030 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2017-11-26 13:03:18 +1030 |
commit | a709197121c8e405c2dd99e408ee3046ccf50a6a (patch) | |
tree | 08817bf70e6309aa0c98f2504431929bd2343c42 /src/cairo-pdf-surface-private.h | |
parent | 17e2abc992b012ac3dceb2f66fba17d312ae6d77 (diff) | |
download | cairo-a709197121c8e405c2dd99e408ee3046ccf50a6a.tar.gz |
pdf: fix some annotation bugs
- each annotation was emitted on every page instead of just the page
that contains the annotation
- the document structure did not correctly link to annotation objects
- fix some annotation related memory leaks
Diffstat (limited to 'src/cairo-pdf-surface-private.h')
-rw-r--r-- | src/cairo-pdf-surface-private.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/cairo-pdf-surface-private.h b/src/cairo-pdf-surface-private.h index 51be68258..84fcf5f64 100644 --- a/src/cairo-pdf-surface-private.h +++ b/src/cairo-pdf-surface-private.h @@ -178,15 +178,16 @@ typedef struct _cairo_pdf_struct_tree_node { struct _cairo_pdf_struct_tree_node *parent; cairo_list_t children; cairo_array_t mcid; /* array of struct page_mcid */ - struct { - struct tag_extents extents; - cairo_pdf_resource_t res; - cairo_link_attrs_t link_attrs; - int src_page; /* page number containing the link */ - } annot; + cairo_pdf_resource_t annot_res; /* 0 if no annot */ + struct tag_extents extents; cairo_list_t link; } cairo_pdf_struct_tree_node_t; +typedef struct _cairo_pdf_annotation { + cairo_pdf_struct_tree_node_t *node; /* node containing the annotation */ + cairo_link_attrs_t link_attrs; +} cairo_pdf_annotation_t; + typedef struct _cairo_pdf_named_dest { cairo_hash_entry_t base; struct tag_extents extents; @@ -228,6 +229,7 @@ typedef struct _cairo_pdf_interchange { cairo_pdf_struct_tree_node_t *end_page_node; cairo_array_t parent_tree; /* parent tree resources */ cairo_array_t mcid_to_tree; /* mcid to tree node mapping for current page */ + cairo_array_t annots; /* array of pointers to cairo_pdf_annotation_t */ cairo_pdf_resource_t parent_tree_res; cairo_list_t extents_list; cairo_hash_table_t *named_dests; |