namespace {
-int const LYX_FORMAT = 295; //Uwe: htmlurl, href
+int const LYX_FORMAT = 296; //RGH: InsetInclude changes
} // namespace anon
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
}
}
- // read manifest after header
- embeddedFiles().readManifest(lex, errorList);
// read main text
bool const res = text().read(*this, lex, errorList);
// make a backup if the file already exists
if (lyxrc.make_backup && fs::exists(encodedFilename)) {
backupName = FileName(absFileName() + '~');
- if (!lyxrc.backupdir_path.empty())
+ if (!lyxrc.backupdir_path.empty()) {
+ string const mangledName =
+ subst(subst(os::internal_path(
+ backupName.absFilename()), '/', '!'), ':', '!');
backupName = FileName(addName(lyxrc.backupdir_path,
- subst(os::internal_path(backupName.absFilename()), '/', '!')));
-
+ mangledName));
+ }
try {
fs::copy_file(encodedFilename, backupName.toFilesystemEncoding(), false);
madeBackup = true;
params().writeFile(ofs);
ofs << "\\end_header\n";
- // write the manifest after header
- ofs << "\n\\begin_manifest\n";
- pimpl_->embedded_files.update();
- embeddedFiles().writeManifest(ofs);
- ofs << "\\end_manifest\n";
-
// write the text
ofs << "\n\\begin_body\n";
text().write(*this, ofs);
// Check if the label 'from' appears more than once
vector<docstring> labels;
+ string paramName;
if (code == CITE_CODE) {
BiblioInfo keys;
keys.fillWithBibKeys(this);
for (; bit != bend; ++bit)
// FIXME UNICODE
labels.push_back(bit->first);
- } else
+ paramName = "key";
+ } else {
getLabelList(labels);
+ paramName = "reference";
+ }
if (std::count(labels.begin(), labels.end(), from) > 1)
return;
for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) {
if (it->lyxCode() == code) {
InsetCommand & inset = static_cast<InsetCommand &>(*it);
- inset.replaceContents(to_utf8(from), to_utf8(to));
+ docstring const oldValue = inset.getParam(paramName);
+ if (oldValue == from)
+ inset.setParam(paramName, to);
}
}
}
}
-void Buffer::embeddingChanged() const
-{
- if (gui_)
- gui_->embeddingChanged();
-}
-
-
void Buffer::errors(std::string const & err) const
{
if (gui_)
for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) {
if (it->lyxCode() != INCLUDE_CODE)
continue;
- InsetInclude const & inset = static_cast<InsetInclude const &>(*it);
+ InsetCommand const & inset = static_cast<InsetCommand const &>(*it);
InsetCommandParams const & ip = inset.params();
Buffer * child = loadIfNeeded(*this, ip);
if (!child)