summaryrefslogtreecommitdiffstats
path: root/src/extension/param/parameter.cpp
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2017-02-13 21:35:48 +0000
committerEduard Braun <eduard.braun2@gmx.de>2017-02-13 21:35:48 +0000
commit435717a3469ebb96ce8b8d30fc50d6151f9cbfbb (patch)
tree0ad0d3ef7ccfeba320eca7564d0ad140be183245 /src/extension/param/parameter.cpp
parentCMake: Include GSettings schemas into Windows installation (diff)
downloadinkscape-435717a3469ebb96ce8b8d30fc50d6151f9cbfbb.tar.gz
inkscape-435717a3469ebb96ce8b8d30fc50d6151f9cbfbb.zip
Extensions: Do not require name for pure UI elements (i.e. parameters that do not store a value and therefore do not need to have a name)
(bzr r15515)
Diffstat (limited to 'src/extension/param/parameter.cpp')
-rw-r--r--src/extension/param/parameter.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/extension/param/parameter.cpp b/src/extension/param/parameter.cpp
index c8b30863b..9fbe662f7 100644
--- a/src/extension/param/parameter.cpp
+++ b/src/extension/param/parameter.cpp
@@ -50,10 +50,17 @@ Parameter *Parameter::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Ex
const char *name = in_repr->attribute("name");
const char *type = in_repr->attribute("type");
- // In this case we just don't have enough information
- if (!name || !type) {
+ // we can't create a parameter without type
+ if (!type) {
return NULL;
}
+ // also require name unless it's a pure UI element that does not store its value
+ if (!name) {
+ static std::vector<std::string> ui_elements = {"description"};
+ if (std::find(ui_elements.begin(), ui_elements.end(), type) == ui_elements.end()) {
+ return NULL;
+ }
+ }
const char *guitext = in_repr->attribute("gui-text");
if (guitext == NULL) {