Code

patch 181692
authorbuliabyak <buliabyak@users.sourceforge.net>
Thu, 12 Jun 2008 02:43:08 +0000 (02:43 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Thu, 12 Jun 2008 02:43:08 +0000 (02:43 +0000)
src/extension/internal/cairo-render-context.cpp
src/extension/internal/pdf-cairo.cpp

index 887ffe602dc233416b4a4adb6474a5344f9058ee..3ec94af63ab2829653b7f798d59de991d507b566 100644 (file)
@@ -788,6 +788,8 @@ CairoRenderContext::finish(void)
         cairo_show_page(_cr);
 
     cairo_destroy(_cr);
+    cairo_surface_finish(_surface);
+    cairo_status_t status = cairo_surface_status(_surface);
     cairo_surface_destroy(_surface);
     _cr = NULL;
     _surface = NULL;
@@ -805,7 +807,10 @@ CairoRenderContext::finish(void)
         _stream = NULL;
     }
 
-    return true;
+    if (status == CAIRO_STATUS_SUCCESS)
+        return true;
+    else
+        return false;
 }
 
 void
index 92b8d92c4272f58fe500c00b6e07eab989ad9d1b..ed6eee5467e8df9a357b7c91717fd5c34be87b34 100644 (file)
@@ -383,6 +383,8 @@ PrintCairoPDF::finish(Inkscape::Extension::Print *mod)
     cairo_show_page(cr);
 
     cairo_destroy(cr);
+    cairo_surface_finish(pdf_surface);
+    cairo_status_t status = cairo_surface_status(pdf_surface);
     cairo_surface_destroy(pdf_surface);
     cr = NULL;
     pdf_surface = NULL;
@@ -394,7 +396,10 @@ PrintCairoPDF::finish(Inkscape::Extension::Print *mod)
     fclose(_stream);
     _stream = 0;
 
-    return 1;
+    if (status == CAIRO_STATUS_SUCCESS)
+        return true;
+    else
+        return false;
 }
 
 unsigned int