MathCell* MathParser::ParseSubSupTag(wxXmlNode* node) { SubSupCell *subsup = new SubSupCell; wxXmlNode* child = node->GetChildren(); if (child) { subsup->SetBase(ParseTag(child, false)); child = child->GetNext(); if (child) { MathCell* index = ParseTag(child, false); index->SetExponentFlag(); subsup->SetIndex(index); child = child->GetNext(); if (child) { MathCell* power = ParseTag(child, false); power->SetExponentFlag(); subsup->SetExponent(power); subsup->SetType(m_ParserStyle); subsup->SetStyle(TS_VARIABLE); return subsup; } } } delete subsup; return NULL; }
MathCell* SubSupCell::Copy() { SubSupCell* tmp = new SubSupCell; CopyData(this, tmp); tmp->SetBase(m_baseCell->CopyList()); tmp->SetIndex(m_indexCell->CopyList()); tmp->SetExponent(m_exptCell->CopyList()); return tmp; }
MathCell* SubSupCell::Copy(bool all) { SubSupCell* tmp = new SubSupCell; CopyData(this, tmp); tmp->SetBase(m_baseCell->Copy(true)); tmp->SetIndex(m_indexCell->Copy(true)); tmp->SetExponent(m_exptCell->Copy(true)); if (all && m_next != NULL) tmp->AppendCell(m_next->Copy(all)); return tmp; }