]> git.lyx.org Git - features.git/commitdiff
fix crashs discovered by Michael
authorAndré Pönitz <poenitz@gmx.net>
Fri, 12 Apr 2002 13:30:14 +0000 (13:30 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Fri, 12 Apr 2002 13:30:14 +0000 (13:30 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3984 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/formulabase.C
src/mathed/math_cursor.C
src/mathed/math_extern.C
src/mathed/math_inset.h

index 8b32f3222a968899c1d7bcc7ff23f549b401fcd4..5685529c35000478c9ae31fe97b00494465b6207 100644 (file)
@@ -373,11 +373,6 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
        if (!mathcursor)
                return UNDISPATCHED;
 
-       if (mathcursor->asHyperActiveInset()) {
-               lyxerr << " uurr.... getting dificult now\n";
-               return mathcursor->asHyperActiveInset()->localDispatch(bv, action, arg);
-       }
-
        RESULT result      = DISPATCHED;
        bool sel           = false;
        bool was_macro     = mathcursor->inMacroMode();
index ba00fe0e751543a6a2e3842847b6975737cab3e2..89fd224f7f57b1b2d3d3dc09e20756ed49c37d60 100644 (file)
@@ -249,12 +249,6 @@ bool MathCursor::popRight()
 #endif
 
 
-UpdatableInset * MathCursor::asHyperActiveInset() const
-{
-       return par()->asHyperActiveInset();
-}
-
-
 bool MathCursor::isInside(MathInset const * p) const
 {
        for (unsigned i = 0; i < Cursor_.size(); ++i)
@@ -266,9 +260,6 @@ bool MathCursor::isInside(MathInset const * p) const
 
 bool MathCursor::openable(MathAtom const & t, bool sel) const
 {
-       if (t->isHyperActive())
-               return true;
-
        if (!t->isActive())
                return false;
 
@@ -316,9 +307,6 @@ bool MathCursor::left(bool sel)
        lastcode_ = LM_TC_MIN;
 
        if (hasPrevAtom() && openable(prevAtom(), sel)) {
-               if (prevAtom()->isHyperActive()) {
-                       lyxerr << "entering hyperactive inset\n";
-               }
                pushRight(prevAtom());
                return true;
        }
@@ -339,12 +327,6 @@ bool MathCursor::right(bool sel)
        lastcode_ = LM_TC_MIN;
 
        if (hasNextAtom() && openable(nextAtom(), sel)) {
-               if (nextAtom()->isHyperActive()) {
-                       lyxerr << "entering hyperactive inset\n";
-                       int x, y;
-                       getPos(x, y);
-                       nextAtom()->edit(formula()->view(), x, y, 0);
-               }
                pushLeft(nextAtom());
                return true;
        }
@@ -982,12 +964,14 @@ void MathCursor::normalize()
        pos() = min(pos(), size());
 
        // remove empty scripts if possible
-       for (pos_type i = 0; i < size(); ++i) {
-               MathScriptInset * p = array().at(i)->asScriptInset();
-               if (p) {
-                       p->removeEmptyScripts();
-                       if (p->empty())
-                               array().erase(i);
+       if (1) {
+               for (pos_type i = 0; i < size(); ++i) {
+                       MathScriptInset * p = array().at(i)->asScriptInset();
+                       if (p) {
+                               p->removeEmptyScripts();
+                               //if (p->empty())
+                               //      array().erase(i);
+                       }
                }
        }
 
index e9573866307478d940a34667f9c4e824baa638bb..1f9e5167523acf8c6f27b44f8b0be685931b07ef 100644 (file)
@@ -105,6 +105,8 @@ MathArray::iterator extractArgument(MathArray & ar,
 
 MathScriptInset const * asScript(MathArray::const_iterator it)
 {
+       if (!it->nucleus())
+               return 0;
        if (it->nucleus()->asScriptInset())
                return 0;
        ++it;
index fce522e195b35d70c95ca815184e196984334d4b..20662bdb853296f88c367c106c8b3e2f1763a3d9 100644 (file)
@@ -204,14 +204,11 @@ public:
        virtual MathSymbolInset const  * asSymbolInset() const  { return 0; }
        virtual MathUnknownInset const * asUnknownInset() const { return 0; }
        virtual MathXYMatrixInset const* asXYMatrixInset() const{ return 0; }
-       virtual UpdatableInset     * asHyperActiveInset() const { return 0; }
 
        /// identifies things that can get scripts
        virtual bool isScriptable() const { return false; }
        /// thing that can be moved into
        virtual bool isActive() const { return nargs() > 0; }
-       /// identifies insets from the outer world
-       virtual bool isHyperActive() const { return 0; }
        /// is the a relational operator (used for splitting equations)
        virtual bool isRelOp() const { return false; }