Code

Merge and cleanup of GSoC C++-ification project.
[inkscape.git] / src / ui / dialog / filedialogimpl-gtkmm.cpp
index fbfdc4a9b5fca13c9b63a69de84e0a898dfc207a..855d5a223c6f71dcb58a57c07a13468dcf6d7696 100644 (file)
@@ -6,6 +6,7 @@
  *   Joel Holdsworth
  *   Bruno Dilly
  *   Other dudes from The Inkscape Organization
+ *   Abhishek Sharma
  *
  * Copyright (C) 2004-2007 Bob Jamison
  * Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
@@ -123,9 +124,9 @@ findExpanderWidgets(Gtk::Container *parent,
 bool SVGPreview::setDocument(SPDocument *doc)
 {
     if (document)
-        sp_document_unref(document);
+        document->doUnref();
 
-    sp_document_ref(doc);
+    doc->doRef();
     document = doc;
 
     //This should remove it from the box, and free resources
@@ -151,7 +152,7 @@ bool SVGPreview::setFileName(Glib::ustring &theFileName)
      * I don't know why passing false to keepalive is bad.  But it
      * prevents the display of an svg with a non-ascii filename
      */
-    SPDocument *doc = sp_document_new (fileName.c_str(), true);
+    SPDocument *doc = SPDocument::createNewDoc (fileName.c_str(), true);
     if (!doc) {
         g_warning("SVGView: error loading document '%s'\n", fileName.c_str());
         return false;
@@ -159,7 +160,7 @@ bool SVGPreview::setFileName(Glib::ustring &theFileName)
 
     setDocument(doc);
 
-    sp_document_unref(doc);
+    doc->doUnref();
 
     return true;
 }
@@ -172,7 +173,7 @@ bool SVGPreview::setFromMem(char const *xmlBuffer)
         return false;
 
     gint len = (gint)strlen(xmlBuffer);
-    SPDocument *doc = sp_document_new_from_mem(xmlBuffer, len, 0);
+    SPDocument *doc = SPDocument::createNewDocFromMem(xmlBuffer, len, 0);
     if (!doc) {
         g_warning("SVGView: error loading buffer '%s'\n",xmlBuffer);
         return false;
@@ -180,7 +181,7 @@ bool SVGPreview::setFromMem(char const *xmlBuffer)
 
     setDocument(doc);
 
-    sp_document_unref(doc);
+    doc->doUnref();
 
     Inkscape::GC::request_early_collection();