]> git.lyx.org Git - features.git/commitdiff
change tracking:
authorMichael Schmitt <michael.schmitt@teststep.org>
Fri, 20 Oct 2006 15:27:11 +0000 (15:27 +0000)
committerMichael Schmitt <michael.schmitt@teststep.org>
Fri, 20 Oct 2006 15:27:11 +0000 (15:27 +0000)
* src/changes.h:
* src/changes.C: remove constructor, destructor,
copy constructor, reset(), and field empty_type_
* src/paragraph_pimpl.C: comment out unwanted code

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15411 a592a061-630c-0410-9148-cb99ea01b6c8

src/changes.C
src/changes.h
src/paragraph_pimpl.C

index 03e7b6e82c865c2aed5f027531457a8c818aa841..4bc21da597514f70029992e07e5b8a2e41de85fa 100644 (file)
@@ -68,23 +68,6 @@ bool Changes::Range::intersects(Range const & r) const
 }
 
 
-Changes::Changes(Change::Type const type)
-       : empty_type_(type)
-{
-}
-
-
-Changes::~Changes()
-{
-}
-
-
-Changes::Changes(Changes const & c)
-{
-       table_ = c.table_;
-}
-
-
 void Changes::record(Change const & change, pos_type const pos)
 {
        if (lyxerr.debugging(Debug::CHANGES)) {
@@ -289,12 +272,6 @@ void Changes::add(Change const & change, ChangeTable::size_type const pos)
 
 Change const Changes::lookup(pos_type const pos) const
 {
-       if (!table_.size()) {
-               if (lyxerr.debugging(Debug::CHANGES))
-                       lyxerr[Debug::CHANGES] << "Empty, type is " << empty_type_ << endl;
-               return Change(empty_type_);
-       }
-
        ChangeTable::const_iterator it = table_.begin();
        ChangeTable::const_iterator const end = table_.end();
 
@@ -308,14 +285,8 @@ Change const Changes::lookup(pos_type const pos) const
 }
 
 
-bool Changes::isChange(pos_type const start, pos_type const end) const
+bool Changes::isChanged(pos_type const start, pos_type const end) const
 {
-       if (!table_.size()) {
-               if (lyxerr.debugging(Debug::CHANGES))
-                       lyxerr[Debug::CHANGES] << "Empty, type is " << empty_type_ << endl;
-               return empty_type_ != Change::UNCHANGED;
-       }
-
        ChangeTable::const_iterator it = table_.begin();
        ChangeTable::const_iterator const itend = table_.end();
 
index 6e34a5ab57b441c171527e4520f4e1a043ca5e00..277308b43f0c6a548f0c7e3e765f429f737c0767 100644 (file)
@@ -45,21 +45,8 @@ bool operator!=(Change const & l, Change const & r);
 
 class Changes {
 public:
-
-       Changes(Change::Type type);
-
-       ~Changes();
-
-       Changes(Changes const &);
-
-       /// reset "default" change type (for empty pars)
-       void reset(Change::Type type) {
-               empty_type_ = type;
-       }
-
        /// set the pos to the given change
        void set(Change const & change, lyx::pos_type pos);
-
        /// set the range to the given change
        void set(Change const & change, lyx::pos_type start, lyx::pos_type end);
 
@@ -70,7 +57,7 @@ public:
        Change const lookup(lyx::pos_type pos) const;
 
        /// return true if there is a change in the given range
-       bool isChange(lyx::pos_type start, lyx::pos_type end) const;
+       bool isChanged(lyx::pos_type start, lyx::pos_type end) const;
 
        /// remove the given entry. This implies that a character was
        /// deleted at pos, and will adjust all range bounds past it
@@ -120,9 +107,6 @@ private:
        /// our table of changes, every row a range and change descriptor
        ChangeTable table_;
 
-       /// change type for an empty paragraph
-       Change::Type empty_type_;
-
        /// handle a delete, either logical or physical (see erase)
        void del(Change const & change, ChangeTable::size_type pos);
 
index 056bfb4eb00a5690cefed6bb082a231d0a6a1a81..4993e540bccb3a7740031c1f404a783923637131 100644 (file)
@@ -77,8 +77,9 @@ Paragraph::Pimpl::Pimpl(Pimpl const & p, Paragraph * owner)
        fontlist = p.fontlist;
        id_ = paragraph_id++;
 
-       if (p.tracking())
-               changes_.reset(new Changes(*p.changes_.get()));
+       // FIXME: change tracking (MG)
+       //if (p.tracking())
+       //              changes_.reset(new Changes(*p.changes_.get()));
 }
 
 
@@ -86,7 +87,8 @@ void Paragraph::Pimpl::setContentsFromPar(Paragraph const & par)
 {
        owner_->text_ = par.text_;
        if (par.pimpl_->tracking()) {
-               changes_.reset(new Changes(*(par.pimpl_->changes_.get())));
+               // FIXME: change tracking (MG)
+               // changes_.reset(new Changes(*(par.pimpl_->changes_.get())));
        }
 }
 
@@ -97,7 +99,7 @@ bool Paragraph::Pimpl::isChanged(pos_type start, pos_type end) const
        if (!tracking())
                return false;
 
-       return changes_->isChange(start, end);
+       return changes_->isChanged(start, end);
 }
 
 
@@ -141,7 +143,8 @@ void Paragraph::Pimpl::acceptChange(pos_type start, pos_type end)
                return;
 
        if (!size()) {
-               changes_.reset(new Changes(Change::UNCHANGED));
+               // FIXME: change tracking (MG)
+               // changes_.reset(new Changes(Change::UNCHANGED));
                return;
        }
 
@@ -171,7 +174,8 @@ void Paragraph::Pimpl::acceptChange(pos_type start, pos_type end)
        }
 
        lyxerr[Debug::CHANGES] << "endacceptchange" << endl;
-       changes_->reset(Change::UNCHANGED);
+       // FIXME: change tracking (MG)
+       // changes_->reset(Change::UNCHANGED);
 }
 
 
@@ -181,7 +185,8 @@ void Paragraph::Pimpl::rejectChange(pos_type start, pos_type end)
                return;
 
        if (!size()) {
-               changes_.reset(new Changes(Change::UNCHANGED));
+               // FIXME: change tracking (MG)
+               // changes_.reset(new Changes(Change::UNCHANGED));
                return;
        }
 
@@ -210,7 +215,8 @@ void Paragraph::Pimpl::rejectChange(pos_type start, pos_type end)
                                break;
                }
        }
-       changes_->reset(Change::UNCHANGED);
+       // FIXME: change tracking (MG)
+       // changes_->reset(Change::UNCHANGED);
 }