From: Michael Schmitt Date: Fri, 6 Oct 2006 19:59:41 +0000 (+0000) Subject: Change tracking: X-Git-Tag: 1.6.10~12446 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=238b880c224150a892c6358a0c2af07caecdad7b;p=features.git Change tracking: Remove methods * trackChanges(...) * untrackChanges(...) * cleanChanges(...) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15262 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/CutAndPaste.C b/src/CutAndPaste.C index 1d44755fd8..846c4041fb 100644 --- a/src/CutAndPaste.C +++ b/src/CutAndPaste.C @@ -82,7 +82,9 @@ class resetParagraph : public std::unary_function { public: resetParagraph(Buffer const & b) : buffer_(b) {} void operator()(Paragraph & p) const { - p.cleanChanges(); + // FIXME: change tracking (MG) + // set p's text to INSERTED in CT mode; clear CT info otherwise + // ERT paragraphs have the Language latex_language. // This is invalid outside of ERT, so we need to change it // to the buffer language. @@ -209,9 +211,8 @@ pasteSelectionHelper(LCursor & cur, ParagraphList const & parlist, tmpbuf->erase(i--); } - // reset change tracking status // FIXME: Change tracking (MG) - // tmpbuf->cleanChanges(Paragraph::trackingOn/Off); + // set tmpbuf's text to INSERTED in CT mode; clear CT info otherwise } bool const empty = pars[pit].empty(); diff --git a/src/insets/insettext.C b/src/insets/insettext.C index caf81d05ae..35d229d798 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -321,10 +321,11 @@ void InsetText::markNew(bool track_changes) ParagraphList::iterator pit = paragraphs().begin(); ParagraphList::iterator end = paragraphs().end(); for (; pit != end; ++pit) { - if (track_changes) - pit->trackChanges(); - else // no-op when not tracking - pit->cleanChanges(); + // FIXME: change tracking (MG) + // if (track_changes) + // set pit's text to UNCHANGED + // else + // set pit's text to INSERTED in CT mode; reset CT info otherwise } } diff --git a/src/paragraph.C b/src/paragraph.C index aac2e0128d..eafe3ce560 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -1417,24 +1417,6 @@ void Paragraph::setContentsFromPar(Paragraph const & par) } -void Paragraph::trackChanges(Change::Type type) -{ - pimpl_->trackChanges(type); -} - - -void Paragraph::untrackChanges() -{ - pimpl_->untrackChanges(); -} - - -void Paragraph::cleanChanges(ChangeTracking ct) -{ - pimpl_->cleanChanges(ct); -} - - Change const Paragraph::lookupChange(lyx::pos_type pos) const { BOOST_ASSERT(pos <= size()); diff --git a/src/paragraph.h b/src/paragraph.h index c5b4270c32..d7a6a2841f 100644 --- a/src/paragraph.h +++ b/src/paragraph.h @@ -204,15 +204,6 @@ public: /// InsetBibitem * bibitem() const; // ale970302 - /// initialise tracking for this par - void trackChanges(Change::Type = Change::UNCHANGED); - - /// stop tracking - void untrackChanges(); - - /// set entire paragraph to new text for change tracking - void cleanChanges(ChangeTracking ct = trackingUnknown); - /// look up change at given pos Change const lookupChange(lyx::pos_type pos) const; diff --git a/src/paragraph_funcs.C b/src/paragraph_funcs.C index 3d4421bd04..f50f0d60a2 100644 --- a/src/paragraph_funcs.C +++ b/src/paragraph_funcs.C @@ -186,11 +186,10 @@ void breakParagraph(BufferParams const & bparams, // subtle, but needed to get empty pars working right if (bparams.trackChanges) { // FIXME: Change tracking (MG) - if (!par.size()) { - par.cleanChanges(); - } else if (!tmp->size()) { - tmp->cleanChanges(); - } + // if (!par.size()) + // set 'par' text to INSERTED in CT mode; clear CT info otherwise + // else if (!tmp->size()) + // set 'tmp' text to INSERTED in CT mode; clear CT info otherwise } } diff --git a/src/paragraph_pimpl.C b/src/paragraph_pimpl.C index f4e77fc8c4..2fe007d7db 100644 --- a/src/paragraph_pimpl.C +++ b/src/paragraph_pimpl.C @@ -90,45 +90,6 @@ void Paragraph::Pimpl::setContentsFromPar(Paragraph const & par) } -void Paragraph::Pimpl::trackChanges(Change::Type type) -{ - if (tracking()) { - lyxerr[Debug::CHANGES] << "already tracking for par " << id_ << endl; - return; - } - - lyxerr[Debug::CHANGES] << "track changes for par " - << id_ << " type " << type << endl; - changes_.reset(new Changes(type)); - changes_->set(type, 0, size() + 1); -} - - -void Paragraph::Pimpl::untrackChanges() -{ - changes_.reset(0); -} - - -void Paragraph::Pimpl::cleanChanges(Paragraph::ChangeTracking ct) -{ - // if the paragraph was not tracked and we don't know the buffer's - // change tracking state, we do nothing - if ((ct == Paragraph::trackingUnknown) && !tracking()) - return; - - // untrack everything if we are in a buffer where ct is disabled - else if (ct == Paragraph::trackingOff) { - untrackChanges(); - return; - } - - // in a buffer where ct is enabled, set everything to INSERTED - changes_.reset(new Changes(Change::INSERTED)); - changes_->set(Change::INSERTED, 0, size() + 1); -} - - bool Paragraph::Pimpl::isChanged(pos_type start, pos_type end) const { if (!tracking()) diff --git a/src/paragraph_pimpl.h b/src/paragraph_pimpl.h index f24c36dbf8..5fe2da5565 100644 --- a/src/paragraph_pimpl.h +++ b/src/paragraph_pimpl.h @@ -38,12 +38,6 @@ public: // // Change tracking // - /// set tracking mode - void trackChanges(Change::Type type = Change::UNCHANGED); - /// stop tracking - void untrackChanges(); - /// set all text as new for change mode - void cleanChanges(Paragraph::ChangeTracking ct = Paragraph::trackingUnknown); /// look up change at given pos Change const lookupChange(lyx::pos_type pos) const; /// is there a change within the given range ? diff --git a/src/text.C b/src/text.C index 67ef060a8d..b7eccfcadb 100644 --- a/src/text.C +++ b/src/text.C @@ -325,11 +325,8 @@ void readParToken(Buffer const & buf, Paragraph & par, LyXLex & lex, par.insertInset(par.size(), new InsetPagebreak, font, change); } else if (token == "\\change_unchanged") { // Hack ! Needed for empty paragraphs :/ - // FIXME: is it still ?? - /* - if (!par.size()) - par.cleanChanges(); - */ + // FIXME: change tracking (MG) + // set empty 'par' to INSERTED??? change = Change(Change::UNCHANGED); } else if (token == "\\change_inserted") { lex.eatLine();