-BookmarksSection::Bookmark const & BookmarksSection::bookmark(unsigned int i) const
-{
- return bookmarks[i];
-}
-
-
-void ToolbarSection::read(istream & is)
-{
- string tmp;
- do {
- char c = is.peek();
- if (c == '[')
- break;
- getline(is, tmp);
- if (tmp == "" || tmp[0] == '#' || tmp[0] == ' ')
- continue;
-
- try {
- // Read session info, saved as key/value pairs
- // would better yell if pos returns npos
- size_t pos = tmp.find_first_of(" = ");
- // silently ignore lines without " = "
- if (pos != string::npos) {
- ToolbarItem item;
- item.key = tmp.substr(0, pos);
- int state;
- int location;
- istringstream value(tmp.substr(pos + 3));
- value >> state;
- value >> location;
- value >> item.info.posx;
- value >> item.info.posy;
- item.info.state = ToolbarInfo::State(state);
- item.info.location = ToolbarInfo::Location(location);
- toolbars.push_back(item);
- } else
- LYXERR(Debug::INIT, "LyX: Warning: Ignore toolbar info: " << tmp);
- } catch (...) {
- LYXERR(Debug::INIT, "LyX: Warning: unknown Toolbar info: " << tmp);
- }
- } while (is.good());
- // sort the toolbars by location, line and position
- sort(toolbars.begin(), toolbars.end());
-}
-
-
-void ToolbarSection::write(ostream & os) const