From 8a8c0f521c0f2224e8f26e8ad2b5676aaa4ddc69 Mon Sep 17 00:00:00 2001 From: Marcelo Lira Date: Mon, 22 Nov 2010 19:22:49 -0300 Subject: Added the 'AbstractMetaField::isModifiedRemoved' method. --- abstractmetalang.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'abstractmetalang.cpp') 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()); -- cgit v1.2.3