]> git.lyx.org Git - features.git/blobdiff - src/LyXFunc.cpp
move more stuff from buffer_func to Buffer
[features.git] / src / LyXFunc.cpp
index 19049d2d33618d9b8a81ab0f77145424fb200d58..9207ef56dfb7e13bd2aa9f4d0a59bf9a45ca14aa 100644 (file)
@@ -4,15 +4,15 @@
  * Licence details can be found in the file COPYING.
  *
  * \author Alfredo Braunstein
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
  * \author Jean-Marc Lasgouttes
  * \author Angus Leeming
  * \author John Levon
- * \author André Pönitz
+ * \author André Pönitz
  * \author Allan Rae
  * \author Dekel Tsur
  * \author Martin Vermeer
- * \author Jürgen Vigna
+ * \author Jürgen Vigna
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -568,6 +568,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
 
        case LFUN_WORD_FIND_FORWARD:
        case LFUN_WORD_FIND_BACKWARD:
+       case LFUN_WORD_FINDADV:
        case LFUN_COMMAND_PREFIX:
        case LFUN_COMMAND_EXECUTE:
        case LFUN_CANCEL:
@@ -1043,7 +1044,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                makeDisplayPath(fname.absFilename())));
                        Buffer * buf = lyx_view_->loadDocument(fname, false);
                        if (buf) {
-                               updateLabels(*buf);
+                               buf->updateLabels();
                                lyx_view_->setBuffer(buf);
                                buf->errors("Parse");
                        }
@@ -1139,7 +1140,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                break;
                        }
 
-                       updateLabels(*buf);
+                       buf->updateLabels();
                        lyx_view_->setBuffer(buf);
                        view()->setCursorFromRow(row);
                        if (loaded)
@@ -1293,7 +1294,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                // This makes insertion of citations and references in the child work,
                                // when the target is in the parent or another child document.
                                child->setParent(buffer);
-                               updateLabels(*child->masterBuffer());
+                               child->masterBuffer()->updateLabels();
                                lyx_view_->setBuffer(child);
                                if (parsed)
                                        child->errors("Parse");
@@ -1628,7 +1629,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        // notify insets we just left
                        if (view()->cursor() != old) {
                                old.fixIfBroken();
-                               bool badcursor = notifyCursorLeaves(old, view()->cursor());
+                               bool badcursor = notifyCursorLeavesOrEnters(old, view()->cursor());
                                if (badcursor)
                                        view()->cursor().fixIfBroken();
                        }
@@ -1652,8 +1653,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                }
 
                // if we executed a mutating lfun, mark the buffer as dirty
-               if (buffer 
-                   && theBufferList().isLoaded(buffer) && flag.enabled()
+               if (theBufferList().isLoaded(buffer) && flag.enabled()
                    && !lyxaction.funcHasFlag(action, LyXAction::NoBuffer)
                    && !lyxaction.funcHasFlag(action, LyXAction::ReadOnly))
                        buffer->markDirty();                    
@@ -1707,7 +1707,7 @@ void LyXFunc::sendDispatchMessage(docstring const & msg, FuncRequest const & cmd
                }
        }
 
-       docstring const shortcuts = theTopLevelKeymap().printBindings(cmd);
+       docstring const shortcuts = theTopLevelKeymap().printBindings(cmd, KeySequence::ForGui);
 
        if (!shortcuts.empty())
                comname += ": " + shortcuts;
@@ -1735,7 +1735,7 @@ void LyXFunc::reloadBuffer()
        docstring const disp_fn = makeDisplayPath(filename.absFilename());
        docstring str;
        if (buf) {
-               updateLabels(*buf);
+               buf->updateLabels();
                lyx_view_->setBuffer(buf);
                buf->errors("Parse");
                str = bformat(_("Document %1$s reloaded."), disp_fn);
@@ -1796,20 +1796,20 @@ bool LyXFunc::wasMetaKey() const
 }
 
 
-void LyXFunc::updateLayout(DocumentClass const * const oldlayout, Buffer * buffer)
+void LyXFunc::updateLayout(DocumentClass const * const oldlayout, Buffer * buf)
 {
        lyx_view_->message(_("Converting document to new document class..."));
        
        StableDocIterator backcur(view()->cursor());
-       ErrorList & el = buffer->errorList("Class Switch");
+       ErrorList & el = buf->errorList("Class Switch");
        cap::switchBetweenClasses(
-                       oldlayout, buffer->params().documentClassPtr(),
-                       static_cast<InsetText &>(buffer->inset()), el);
+                       oldlayout, buf->params().documentClassPtr(),
+                       static_cast<InsetText &>(buf->inset()), el);
 
-       view()->setCursor(backcur.asDocIterator(&(buffer->inset())));
+       view()->setCursor(backcur.asDocIterator(&(buf->inset())));
 
-       buffer->errors("Class Switch");
-       updateLabels(*buffer);
+       buf->errors("Class Switch");
+       buf->updateLabels();
 }
 
 
@@ -1826,8 +1826,8 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        switch (tag) {
        case LyXRC::RC_ACCEPT_COMPOUND:
        case LyXRC::RC_ALT_LANG:
-       case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
        case LyXRC::RC_PLAINTEXT_LINELEN:
+       case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
        case LyXRC::RC_AUTOREGIONDELETE:
        case LyXRC::RC_AUTORESET_OPTIONS:
        case LyXRC::RC_AUTOSAVE:
@@ -1970,6 +1970,4 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
 }
 
 } // namespace anon
-
-
 } // namespace lyx