summaryrefslogtreecommitdiffstats
path: root/src/extension/param/enum.cpp
diff options
context:
space:
mode:
authorVinícius dos Santos Oliveira <vini.ipsmaker@gmail.com>2013-06-05 19:03:06 +0000
committerVinícius dos Santos Oliveira <vini.ipsmaker@gmail.com>2013-06-05 19:03:06 +0000
commit4cec6d0c7d401ed0616e91a923a7ec4caf806f3d (patch)
tree4737bd0075f714385a55b0f3d9339211baaecbf9 /src/extension/param/enum.cpp
parentCorrect to compile against recent gtkmm, including updated macports versions.... (diff)
downloadinkscape-4cec6d0c7d401ed0616e91a923a7ec4caf806f3d.tar.gz
inkscape-4cec6d0c7d401ed0616e91a923a7ec4caf806f3d.zip
Add command line option to specify PDF export version. Patch from schwieni.
From the patch's author: Additional command line option added to export to different PDF-versions supported by cairo (currently only "PDF 1.4" and "PDF 1.5"). The user must provide the exact string found in the PDF-export dialog of Inkscape. This feature was previously only accessible via the GUI of Inkscape. This option is useful for people opting for PDF-a conformance in their PDFs. Moreover, the Extension and Parameter classes are extended by setters for enum parameters (used in combo boxes). (bzr r12348)
Diffstat (limited to 'src/extension/param/enum.cpp')
-rw-r--r--src/extension/param/enum.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/extension/param/enum.cpp b/src/extension/param/enum.cpp
index 292e677a7..9cdc05049 100644
--- a/src/extension/param/enum.cpp
+++ b/src/extension/param/enum.cpp
@@ -175,6 +175,24 @@ const gchar *ParamComboBox::set(const gchar * in, SPDocument * /*doc*/, Inkscape
return _value;
}
+/**
+ * function to test if \c guitext is selectable
+ */
+bool ParamComboBox::contains(const gchar * guitext, SPDocument const * /*doc*/, Inkscape::XML::Node const * /*node*/) const
+{
+ if (guitext == NULL) {
+ return false; /* Can't have NULL string */
+ }
+
+ for (GSList * list = choices; list != NULL; list = g_slist_next(list)) {
+ enumentry * entr = reinterpret_cast<enumentry *>(list->data);
+ if ( !entr->guitext.compare(guitext) )
+ return true;
+ }
+ // if we did not find the guitext in this ParamComboBox:
+ return false;
+}
+
void
ParamComboBox::changed (void) {