]> git.lyx.org Git - lyx.git/blobdiff - src/FuncStatus.C
hopefully fix tex2lyx linking.
[lyx.git] / src / FuncStatus.C
index 1998db67d1d0a9f81311606931c334c578d9137e..530b8e893a04c0bd35710b699ca7e88d755890b9 100644 (file)
 
 #include "FuncStatus.h"
 
-FuncStatus::FuncStatus() : v_(OK)
+
+namespace lyx {
+
+FuncStatus::FuncStatus()
+       : v_(OK)
 {
 }
 
@@ -20,12 +24,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 +52,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 +80,18 @@ bool FuncStatus::onoff(bool b) const
        else
                return (v_ & OFF);
 }
+
+
+void FuncStatus::message(docstring const & m)
+{
+       message_ = m;
+}
+
+
+docstring const & FuncStatus::message() const
+{
+       return message_;
+}
+
+
+} // namespace lyx