diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2015-10-05 10:41:51 +0900 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-05 06:22:11 +0000 |
commit | 57c1b07d24c40ec1e1912d06c3dc2c5d5fefd268 (patch) | |
tree | bc4ac36689e98f11c55a664af9641fbe22042343 /starmath | |
parent | 7d82dfca4d78841930a4411371c3d211badeccdb (diff) |
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>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/parse.cxx | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx index e3306de59dab..02b123656fbd 100644 --- a/starmath/source/parse.cxx +++ b/starmath/source/parse.cxx @@ -1018,26 +1018,21 @@ void SmParser::DoAlign() void SmParser::DoLine() { - sal_uInt16 n = 0; SmNodeArray ExpressionArray; - ExpressionArray.resize(n); - // start with single expression that may have an alignment statement // (and go on with expressions that must not have alignment // statements in 'while' loop below. See also 'Expression()'.) if (m_aCurToken.eType != TEND && m_aCurToken.eType != TNEWLINE) { DoAlign(); - ExpressionArray.resize(++n); - ExpressionArray[n - 1] = popOrZero(m_aNodeStack); + ExpressionArray.push_back(popOrZero(m_aNodeStack)); } while (m_aCurToken.eType != TEND && m_aCurToken.eType != TNEWLINE) { DoExpression(); - ExpressionArray.resize(++n); - ExpressionArray[n - 1] = popOrZero(m_aNodeStack); + ExpressionArray.push_back(popOrZero(m_aNodeStack)); } //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) } - sal_uInt16 n = 0; SmNodeArray RelationArray; - RelationArray.resize(n); - DoRelation(); - RelationArray.resize(++n); - RelationArray[n - 1] = popOrZero(m_aNodeStack); + RelationArray.push_back(popOrZero(m_aNodeStack)); while (m_aCurToken.nLevel >= 4) { DoRelation(); - RelationArray.resize(++n); - RelationArray[n - 1] = popOrZero(m_aNodeStack); + RelationArray.push_back(popOrZero(m_aNodeStack)); } - if (n > 1) + if (RelationArray.size() > 1) { SmExpressionNode *pSNode = new SmExpressionNode(m_aCurToken); pSNode->SetSubNodes(RelationArray); |