]> git.lyx.org Git - lyx.git/commitdiff
Trying to be too smart by reducing the number of regenerated previews, may
authorEnrico Forestieri <forenr@lyx.org>
Mon, 13 Dec 2010 22:20:29 +0000 (22:20 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Mon, 13 Dec 2010 22:20:29 +0000 (22:20 +0000)
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

index 3687bd185a8fa3ed5cb757457d68e06524637a9e..2989e2be5ce01ba25c5aab5ccabdf091308552d4 100644 (file)
@@ -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;
                }
        }