From ba18d57339dbedbbdb7f3ca35b06ce6b5dbcd972 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 25 Sep 2008 09:39:41 +0100 Subject: [PATCH] [pdf] Propagate status Check and return a few forgotten error codes from static functions. --- src/cairo-pdf-operators.c | 14 +++++++++++--- src/cairo-pdf-surface.c | 6 +++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/cairo-pdf-operators.c b/src/cairo-pdf-operators.c index baa36de19..819318a19 100644 --- a/src/cairo-pdf-operators.c +++ b/src/cairo-pdf-operators.c @@ -1303,7 +1303,10 @@ _cairo_pdf_operators_emit_cluster (cairo_pdf_operators_t *pdf_operators, /* Fallback to using ActualText to map zero or more glyphs to a * unicode string. */ - _cairo_pdf_operators_flush_glyphs (pdf_operators); + status = _cairo_pdf_operators_flush_glyphs (pdf_operators); + if (status) + return status; + status = _cairo_pdf_operators_begin_actualtext (pdf_operators, utf8, utf8_len); if (status) return status; @@ -1367,7 +1370,9 @@ _cairo_pdf_operators_show_text_glyphs (cairo_pdf_operators_t *pdf_operators, pdf_operators->is_new_text_object = FALSE; if (pdf_operators->in_text_object == FALSE) { - _cairo_pdf_operators_begin_text (pdf_operators); + status = _cairo_pdf_operators_begin_text (pdf_operators); + if (status) + return status; /* Force Tm and Tf to be emitted when starting a new text * object.*/ @@ -1386,7 +1391,10 @@ _cairo_pdf_operators_show_text_glyphs (cairo_pdf_operators_t *pdf_operators, if (pdf_operators->is_new_text_object || ! _cairo_matrix_scale_equal (&pdf_operators->text_matrix, &text_matrix)) { - _cairo_pdf_operators_flush_glyphs (pdf_operators); + status = _cairo_pdf_operators_flush_glyphs (pdf_operators); + if (status) + return status; + x = glyphs[0].x; y = glyphs[0].y; cairo_matrix_transform_point (&pdf_operators->cairo_to_pdf, &x, &y); diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c index f96e1fcac..0c6b219f0 100644 --- a/src/cairo-pdf-surface.c +++ b/src/cairo-pdf-surface.c @@ -2956,7 +2956,11 @@ _cairo_pdf_surface_emit_to_unicode_stream (cairo_pdf_surface_t *surface, "<%02x> ", i + 1); } - _cairo_pdf_surface_emit_unicode_for_glyph (surface, font_subset->utf8[i + 1]); + status = _cairo_pdf_surface_emit_unicode_for_glyph (surface, + font_subset->utf8[i + 1]); + if (status) + return status; + _cairo_output_stream_printf (surface->output, "\n"); }