index fbfdc4a9b5fca13c9b63a69de84e0a898dfc207a..855d5a223c6f71dcb58a57c07a13468dcf6d7696 100644 (file)
* 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>
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
* 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;
setDocument(doc);
- sp_document_unref(doc);
+ doc->doUnref();
return true;
}
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;
setDocument(doc);
- sp_document_unref(doc);
+ doc->doUnref();
Inkscape::GC::request_early_collection();