]> git.lyx.org Git - lyx.git/blobdiff - src/bufferview_funcs.C
more cursor dispatch
[lyx.git] / src / bufferview_funcs.C
index fb14fbf9bb1af520a8c74761cbe2e3195a05c2fe..634ed5f9c4342190530f8823a651a36c1778f67d 100644 (file)
 
 #include "insets/insettext.h"
 
-#include "mathed/math_cursor.h"
-
 #include "support/tostr.h"
-
 #include "support/std_sstream.h"
 
 using lyx::support::bformat;
@@ -164,13 +161,15 @@ void changeDepth(BufferView * bv, LyXText * text, DEPTH_CHANGE type)
 // Returns the current font and depth as a message.
 string const currentState(BufferView * bv)
 {
+       ostringstream state;
+
        if (!bv->available())
                return string();
 
-       if (mathcursor)
-               return mathcursor->info(bv->fullCursor());
-
-       ostringstream state;
+       if (bv->cursor().inMathed()) {
+               bv->cursor().info(state);
+               return state.str();
+       }
 
        LyXText * text = bv->getLyXText();
        Buffer * buffer = bv->buffer();
@@ -254,7 +253,7 @@ string const currentState(BufferView * bv)
 // deletes a selection during an insertion
 void replaceSelection(LyXText * text)
 {
-       if (text->bv()->selection().set()) {
+       if (text->bv()->cursor().selection()) {
                text->cutSelection(true, false);
                text->bv()->update();
        }