From b89ef8a5b31a02240f90a6d6252b1b680e1e1ac8 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 4 Oct 2013 15:01:42 +0200 Subject: [PATCH] Revert "Do not kill the undo stack when doing a Save As..." This commit was causing bug #8821. This reverts commit 467422f9df784e2e6bab4f0cc8fcfbc166c59bd4. --- src/Buffer.cpp | 5 ++--- src/Buffer.h | 3 +-- src/frontends/qt4/GuiView.cpp | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 948f9cc2fd..ceb86b91e5 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -4736,7 +4736,7 @@ int Buffer::charCount(bool with_blanks) const } -Buffer::ReadStatus Buffer::reload(bool clearUndo) +Buffer::ReadStatus Buffer::reload() { setBusy(true); // c.f. bug http://www.lyx.org/trac/ticket/6587 @@ -4754,8 +4754,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 386625e18d..5fdf020e4c 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -230,8 +230,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 a5438b930e..70f1e2ec27 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -2364,7 +2364,7 @@ bool GuiView::renameBuffer(Buffer & b, docstring const & newname, RenameKind kin bool const saved = saveBuffer(b, fname); if (saved) - b.reload(false); + b.reload(); return saved; }