]> git.lyx.org Git - features.git/blobdiff - src/mathed/formulabase.C
Replace LString.h with support/std_string.h,
[features.git] / src / mathed / formulabase.C
index bd5fdcc8a7de8d656c9b1808eb69e423449058b4..c50427587aff15045308bfaa425a397065a12262 100644 (file)
 
 #include <config.h>
 
-#include "Lsstream.h"
+#include "formulabase.h"
+#include "support/std_sstream.h"
 #include "support/LAssert.h"
 #include "formula.h"
 #include "formulamacro.h"
-#include "lyxrc.h"
 #include "funcrequest.h"
 #include "BufferView.h"
 #include "lyxtext.h"
 #include "gettext.h"
-#include "LaTeXFeatures.h"
 #include "debug.h"
 #include "math_support.h"
-#include "metricsinfo.h"
-#include "math_data.h"
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
 #include "frontends/LyXView.h"
-#include "frontends/font_metrics.h"
-#include "frontends/mouse_state.h"
 #include "math_arrayinset.h"
-#include "math_charinset.h"
 #include "math_deliminset.h"
 #include "math_cursor.h"
 #include "math_factory.h"
-#include "math_fontinset.h"
 #include "math_hullinset.h"
-#include "math_iterator.h"
-#include "math_macrotable.h"
 #include "math_parser.h"
-#include "math_pos.h"
 #include "math_spaceinset.h"
 #include "undo_funcs.h"
-#include "textpainter.h"
 #include "frontends/Dialogs.h"
-#include "intl.h"
 #include "ref_inset.h"
 
-#include <fstream>
 
 using namespace lyx::support;
 
@@ -83,7 +70,7 @@ bool openNewInset(BufferView * bv, UpdatableInset * new_inset)
 
 
 InsetFormulaBase::InsetFormulaBase()
-       : xo_(0), yo_(0)
+       : view_(0), xo_(0), yo_(0)
 {
        // This is needed as long the math parser is not re-entrant
        initMath();
@@ -153,12 +140,12 @@ void InsetFormulaBase::insetUnlock(BufferView * bv)
        if (mathcursor) {
                if (mathcursor->inMacroMode()) {
                        mathcursor->macroModeClose();
-                       bv->updateInset();
+                       bv->updateInset(this);
                }
                releaseMathCursor(bv);
        }
        generatePreview();
-       bv->updateInset();
+       bv->updateInset(this);
 }
 
 
@@ -204,7 +191,7 @@ void InsetFormulaBase::fitInsetCursor(BufferView * bv) const
 void InsetFormulaBase::toggleInsetSelection(BufferView * bv)
 {
        if (mathcursor)
-               bv->updateInset();
+               bv->updateInset(this);
 }
 
 
@@ -214,7 +201,7 @@ dispatch_result InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
                return UNDISPATCHED;
 
        BufferView * bv = cmd.view();
-       bv->updateInset();
+       bv->updateInset(this);
        //lyxerr << "lfunMouseRelease: buttons: " << cmd.button() << endl;
 
        if (cmd.button() == mouse_button::button3) {
@@ -233,7 +220,7 @@ dispatch_result InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
                mathcursor->selClear();
                mathcursor->setPos(cmd.x + xo_, cmd.y + yo_);
                mathcursor->insert(ar);
-               bv->updateInset();
+               bv->updateInset(this);
                return DISPATCHED;
        }
 
@@ -280,7 +267,7 @@ dispatch_result InsetFormulaBase::lfunMousePress(FuncRequest const & cmd)
                return DISPATCHED;
        }
 
-       bv->updateInset();
+       bv->updateInset(this);
        return DISPATCHED;
 }
 
@@ -308,7 +295,7 @@ dispatch_result InsetFormulaBase::lfunMouseMotion(FuncRequest const & cmd)
 
        BufferView * bv = cmd.view();
        mathcursor->setPos(cmd.x + xo_, cmd.y + yo_);
-       bv->updateInset();
+       bv->updateInset(this);
        return DISPATCHED;
 }
 
@@ -342,7 +329,7 @@ dispatch_result InsetFormulaBase::localDispatch(FuncRequest const & cmd)
                        }
                        // if that is removed, we won't get the magenta box when entering an
                        // inset for the first time
-                       bv->updateInset();
+                       bv->updateInset(this);
                        return DISPATCHED;
 
                case LFUN_MOUSE_PRESS:
@@ -720,7 +707,7 @@ dispatch_result InsetFormulaBase::localDispatch(FuncRequest const & cmd)
        }
 
        if (result == DISPATCHED)
-               bv->updateInset();
+               bv->updateInset(this);
 
        mathcursor->normalize();
        mathcursor->touch();
@@ -850,7 +837,7 @@ bool InsetFormulaBase::searchForward(BufferView * bv, string const & str,
                        mathcursor->setSelection(it, ar.size());
                        current = it;
                        it.jump(ar.size());
-                       bv->updateInset();
+                       bv->updateInset(this);
                        return true;
                }
        }
@@ -892,7 +879,7 @@ void mathDispatchCreation(FuncRequest const & cmd, bool display)
        //      sel = "";
        //else
 
-       string sel = bv->getLyXText()->selectionAsString(bv->buffer(), false);
+       string sel = bv->getLyXText()->selectionAsString(*bv->buffer(), false);
 
        if (sel.empty()) {
                InsetFormula * f = new InsetFormula(bv);