]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/TocModel.cpp
do what the FIXME suggested
[lyx.git] / src / frontends / qt4 / TocModel.cpp
index 24bcf728780cfe413ecde79a256c88b72ce8a1be..2f8fadc5039b8e40e7ab144f3f52272a003856d7 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * \file GuiTocDialog.C
+ * \file TocModel.cpp
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
 
 #include "TocModel.h"
 
-#include "debug.h"
+#include "support/debug.h"
 
+#include <boost/assert.hpp>
 #include <climits>
 
-#include <vector>
-#include <string>
-
-using std::endl;
-using std::pair;
-using std::map;
-using std::vector;
-using std::string;
-using std::make_pair;
-using std::max;
-using std::min;
+using namespace std;
 
 namespace lyx {
 namespace frontend {
@@ -107,10 +98,8 @@ void TocModel::populate(Toc const & toc)
                toc_map_.insert( TocPair(top_level_item, iter) );
                model_map_[iter] = top_level_item;
 
-               LYXERR(Debug::GUI)
-                       << "Toc: at depth " << iter->depth()
-                       << ", added item " << to_utf8(iter->str())
-                       << endl;
+               LYXERR(Debug::GUI, "Toc: at depth " << iter->depth()
+                       << ", added item " << to_utf8(iter->str()));
 
                populate(iter, end, top_level_item);
 
@@ -125,9 +114,8 @@ void TocModel::populate(Toc const & toc)
 }
 
 
-void TocModel::populate(TocIterator & iter,
-                                               TocIterator const & end,
-                                               QModelIndex const & parent)
+void TocModel::populate(TocIterator & iter, TocIterator const & end,
+       QModelIndex const & parent)
 {
        int curdepth = iter->depth() + 1;
 
@@ -165,7 +153,7 @@ void TocModel::populate(TocIterator & iter,
 }
 
 
-int TocModel::modelDepth()
+int TocModel::modelDepth() const
 {
        return maxdepth_ - mindepth_;
 }