From 68c305f169dfe9a273e29dd2aa587f0d59071483 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sun, 6 Nov 2016 16:33:01 +0100 Subject: further cppification Fixed bugs: - https://launchpad.net/bugs/1306662 (bzr r15218) --- src/main.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 0d5f35797..95764aea9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -119,6 +119,7 @@ #include "verbs.h" #include "path-chemistry.h" +#include "object-set.h" #include "sp-text.h" #include "sp-flowtext.h" #include "text-editing.h" @@ -1161,16 +1162,13 @@ static int sp_process_file_list(GSList *fl) // "crop" the document to the specified object, cleaning as we go. SPObject *obj = doc->getObjectById(sp_export_id); - Geom::OptRect const bbox(SP_ITEM(obj)->visualBounds()); - - if (bbox) { - doc->fitToRect(*bbox, false); - } - if (sp_export_id_only) { // If -j then remove all other objects to complete the "crop" doc->getRoot()->cropToObject(obj); } + Inkscape::ObjectSet s(doc); + s.set(obj); + s.fitCanvas(false); } Inkscape::Extension::save(Inkscape::Extension::db.get("org.inkscape.output.svg.plain"), doc, sp_export_svg, false, -- cgit v1.2.3