From 81364db0bc98b01319dc5ecb835a4e37b906bad2 Mon Sep 17 00:00:00 2001 From: Dmitry Zhulanov Date: Sat, 1 Oct 2016 13:05:10 +0700 Subject: disable xverb feature if WITH_YAML defined (bzr r15136.1.9) --- src/main-cmdlinexact.cpp | 10 ++++++++-- src/main.cpp | 15 +++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/main-cmdlinexact.cpp b/src/main-cmdlinexact.cpp index a3c9436bd..3dc83bc8f 100644 --- a/src/main-cmdlinexact.cpp +++ b/src/main-cmdlinexact.cpp @@ -52,7 +52,10 @@ #include #include "main-cmdlinexact.h" +#ifdef WITH_YAML #include "yaml.h" +#endif // WITH_YAML + #include "extension/system.h" #include "file.h" #include @@ -312,6 +315,9 @@ typedef std::list verbs_list_t; void CmdLineXAction::createActionsFromYAML( gchar const *yaml_filename ) { +#ifndef WITH_YAML + return; +#else // WITH_YAML FILE *fh = fopen(yaml_filename, "r"); if(fh == NULL) { printf("Failed to open file!\n"); @@ -409,7 +415,7 @@ CmdLineXAction::createActionsFromYAML( gchar const *yaml_filename ) { verb_info_t verb; verb.xverb = true; verb.args = vectorFromString((char *)token.data.scalar.value); - if ((verb.args.size() > 1) && Verb::getbyid((char *)token.data.scalar.value)) + if ((verb.args.size() > 1) && Verb::getbyid((char *)token.data.scalar.value, false)) verb.xverb = false; verbs_list.push_back(verb); } @@ -529,7 +535,7 @@ CmdLineXAction::createActionsFromYAML( gchar const *yaml_filename ) { } fflush(stdout); - return; +#endif // WITH_YAML } diff --git a/src/main.cpp b/src/main.cpp index d9f11ed8b..5b7dcc5ef 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -229,8 +229,10 @@ static gchar *sp_export_png_utf8 = NULL; static gchar *sp_export_svg_utf8 = NULL; static gchar *sp_global_printer_utf8 = NULL; +#ifdef WITH_YAML static gchar *sp_xverbs_yaml_utf8 = NULL; static gchar *sp_xverbs_yaml = NULL; +#endif // WITH_YAML /** @@ -305,12 +307,12 @@ struct poptOption options[] = { POPT_ARG_STRING, NULL, SP_ARG_FILE, N_("Open specified document(s) (option string may be excluded)"), N_("FILENAME")}, - - {"xverbs", 'B', +#ifdef WITH_YAML + {"xverbs", 0, POPT_ARG_STRING, &sp_xverbs_yaml, SP_ARG_XVERBS, N_("xverbs command"), N_("XVERBS_FILENAME")}, - +#endif // WITH_YAML {"print", 'p', POPT_ARG_STRING, &sp_global_printer, SP_ARG_PRINT, N_("Print document(s) to specified output file (use '| program' for pipe)"), @@ -891,7 +893,9 @@ static int sp_common_main( int argc, char const **argv, GSList **flDest ) fixupSingleFilename( &sp_export_png, &sp_export_png_utf8 ); fixupSingleFilename( &sp_export_svg, &sp_export_svg_utf8 ); fixupSingleFilename( &sp_global_printer, &sp_global_printer_utf8 ); +#ifdef WITH_YAML fixupSingleFilename( &sp_xverbs_yaml, &sp_xverbs_yaml_utf8 ); +#endif // WITH_YAML } else { @@ -901,9 +905,10 @@ static int sp_common_main( int argc, char const **argv, GSList **flDest ) sp_export_svg_utf8 = g_strdup( sp_export_svg ); if ( sp_global_printer ) sp_global_printer_utf8 = g_strdup( sp_global_printer ); +#ifdef WITH_YAML if ( sp_xverbs_yaml ) sp_xverbs_yaml_utf8 = g_strdup( sp_xverbs_yaml ); - +#endif // WITH_YAML } #ifdef WITH_DBUS @@ -2145,6 +2150,7 @@ sp_process_args(poptContext ctx) } break; } +#ifdef WITH_YAML case SP_ARG_XVERBS: { gchar const *fn = poptGetOptArg(ctx); if (fn != NULL) { @@ -2153,6 +2159,7 @@ sp_process_args(poptContext ctx) } break; } +#endif // WITH_YAML case SP_ARG_VERSION: { printf("Inkscape %s (%s)\n", Inkscape::version_string, __DATE__); exit(0); -- cgit v1.2.3