From: johanengelen Date: Wed, 6 Feb 2008 22:41:42 +0000 (+0000) Subject: add extra note of importance to EnumDataConverter and add is_valid_id method X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f543e3486f3e3ffbd7e34f94edf928fa52d1baf2;p=inkscape.git add extra note of importance to EnumDataConverter and add is_valid_id method --- 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;