diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2021-07-26 18:45:31 +0930 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2021-07-29 06:00:37 +0930 |
commit | 24616585ecb83ead34b4662e8a07957da5299c28 (patch) | |
tree | 7a69a0590b310e227f89f20a89ed6a9ef1d215ca /src/cairo-pdf-interchange.c | |
parent | 4e3f6bf0c2eb4ff5065bb18fb846019d4fef597f (diff) | |
download | cairo-24616585ecb83ead34b4662e8a07957da5299c28.tar.gz |
Print tag error details when CAIRO_DEBUG_TAG is defined
Add a _cairo_tag_error(fmt, ...) function that is used liked _cairo_error()
but allows an error message to be specified. When CAIRO_DEBUG_TAG is defined
the error is printed.
Diffstat (limited to 'src/cairo-pdf-interchange.c')
-rw-r--r-- | src/cairo-pdf-interchange.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cairo-pdf-interchange.c b/src/cairo-pdf-interchange.c index aacc728e5..45c9139b4 100644 --- a/src/cairo-pdf-interchange.c +++ b/src/cairo-pdf-interchange.c @@ -410,7 +410,7 @@ cairo_pdf_interchange_write_dest (cairo_pdf_surface_t *surface, free (dest); } else { if (link_attrs->page < 1) - return CAIRO_INT_STATUS_TAG_ERROR; + return _cairo_tag_error ("Link attribute: \"page=%d\" page must be >= 1", link_attrs->page); if (link_attrs->page <= (int)_cairo_array_num_elements (&surface->pages)) { _cairo_output_stream_printf (surface->object_stream.stream, " /Dest "); @@ -924,7 +924,9 @@ cairo_pdf_interchange_write_forward_links (cairo_pdf_surface_t *surface) for (i = 0; i < num_elems; i++) { link = _cairo_array_index (&surface->forward_links, i); if (link->page > (int)_cairo_array_num_elements (&surface->pages)) - return CAIRO_INT_STATUS_TAG_ERROR; + return _cairo_tag_error ("Link attribute: \"page=%d\" page exceeds page count (%d)", + link->page, _cairo_array_num_elements (&surface->pages)); + status = _cairo_pdf_surface_object_begin (surface, link->res); if (unlikely (status)) |