]> git.lyx.org Git - lyx.git/commitdiff
Some small code simplications.
authorVincent van Ravesteijn <vfr@lyx.org>
Tue, 4 Aug 2009 23:01:06 +0000 (23:01 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Tue, 4 Aug 2009 23:01:06 +0000 (23:01 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30866 a592a061-630c-0410-9148-cb99ea01b6c8

src/Paragraph.cpp
src/Text.cpp
src/Text3.cpp
src/paragraph_funcs.cpp

index 267e2ebfbecafcb99cab3671256088d8fd1c98ff..6f1c408aba621a66bf3bbece0cd359db3b04b7bb 100644 (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;
 }
 
index e75e94c8d1c51fc08a5e654623be7bc578f929ac..73c16f1d775388a8d0b55b05eb13b5e808201d74 100644 (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())
index 18ec4777ede673c72ab0bc88d36b403d575ccfb9..617a3ef6d7665a55bdf201acad70bd7f90ef24be 100644 (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;
index f1f018ddbe39ab12528f6e045071079005c27208..dfc895d1f1285e2da7111f4c1230c617f0b9c6a4 100644 (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));