mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 00:38:06 +02:00
[cairo-scaled-font-subsets] Simplify boolean return code.
_cairo_sub_font_lookup_glyph() was returning either a NULL_POINTER error or success whereas its only caller was using it as a simple predicate and handled the 'error' rather than propagate it upwards.
This commit is contained in:
parent
379b9b79fa
commit
c64335a9a8
1 changed files with 9 additions and 11 deletions
|
|
@ -275,7 +275,7 @@ _cairo_sub_font_pluck (void *entry, void *closure)
|
|||
_cairo_sub_font_destroy (sub_font);
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
static cairo_bool_t
|
||||
_cairo_sub_font_lookup_glyph (cairo_sub_font_t *sub_font,
|
||||
unsigned long scaled_font_glyph_index,
|
||||
cairo_scaled_font_subsets_glyph_t *subset_glyph)
|
||||
|
|
@ -293,10 +293,10 @@ _cairo_sub_font_lookup_glyph (cairo_sub_font_t *sub_font,
|
|||
subset_glyph->is_composite = sub_font->is_composite;
|
||||
subset_glyph->x_advance = sub_font_glyph->x_advance;
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return _cairo_error (CAIRO_STATUS_NULL_POINTER);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
|
|
@ -519,10 +519,9 @@ _cairo_scaled_font_subsets_map_glyph (cairo_scaled_font_subsets_t *subsets,
|
|||
if (_cairo_hash_table_lookup (subsets->unscaled_sub_fonts, &key.base,
|
||||
(cairo_hash_entry_t **) &sub_font))
|
||||
{
|
||||
status = _cairo_sub_font_lookup_glyph (sub_font,
|
||||
scaled_font_glyph_index,
|
||||
subset_glyph);
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
if (_cairo_sub_font_lookup_glyph (sub_font,
|
||||
scaled_font_glyph_index,
|
||||
subset_glyph))
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
@ -533,10 +532,9 @@ _cairo_scaled_font_subsets_map_glyph (cairo_scaled_font_subsets_t *subsets,
|
|||
if (_cairo_hash_table_lookup (subsets->scaled_sub_fonts, &key.base,
|
||||
(cairo_hash_entry_t **) &sub_font))
|
||||
{
|
||||
status = _cairo_sub_font_lookup_glyph (sub_font,
|
||||
scaled_font_glyph_index,
|
||||
subset_glyph);
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
if (_cairo_sub_font_lookup_glyph (sub_font,
|
||||
scaled_font_glyph_index,
|
||||
subset_glyph))
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue