]> git.lyx.org Git - lyx.git/blobdiff - src/Changes.cpp
Get package things working with modules prior to UI patch.
[lyx.git] / src / Changes.cpp
index 6b5979b0bb00115ca351c6e18a7ff3fbdf08aaa7..d0356b8895ead3e34c9ba641f904004d0a73d87e 100644 (file)
 
 #include <boost/assert.hpp>
 
-
-namespace lyx {
-
 using std::abs;
 using std::endl;
 using std::string;
 using std::max;
 
+namespace lyx {
+
 /*
  * Class Change has a changetime field that specifies the exact time at which
  * a specific change was made. The change time is used as a guidance for the
@@ -37,7 +36,7 @@ using std::max;
  * When merging two adjacent changes, the changetime is not considered,
  * only the equality of the change type and author is checked (in method
  * isSimilarTo(...)). If two changes are in fact merged (in method merge()),
- * the later change time is preserved. 
+ * the later change time is preserved.
  */
 
 bool Change::isSimilarTo(Change const & change)
@@ -64,7 +63,7 @@ bool operator==(Change const & l, Change const & r)
        if (l.type == Change::UNCHANGED) {
                return true;
        }
-       
+
        return l.author == r.author &&
               l.changetime == r.changetime;
 }
@@ -222,7 +221,7 @@ void Changes::insert(Change const & change, lyx::pos_type pos)
 Change const & Changes::lookup(pos_type const pos) const
 {
        static Change const noChange = Change(Change::UNCHANGED);
-               
+
        ChangeTable::const_iterator it = table_.begin();
        ChangeTable::const_iterator const end = table_.end();
 
@@ -282,7 +281,7 @@ void Changes::merge()
 
                        (it + 1)->range.start = it->range.start;
                        (it + 1)->change.changetime = max(it->change.changetime,
-                                                         (it + 1)->change.changetime);
+                                                         (it + 1)->change.changetime);
                        table_.erase(it);
                        // start again
                        it = table_.begin();
@@ -314,7 +313,7 @@ int Changes::latexMarkChange(odocstream & os, BufferParams const & bparams,
        if (change.type == Change::DELETED) {
                docstring str = "\\lyxdeleted{" +
                        bparams.authors().get(change.author).name() + "}{" +
-                       chgTime + "}{"; 
+                       chgTime + "}{";
                os << str;
                column += str.size();
        } else if (change.type == Change::INSERTED) {
@@ -357,4 +356,13 @@ void Changes::lyxMarkChange(std::ostream & os, int & column,
 }
 
 
+void Changes::checkAuthors(AuthorList const & authorList)
+{
+       ChangeTable::const_iterator it = table_.begin();
+       ChangeTable::const_iterator endit = table_.end();
+       for ( ; it != endit ; ++it) 
+               if (it->change.type != Change::UNCHANGED)
+                       authorList.get(it->change.author).used(true);
+}
+
 } // namespace lyx