From 8761f46f7b8c2a2df82203f5be89d60072998a82 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Mon, 2 Oct 2017 02:12:27 +0200 Subject: Second batch --- src/main.cpp | 80 ++++++++++++++++++------------------------------------------ 1 file changed, 24 insertions(+), 56 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 71014ee35..3402bcc72 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -294,7 +294,7 @@ static void resetCommandlineGlobals() { #ifdef WIN32 static bool replaceArgs( int& argc, char**& argv ); #endif -static GSList *sp_process_args(poptContext ctx); +static std::vector sp_process_args(poptContext ctx); struct poptOption options[] = { {"version", 'V', POPT_ARG_NONE, NULL, SP_ARG_VERSION, @@ -815,46 +815,19 @@ static void fixupSingleFilename( gchar **orig, gchar **spare ) -static GSList *fixupFilenameEncoding( GSList* fl ) +static void fixupFilenameEncoding( std::vector &filenames) { - GSList *newFl = NULL; - while ( fl ) { - gchar *fn = static_cast(fl->data); - fl = g_slist_remove( fl, fl->data ); + for (int i=0; i *flDest ) { #ifdef ENABLE_NLS // temporarily switch gettext encoding to locale, so that help messages can be output properly @@ -866,7 +839,7 @@ static int sp_common_main( int argc, char const **argv, GSList **flDest ) g_return_val_if_fail(ctx != NULL, 1); /* Collect own arguments */ - GSList *fl = sp_process_args(ctx); + std::vector fl = sp_process_args(ctx); poptFreeContext(ctx); #ifdef ENABLE_NLS @@ -877,7 +850,7 @@ static int sp_common_main( int argc, char const **argv, GSList **flDest ) // Now let's see if the file list still holds up if ( needToRecodeParams ) { - fl = fixupFilenameEncoding( fl ); + fixupFilenameEncoding( fl ); } // Check the globals for filename-fixup @@ -916,12 +889,10 @@ static int sp_common_main( int argc, char const **argv, GSList **flDest ) // Return the list if wanted, else free it up. if ( flDest ) { - *flDest = fl; - fl = 0; + flDest->insert(flDest->end(),fl.begin(),fl.end()); } else { - while ( fl ) { - g_free( fl->data ); - fl = g_slist_remove( fl, fl->data ); + for (auto i:fl) { + g_free(i); } } return 0; @@ -1020,7 +991,7 @@ sp_main_gui(int argc, char const **argv) { Gtk::Main main_instance (&argc, const_cast(&argv)); - GSList *fl = NULL; + std::vector fl; int retVal = sp_common_main( argc, argv, &fl ); g_return_val_if_fail(retVal == 0, 1); @@ -1036,11 +1007,10 @@ sp_main_gui(int argc, char const **argv) /// \todo FIXME BROKEN - non-UTF-8 sneaks in here. Inkscape::Application::create(argv[0], true); - while (fl) { - if (sp_file_open((gchar *)fl->data,NULL)) { + for (auto i:fl) { + if (sp_file_open(i,NULL)) { create_new=false; } - fl = g_slist_remove(fl, fl->data); } if (create_new) { sp_file_new_default(); @@ -1060,11 +1030,11 @@ sp_main_gui(int argc, char const **argv) /** * Process file list */ -static int sp_process_file_list(GSList *fl) +static int sp_process_file_list(std::vector fl) { int retVal = 0; #ifdef WITH_DBUS - if (!fl) { + if (fl.empty()) { // If we've been asked to listen for D-Bus messages, enter a main loop here // The main loop may be exited by calling "exit" on the D-Bus application interface. if (sp_dbus_listen) { @@ -1074,8 +1044,7 @@ static int sp_process_file_list(GSList *fl) } #endif // WITH_DBUS - while (fl) { - const gchar *filename = (gchar *)fl->data; + for (auto filename:fl) { SPDocument *doc = NULL; try { @@ -1201,7 +1170,6 @@ static int sp_process_file_list(GSList *fl) delete doc; } - fl = g_slist_remove(fl, fl->data); } return retVal; } @@ -1258,7 +1226,7 @@ static int sp_main_shell(char const* command_name) poptContext ctx = poptGetContext(NULL, argc, const_cast(argv), options, 0); poptSetOtherOptionHelp(ctx, _("[OPTIONS...] [FILE...]\n\nAvailable options:")); if ( ctx ) { - GSList *fl = sp_process_args(ctx); + std::vector fl = sp_process_args(ctx); if (sp_process_file_list(fl)) { retval = -1; } @@ -1297,11 +1265,11 @@ int sp_main_console(int argc, char const **argv) char **argv2 = const_cast(argv); gtk_init_check( &argc, &argv2 ); - GSList *fl = NULL; + std::vector fl; int retVal = sp_common_main( argc, argv, &fl ); g_return_val_if_fail(retVal == 0, 1); - if (fl == NULL && !sp_shell + if (fl.empty() && !sp_shell #ifdef WITH_DBUS && !sp_dbus_listen #endif // WITH_DBUS @@ -2131,10 +2099,10 @@ bool replaceArgs( int& argc, char**& argv ) } #endif // WIN32 -static GSList * +static std::vector sp_process_args(poptContext ctx) { - GSList *fl = NULL; + std::vector fl; gint a; while ((a = poptGetNextOpt(ctx)) != -1) { @@ -2142,7 +2110,7 @@ sp_process_args(poptContext ctx) case SP_ARG_FILE: { gchar const *fn = poptGetOptArg(ctx); if (fn != NULL) { - fl = g_slist_append(fl, g_strdup(fn)); + fl.push_back(g_strdup(fn)); } break; } @@ -2214,7 +2182,7 @@ sp_process_args(poptContext ctx) gchar const ** const args = poptGetArgs(ctx); if (args != NULL) { for (unsigned i = 0; args[i] != NULL; i++) { - fl = g_slist_append(fl, g_strdup(args[i])); + fl.push_back(g_strdup(args[i])); } } -- cgit v1.2.3 From 525c6c0c7ea39c6bdb0013c546d08b6e94e51e61 Mon Sep 17 00:00:00 2001 From: Andrey Mozzhuhin Date: Fri, 6 Oct 2017 00:46:14 +0300 Subject: Rename get_group0_keyval to get_latin_keyval --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 3402bcc72..9f204851b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -902,7 +902,7 @@ namespace Inkscape { namespace UI { namespace Tools { -guint get_group0_keyval(GdkEventKey const* event, guint *consumed_modifiers = NULL); +guint get_latin_keyval(GdkEventKey const* event, guint *consumed_modifiers = NULL); } } @@ -960,7 +960,7 @@ snooper(GdkEvent *event, gpointer /*data*/) { alt_pressed = TRUE && (event->button.state & GDK_MOD1_MASK); break; case GDK_KEY_PRESS: - keyval = Inkscape::UI::Tools::get_group0_keyval(&event->key); + keyval = Inkscape::UI::Tools::get_latin_keyval(&event->key); if (keyval == GDK_KEY_Alt_L) altL_pressed = TRUE; if (keyval == GDK_KEY_Alt_R) altR_pressed = TRUE; alt_pressed = alt_pressed || altL_pressed || altR_pressed; @@ -971,7 +971,7 @@ snooper(GdkEvent *event, gpointer /*data*/) { event->key.state &= ~GDK_MOD1_MASK; break; case GDK_KEY_RELEASE: - keyval = Inkscape::UI::Tools::get_group0_keyval(&event->key); + keyval = Inkscape::UI::Tools::get_latin_keyval(&event->key); if (keyval == GDK_KEY_Alt_L) altL_pressed = FALSE; if (keyval == GDK_KEY_Alt_R) altR_pressed = FALSE; if (!altL_pressed && !altR_pressed) -- cgit v1.2.3 From 22430892c3b4fc1e2c4bdef625e71db4cf5bfd42 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Thu, 12 Oct 2017 19:43:37 +0200 Subject: Do not force-disable CSD on Windows The code introduced in 860d326a9ac03c2b1e0a3f45c3ed3d35f94c3d54 is no longer necessary as gtk3 client side decorations are now disabled by default in MSYS2's gtk3 builds, see upstream patch: https://github.com/Alexpux/MINGW-packages/commit/69f8e3294ec0d612d274f69e5e517026a8c340b6 To enable CSD on-the-fly set the environment variable `GTK_CSD` to 1 --- src/main.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 9f204851b..aec7d96a9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -700,10 +700,6 @@ main(int argc, char **argv) RegistryTool rt; rt.setPathInfo(); } - - // disable "client side decorations" as they prevent window borders and titlebars to be drawn with native theming - // see also https://bugzilla.gnome.org/show_bug.cgi?id=778791 - g_setenv("GTK_CSD", "0", FALSE); #endif set_extensions_env(); -- cgit v1.2.3 From c169d8f366f0765513e08e94057d1e0dc3872c73 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sat, 14 Oct 2017 16:27:09 +0200 Subject: make --export-area-drawing work when exporting SVG Fixed bugs: - https://bugs.launchpad.net/inkscape/+bug/1597921 - https://bugs.launchpad.net/inkscape/+bug/1722844 --- src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index aec7d96a9..537605e37 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -59,6 +59,7 @@ #include "document.h" #include "layer-model.h" #include "selection.h" +#include "selection-chemistry.h" #include "ui/interface.h" #include "print.h" #include "color.h" @@ -1116,6 +1117,9 @@ static int sp_process_file_list(std::vector fl) sp_item_list_to_curves(items, selected, to_select); } + if(sp_export_area_drawing) { + fit_canvas_to_drawing(doc, false); + } if(sp_export_id) { doc->ensureUpToDate(); -- cgit v1.2.3 From 201d28e01980bef947ef632628c731ab878185c6 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sat, 14 Oct 2017 18:12:01 +0200 Subject: Support --export-margin when exporting to SVG --- src/main.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 537605e37..c40337cbe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -354,7 +354,7 @@ struct poptOption options[] = { {"export-margin", 0, POPT_ARG_STRING, &sp_export_margin, SP_ARG_EXPORT_MARGIN, - N_("Only for PS/EPS/PDF, sets margin in mm around exported area (default 0)"), + N_("Sets margin around exported area (default 0) in units of page size for SVG and mm for PS/EPS/PDF"), N_("VALUE")}, {"export-area-snap", 0, @@ -1117,8 +1117,20 @@ static int sp_process_file_list(std::vector fl) sp_item_list_to_curves(items, selected, to_select); } + if (sp_export_margin) { + gdouble margin = g_ascii_strtod(sp_export_margin, NULL); + doc->ensureUpToDate(); + SPNamedView *nv; + Inkscape::XML::Node *nv_repr; + if ((nv = sp_document_namedview(doc, 0)) && (nv_repr = nv->getRepr())) { + sp_repr_set_svg_double(nv_repr, "fit-margin-top", margin); + sp_repr_set_svg_double(nv_repr, "fit-margin-left", margin); + sp_repr_set_svg_double(nv_repr, "fit-margin-right", margin); + sp_repr_set_svg_double(nv_repr, "fit-margin-bottom", margin); + } + } if(sp_export_area_drawing) { - fit_canvas_to_drawing(doc, false); + fit_canvas_to_drawing(doc, sp_export_margin ? true : false); } if(sp_export_id) { doc->ensureUpToDate(); @@ -1131,7 +1143,7 @@ static int sp_process_file_list(std::vector fl) } Inkscape::ObjectSet s(doc); s.set(obj); - s.fitCanvas(false); + s.fitCanvas(sp_export_margin ? true : false); } if (sp_export_svg) { Inkscape::Extension::save(Inkscape::Extension::db.get("org.inkscape.output.svg.plain"), doc, sp_export_svg, false, -- cgit v1.2.3 From b73dbb746ba026573dd7fc67a0cdf5ac9a934d4e Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sat, 14 Oct 2017 19:17:22 +0200 Subject: Support --export-area-page when using --export-id to export to SVG --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index c40337cbe..792c1182a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1143,7 +1143,9 @@ static int sp_process_file_list(std::vector fl) } Inkscape::ObjectSet s(doc); s.set(obj); - s.fitCanvas(sp_export_margin ? true : false); + if (!sp_export_area_page) { + s.fitCanvas(sp_export_margin ? true : false); + } } if (sp_export_svg) { Inkscape::Extension::save(Inkscape::Extension::db.get("org.inkscape.output.svg.plain"), doc, sp_export_svg, false, -- cgit v1.2.3 From 16ff7505bac18399e83f38d160049d1c564a1db3 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sat, 14 Oct 2017 19:54:22 +0200 Subject: Refactoring: put SVG export into separate function --- src/main.cpp | 132 +++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 73 insertions(+), 59 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 792c1182a..5f6fc75cf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -182,6 +182,7 @@ enum { int sp_main_gui(int argc, char const **argv); int sp_main_console(int argc, char const **argv); static int sp_do_export_png(SPDocument *doc); +static int do_export_svg(SPDocument* doc); static int do_export_ps_pdf(SPDocument* doc, gchar const* uri, char const *mime); static int do_export_emf(SPDocument* doc, gchar const* uri, char const *mime); static int do_export_wmf(SPDocument* doc, gchar const* uri, char const *mime); @@ -1097,65 +1098,7 @@ static int sp_process_file_list(std::vector fl) retVal |= sp_do_export_png(doc); } if (sp_export_svg || sp_export_inkscape_svg) { - if (sp_export_text_to_path) { - std::vector items; - SPRoot *root = doc->getRoot(); - doc->ensureUpToDate(); - for (auto& iter: root->children) { - SPItem* item = (SPItem*) &iter; - if (! (SP_IS_TEXT(item) || SP_IS_FLOWTEXT(item) || SP_IS_GROUP(item))) { - continue; - } - - te_update_layout_now_recursive(item); - items.push_back(item); - } - - std::vector selected; - std::vector to_select; - - sp_item_list_to_curves(items, selected, to_select); - - } - if (sp_export_margin) { - gdouble margin = g_ascii_strtod(sp_export_margin, NULL); - doc->ensureUpToDate(); - SPNamedView *nv; - Inkscape::XML::Node *nv_repr; - if ((nv = sp_document_namedview(doc, 0)) && (nv_repr = nv->getRepr())) { - sp_repr_set_svg_double(nv_repr, "fit-margin-top", margin); - sp_repr_set_svg_double(nv_repr, "fit-margin-left", margin); - sp_repr_set_svg_double(nv_repr, "fit-margin-right", margin); - sp_repr_set_svg_double(nv_repr, "fit-margin-bottom", margin); - } - } - if(sp_export_area_drawing) { - fit_canvas_to_drawing(doc, sp_export_margin ? true : false); - } - if(sp_export_id) { - doc->ensureUpToDate(); - - // "crop" the document to the specified object, cleaning as we go. - SPObject *obj = doc->getObjectById(sp_export_id); - 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); - if (!sp_export_area_page) { - s.fitCanvas(sp_export_margin ? true : false); - } - } - if (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_inkscape_svg) { - // Export as inkscape SVG. - Inkscape::Extension::save(Inkscape::Extension::db.get("org.inkscape.output.svg.inkscape"), doc, sp_export_inkscape_svg, false, - false, false, Inkscape::Extension::FILE_SAVE_METHOD_INKSCAPE_SVG); - } + retVal |= do_export_svg(doc); } if (sp_export_ps) { retVal |= do_export_ps_pdf(doc, sp_export_ps, "image/x-postscript"); @@ -1617,6 +1560,77 @@ static int sp_do_export_png(SPDocument *doc) return retcode; } +/** + * Perform an SVG export + * + * \param doc Document to export. + */ + +static int do_export_svg(SPDocument* doc) +{ + if (sp_export_text_to_path) { + std::vector items; + SPRoot *root = doc->getRoot(); + doc->ensureUpToDate(); + for (auto& iter: root->children) { + SPItem* item = (SPItem*) &iter; + if (! (SP_IS_TEXT(item) || SP_IS_FLOWTEXT(item) || SP_IS_GROUP(item))) { + continue; + } + + te_update_layout_now_recursive(item); + items.push_back(item); + } + + std::vector selected; + std::vector to_select; + + sp_item_list_to_curves(items, selected, to_select); + + } + if (sp_export_margin) { + gdouble margin = g_ascii_strtod(sp_export_margin, NULL); + doc->ensureUpToDate(); + SPNamedView *nv; + Inkscape::XML::Node *nv_repr; + if ((nv = sp_document_namedview(doc, 0)) && (nv_repr = nv->getRepr())) { + sp_repr_set_svg_double(nv_repr, "fit-margin-top", margin); + sp_repr_set_svg_double(nv_repr, "fit-margin-left", margin); + sp_repr_set_svg_double(nv_repr, "fit-margin-right", margin); + sp_repr_set_svg_double(nv_repr, "fit-margin-bottom", margin); + } + } + if(sp_export_area_drawing) { + fit_canvas_to_drawing(doc, sp_export_margin ? true : false); + } + if(sp_export_id) { + doc->ensureUpToDate(); + + // "crop" the document to the specified object, cleaning as we go. + SPObject *obj = doc->getObjectById(sp_export_id); + 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); + if (!sp_export_area_page) { + s.fitCanvas(sp_export_margin ? true : false); + } + } + + if (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_inkscape_svg) { + // Export as inkscape SVG. + Inkscape::Extension::save(Inkscape::Extension::db.get("org.inkscape.output.svg.inkscape"), doc, sp_export_inkscape_svg, false, + false, false, Inkscape::Extension::FILE_SAVE_METHOD_INKSCAPE_SVG); + } + return 0; +} + /** * Perform a PDF/PS/EPS export * -- cgit v1.2.3 From 300986fe58897667ba1c41859b5cec2f9e654efa Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sat, 14 Oct 2017 20:05:57 +0200 Subject: Some basic error handling for SVG export --- src/main.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 5f6fc75cf..d934d1d77 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1619,16 +1619,27 @@ static int do_export_svg(SPDocument* doc) } } + int ret = 0; if (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); + try { + 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); + } catch (Inkscape::Extension::Output::save_failed &e) { + g_warning("Failed to save plain SVG to: %s", sp_export_svg); + ret = 1; + } } if (sp_export_inkscape_svg) { // Export as inkscape SVG. - Inkscape::Extension::save(Inkscape::Extension::db.get("org.inkscape.output.svg.inkscape"), doc, sp_export_inkscape_svg, false, - false, false, Inkscape::Extension::FILE_SAVE_METHOD_INKSCAPE_SVG); + try { + Inkscape::Extension::save(Inkscape::Extension::db.get("org.inkscape.output.svg.inkscape"), doc, sp_export_inkscape_svg, false, + false, false, Inkscape::Extension::FILE_SAVE_METHOD_INKSCAPE_SVG); + } catch (Inkscape::Extension::Output::save_failed &e) { + g_warning("Failed to save Inkscape SVG to: %s", sp_export_inkscape_svg); + ret = 1; + } } - return 0; + return ret; } /** -- cgit v1.2.3 From d780e396ddf12f0bb6e96bd99a8c288707016e46 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sat, 14 Oct 2017 20:13:06 +0200 Subject: Cleanup: rename sp_do_export_png for consistency Also actually return non-zero if PNG could not be saved. --- src/main.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index d934d1d77..6ec04675b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -181,7 +181,7 @@ enum { int sp_main_gui(int argc, char const **argv); int sp_main_console(int argc, char const **argv); -static int sp_do_export_png(SPDocument *doc); +static int do_export_png(SPDocument *doc); static int do_export_svg(SPDocument* doc); static int do_export_ps_pdf(SPDocument* doc, gchar const* uri, char const *mime); static int do_export_emf(SPDocument* doc, gchar const* uri, char const *mime); @@ -1095,7 +1095,7 @@ static int sp_process_file_list(std::vector fl) sp_print_document_to_file(doc, sp_global_printer); } if (sp_export_png || (sp_export_id && sp_export_use_hints)) { - retVal |= sp_do_export_png(doc); + retVal |= do_export_png(doc); } if (sp_export_svg || sp_export_inkscape_svg) { retVal |= do_export_svg(doc); @@ -1322,8 +1322,13 @@ do_query_all_recurse (SPObject *o) } } +/** + * Perform a PNG export + * + * \param doc Document to export. + */ -static int sp_do_export_png(SPDocument *doc) +static int do_export_png(SPDocument *doc) { Glib::ustring filename; bool filename_from_hint = false; @@ -1532,12 +1537,10 @@ static int sp_do_export_png(SPDocument *doc) path = filename; } - int retcode = 0; //check if specified directory exists - if (!Inkscape::IO::file_directory_exists(filename.c_str())) { g_warning("File path \"%s\" includes directory that doesn't exist.\n", filename.c_str()); - retcode = 1; + return 1; } else { g_print("Background RRGGBBAA: %08x\n", bgcolor); @@ -1551,13 +1554,15 @@ static int sp_do_export_png(SPDocument *doc) g_print("Bitmap saved as: %s\n", filename.c_str()); } else { g_warning("Bitmap failed to save to: %s", filename.c_str()); + return 1; } } else { g_warning("Calculated bitmap dimensions %lu %lu are out of range (1 - %lu). Nothing exported.", width, height, (unsigned long int)PNG_UINT_31_MAX); + return 1; } } - return retcode; + return 0; } /** -- cgit v1.2.3 From 0519ede69ea1bb876975ae584827fd56d9800dfc Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sat, 14 Oct 2017 20:19:18 +0200 Subject: Do not use GUI for --export-inkscape-svg --- 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 6ec04675b..6e559692c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -731,6 +731,7 @@ main(int argc, char **argv) || !strncmp(argv[i], "--export-png", 12) || !strcmp(argv[i], "-l") || !strncmp(argv[i], "--export-plain-svg", 18) + || !strncmp(argv[i], "--export-inkscape-svg", 21) || !strcmp(argv[i], "-i") || !strncmp(argv[i], "--export-area-drawing", 21) || !strcmp(argv[i], "-D") -- cgit v1.2.3