From cfa0a1181b92dcd8165db22cc63fdd7b5872e40c Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 5 Oct 2012 10:51:51 +0200 Subject: [PATCH] Revert "Do not kill the undo stack when doing a Save As..." This reverts commit 824fe175112559af42fc42da889a60dc7ee465d1. Following discussion on ticket #8342, I am not sure anymore that this is safe for branch. Reverting does not hurt much since the annoying debug messages that were cured by this commit are already (better) fixed by the patch for #8342. --- src/Buffer.cpp | 7 +++---- src/Buffer.h | 3 +-- src/frontends/qt4/GuiView.cpp | 2 +- status.20x | 2 -- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 6fc8741d54..9a1642396e 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -4440,8 +4440,8 @@ int Buffer::charCount(bool with_blanks) const { return d->charCount(with_blanks); } - -Buffer::ReadStatus Buffer::reload(bool clearUndo) + +Buffer::ReadStatus Buffer::reload() { setBusy(true); // c.f. bug http://www.lyx.org/trac/ticket/6587 @@ -4459,8 +4459,7 @@ Buffer::ReadStatus Buffer::reload(bool clearUndo) updateTitles(); markClean(); message(bformat(_("Document %1$s reloaded."), disp_fn)); - if (clearUndo) - d->undo_.clear(); + d->undo_.clear(); } else { message(bformat(_("Could not reload document %1$s."), disp_fn)); } diff --git a/src/Buffer.h b/src/Buffer.h index c8cf926b3b..410cb978a7 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -209,8 +209,7 @@ public: /// read a new document from a string bool readString(std::string const &); /// Reloads the LyX file - /// \param clearUndo if false, leave alone the undo stack. - ReadStatus reload(bool clearUndo = true); + ReadStatus reload(); //FIXME: The following function should be private //private: /// read the header, returns number of unknown tokens diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index bf01917dc0..42716192a7 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -2294,7 +2294,7 @@ bool GuiView::renameBuffer(Buffer & b, docstring const & newname) bool const saved = saveBuffer(b, fname); if (saved) - b.reload(false); + b.reload(); return saved; } diff --git a/status.20x b/status.20x index 9161afd490..71bc79bbe1 100644 --- a/status.20x +++ b/status.20x @@ -168,8 +168,6 @@ What's new - Fix undo machinery confusion after checking in a document under version control (bug 8342). -- Do not forget the undo information when doing a Save As... - - Replace current selection when pasting (bug 8027). - Fix issues with crossref dialog in read-only documents (#8177). -- 2.39.5