Remove the unclear FuncStatus::operator|=. Without knowing the internals of FuncStatus it is unsafe to use this operator, so let's not use it.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34161 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2010-04-16 12:15:27 +00:00
parent 3417702346
commit 5a77a063c1
4 changed files with 3 additions and 15 deletions

View File

@ -1121,15 +1121,13 @@ bool BufferView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
Inset * inset = editedInset(name); Inset * inset = editedInset(name);
if (inset) { if (inset) {
FuncRequest fr(LFUN_INSET_MODIFY, cmd.argument()); FuncRequest fr(LFUN_INSET_MODIFY, cmd.argument());
FuncStatus fs; if (!inset->getStatus(cur, fr, flag)) {
if (!inset->getStatus(cur, fr, fs)) {
// Every inset is supposed to handle this // Every inset is supposed to handle this
LASSERT(false, break); LASSERT(false, break);
} }
flag |= fs;
} else { } else {
FuncRequest fr(LFUN_INSET_INSERT, cmd.argument()); FuncRequest fr(LFUN_INSET_INSERT, cmd.argument());
flag |= lyx::getStatus(fr); flag = lyx::getStatus(fr);
} }
break; break;
} }

View File

@ -28,14 +28,6 @@ void FuncStatus::clear()
} }
void FuncStatus::operator|=(FuncStatus const & f)
{
v_ |= f.v_;
if (!f.message_.empty())
message_ = f.message_;
}
void FuncStatus::setUnknown(bool b) void FuncStatus::setUnknown(bool b)
{ {
if (b) if (b)

View File

@ -52,8 +52,6 @@ public:
/// ///
void clear(); void clear();
/// ///
void operator|=(FuncStatus const & f);
///
void setUnknown(bool b); void setUnknown(bool b);
/// ///
bool unknown() const; bool unknown() const;

View File

@ -1401,7 +1401,7 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
GuiToc * toc = static_cast<GuiToc*>(findOrBuild("toc", false)); GuiToc * toc = static_cast<GuiToc*>(findOrBuild("toc", false));
FuncStatus fs; FuncStatus fs;
if (toc->getStatus(documentBufferView()->cursor(), cmd, fs)) if (toc->getStatus(documentBufferView()->cursor(), cmd, fs))
flag |= fs; flag = fs;
else else
flag.setEnabled(false); flag.setEnabled(false);
return true; return true;