From 116c20a2030bc16577f821bca0e1256fd18b267e Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Mon, 13 Dec 2010 22:20:29 +0000 Subject: [PATCH] Trying to be too smart by reducing the number of regenerated previews, may cause to miss some regeneration. So, better too much than less. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36872 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/MathMacroTemplate.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mathed/MathMacroTemplate.cpp b/src/mathed/MathMacroTemplate.cpp index 3687bd185a..2989e2be5c 100644 --- a/src/mathed/MathMacroTemplate.cpp +++ b/src/mathed/MathMacroTemplate.cpp @@ -737,14 +737,14 @@ public: /// AddRemoveMacroInstanceFix(int n, bool insert) : n_(n), insert_(insert) {} /// - bool operator()(MathMacro * macro) { + void operator()(MathMacro * macro) + { if (macro->folded()) { if (insert_) macro->insertArgument(n_); else macro->removeArgument(n_); } - return true; } private: @@ -762,9 +762,9 @@ public: /// OptionalsMacroInstanceFix(int optionals) : optionals_(optionals) {} /// - bool operator()(MathMacro * macro) { + void operator()(MathMacro * macro) + { macro->setOptionals(optionals_); - return true; } private: @@ -778,7 +778,7 @@ class NullMacroInstanceFix { public: /// - bool operator()(MathMacro * ) { return false; } + void operator()(MathMacro * ) {} }; @@ -833,7 +833,8 @@ void fixMacroInstances(Cursor & cur, DocIterator const & inset_pos, MathMacro * macro = insetMath->asMacro(); if (macro && macro->name() == name && macro->folded()) { - if (fix(macro) && RenderPreview::status() == LyXRC::PREVIEW_ON) + fix(macro); + if (RenderPreview::status() == LyXRC::PREVIEW_ON) preview_reload_needed = true; } }