]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
remove more forms.h cruft
[lyx.git] / src / lyxfunc.C
index f123166106065c16c8e0f58aa2e9d85565844b1b..9a5f2b241016db7f253534c311e9962728624d4f 100644 (file)
@@ -32,7 +32,6 @@
 #include "BufferView.h"
 #include "ColorHandler.h"
 #include "lyxserver.h"
-#include "figure_form.h"
 #include "intl.h"
 #include "lyx_main.h"
 #include "lyx_cb.h"
@@ -656,7 +655,14 @@ string const LyXFunc::Dispatch(int ac,
                if (!do_not_use_this_arg.empty())
                        argument = do_not_use_this_arg; // except here
        }
-    
+
+#ifdef NEW_DISPATCHER
+       // We try do call the most specific dispatcher first:
+       //  1. the lockinginset's dispatch
+       //  2. the bufferview's dispatch
+       //  3. the lyxview's dispatch
+#endif
+       
        selection_possible = false;
        
        if (owner->view()->available())
@@ -1064,25 +1070,25 @@ string const LyXFunc::Dispatch(int ac,
                        setErrorMessage(N_("Missing argument"));
                        break;
                }
-               ProhibitInput(owner->view());
+               owner->prohibitInput();
                string const fname = i18nLibFileSearch("doc", arg, "lyx");
                if (fname.empty()) {
                        lyxerr << "LyX: unable to find documentation file `"
                               << arg << "'. Bad installation?" << endl;
-                       AllowInput(owner->view());
+                       owner->allowInput();
                        break;
                }
                ostringstream str;
                str << _("Opening help file") << ' '
                    << MakeDisplayPath(fname) << "...";
                owner->message(str.str().c_str());
-               owner->view()->buffer(bufferlist.loadLyXFile(fname,false));
-               AllowInput(owner->view());
+               owner->view()->buffer(bufferlist.loadLyXFile(fname, false));
+               owner->allowInput();
                break;
         }
 
        case LFUN_HELP_VERSION: {
-               ProhibitInput(owner->view());
+               owner->prohibitInput();
                string msg(_("LyX Version "));
                msg += LYX_VERSION;
                msg += " of ";
@@ -1092,7 +1098,7 @@ string const LyXFunc::Dispatch(int ac,
                                 + MakeDisplayPath(system_lyxdir)).c_str(),
                                (_("User directory: ") 
                                 + MakeDisplayPath(user_lyxdir)).c_str());
-               AllowInput(owner->view());
+               owner->allowInput();
                break;
        }
        
@@ -1250,19 +1256,26 @@ string const LyXFunc::Dispatch(int ac,
 
        case LFUN_GOTOFILEROW:
        {
+#if 0
                char file_name[100];
                int row;
                ::sscanf(argument.c_str(), " %s %d", file_name, &row);
-
+#else
+               string file_name;
+               int row;
+               istringstream istr(argument.c_str());
+               istr >> file_name >> row;
+#endif
                // Must replace extension of the file to be .lyx and get full path
-               string s = ChangeExtension(string(file_name), ".lyx");
+               string const s(ChangeExtension(file_name, ".lyx"));
 
                // Either change buffer or load the file
-               if (bufferlist.exists(s))
+               if (bufferlist.exists(s)) {
                        owner->view()->buffer(bufferlist.getBuffer(s));
-               else
+               } else {
                        owner->view()->buffer(bufferlist.loadLyXFile(s));
-
+               }
+               
                // Set the cursor  
                owner->view()->setCursorFromRow(row);
 
@@ -1278,8 +1291,11 @@ string const LyXFunc::Dispatch(int ac,
                int id;
                istr >> id;
                Paragraph * par = TEXT()->getParFromID(id);
-               if (par == 0)
+               if (par == 0) {
+                       lyxerr[Debug::INFO] << "No matching paragraph found! ["
+                                           << id << "]" << std::endl;
                        break;
+               }
 
                // Set the cursor
                TEXT()->setCursor(owner->view(), par, 0);