]> git.lyx.org Git - lyx.git/blobdiff - src/author.C
split LyXText::rowlist_ into individual Paragraph::rows_ chunks
[lyx.git] / src / author.C
index aef006e535c5b830f50ffb25d941b2da2c9f3507..9901659948df65fb4d57befb3a1298c6ea589dcf 100644 (file)
 
 #include "author.h"
 
-#include "debug.h"
-
 #include "support/LAssert.h"
 #include "support/LOstream.h"
 #include "support/LIstream.h"
 #include "support/lstrings.h"
 
-using std::endl;
-
-namespace {
-       int cur_id;
-}
-
+using namespace lyx::support;
 
 bool operator==(Author const & l, Author const & r)
 {
@@ -44,11 +37,16 @@ std::istream & operator>>(std::istream & is, Author & a)
        getline(is, s);
        a.name_ = trim(token(s, '\"', 1));
        a.email_ = trim(token(s, '\"', 2));
-       lyxerr << "Read name " << a.name_ << " email " << a.email_ << endl;
        return is;
 }
 
 
+AuthorList::AuthorList()
+       : last_id_(0)
+{
+}
+
+
 int AuthorList::record(Author const & a)
 {
        Authors::const_iterator it(authors_.begin());
@@ -59,16 +57,14 @@ int AuthorList::record(Author const & a)
                        return it->first;
        }
 
-       lyxerr[Debug::CHANGES] << "Adding author " << a << endl;
-
-       authors_[cur_id++] = a;
-       return cur_id - 1;
+       authors_[last_id_++] = a;
+       return last_id_ - 1;
 }
 
 
 void AuthorList::record(int id, Author const & a)
 {
-       lyx::Assert(id < authors_.size());
+       Assert(unsigned(id) < authors_.size());
 
        authors_[id] = a;
 }
@@ -77,7 +73,7 @@ void AuthorList::record(int id, Author const & a)
 Author const & AuthorList::get(int id)
 {
        Authors::const_iterator it(authors_.find(id));
-       lyx::Assert(it != authors_.end());
+       Assert(it != authors_.end());
        return it->second;
 }