]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathScript.cpp
Get package things working with modules prior to UI patch.
[lyx.git] / src / mathed / InsetMathScript.cpp
index 3080b60ce1dbd9fc036644ac6dfddce63485d19b..487c17b4770f1cbd38aece12bc599dd3e9447f16 100644 (file)
 #include "MathSupport.h"
 #include "InsetMathSymbol.h"
 #include "InsetMathFont.h"
-#include "dispatchresult.h"
-#include "cursor.h"
+#include "DispatchResult.h"
+#include "Cursor.h"
 #include "debug.h"
-#include "funcrequest.h"
-#include "undo.h"
+#include "FuncRequest.h"
+#include "Undo.h"
 
 #include <boost/assert.hpp>
 
@@ -52,9 +52,9 @@ InsetMathScript::InsetMathScript(MathAtom const & at, bool up)
 }
 
 
-auto_ptr<InsetBase> InsetMathScript::doClone() const
+auto_ptr<Inset> InsetMathScript::doClone() const
 {
-       return auto_ptr<InsetBase>(new InsetMathScript(*this));
+       return auto_ptr<Inset>(new InsetMathScript(*this));
 }
 
 
@@ -70,7 +70,7 @@ InsetMathScript * InsetMathScript::asScriptInset()
 }
 
 
-bool InsetMathScript::idxFirst(LCursor & cur) const
+bool InsetMathScript::idxFirst(Cursor & cur) const
 {
        cur.idx() = 0;
        cur.pos() = 0;
@@ -78,7 +78,7 @@ bool InsetMathScript::idxFirst(LCursor & cur) const
 }
 
 
-bool InsetMathScript::idxLast(LCursor & cur) const
+bool InsetMathScript::idxLast(Cursor & cur) const
 {
        cur.idx() = 0;
        cur.pos() = nuc().size();
@@ -86,7 +86,7 @@ bool InsetMathScript::idxLast(LCursor & cur) const
 }
 
 
-MathArray const & InsetMathScript::down() const
+MathData const & InsetMathScript::down() const
 {
        if (nargs() == 3)
                return cell(2);
@@ -95,7 +95,7 @@ MathArray const & InsetMathScript::down() const
 }
 
 
-MathArray & InsetMathScript::down()
+MathData & InsetMathScript::down()
 {
        if (nargs() == 3)
                return cell(2);
@@ -104,14 +104,14 @@ MathArray & InsetMathScript::down()
 }
 
 
-MathArray const & InsetMathScript::up() const
+MathData const & InsetMathScript::up() const
 {
        BOOST_ASSERT(nargs() > 1);
        return cell(1);
 }
 
 
-MathArray & InsetMathScript::up()
+MathData & InsetMathScript::up()
 {
        BOOST_ASSERT(nargs() > 1);
        return cell(1);
@@ -122,26 +122,26 @@ void InsetMathScript::ensure(bool up)
 {
        if (nargs() == 1) {
                // just nucleus so far
-               cells_.push_back(MathArray());
+               cells_.push_back(MathData());
                cell_1_is_up_ = up;
        } else if (nargs() == 2 && !has(up)) {
                if (up) {
                        cells_.push_back(cell(1));
                        cell(1).clear();
                } else {
-                       cells_.push_back(MathArray());
+                       cells_.push_back(MathData());
                }
        }
 }
 
 
-MathArray const & InsetMathScript::nuc() const
+MathData const & InsetMathScript::nuc() const
 {
        return cell(0);
 }
 
 
-MathArray & InsetMathScript::nuc()
+MathData & InsetMathScript::nuc()
 {
        return cell(0);
 }
@@ -157,7 +157,7 @@ bool isAlphaSymbol(MathAtom const & at)
                return true;
 
        if (at->asFontInset()) {
-               MathArray const & ar = at->asFontInset()->cell(0);
+               MathData const & ar = at->asFontInset()->cell(0);
                for (size_t i = 0; i < ar.size(); ++i) {
                        if (!(ar[i]->asCharInset() ||
                                        (ar[i]->asSymbolInset() &&
@@ -340,7 +340,7 @@ void InsetMathScript::draw(PainterInfo & pi, int x, int y) const
        else {
                nuc().setXY(*pi.base.bv, x + dxx(), y);
                if (editing(pi.base.bv))
-                        pi.draw(x + dxx(), y, char_type('.'));
+                       pi.draw(x + dxx(), y, char_type('.'));
        }
        ScriptChanger dummy(pi.base);
        if (hasUp())
@@ -440,7 +440,7 @@ bool InsetMathScript::hasDown() const
 }
 
 
-InsetBase::idx_type InsetMathScript::idxOfScript(bool up) const
+Inset::idx_type InsetMathScript::idxOfScript(bool up) const
 {
        if (nargs() == 1)
                return 0;
@@ -454,19 +454,19 @@ InsetBase::idx_type InsetMathScript::idxOfScript(bool up) const
 }
 
 
-bool InsetMathScript::idxRight(LCursor &) const
+bool InsetMathScript::idxRight(Cursor &) const
 {
        return false;
 }
 
 
-bool InsetMathScript::idxLeft(LCursor &) const
+bool InsetMathScript::idxLeft(Cursor &) const
 {
        return false;
 }
 
 
-bool InsetMathScript::idxUpDown(LCursor & cur, bool up) const
+bool InsetMathScript::idxUpDown(Cursor & cur, bool up) const
 {
        // in nucleus?
        if (cur.idx() == 0) {
@@ -484,7 +484,7 @@ bool InsetMathScript::idxUpDown(LCursor & cur, bool up) const
        }
 
        // Are we 'up'?
-       if (has(up) && cur.idx() == idxOfScript(true)) {
+       if (cur.idx() == idxOfScript(true)) {
                // can't go further up
                if (up)
                        return false;
@@ -495,7 +495,7 @@ bool InsetMathScript::idxUpDown(LCursor & cur, bool up) const
        }
 
        // Are we 'down'?
-       if (has(up) && cur.idx() == idxOfScript(false)) {
+       if (cur.idx() == idxOfScript(false)) {
                // can't go further down
                if (!up)
                        return false;
@@ -647,7 +647,7 @@ void InsetMathScript::infoize2(odocstream & os) const
 }
 
 
-bool InsetMathScript::notifyCursorLeaves(LCursor & cur)
+bool InsetMathScript::notifyCursorLeaves(Cursor & cur)
 {
        InsetMathNest::notifyCursorLeaves(cur);
 
@@ -672,12 +672,12 @@ bool InsetMathScript::notifyCursorLeaves(LCursor & cur)
                recordUndoInset(cur);
                removeScript(cell_1_is_up_);
                // Let the script inset commit suicide. This is
-               // modelled on LCursor.pullArg(), but tries not to
+               // modelled on Cursor.pullArg(), but tries not to
                // invoke notifyCursorLeaves again and does not touch
                // cur (since the top slice will be deleted
                // afterwards))
-               MathArray ar = cell(0);
-               LCursor tmpcur = cur;
+               MathData ar = cell(0);
+               Cursor tmpcur = cur;
                tmpcur.pop();
                tmpcur.cell().erase(tmpcur.pos());
                tmpcur.cell().insert(tmpcur.pos(), ar);
@@ -689,7 +689,7 @@ bool InsetMathScript::notifyCursorLeaves(LCursor & cur)
 }
 
 
-void InsetMathScript::doDispatch(LCursor & cur, FuncRequest & cmd)
+void InsetMathScript::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        //lyxerr << "InsetMathScript: request: " << cmd << std::endl;