Some small code simplications.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30866 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2009-08-04 23:01:06 +00:00
parent b86942b4f4
commit 3114ce609c
4 changed files with 9 additions and 10 deletions

View File

@ -759,7 +759,7 @@ void Paragraph::Private::latexInset(
column = 0;
}
if (owner_->lookupChange(i).deleted()) {
if (owner_->isDeleted(i)) {
if( ++runparams.inDeletedInset == 1)
runparams.changeOfDeletedInset = owner_->lookupChange(i);
}
@ -848,7 +848,7 @@ void Paragraph::Private::latexInset(
column += os.tellp() - len;
}
if (owner_->lookupChange(i).deleted())
if (owner_->isDeleted(i))
--runparams.inDeletedInset;
}

View File

@ -795,8 +795,8 @@ void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op)
LASSERT(this == cur.text(), /**/);
if (!cur.selection()) {
Change const & change = cur.paragraph().lookupChange(cur.pos());
if (!(change.changed() && findNextChange(&cur.bv())))
bool const changed = cur.paragraph().isChanged(cur.pos());
if (!(changed && findNextChange(&cur.bv())))
return;
}
@ -1356,7 +1356,7 @@ docstring Text::currentState(Cursor const & cur) const
Change change = par.lookupChange(cur.pos());
if (change.type != Change::UNCHANGED) {
if (change.changed()) {
Author const & a = buf.params().authors().get(change.author);
os << _("Change: ") << a.name();
if (!a.email().empty())

View File

@ -2557,10 +2557,9 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
// However, without proper optimizations, this will inevitably
// result in unacceptable performance - just imagine a user who
// wants to select the complete content of a long document.
if (!cur.selection()) {
Change const & change = cur.paragraph().lookupChange(cur.pos());
enable = change.changed();
} else
if (!cur.selection())
enable = cur.paragraph().isChanged(cur.pos());
else
// TODO: context-sensitive enabling of LFUN_CHANGE_ACCEPT/REJECT
// for selections.
enable = true;

View File

@ -191,7 +191,7 @@ void mergeParagraph(BufferParams const & bparams,
// the imaginary end-of-paragraph character (at par.size()) has to be
// marked as unmodified. Otherwise, its change is adopted by the first
// character of the next paragraph.
if (par.lookupChange(par.size()).type != Change::UNCHANGED) {
if (par.isChanged(par.size())) {
LYXERR(Debug::CHANGES,
"merging par with inserted/deleted end-of-par character");
par.setChange(par.size(), Change(Change::UNCHANGED));