X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FFuncStatus.C;h=2f0cf8e064bd3792cc37e6bdd91fd2c595f7f247;hb=61133c4b5625993f600ffa7d209c3e2bc28d26f6;hp=1998db67d1d0a9f81311606931c334c578d9137e;hpb=5c3d9a254640468e40b2d30467a26222c91d856d;p=lyx.git diff --git a/src/FuncStatus.C b/src/FuncStatus.C index 1998db67d1..2f0cf8e064 100644 --- a/src/FuncStatus.C +++ b/src/FuncStatus.C @@ -12,6 +12,8 @@ #include "FuncStatus.h" +using std::string; + FuncStatus::FuncStatus() : v_(OK) { } @@ -20,12 +22,15 @@ FuncStatus::FuncStatus() : v_(OK) void FuncStatus::clear() { v_ = OK; + message_.erase(); } void FuncStatus::operator|=(FuncStatus const & f) { v_ |= f.v_; + if (!f.message_.empty()) + message_ = f.message_; } @@ -45,18 +50,18 @@ bool FuncStatus::unknown() const } -void FuncStatus::disabled(bool b) +void FuncStatus::enabled(bool b) { if (b) - v_ |= DISABLED; - else v_ &= !DISABLED; + else + v_ |= DISABLED; } -bool FuncStatus::disabled() const +bool FuncStatus::enabled() const { - return (v_ & DISABLED); + return !(v_ & DISABLED); } @@ -73,3 +78,15 @@ bool FuncStatus::onoff(bool b) const else return (v_ & OFF); } + + +void FuncStatus::message(string const & m) +{ + message_ = m; +} + + +string const & FuncStatus::message() const +{ + return message_; +}