if (&(*it) == ptr) {
// this is basically BufferView::saveBookmark(0)
LyX::ref().session().bookmarks().save(
- FileName(buf->fileName()),
+ FileName(buf->absFileName()),
it.bottom().pit(),
it.bottom().pos(),
it.paragraph().id(),
}
-bool EmbeddedFiles::readManifest(Lexer & lex, ErrorList & errorList)
-{
- int line = -1;
- int begin_manifest_line = -1;
-
- file_list_.clear();
- string filename;
- string inzipName;
- bool embedded = false;
-
- while (lex.isOK()) {
- lex.next();
- string const token = lex.getString();
-
- if (token.empty())
- continue;
-
- if (token == "\\end_manifest")
- break;
-
- ++line;
- if (token == "\\begin_manifest") {
- begin_manifest_line = line;
- continue;
- }
-
- LYXERR(Debug::PARSER) << "Handling document manifest token: `"
- << token << '\'' << endl;
-
- if (token == "\\filename")
- lex >> filename;
- else if (token == "\\inzipName")
- lex >> inzipName;
- else if (token == "\\embed") {
- lex >> embedded;
- registerFile(filename, embedded, NULL, inzipName);
- filename = "";
- inzipName = "";
- } else {
- docstring const s = _("\\begin_file is missing");
- errorList.push_back(ErrorItem(_("Manifest error"),
- s, -1, 0, 0));
- }
- }
- if (begin_manifest_line) {
- docstring const s = _("\\begin_manifest is missing");
- errorList.push_back(ErrorItem(_("Manifest error"),
- s, -1, 0, 0));
- }
- return true;
-}
-
-
-void EmbeddedFiles::writeManifest(ostream & os) const
-{
- EmbeddedFiles::EmbeddedFileList::const_iterator it = begin();
- EmbeddedFiles::EmbeddedFileList::const_iterator it_end = end();
- for (; it != it_end; ++it) {
- // only saved 'extra' files. Other embedded files are saved
- // with insets.
- if (!it->valid() || it->refCount() > 0)
- continue;
- // save the relative path
- os << "\\filename "
- << to_utf8(makeRelPath(from_utf8(it->absFilename()),
- from_utf8(buffer_->filePath()))) << '\n'
- << "\\inzipName " << it->inzipName() << '\n'
- << "\\embed " << (it->embedded() ? "true" : "false") << '\n';
- }
-}
-
-
void EmbeddedFiles::updateInsets() const
{
EmbeddedFiles::EmbeddedFileList::const_iterator it = begin();