=== modified file 'src/main.cpp' --- src/main.cpp 2015-11-20 17:34:03 +0000 +++ src/main.cpp 2016-04-19 15:32:31 +0000 @@ -152,6 +152,7 @@ SP_ARG_EXPORT_BACKGROUND, SP_ARG_EXPORT_BACKGROUND_OPACITY, SP_ARG_EXPORT_SVG, + SP_ARG_EXPORT_INKSCAPE_SVG, SP_ARG_EXPORT_PS, SP_ARG_EXPORT_EPS, SP_ARG_EXPORT_PS_LEVEL, @@ -210,6 +211,7 @@ static gboolean sp_export_use_hints = FALSE; static gboolean sp_export_id_only = FALSE; static gchar *sp_export_svg = NULL; +static gchar *sp_export_inkscape_svg = NULL; static gchar *sp_export_ps = NULL; static gchar *sp_export_eps = NULL; static gint sp_export_ps_level = 3; @@ -234,6 +236,7 @@ #endif // WITH_DBUS static gchar *sp_export_png_utf8 = NULL; static gchar *sp_export_svg_utf8 = NULL; +static gchar *sp_export_inkscape_svg_utf8 = NULL; static gchar *sp_global_printer_utf8 = NULL; @@ -258,6 +261,7 @@ sp_export_use_hints = FALSE; sp_export_id_only = FALSE; sp_export_svg = NULL; + sp_export_inkscape_svg = NULL; sp_export_ps = NULL; sp_export_eps = NULL; sp_export_ps_level = 3; @@ -282,6 +286,7 @@ sp_export_png_utf8 = NULL; sp_export_svg_utf8 = NULL; + sp_export_inkscape_svg_utf8 = NULL; sp_global_printer_utf8 = NULL; } @@ -387,6 +392,10 @@ N_("Background opacity of exported bitmap (either 0.0 to 1.0, or 1 to 255)"), N_("VALUE")}, + {"export-inkscape-svg", 0, + POPT_ARG_STRING, &sp_export_inkscape_svg, SP_ARG_EXPORT_INKSCAPE_SVG, + N_("Export document to an inkscape SVG file (similar to save as.)"), + N_("FILENAME")}, {"export-plain-svg", 'l', POPT_ARG_STRING, &sp_export_svg, SP_ARG_EXPORT_SVG, N_("Export document to plain SVG file (no sodipodi or inkscape namespaces)"), @@ -889,6 +898,7 @@ { fixupSingleFilename( &sp_export_png, &sp_export_png_utf8 ); fixupSingleFilename( &sp_export_svg, &sp_export_svg_utf8 ); + fixupSingleFilename( &sp_export_inkscape_svg, &sp_export_inkscape_svg_utf8 ); fixupSingleFilename( &sp_global_printer, &sp_global_printer_utf8 ); } else @@ -897,6 +907,8 @@ sp_export_png_utf8 = g_strdup( sp_export_png ); if ( sp_export_svg ) sp_export_svg_utf8 = g_strdup( sp_export_svg ); + if ( sp_export_inkscape_svg ) + sp_export_inkscape_svg_utf8 = g_strdup( sp_export_inkscape_svg ); if ( sp_global_printer ) sp_global_printer_utf8 = g_strdup( sp_global_printer ); } @@ -1147,11 +1159,16 @@ } #endif // WITH_DBUS - if (!sp_export_svg && (sp_vacuum_defs || has_performed_actions)) { + if (!sp_export_svg && !sp_export_inkscape_svg && (sp_vacuum_defs || has_performed_actions)) { // save under the name given in the command line 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_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); + } if (sp_global_printer) { sp_print_document_to_file(doc, sp_global_printer); }