]> git.lyx.org Git - lyx.git/blobdiff - src/Session.cpp
Free line setting in tabulars. FILE FORMAT CHANGE.
[lyx.git] / src / Session.cpp
index faaabf17f8d30674f380adc6711e6d5823203ad4..9291ef1c2213bfcd974a4a992544446915bee8fe 100644 (file)
 #include <config.h>
 
 #include "Session.h"
-#include "debug.h"
-#include "support/Package.h"
+
+#include "support/debug.h"
 #include "support/filetools.h"
+#include "support/Package.h"
 
 #include <fstream>
 #include <sstream>
 #include <algorithm>
 #include <iterator>
 
-using lyx::support::absolutePath;
-using lyx::support::addName;
-using lyx::support::FileName;
-using lyx::support::package;
-
-using std::vector;
-using std::getline;
-using std::string;
-using std::ifstream;
-using std::ofstream;
-using std::istream;
-using std::ostream;
-using std::endl;
-using std::istringstream;
-using std::copy;
-using std::find;
-using std::ostream_iterator;
+using namespace std;
+using namespace lyx::support;
 
 namespace {
 
@@ -53,6 +39,7 @@ string const sec_toolbars = "[toolbars]";
 
 namespace lyx {
 
+
 LastFilesSection::LastFilesSection(unsigned int num) :
        default_num_last_files(4),
        absolute_max_last_files(100)
@@ -69,11 +56,11 @@ void LastFilesSection::read(istream & is)
                if (c == '[')
                        break;
                getline(is, tmp);
-               if (tmp == "" || tmp[0] == '#' || tmp[0] == ' ' || !absolutePath(tmp))
+               FileName const file(tmp);
+               if (tmp == "" || tmp[0] == '#' || tmp[0] == ' ' || !file.isAbsolute())
                        continue;
 
                // read lastfiles
-               FileName const file(tmp);
                if (file.exists() && !file.isDirectory()
                    && lastfiles.size() < num_lastfiles)
                        lastfiles.push_back(file);
@@ -123,10 +110,10 @@ void LastOpenedSection::read(istream & is)
                if (c == '[')
                        break;
                getline(is, tmp);
-               if (tmp == "" || tmp[0] == '#' || tmp[0] == ' ' || !absolutePath(tmp))
+               FileName const file(tmp);
+               if (tmp == "" || tmp[0] == '#' || tmp[0] == ' ' || !file.isAbsolute())
                        continue;
 
-               FileName const file(tmp);
                if (file.exists() && !file.isDirectory())
                        lastopened.push_back(file);
                else
@@ -177,9 +164,9 @@ void LastFilePosSection::read(istream & is)
                        itmp >> filepos.pos;
                        itmp.ignore(2);  // ignore ", "
                        getline(itmp, fname);
-                       if (!absolutePath(fname))
-                               continue;
                        FileName const file(fname);
+                       if (!file.isAbsolute())
+                               continue;
                        if (file.exists() && !file.isDirectory()
                            && lastfilepos.size() < num_lastfilepos)
                                lastfilepos[file] = filepos;
@@ -254,9 +241,9 @@ void BookmarksSection::read(istream & is)
                        itmp >> pos;
                        itmp.ignore(2);  // ignore ", "
                        getline(itmp, fname);
-                       if (!absolutePath(fname))
-                               continue;
                        FileName const file(fname);
+                       if (!file.isAbsolute())
+                               continue;
                        // only load valid bookmarks
                        if (file.exists() && !file.isDirectory() && idx <= max_bookmarks)
                                bookmarks[idx] = Bookmark(file, pit, pos, 0, 0);
@@ -340,7 +327,7 @@ void ToolbarSection::read(istream & is)
                }
        } while (is.good());
        // sort the toolbars by location, line and position
-       std::sort(toolbars.begin(), toolbars.end());
+       sort(toolbars.begin(), toolbars.end());
 }