From 25ff2b2a4c2808b27fa40829978c6674668f6035 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Thu, 3 Apr 2014 09:15:25 +0200 Subject: Use the save mechanism from the export instead of suplicating code to save an svg. Fixes bug #500440 also clean vacuum defs from command line which should be using extension also. Fixed bugs: - https://launchpad.net/bugs/500440 (bzr r13252) --- src/main.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 00d0fcbb6..c2377b42c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1145,7 +1145,8 @@ static int sp_process_file_list(GSList *fl) if (!sp_export_svg && (sp_vacuum_defs || has_performed_actions)) { // save under the name given in the command line - sp_repr_save_file(doc->rdoc, filename, SP_SVG_NS_URI); + Inkscape::Extension::save(Inkscape::Extension::db.get("org.inkscape.output.svg.inkscape"), doc, filename, false, + false, false, Inkscape::Extension::FILE_SAVE_METHOD_INKSCAPE_SVG); } if (sp_global_printer) { sp_print_document_to_file(doc, sp_global_printer); @@ -1177,13 +1178,8 @@ static int sp_process_file_list(GSList *fl) g_slist_free (to_select); } - Inkscape::XML::Document *rdoc; - Inkscape::XML::Node *repr; - rdoc = sp_repr_document_new("svg:svg"); - repr = rdoc->root(); - repr = doc->getRoot()->updateRepr(rdoc, repr, SP_OBJECT_WRITE_BUILD); - sp_repr_save_rebased_file(repr->document(), sp_export_svg, SP_SVG_NS_URI, - doc->getBase(), sp_export_svg); + Inkscape::Extension::save(Inkscape::Extension::db.get("org.inkscape.output.svg.plain"), doc, sp_export_svg, false, + false, false, Inkscape::Extension::FILE_SAVE_METHOD_SAVE_COPY); } if (sp_export_ps) { retVal |= do_export_ps_pdf(doc, sp_export_ps, "image/x-postscript"); -- cgit v1.2.3 From a303321365bf5ae640715eb9e033f6f01cb085c8 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Sat, 5 Apr 2014 08:15:20 +0200 Subject: Allow command line options -i and -j to effect plain-svg output, this involves cropping and reducing. (bzr r13268) --- src/main.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index c2377b42c..6f4add4b1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1177,6 +1177,22 @@ static int sp_process_file_list(GSList *fl) g_slist_free (selected); g_slist_free (to_select); } + if(sp_export_id) { + doc->ensureUpToDate(); + + // "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::Extension::save(Inkscape::Extension::db.get("org.inkscape.output.svg.plain"), doc, sp_export_svg, false, false, false, Inkscape::Extension::FILE_SAVE_METHOD_SAVE_COPY); -- cgit v1.2.3 From 2dbb379145083fe62eee32c209962c51d83b0043 Mon Sep 17 00:00:00 2001 From: mathog <> Date: Tue, 3 Jun 2014 10:50:49 -0700 Subject: Fix for bugs 1262782 and 1262792 (bzr r13406) --- src/main.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 6f4add4b1..517ba0506 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1158,6 +1158,7 @@ static int sp_process_file_list(GSList *fl) if (sp_export_text_to_path) { GSList *items = NULL; SPRoot *root = doc->getRoot(); + doc->ensureUpToDate(); for ( SPObject *iter = root->firstChild(); iter ; iter = iter->getNext()) { SPItem* item = (SPItem*) iter; if (! (SP_IS_TEXT(item) || SP_IS_FLOWTEXT(item) || SP_IS_GROUP(item))) { -- cgit v1.2.3 From efd39893a4f5e629a9df2d0674222aea1be14199 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sun, 5 Oct 2014 12:38:15 -0400 Subject: Move obvious ui component to ui/ (bzr r13341.1.247) --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 517ba0506..caec66b05 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -64,7 +64,7 @@ #include "layer-model.h" #include "selection.h" #include "sp-object.h" -#include "interface.h" +#include "ui/interface.h" #include "print.h" #include "color.h" #include "sp-item.h" -- cgit v1.2.3 From 8282b8547972d776a1f3886f38f1464b73cbf71c Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Sun, 2 Nov 2014 18:55:56 -0500 Subject: default export dpi = 96 (bzr r13661) --- src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index caec66b05..12ddb76e6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -322,7 +322,7 @@ struct poptOption options[] = { {"export-dpi", 'd', POPT_ARG_STRING, &sp_export_dpi, SP_ARG_EXPORT_DPI, - N_("Resolution for exporting to bitmap and for rasterization of filters in PS/EPS/PDF (default 90)"), + N_("Resolution for exporting to bitmap and for rasterization of filters in PS/EPS/PDF (default 96)"), N_("DPI")}, {"export-area", 'a', @@ -1738,12 +1738,12 @@ static int do_export_ps_pdf(SPDocument* doc, gchar const* uri, char const* mime) } else { (*i)->set_param_bool("blurToBitmap", TRUE); - gdouble dpi = 90.0; + gdouble dpi = 96.0; if (sp_export_dpi) { dpi = atof(sp_export_dpi); if ((dpi < 1) || (dpi > 10000.0)) { - g_warning("DPI value %s out of range [1 - 10000]. Using 90 dpi instead.", sp_export_dpi); - dpi = 90; + g_warning("DPI value %s out of range [1 - 10000]. Using 96 dpi instead.", sp_export_dpi); + dpi = 96; } } -- cgit v1.2.3