diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2016-10-24 22:58:43 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2016-10-24 22:58:43 +0000 |
| commit | 532f77b14a76fc04e6bdeca3625f9a55b5f11bdf (patch) | |
| tree | b70df28300f24edde9b04d0c7704c11c295c4c62 /src/file.cpp | |
| parent | [Bug #1636086] Update Catalan translation for Inkscape 0.92. (diff) | |
| download | inkscape-532f77b14a76fc04e6bdeca3625f9a55b5f11bdf.tar.gz inkscape-532f77b14a76fc04e6bdeca3625f9a55b5f11bdf.zip | |
CPPification: almost all sp_object_set_whatever and sp_selection_whatever global functions are now methods of ObjectSet*, with these additional benefits:
- They can now act on any SelectionSet, not just the current selection;
- Whenever possible, they don't need a desktop anymore and can run if called from GUI.
I hope I did not break too many things in the process.
*: So instead of callink sp_selection_move(desktop,x,y), you call myobjectset->move(x,y)
(bzr r15189)
Diffstat (limited to 'src/file.cpp')
| -rw-r--r-- | src/file.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/file.cpp b/src/file.cpp index 7c17a6158..e5c7240dc 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -1118,14 +1118,14 @@ void sp_import_document(SPDesktop *desktop, SPDocument *clipdoc, bool in_place) Inkscape::Selection *selection = desktop->getSelection(); selection->setReprList(pasted_objects_not); Geom::Affine doc2parent = SP_ITEM(desktop->currentLayer())->i2doc_affine().inverse(); - sp_object_set_apply_affine(selection, desktop->dt2doc() * doc2parent * desktop->doc2dt(), true, false, false); - sp_selection_delete(desktop); + selection->applyAffine(desktop->dt2doc() * doc2parent * desktop->doc2dt(), true, false, false); + selection->deleteItems(); // Change the selection to the freshly pasted objects selection->setReprList(pasted_objects); // Apply inverse of parent transform - sp_object_set_apply_affine(selection, desktop->dt2doc() * doc2parent * desktop->doc2dt(), true, false, false); + selection->applyAffine(desktop->dt2doc() * doc2parent * desktop->doc2dt(), true, false, false); // Update (among other things) all curves in paths, for bounds() to work target_document->ensureUpToDate(); @@ -1155,7 +1155,7 @@ void sp_import_document(SPDesktop *desktop, SPDocument *clipdoc, bool in_place) m.unSetup(); } - sp_object_set_move_relative(selection, offset); + selection->moveRelative(offset); } } @@ -1260,7 +1260,7 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, // c2p is identity matrix at this point unless ensureUpToDate is called doc->ensureUpToDate(); Geom::Affine affine = doc->getRoot()->c2p * SP_ITEM(place_to_insert)->i2doc_affine().inverse(); - sp_object_set_apply_affine(selection, desktop->dt2doc() * affine * desktop->doc2dt(), true, false, false); + selection->applyAffine(desktop->dt2doc() * affine * desktop->doc2dt(), true, false, false); // move to mouse pointer { @@ -1268,7 +1268,7 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, Geom::OptRect sel_bbox = selection->visualBounds(); if (sel_bbox) { Geom::Point m( desktop->point() - sel_bbox->midpoint() ); - sp_object_set_move_relative(selection, m, false); + selection->moveRelative(m, false); } } } |
