From: André Pönitz Date: Fri, 12 Apr 2002 13:30:14 +0000 (+0000) Subject: fix crashs discovered by Michael X-Git-Tag: 1.6.10~19422 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=4025b11bc49f641232761e87dcff40abe383da12;p=features.git fix crashs discovered by Michael git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3984 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index 8b32f3222a..5685529c35 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -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(); diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index ba00fe0e75..89fd224f7f 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -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); + } } } diff --git a/src/mathed/math_extern.C b/src/mathed/math_extern.C index e957386630..1f9e516752 100644 --- a/src/mathed/math_extern.C +++ b/src/mathed/math_extern.C @@ -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; diff --git a/src/mathed/math_inset.h b/src/mathed/math_inset.h index fce522e195..20662bdb85 100644 --- a/src/mathed/math_inset.h +++ b/src/mathed/math_inset.h @@ -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; }