]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
get rid of broken_header.h and some unneeded tests
[lyx.git] / src / lyxfunc.C
index fb7343aab1542eb94adec58a41753ef5c4dc1a49..56a79f8ab69411f947b543d983fbac3ece7bace4 100644 (file)
 #include "frontends/Menubar.h"
 #include "frontends/Toolbars.h"
 
+#include "support/filefilterlist.h"
 #include "support/FileInfo.h"
 #include "support/filetools.h"
 #include "support/forkedcontr.h"
-#include "support/globbing.h"
 #include "support/lstrings.h"
 #include "support/path.h"
 #include "support/path_defines.h"
@@ -396,27 +396,27 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
                if (!inset)
                        break;
 
-               InsetOld::Code code = inset->lyxCode();
+               InsetBase::Code code = inset->lyxCode();
                switch (code) {
-                       case InsetOld::TABULAR_CODE:
+                       case InsetBase::TABULAR_CODE:
                                enable = cmd.argument == "tabular";
                                break;
-                       case InsetOld::ERT_CODE:
+                       case InsetBase::ERT_CODE:
                                enable = cmd.argument == "ert";
                                break;
-                       case InsetOld::FLOAT_CODE:
+                       case InsetBase::FLOAT_CODE:
                                enable = cmd.argument == "float";
                                break;
-                       case InsetOld::WRAP_CODE:
+                       case InsetBase::WRAP_CODE:
                                enable = cmd.argument == "wrap";
                                break;
-                       case InsetOld::NOTE_CODE:
+                       case InsetBase::NOTE_CODE:
                                enable = cmd.argument == "note";
                                break;
-                       case InsetOld::BRANCH_CODE:
+                       case InsetBase::BRANCH_CODE:
                                enable = cmd.argument == "branch";
                                break;
-                       case InsetOld::BOX_CODE:
+                       case InsetBase::BOX_CODE:
                                enable = cmd.argument == "box";
                                break;
                        default:
@@ -437,7 +437,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
                        enable = Exporter::IsExportable(*buf, "dvi")
                                && lyxrc.print_command != "none";
                else if (name == "character")
-                       enable = cur.inset().lyxCode() != InsetOld::ERT_CODE;
+                       enable = cur.inset().lyxCode() != InsetBase::ERT_CODE;
                else if (name == "vclog")
                        enable = buf->lyxvc().inUse();
                else if (name == "latexlog")
@@ -601,6 +601,7 @@ void loadTextclass(string const & name)
 
 void LyXFunc::dispatch(FuncRequest const & cmd)
 {
+       BOOST_ASSERT(view());
        string const argument = cmd.argument;
        kb_action const action = cmd.action;
 
@@ -1450,7 +1451,6 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                update |= view()->cursor().result().update();
                        else
                                update |= view()->dispatch(cmd);
-
                        break;
                }
                }
@@ -1459,14 +1459,8 @@ 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.
-                       if (update)
-                               view()->update();
-
-                       // fitCursor() needs valid inset position. The previous call to
-                       // update() makes sure we have such even for freshly created
-                       // insets.
-                       if (view()->fitCursor())
-                               view()->update();
+                       view()->update(true, update);
+
                        // if we executed a mutating lfun, mark the buffer as dirty
                        if (getStatus(cmd).enabled()
                                        && !lyxaction.funcHasFlag(cmd.action, LyXAction::NoBuffer)