[cairo-commit] src/cairo-svg-surface.c

Emmanuel Pacaud emmanuel at kemper.freedesktop.org
Wed Apr 5 12:34:56 PDT 2006


 src/cairo-svg-surface.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

New commits:
diff-tree 5baae7ff21a4236ebc9eaff087eb29fd1432c7ff (from 4fd30e6f402ae031c2084c20f136b84307a128cc)
Author: Emmanuel Pacaud <emmanuel.pacaud at free.fr>
Date:   Wed Apr 5 21:24:06 2006 +0200

    SVG: Fix typo and stream status handling

diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c
index 253055a..21d73f6 100644
--- a/src/cairo-svg-surface.c
+++ b/src/cairo-svg-surface.c
@@ -150,7 +150,7 @@ cairo_svg_surface_create_for_stream (cai
     status = _cairo_output_stream_get_status (stream);
     if (status) {
 	_cairo_error (status);
-	return (cairo_surface_t *) &cairo_surface_nil;
+	return (cairo_surface_t *) &_cairo_surface_nil;
     }
 
     return _cairo_svg_surface_create_for_stream_internal (stream, width, height);
@@ -168,7 +168,7 @@ cairo_svg_surface_create (const char	*fi
     status = _cairo_output_stream_get_status (stream);
     if (status) {
 	_cairo_error (status);
-	return (cairo_surface_t *) &cairo_surface_nil;
+	return (cairo_surface_t *) &_cairo_surface_nil;
     }
 
     return _cairo_svg_surface_create_for_stream_internal (stream, width, height);
@@ -1355,13 +1355,18 @@ _cairo_svg_document_write (cairo_output_
 			   const char * buffer,
 			   int len)
 {
-    if (_cairo_output_stream_write (output_stream, buffer, len) != CAIRO_STATUS_SUCCESS)
+    cairo_status_t status;
+    
+    _cairo_output_stream_write (output_stream, buffer, len);
+    status = _cairo_output_stream_get_status (output_stream);
+    if (status) {
+	_cairo_error (status);
 	return -1;
+    }
 
     return len;
 }
 
-
 static cairo_status_t
 _cairo_svg_document_finish (cairo_svg_document_t *document)
 {


More information about the cairo-commit mailing list