summaryrefslogtreecommitdiffstats
path: root/src/util/enums.h
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-02-06 22:41:42 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-02-06 22:41:42 +0000
commit1e65c589308e6176f4b27538f0b58bd75019f8ba (patch)
tree2ad9af3e7c713daf6880429789fb03d112fd52d2 /src/util/enums.h
parent* [INTL: es] Spanish update by Lucas Vieites (closes: #189714) (diff)
downloadinkscape-1e65c589308e6176f4b27538f0b58bd75019f8ba.tar.gz
inkscape-1e65c589308e6176f4b27538f0b58bd75019f8ba.zip
add extra note of importance to EnumDataConverter and add is_valid_id method
(bzr r4671)
Diffstat (limited to 'src/util/enums.h')
-rw-r--r--src/util/enums.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/util/enums.h b/src/util/enums.h
index 909765216..69514b202 100644
--- a/src/util/enums.h
+++ b/src/util/enums.h
@@ -12,7 +12,9 @@
/* IMPORTANT
* When initializing the EnumData struct, you cannot use _(...) to translate strings.
- * Instead, one must use N_(...) and do the translation every time the string is retreived.
+ * Instead, one must use N_(...) and do the translation every time the string is retreived.
+ *
+ * Note that get_id_from_key and get_id_from_label return 0 if it cannot find an entry for that key string
*/
@@ -71,6 +73,11 @@ public:
return false;
}
+ bool is_valid_id(const E e) const
+ {
+ return ( (int)e < end );
+ }
+
const Glib::ustring& get_label(const E e) const
{
return _data[e].label;