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/file.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/file.cpp') diff --git a/src/file.cpp b/src/file.cpp index e0ecd5084..352362424 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -118,7 +118,7 @@ sp_file_new(const Glib::ustring &templ) char *templName = NULL; if (templ.size()>0) templName = (char *)templ.c_str(); - SPDocument *doc = sp_document_new(templName, TRUE, true); + SPDocument *doc = SPDocument::createDoc(templName, TRUE, true); g_return_val_if_fail(doc != NULL, NULL); SPDesktop *dt; @@ -128,7 +128,7 @@ sp_file_new(const Glib::ustring &templ) } else { SPViewWidget *dtw = sp_desktop_widget_new(sp_document_namedview(doc, NULL)); g_return_val_if_fail(dtw != NULL, NULL); - sp_document_unref(doc); + doc->doUnref(); sp_create_window(dtw, TRUE); dt = static_cast(dtw->view); @@ -250,7 +250,7 @@ sp_file_open(const Glib::ustring &uri, doc->virgin = FALSE; // everyone who cares now has a reference, get rid of ours - sp_document_unref(doc); + doc->doUnref(); // resize the window to match the document properties sp_namedview_window_from_document(desktop); sp_namedview_update_layers_from_document(desktop); @@ -1049,7 +1049,7 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, // preserve parent and viewBox transformations // c2p is identity matrix at this point unless sp_document_ensure_up_to_date is called sp_document_ensure_up_to_date(doc); - Geom::Matrix affine = SP_ROOT(SP_DOCUMENT_ROOT(doc))->c2p * sp_item_i2doc_affine(SP_ITEM(place_to_insert)).inverse(); + Geom::Matrix affine = SP_ROOT(SP_DOCUMENT_ROOT(doc))->c2p * SP_ITEM(place_to_insert)->i2doc_affine().inverse(); sp_selection_apply_affine(selection, desktop->dt2doc() * affine * desktop->doc2dt(), true, false); // move to mouse pointer @@ -1063,7 +1063,7 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, } } - sp_document_unref(doc); + doc->doUnref(); sp_document_done(in_doc, SP_VERB_FILE_IMPORT, _("Import")); -- cgit v1.2.3