From 942b62ac0fc00566f3b2c33e400efd3707497def Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 9 Feb 2016 16:37:50 +0100 Subject: [PATCH] Do not record undo in the tabularFeatures helper Since the low-level version of tabular features is only called by the high-level one, it does not make sense to record undo there. It is much better to do it once in the high-level handler, rather than 37 times (yes!) at lower level when the tabular GUI calls tabular-feature with all the settings at once. With large tables, this avoids to keep 37 copies of the table in Undo stack. --- src/insets/InsetTabular.cpp | 4 ++-- src/insets/InsetTabular.h | 4 ++-- status.21x | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 993368a6cc..36db667c2c 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -5348,6 +5348,8 @@ void InsetTabular::movePrevCell(Cursor & cur, EntryDirection entry_from) bool InsetTabular::tabularFeatures(Cursor & cur, string const & argument) { + cur.recordUndoInset(ATOMIC_UNDO, this); + istringstream is(argument); string s; is >> s; @@ -5479,8 +5481,6 @@ void InsetTabular::tabularFeatures(Cursor & cur, break; } - cur.recordUndoInset(ATOMIC_UNDO, this); - getSelection(cur, sel_row_start, sel_row_end, sel_col_start, sel_col_end); row_type const row = tabular.cellRow(cur.idx()); col_type const column = tabular.cellColumn(cur.idx()); diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h index 3b206ea1d1..132146fba7 100644 --- a/src/insets/InsetTabular.h +++ b/src/insets/InsetTabular.h @@ -882,9 +882,9 @@ public: /// get offset of this cursor slice relative to our upper left corner void cursorPos(BufferView const & bv, CursorSlice const & sl, bool boundary, int & x, int & y) const; - /// + /// Executes a space-separated sequence of tabular-features requests bool tabularFeatures(Cursor & cur, std::string const & what); - /// + /// Change a single tabular feature; does not handle undo. void tabularFeatures(Cursor & cur, Tabular::Feature feature, std::string const & val = std::string()); /// number of cells diff --git a/status.21x b/status.21x index 9f354f9874..8232a3e75f 100644 --- a/status.21x +++ b/status.21x @@ -156,6 +156,8 @@ What's new - Allow quotes in PDF text properties (bug 9830). +- Avoid clogging the undo stack with useless entries when using the + tabular dialog (bug 9960). * DOCUMENTATION AND LOCALIZATION