- int dx = pos2 - pos1;
- MathedArray a;
- a.resize(dx + 1);
- strange_copy(&a, (fc) ? 1 : 0, pos1, dx);
- if (fc) {
- a[0] = fc;
- ++dx;
+// returns sequence of char with same code starting at it up to end
+// it might be less, though...
+string charSequence(MathArray::const_iterator it, MathArray::const_iterator end)
+{
+ string s;
+ MathCharInset const * p = it->nucleus()->asCharInset();
+ if (!p)
+ return s;
+
+ for (MathTextCodes c = p->code(); it != end; ++it) {
+ if (!it->nucleus())
+ break;
+ p = it->nucleus()->asCharInset();
+ if (!p || p->code() != c)
+ break;
+ s += p->getChar();