mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-02 02:38:07 +02:00
pdf: don't write logical structure if it only contains links
This commit is contained in:
parent
63f14d4a8f
commit
74c6e3ae1d
2 changed files with 14 additions and 8 deletions
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -175,6 +175,7 @@ _cairo_tag_stack_push (cairo_tag_stack_t *stack,
|
|||
stack->type = TAG_TREE_TYPE_STRUCTURE;
|
||||
} else {
|
||||
if (stack->type == TAG_TREE_TYPE_LINK_ONLY &&
|
||||
(strcmp (name, "Link") != 0) &&
|
||||
name_in_list (name, _cairo_tag_stack_struct_pdf_list))
|
||||
{
|
||||
stack->type = TAG_TREE_TYPE_STRUCTURE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue