starmath: Simply add elements to the end of the vector
No logic changed. Change-Id: I5df80d6c31f1c103c49ac4310a7d06da57d1a05f Reviewed-on: https://gerrit.libreoffice.org/19142 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
committed by
Noel Grandin
parent
7d82dfca4d
commit
57c1b07d24
@@ -1018,26 +1018,21 @@ void SmParser::DoAlign()
|
|||||||
|
|
||||||
void SmParser::DoLine()
|
void SmParser::DoLine()
|
||||||
{
|
{
|
||||||
sal_uInt16 n = 0;
|
|
||||||
SmNodeArray ExpressionArray;
|
SmNodeArray ExpressionArray;
|
||||||
|
|
||||||
ExpressionArray.resize(n);
|
|
||||||
|
|
||||||
// start with single expression that may have an alignment statement
|
// start with single expression that may have an alignment statement
|
||||||
// (and go on with expressions that must not have alignment
|
// (and go on with expressions that must not have alignment
|
||||||
// statements in 'while' loop below. See also 'Expression()'.)
|
// statements in 'while' loop below. See also 'Expression()'.)
|
||||||
if (m_aCurToken.eType != TEND && m_aCurToken.eType != TNEWLINE)
|
if (m_aCurToken.eType != TEND && m_aCurToken.eType != TNEWLINE)
|
||||||
{
|
{
|
||||||
DoAlign();
|
DoAlign();
|
||||||
ExpressionArray.resize(++n);
|
ExpressionArray.push_back(popOrZero(m_aNodeStack));
|
||||||
ExpressionArray[n - 1] = popOrZero(m_aNodeStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (m_aCurToken.eType != TEND && m_aCurToken.eType != TNEWLINE)
|
while (m_aCurToken.eType != TEND && m_aCurToken.eType != TNEWLINE)
|
||||||
{
|
{
|
||||||
DoExpression();
|
DoExpression();
|
||||||
ExpressionArray.resize(++n);
|
ExpressionArray.push_back(popOrZero(m_aNodeStack));
|
||||||
ExpressionArray[n - 1] = popOrZero(m_aNodeStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//If there's no expression, add an empty one.
|
//If there's no expression, add an empty one.
|
||||||
@@ -1067,23 +1062,18 @@ void SmParser::DoExpression()
|
|||||||
m_aNodeStack.push_front(pNode.release()); // push the node from above again (now to be used as argument to this current 'nospace' node)
|
m_aNodeStack.push_front(pNode.release()); // push the node from above again (now to be used as argument to this current 'nospace' node)
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_uInt16 n = 0;
|
|
||||||
SmNodeArray RelationArray;
|
SmNodeArray RelationArray;
|
||||||
|
|
||||||
RelationArray.resize(n);
|
|
||||||
|
|
||||||
DoRelation();
|
DoRelation();
|
||||||
RelationArray.resize(++n);
|
RelationArray.push_back(popOrZero(m_aNodeStack));
|
||||||
RelationArray[n - 1] = popOrZero(m_aNodeStack);
|
|
||||||
|
|
||||||
while (m_aCurToken.nLevel >= 4)
|
while (m_aCurToken.nLevel >= 4)
|
||||||
{
|
{
|
||||||
DoRelation();
|
DoRelation();
|
||||||
RelationArray.resize(++n);
|
RelationArray.push_back(popOrZero(m_aNodeStack));
|
||||||
RelationArray[n - 1] = popOrZero(m_aNodeStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n > 1)
|
if (RelationArray.size() > 1)
|
||||||
{
|
{
|
||||||
SmExpressionNode *pSNode = new SmExpressionNode(m_aCurToken);
|
SmExpressionNode *pSNode = new SmExpressionNode(m_aCurToken);
|
||||||
pSNode->SetSubNodes(RelationArray);
|
pSNode->SetSubNodes(RelationArray);
|
||||||
|
Reference in New Issue
Block a user