#include "math_diffinset.h"
#include "math_exfuncinset.h"
#include "math_exintinset.h"
-#include "math_funcinset.h"
#include "math_fracinset.h"
#include "math_matrixinset.h"
#include "math_mathmlstream.h"
#include "math_scriptinset.h"
#include "math_stringinset.h"
#include "math_symbolinset.h"
+#include "math_unknowninset.h"
#include "Lsstream.h"
#include "debug.h"
// returns sequence of char with same code starting at it up to end
// it might be less, though...
MathArray::const_iterator charSequence(MathArray::const_iterator it,
- MathArray::const_iterator end, string & s, MathTextCodes & c)
+ MathArray::const_iterator end, string & s)
{
- MathCharInset const * p = (*it)->asCharInset();
- c = p->code();
- for (; it != end; ++it) {
- p = (*it)->asCharInset();
- if (!p || p->code() != c)
- break;
- s += p->getChar();
- }
+ for (; it != end && (*it)->asCharInset(); ++it)
+ s += (*it)->getChar();
return it;
}
// create proper string inset
MathStringInset * p = new MathStringInset;
MathArray::const_iterator
- jt = charSequence(it, ar.end(), p->str_, p->code_);
+ jt = charSequence(it, ar.end(), p->str_);
// clean up
(*it).reset(p);
bool extractNumber(MathArray const & ar, int & i)
{
string s;
- MathTextCodes c;
- charSequence(ar.begin(), ar.end(), s, c);
+ charSequence(ar.begin(), ar.end(), s);
istringstream is(s.c_str());
is >> i;
return is;
bool extractNumber(MathArray const & ar, double & i)
{
string s;
- MathTextCodes c;
- charSequence(ar.begin(), ar.end(), s, c);
+ charSequence(ar.begin(), ar.end(), s);
istringstream is(s.c_str());
is >> i;
return is;
string name;
// is it a function?
- if ((*it)->asFuncInset()) {
+ if ((*it)->asUnknownInset()) {
// it certainly is if it is well known...
- name = (*it)->asFuncInset()->name();
+ name = (*it)->asUnknownInset()->name();
} else {
// is this a user defined function?
// it it probably not, if it doesn't have a name.