diff options
| author | Patrick Storz <eduard.braun2@gmx.de> | 2019-07-22 23:06:21 +0000 |
|---|---|---|
| committer | Patrick Storz <eduard.braun2@gmx.de> | 2019-08-31 14:50:38 +0000 |
| commit | 8f7a3a637f6a465e78e88490a03f539f0d8fdc1a (patch) | |
| tree | e503502036ba4268921ded10a81ab3b4157d89d5 /src/io/file-export-cmd.cpp | |
| parent | Move error classes to Parameter where they belong (diff) | |
| download | inkscape-8f7a3a637f6a465e78e88490a03f539f0d8fdc1a.tar.gz inkscape-8f7a3a637f6a465e78e88490a03f539f0d8fdc1a.zip | |
Refactor a lot of the parameter handling code
Many fixes, improvements and simplifications to existing code.
Implements the first part of the changes discussed in
https://gitlab.com/inkscape/inkscape/issues/333
Diffstat (limited to 'src/io/file-export-cmd.cpp')
| -rw-r--r-- | src/io/file-export-cmd.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/io/file-export-cmd.cpp b/src/io/file-export-cmd.cpp index 9af2d61ac..bf1d72a75 100644 --- a/src/io/file-export-cmd.cpp +++ b/src/io/file-export-cmd.cpp @@ -611,12 +611,12 @@ InkFileExportCmd::do_export_ps_pdf(SPDocument* doc, std::string filename_in, std const gchar *pdfver_param_name = "PDFversion"; if (!export_pdf_level.empty()) { // combine "PDF " and the given command line - std::string version_gui_string = std::string("PDF ") + export_pdf_level; - try{ + std::string version_gui_string = std::string("PDF-") + export_pdf_level; + try { // first, check if the given pdf version is selectable in the ComboBox - if((*i)->get_param_enum_contains("PDFversion", version_gui_string.c_str())) { - (*i)->set_param_enum(pdfver_param_name, version_gui_string.c_str()); - set_export_pdf_version_fail=false; + if ((*i)->get_param_optiongroup_contains("PDFversion", version_gui_string.c_str())) { + (*i)->set_param_optiongroup(pdfver_param_name, version_gui_string.c_str()); + set_export_pdf_version_fail = false; } else { g_warning("Desired PDF export version \"%s\" not supported! Hint: input one of the versions found in the pdf export dialog e.g. \"1.4\".", export_pdf_level.c_str()); @@ -631,7 +631,7 @@ InkFileExportCmd::do_export_ps_pdf(SPDocument* doc, std::string filename_in, std // set default pdf export version to 1.4, also if something went wrong if(set_export_pdf_version_fail) { - (*i)->set_param_enum(pdfver_param_name, "PDF 1.4"); + (*i)->set_param_optiongroup(pdfver_param_name, "PDF-1.4"); } } @@ -642,8 +642,7 @@ InkFileExportCmd::do_export_ps_pdf(SPDocument* doc, std::string filename_in, std export_ps_level = 2; } - (*i)->set_param_enum("PSlevel", (export_ps_level == 3) - ? "PostScript level 3" : "PostScript level 2"); + (*i)->set_param_optiongroup("PSlevel", (export_ps_level == 3) ? "PS3" : "PS2"); } |
