summaryrefslogtreecommitdiffstats
path: root/src/attributes.h
diff options
context:
space:
mode:
authorThomas Holder <thomas@thomas-holder.de>2018-12-22 20:14:32 +0000
committerThomas Holder <thomas@thomas-holder.de>2018-12-24 12:21:19 +0000
commitbbb920113f84ab5778784dfce40161a8f59cfa59 (patch)
tree0f8ca88addb5dd2220b93d8b7f59d496559a21b2 /src/attributes.h
parentStandard: Cpp11 (diff)
downloadinkscape-bbb920113f84ab5778784dfce40161a8f59cfa59.tar.gz
inkscape-bbb920113f84ab5778784dfce40161a8f59cfa59.zip
sp_attribute_lookup with std::map
- replace linear array search with std::map lookup - remove duplicated name lookup logic in SPStylePropHelper
Diffstat (limited to 'src/attributes.h')
-rw-r--r--src/attributes.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/attributes.h b/src/attributes.h
index 1f0178fae..512c00499 100644
--- a/src/attributes.h
+++ b/src/attributes.h
@@ -564,7 +564,14 @@ enum SPAttributeEnum : unsigned {
SP_PROP_PATH_EFFECT,
};
+/**
+ * Get attribute id by name. Return SP_ATTR_INVALID for invalid names.
+ */
SPAttributeEnum sp_attribute_lookup(gchar const *key);
+
+/**
+ * Get attribute name by id. Return NULL for invalid ids.
+ */
gchar const *sp_attribute_name(SPAttributeEnum id);
#endif