Skip to content

Commit ef25625

Browse files
committed
meta_enum::add_values(), removed allow_alias boolean parameter (else
name-value call cannot work in Lua binding)
1 parent 35ad684 commit ef25625

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

lib/programming_examples/Lua/custom_commands.lua

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ menum = gom.meta_types.OGF.MetaEnum.create('Titi')
1616
menum.add_value('tutu',0)
1717
menum.add_value('tata',1)
1818
menum.add_value('toto',2)
19-
-- menum.add_values({tutu=0,tata=1,toto=2})
2019
-- Make new enum visible from GOM type system
2120
gom.bind_meta_type(menum)
2221

@@ -279,5 +278,3 @@ scene_graph.register_grob_commands(gom.meta_types.OGF.SceneGraph, mclass)
279278
-- Your new command classes are a "citizen" of the Graphite Object Model,
280279
-- with the same "rights" as the ones implemented in C++ (can be scripted
281280
-- and invoked from the gui)
282-
283-

src/lib/OGF/gom/reflection/meta_enum.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ namespace OGF {
6969
return true;
7070
}
7171

72-
bool MetaEnum::add_values(const ArgList& values, bool allow_aliases) {
72+
bool MetaEnum::add_values(const ArgList& values) {
73+
bool allow_aliases = false;
7374
bool result = true;
7475
for(index_t i=0; i<values.nb_args(); ++i) {
7576
const std::string& name = values.ith_arg_name(i);

src/lib/OGF/gom/reflection/meta_enum.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ namespace OGF {
150150
* \param[in] values an arglist with name,value pairs
151151
* \return true if the values could be added
152152
* \return false otherwise, that is, one or several values already
153-
* existed in enum and allow_aliases was not set
153+
* existed in enum.
154154
*/
155-
bool add_values(const ArgList& values, bool allow_aliases = false);
155+
bool add_values(const ArgList& values);
156156

157157
private:
158158
struct Value {

0 commit comments

Comments
 (0)