summaryrefslogtreecommitdiff
path: root/src/cairo-pdf-interchange.c
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2017-08-22 21:18:54 +0930
committerAdrian Johnson <ajohnson@redneon.com>2017-08-22 21:25:22 +0930
commit74c6e3ae1d356e8bb4c7043cb9d3897c45cc0f79 (patch)
tree82549712ca2d7792c915113e996d3d50f3129b58 /src/cairo-pdf-interchange.c
parent63f14d4a8f155ebaaca63b49e7bacca55d681af5 (diff)
downloadcairo-74c6e3ae1d356e8bb4c7043cb9d3897c45cc0f79.tar.gz
pdf: don't write logical structure if it only contains links
Diffstat (limited to 'src/cairo-pdf-interchange.c')
-rw-r--r--src/cairo-pdf-interchange.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/cairo-pdf-interchange.c b/src/cairo-pdf-interchange.c
index b7ce1dca6..baf3e0fe0 100644
--- a/src/cairo-pdf-interchange.c
+++ b/src/cairo-pdf-interchange.c
@@ -1183,17 +1183,22 @@ _cairo_pdf_interchange_write_document_objects (cairo_pdf_surface_t *surface)
{
cairo_pdf_interchange_t *ic = &surface->interchange;
cairo_int_status_t status = CAIRO_STATUS_SUCCESS;
+ cairo_tag_stack_structure_type_t tag_type;
- status = cairo_pdf_interchange_write_parent_tree (surface);
- if (unlikely (status))
- return status;
+ tag_type = _cairo_tag_stack_get_structure_type (&ic->analysis_tag_stack);
+ if (tag_type == TAG_TREE_TYPE_TAGGED || tag_type == TAG_TREE_TYPE_STRUCTURE) {
- status = cairo_pdf_interchange_write_struct_tree (surface);
- if (unlikely (status))
- return status;
+ status = cairo_pdf_interchange_write_parent_tree (surface);
+ if (unlikely (status))
+ return status;
- if (_cairo_tag_stack_get_structure_type (&ic->analysis_tag_stack) == TAG_TREE_TYPE_TAGGED)
- surface->tagged = TRUE;
+ status = cairo_pdf_interchange_write_struct_tree (surface);
+ if (unlikely (status))
+ return status;
+
+ if (tag_type == TAG_TREE_TYPE_TAGGED)
+ surface->tagged = TRUE;
+ }
status = cairo_pdf_interchange_write_outline (surface);
if (unlikely (status))