diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2018-12-22 20:14:32 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2018-12-24 12:21:19 +0000 |
| commit | bbb920113f84ab5778784dfce40161a8f59cfa59 (patch) | |
| tree | 0f8ca88addb5dd2220b93d8b7f59d496559a21b2 /src/attributes.h | |
| parent | Standard: Cpp11 (diff) | |
| download | inkscape-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.h | 7 |
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 |
