diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-01-16 16:23:23 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-01-16 16:51:32 +0000 |
commit | 7111b18c27d7ee0439339a6aa72f0e4244f883f9 (patch) | |
tree | 162d5cf10b629ded2a44f8bb1cc64e4671a58cc7 /src/cairo-paginated-surface.c | |
parent | 5cbc45488e276cb6e6ecfa7bc7dd4fae342de85e (diff) |
[cairo-surface] Introduce _cairo_surface_create_in_error().
Unexport all the static error surfaces and use a function to select
the appropriate error surface for the status.
Diffstat (limited to 'src/cairo-paginated-surface.c')
-rw-r--r-- | src/cairo-paginated-surface.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c index 6af4be6e..98ec061c 100644 --- a/src/cairo-paginated-surface.c +++ b/src/cairo-paginated-surface.c @@ -74,10 +74,11 @@ _cairo_paginated_surface_create (cairo_surface_t *target, const cairo_paginated_surface_backend_t *backend) { cairo_paginated_surface_t *surface; + cairo_status_t status; surface = malloc (sizeof (cairo_paginated_surface_t)); if (surface == NULL) { - _cairo_error_throw (CAIRO_STATUS_NO_MEMORY); + status = _cairo_error (CAIRO_STATUS_NO_MEMORY); goto FAIL; } @@ -97,7 +98,8 @@ _cairo_paginated_surface_create (cairo_surface_t *target, surface->backend = backend; surface->meta = _cairo_meta_surface_create (content, width, height); - if (cairo_surface_status (surface->meta)) + status = cairo_surface_status (surface->meta); + if (status) goto FAIL_CLEANUP_SURFACE; surface->page_num = 1; @@ -108,7 +110,7 @@ _cairo_paginated_surface_create (cairo_surface_t *target, FAIL_CLEANUP_SURFACE: free (surface); FAIL: - return (cairo_surface_t*) &_cairo_surface_nil; + return _cairo_surface_create_in_error (status); } cairo_bool_t |