// Do not remove the comment below, so we get merge conflict in
// independent branches. Instead add your own.
-int const LYX_FORMAT = 378; // ps: rev insetinfo
+int const LYX_FORMAT = 381; // vfr: new parameters for xymatrix
typedef map<string, bool> DepClean;
typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
// Should probably be moved to somewhere else: BufferView? GuiView?
bool Buffer::save() const
{
+ // ask if the disk file has been externally modified (use checksum method)
+ if (fileName().exists() && isExternallyModified(checksum_method)) {
+ docstring const file = makeDisplayPath(absFileName(), 20);
+ docstring text = bformat(_("Document %1$s has been externally modified. Are you sure "
+ "you want to overwrite this file?"), file);
+ int const ret = Alert::prompt(_("Overwrite modified file?"),
+ text, 1, 1, _("&Overwrite"), _("&Cancel"));
+ if (ret == 1)
+ return false;
+ }
+
// We don't need autosaves in the immediate future. (Asger)
resetAutosaveTimers();
backupName = FileName(addName(lyxrc.backupdir_path,
mangledName));
}
- if (fileName().copyTo(backupName)) {
+ if (fileName().moveTo(backupName)) {
madeBackup = true;
} else {
Alert::error(_("Backup failure"),
}
}
- // ask if the disk file has been externally modified (use checksum method)
- if (fileName().exists() && isExternallyModified(checksum_method)) {
- docstring const file = makeDisplayPath(absFileName(), 20);
- docstring text = bformat(_("Document %1$s has been externally modified. Are you sure "
- "you want to overwrite this file?"), file);
- int const ret = Alert::prompt(_("Overwrite modified file?"),
- text, 1, 1, _("&Overwrite"), _("&Cancel"));
- if (ret == 1)
- return false;
- }
-
if (writeFile(d->filename)) {
markClean();
return true;
return false;
}
- removeAutosaveFile();
+ // see bug 6587
+ // removeAutosaveFile();
saveCheckSum(d->filename);
message(str + _(" done."));
ErrorList & Buffer::errorList(string const & type) const
{
static ErrorList emptyErrorList;
- map<string, ErrorList>::iterator I = d->errorLists.find(type);
- if (I == d->errorLists.end())
+ map<string, ErrorList>::iterator it = d->errorLists.find(type);
+ if (it == d->errorLists.end())
return emptyErrorList;
- return I->second;
+ return it->second;
}
bool const success = theConverters().convert(this, FileName(filename),
tmp_result_file, FileName(absFileName()), backend_format, format,
error_list);
- // Emit the signal to show the error list.
+
+ // Emit the signal to show the error list or copy it back to the
+ // cloned Buffer so that it cab be emitted afterwards.
if (format != backend_format) {
- errors(error_type);
+ if (d->cloned_buffer_) {
+ d->cloned_buffer_->d->errorLists[error_type] =
+ d->errorLists[error_type];
+ } else
+ errors(error_type);
// also to the children, in case of master-buffer-view
std::vector<Buffer *> clist = getChildren();
for (vector<Buffer *>::const_iterator cit = clist.begin();
- cit != clist.end(); ++cit)
- (*cit)->errors(error_type, true);
+ cit != clist.end(); ++cit) {
+ if (d->cloned_buffer_) {
+ (*cit)->d->cloned_buffer_->d->errorLists[error_type] =
+ (*cit)->d->errorLists[error_type];
+ } else
+ (*cit)->errors(error_type, true);
+ }
}
- if (!success)
- return false;
if (d->cloned_buffer_) {
// Enable reverse dvi or pdf to work by copying back the texrow
// FIXME: There is a possibility of concurrent access to texrow
// here from the main GUI thread that should be securized.
d->cloned_buffer_->d->texrow = d->texrow;
+ string const error_type = bufferFormat();
+ d->cloned_buffer_->d->errorLists[error_type] = d->errorLists[error_type];
}
+ if (!success)
+ return false;
+
if (put_in_tempdir) {
result_file = tmp_result_file.absFilename();
return true;
InsetList::const_iterator end = parit->insetList().end();
for (; iit != end; ++iit) {
parit.pos() = iit->pos;
- if (!parit->isDeleted(iit->pos))
- iit->inset->updateBuffer(parit, utype);
+ iit->inset->updateBuffer(parit, utype);
}
}
}
message(bformat(_("Could not reload document %1$s."), disp_fn));
}
setBusy(false);
+ thePreviews().removeLoader(*this);
+ if (graphics::Previews::status() != LyXRC::PREVIEW_OFF)
+ thePreviews().generateBufferPreviews(*this);
errors("Parse");
return success;
}