Skip to content

Commit

Permalink
[pdf] Propagate status
Browse files Browse the repository at this point in the history
Check and return a few forgotten error codes from static functions.
  • Loading branch information
Chris Wilson committed Sep 26, 2008
1 parent 907f550 commit ba18d57
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
14 changes: 11 additions & 3 deletions src/cairo-pdf-operators.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.*/
Expand All @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion src/cairo-pdf-surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down

0 comments on commit ba18d57

Please sign in to comment.