diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-11-22 19:22:49 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-09 19:10:12 -0300 |
commit | 8a8c0f521c0f2224e8f26e8ad2b5676aaa4ddc69 (patch) | |
tree | 3b79d1e5199f129a0828fecade09de77d16d00ca | |
parent | c79374b5a72959f541fdeb95d7e6b57396ed6b15 (diff) |
Added the 'AbstractMetaField::isModifiedRemoved' method.
-rw-r--r-- | abstractmetalang.cpp | 17 | ||||
-rw-r--r-- | abstractmetalang.h | 2 |
2 files changed, 19 insertions, 0 deletions
diff --git a/abstractmetalang.cpp b/abstractmetalang.cpp index de3451d3d..3dc48fac7 100644 --- a/abstractmetalang.cpp +++ b/abstractmetalang.cpp @@ -1479,6 +1479,23 @@ AbstractMetaField *AbstractMetaField::copy() const return returned; } +/******************************************************************************* + * Indicates that this field has a modification that removes it + */ +bool AbstractMetaField::isModifiedRemoved(int types) const +{ + FieldModificationList mods = modifications(); + foreach (FieldModification mod, mods) { + if (!mod.isRemoveModifier()) + continue; + + if ((mod.removal & types) == types) + return true; + } + + return false; +} + static QString upCaseFirst(const QString &str) { Q_ASSERT(!str.isEmpty()); diff --git a/abstractmetalang.h b/abstractmetalang.h index 333aaf3cb..1f1dc4855 100644 --- a/abstractmetalang.h +++ b/abstractmetalang.h @@ -744,6 +744,8 @@ public: FieldModificationList modifications() const; + bool isModifiedRemoved(int types = TypeSystem::All) const; + using AbstractMetaVariable::setDocumentation; using AbstractMetaVariable::documentation; |