X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fbufferlist.C;h=d38fdc9cf45554ce21a5612db983fd0ea5464c76;hb=c727c6db7f2dd7f6a727462f5d11964888d0e76e;hp=fe6516fa4be836f54552ca53e9110a4d4d340f9b;hpb=b9c604e968bffcd4aacceee87989782f28492f2f;p=lyx.git diff --git a/src/bufferlist.C b/src/bufferlist.C index fe6516fa4b..d38fdc9cf4 100644 --- a/src/bufferlist.C +++ b/src/bufferlist.C @@ -39,7 +39,7 @@ namespace lyx { using support::addName; using support::bformat; -using support::makeAbsPath; +using support::FileName; using support::makeDisplayPath; using support::onlyFilename; using support::removeAutosaveFile; @@ -72,6 +72,30 @@ bool BufferList::empty() const } +BufferList::iterator BufferList::begin() +{ + return bstore.begin(); +} + + +BufferList::const_iterator BufferList::begin() const +{ + return bstore.begin(); +} + + +BufferList::iterator BufferList::end() +{ + return bstore.end(); +} + + +BufferList::const_iterator BufferList::end() const +{ + return bstore.end(); +} + + bool BufferList::quitWriteBuffer(Buffer * buf) { BOOST_ASSERT(buf); @@ -135,7 +159,7 @@ bool BufferList::quitWriteAll() // if master/slave are both open, do not save slave since it // will be automatically loaded when the master is loaded if ((*it)->getMasterBuffer() == (*it)) - LyX::ref().session().lastOpened().add((*it)->fileName()); + LyX::ref().session().lastOpened().add(FileName((*it)->fileName())); } return true; @@ -235,6 +259,14 @@ Buffer * BufferList::first() } +Buffer * BufferList::last() +{ + if (bstore.empty()) + return 0; + return bstore.back(); +} + + Buffer * BufferList::getBuffer(unsigned int const choice) { if (choice >= bstore.size()) @@ -286,7 +318,7 @@ void BufferList::updateIncludedTeXfiles(string const & mastertmpdir, string writefile = mastertmpdir; writefile += '/'; writefile += (*it)->getLatexName(); - (*it)->makeLaTeXFile(writefile, mastertmpdir, + (*it)->makeLaTeXFile(FileName(writefile), mastertmpdir, runparams, false); (*it)->markDepClean(mastertmpdir); } @@ -324,7 +356,7 @@ void BufferList::emergencyWrite(Buffer * buf) string s = buf->fileName(); s += ".emergency"; lyxerr << " " << s << endl; - if (buf->writeFile(s)) { + if (buf->writeFile(FileName(s))) { buf->markClean(); lyxerr << to_utf8(_(" Save seems successful. Phew.")) << endl; return; @@ -337,7 +369,7 @@ void BufferList::emergencyWrite(Buffer * buf) string s = addName(package().home_dir(), buf->fileName()); s += ".emergency"; lyxerr << ' ' << s << endl; - if (buf->writeFile(s)) { + if (buf->writeFile(FileName(s))) { buf->markClean(); lyxerr << to_utf8(_(" Save seems successful. Phew.")) << endl; return; @@ -351,7 +383,7 @@ void BufferList::emergencyWrite(Buffer * buf) s = addName(package().temp_dir(), buf->fileName()); s += ".emergency"; lyxerr << ' ' << s << endl; - if (buf->writeFile(s)) { + if (buf->writeFile(FileName(s))) { buf->markClean(); lyxerr << to_utf8(_(" Save seems successful. Phew.")) << endl; return; @@ -402,7 +434,7 @@ Buffer * BufferList::getBufferFromTmp(string const & s) } -void BufferList::setCurrentAuthor(string const & name, string const & email) +void BufferList::setCurrentAuthor(docstring const & name, docstring const & email) { BufferStorage::iterator it = bstore.begin(); BufferStorage::iterator end = bstore.end();