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

View File

@ -795,8 +795,8 @@ void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op)
LASSERT(this == cur.text(), /**/); LASSERT(this == cur.text(), /**/);
if (!cur.selection()) { if (!cur.selection()) {
Change const & change = cur.paragraph().lookupChange(cur.pos()); bool const changed = cur.paragraph().isChanged(cur.pos());
if (!(change.changed() && findNextChange(&cur.bv()))) if (!(changed && findNextChange(&cur.bv())))
return; return;
} }
@ -1356,7 +1356,7 @@ docstring Text::currentState(Cursor const & cur) const
Change change = par.lookupChange(cur.pos()); Change change = par.lookupChange(cur.pos());
if (change.type != Change::UNCHANGED) { if (change.changed()) {
Author const & a = buf.params().authors().get(change.author); Author const & a = buf.params().authors().get(change.author);
os << _("Change: ") << a.name(); os << _("Change: ") << a.name();
if (!a.email().empty()) 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 // However, without proper optimizations, this will inevitably
// result in unacceptable performance - just imagine a user who // result in unacceptable performance - just imagine a user who
// wants to select the complete content of a long document. // wants to select the complete content of a long document.
if (!cur.selection()) { if (!cur.selection())
Change const & change = cur.paragraph().lookupChange(cur.pos()); enable = cur.paragraph().isChanged(cur.pos());
enable = change.changed(); else
} else
// TODO: context-sensitive enabling of LFUN_CHANGE_ACCEPT/REJECT // TODO: context-sensitive enabling of LFUN_CHANGE_ACCEPT/REJECT
// for selections. // for selections.
enable = true; 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 // the imaginary end-of-paragraph character (at par.size()) has to be
// marked as unmodified. Otherwise, its change is adopted by the first // marked as unmodified. Otherwise, its change is adopted by the first
// character of the next paragraph. // character of the next paragraph.
if (par.lookupChange(par.size()).type != Change::UNCHANGED) { if (par.isChanged(par.size())) {
LYXERR(Debug::CHANGES, LYXERR(Debug::CHANGES,
"merging par with inserted/deleted end-of-par character"); "merging par with inserted/deleted end-of-par character");
par.setChange(par.size(), Change(Change::UNCHANGED)); par.setChange(par.size(), Change(Change::UNCHANGED));