]> git.lyx.org Git - lyx.git/blobdiff - src/DepTable.C
Fix working of the spellchecker dialog with ispell when there are no
[lyx.git] / src / DepTable.C
index 8af0420aaf24255fb78069f60bce754c0405e432..132419b920b4c92007c9b6e1c636c8414bcec27d 100644 (file)
@@ -3,9 +3,9 @@
  * 
  *           LyX, The Document Processor
  *          Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2000 The LyX Team.
+ *           Copyright 1995-2001 The LyX Team.
  *
- *           This file is Copyright 1996-2000
+ *           This file is Copyright 1996-2001
  *           Lars Gullik Bjønnes
  *
  * ====================================================== 
@@ -20,7 +20,9 @@
 #include "DepTable.h"
 #include "support/lyxlib.h"
 #include "support/filetools.h"
+#include "support/lstrings.h"
 #include <fstream>
+#include "debug.h"
 
 using std::make_pair;
 using std::ofstream;
@@ -46,14 +48,14 @@ void DepTable::insert(string const & fi,
 
 void DepTable::update()
 {
-       for(DepList::iterator itr = deplist.begin();
+       for (DepList::iterator itr = deplist.begin();
            itr != deplist.end();
            ++itr) {
-               unsigned long const one = (*itr).second.second;
-               unsigned long const two = lyx::sum((*itr).first);
-               (*itr).second = make_pair(one, two);
+               unsigned long const one = itr->second.second;
+               unsigned long const two = lyx::sum(itr->first);
+               itr->second = make_pair(one, two);
                if (lyxerr.debugging(Debug::DEPEND)) {
-                       lyxerr << "Update dep: " << (*itr).first << " "
+                       lyxerr << "Update dep: " << itr->first << " "
                               << one << " " << two;
                        if (one != two)
                                lyxerr << " +";
@@ -68,7 +70,7 @@ bool DepTable::sumchange() const
        for (DepList::const_iterator cit = deplist.begin();
             cit != deplist.end();
             ++cit) {
-               if ((*cit).second.first != (*cit).second.second) return true;
+               if ((*cit).second.first != cit->second.second) return true;
        }
        return false;
 }
@@ -80,8 +82,8 @@ bool DepTable::haschanged(string const & f) const
        string fil = MakeAbsPath(f);
        DepList::const_iterator cit = deplist.find(fil);
        if (cit != deplist.end()) {
-               if ((*cit).second.first != (*cit).second.second
-                   && (*cit).second.second != 0)
+               if (cit->second.first != cit->second.second
+                   && cit->second.second != 0)
                        return true;
        }
        return false;
@@ -93,8 +95,8 @@ bool DepTable::extchanged(string const & ext) const
        for (DepList::const_iterator cit = deplist.begin();
             cit != deplist.end();
             ++cit) {
-               if (suffixIs((*cit).first, ext)) {
-                       if ((*cit).second.first != (*cit).second.second)
+               if (suffixIs(cit->first, ext)) {
+                       if (cit->second.first != cit->second.second)
                                return true;
                }
        }
@@ -113,10 +115,11 @@ bool DepTable::exist(string const & fil) const
 void DepTable::remove_files_with_extension(string const & suf)
 {
        DepList tmp;
-       for (DepList::const_iterator cit = deplist.begin();
+       // we want const_iterator (Lgb)
+       for (DepList::iterator cit = deplist.begin();
             cit != deplist.end(); ++cit) {
-               if (!suffixIs((*cit).first, suf))
-                       tmp[(*cit).first] = (*cit).second;
+               if (!suffixIs(cit->first, suf))
+                       tmp[cit->first] = cit->second;
        }
        deplist.swap(tmp);
 }
@@ -129,13 +132,13 @@ void DepTable::write(string const & f) const
             cit != deplist.end(); ++cit) {
                if (lyxerr.debugging(Debug::DEPEND)) {
                        lyxerr << "Write dep: "
-                              << (*cit).first << " "
-                              << (*cit).second.first << " "
-                              << (*cit).second.second << endl;
+                              << cit->first << " "
+                              << cit->second.first << " "
+                              << cit->second.second << endl;
                }
-               ofs << (*cit).first << " "
-                   << (*cit).second.first << " "
-                   << (*cit).second.second << endl;
+               ofs << cit->first << " "
+                   << cit->second.first << " "
+                   << cit->second.second << endl;
        }
 }