]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
reduce number of calls to LyXText::getFont
[lyx.git] / src / lyxfunc.C
index 3426cc28e1faea55e9c23e1fa7e931e4b3508395..36ec96f45b027951f4776528efd40d91926fd93e 100644 (file)
@@ -493,10 +493,14 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
                                && lyxrc.print_command != "none";
                else if (name == "character" || name == "mathpanel")
                        enable = cur.inset().lyxCode() != InsetBase::ERT_CODE;
-               else if (name == "vclog")
-                       enable = buf->lyxvc().inUse();
                else if (name == "latexlog")
                        enable = IsFileReadable(buf->getLogName().second);
+#if !defined (USE_ASPELL) && !defined (USE_ISPELL) && !defined (USE_PSPELL)
+               else if (name == "spellchecker")
+                       enable = false;
+#endif
+               else if (name == "vclog")
+                       enable = buf->lyxvc().inUse();
                break;
        }
 
@@ -1352,6 +1356,9 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                FuncRequest fr(LFUN_INSET_INSERT, argument);
                                dispatch(fr);
                        }
+                       // ideally, the update flag should be set by the insets,
+                       // but this is not possible currently
+                       update = true;
                        break;
                }
 
@@ -1468,12 +1475,14 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
 
                        owner->message(_("Converting document to new document class..."));
                        ErrorList el;
-                       lyx::cap::SwitchLayoutsBetweenClasses(
+                       lyx::cap::SwitchBetweenClasses(
                                old_class, new_class,
                                buffer->paragraphs(), el);
 
                        bufferErrors(*buffer, el);
                        view()->showErrorList(_("Class switch"));
+                       updateCounters(*buffer);
+                       update = true;
                        break;
                }
 
@@ -1513,7 +1522,10 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        // Redraw screen unless explicitly told otherwise.
                        // This also initializes the position cache for all insets
                        // in (at least partially) visible top-level paragraphs.
-                       view()->update(true, update);
+                       if (update)
+                               view()->update(Update::FitCursor | Update::Force);
+                       else
+                               view()->update(Update::FitCursor);
 
                        // if we executed a mutating lfun, mark the buffer as dirty
                        // FIXME: Why not use flag.enabled() but call getStatus again?
@@ -1971,6 +1983,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        case LyXRC::RC_SPELL_COMMAND:
        case LyXRC::RC_TEMPDIRPATH:
        case LyXRC::RC_TEMPLATEPATH:
+       case LyXRC::RC_TEX_ALLOWS_SPACES:
        case LyXRC::RC_UIFILE:
        case LyXRC::RC_USER_EMAIL:
        case LyXRC::RC_USER_NAME: