From 8867de5daf309e4cdd3fce177b408618490be4f3 Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Public Date: Tue, 29 Jun 2010 23:35:42 +0530 Subject: This is the first c++ification commit from me. It handles sp-line, sp-polyline, sp-item and marks the onset of document c++ification as well. Users can check performace increase with [/usr/bin/time -v inkscape_binary_with_commandline_options]. (bzr r9546.1.1) --- src/ui/widget/imageicon.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/ui/widget/imageicon.cpp') diff --git a/src/ui/widget/imageicon.cpp b/src/ui/widget/imageicon.cpp index 71ba4428c..79cc8ca42 100644 --- a/src/ui/widget/imageicon.cpp +++ b/src/ui/widget/imageicon.cpp @@ -76,7 +76,7 @@ ImageIcon::ImageIcon(const ImageIcon &other) ImageIcon::~ImageIcon() { if (document) - sp_document_unref(document); + document->doUnref(); } @@ -98,11 +98,11 @@ bool ImageIcon::showSvgDocument(const SPDocument *docArg) { if (document) - sp_document_unref(document); + document->doUnref(); SPDocument *doc = (SPDocument *)docArg; - sp_document_ref(doc); + doc->doRef(); document = doc; //This should remove it from the box, and free resources @@ -127,7 +127,7 @@ bool ImageIcon::showSvgFile(const Glib::ustring &theFileName) fileName = Glib::filename_to_utf8(fileName); - SPDocument *doc = sp_document_new (fileName.c_str(), 0); + SPDocument *doc = SPDocument::createDoc (fileName.c_str(), 0); if (!doc) { g_warning("SVGView: error loading document '%s'\n", fileName.c_str()); return false; @@ -135,7 +135,7 @@ bool ImageIcon::showSvgFile(const Glib::ustring &theFileName) showSvgDocument(doc); - sp_document_unref(doc); + doc->doUnref(); return true; } @@ -148,7 +148,7 @@ bool ImageIcon::showSvgFromMemory(const char *xmlBuffer) return false; gint len = (gint)strlen(xmlBuffer); - SPDocument *doc = sp_document_new_from_mem(xmlBuffer, len, 0); + SPDocument *doc = SPDocument::createDocFromMem(xmlBuffer, len, 0); if (!doc) { g_warning("SVGView: error loading buffer '%s'\n",xmlBuffer); return false; @@ -156,7 +156,7 @@ bool ImageIcon::showSvgFromMemory(const char *xmlBuffer) showSvgDocument(doc); - sp_document_unref(doc); + doc->doUnref(); return true; } -- cgit v1.2.3 From 121815791be2d24cb745663520b111ee914fbc09 Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Public Date: Thu, 1 Jul 2010 15:36:56 +0530 Subject: C++fied SPDocument added (bzr r9546.1.2) --- src/ui/widget/imageicon.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ui/widget/imageicon.cpp') diff --git a/src/ui/widget/imageicon.cpp b/src/ui/widget/imageicon.cpp index 79cc8ca42..f5dd3e9fa 100644 --- a/src/ui/widget/imageicon.cpp +++ b/src/ui/widget/imageicon.cpp @@ -127,7 +127,7 @@ bool ImageIcon::showSvgFile(const Glib::ustring &theFileName) fileName = Glib::filename_to_utf8(fileName); - SPDocument *doc = SPDocument::createDoc (fileName.c_str(), 0); + SPDocument *doc = SPDocument::createNewDoc (fileName.c_str(), 0); if (!doc) { g_warning("SVGView: error loading document '%s'\n", fileName.c_str()); return false; @@ -148,7 +148,7 @@ bool ImageIcon::showSvgFromMemory(const char *xmlBuffer) return false; gint len = (gint)strlen(xmlBuffer); - SPDocument *doc = SPDocument::createDocFromMem(xmlBuffer, len, 0); + SPDocument *doc = SPDocument::createNewDocFromMem(xmlBuffer, len, 0); if (!doc) { g_warning("SVGView: error loading buffer '%s'\n",xmlBuffer); return false; -- cgit v1.2.3