summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2017-03-10 10:37:11 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2017-03-10 08:59:27 +0000
commit657a791349f8cd5b1aa271ac7c75ce5b5b2a859f (patch)
tree23613bd9e340e943ae8a0e9a0f911fb0de4cff62 /starmath
parent0ae45758d1f4235f98c98f22e027ab3298e21b86 (diff)
starmath: Return SmGlyphSpecialNode from DoGlyphSpecial()
instead of pushing it to the stack. This spares some pops. Change-Id: I9fc987ebf851ff6387e347a2878ff01f482d8f7f Reviewed-on: https://gerrit.libreoffice.org/35029 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/inc/parse.hxx2
-rw-r--r--starmath/source/parse.cxx12
2 files changed, 6 insertions, 8 deletions
diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index 6804b1a9ec02..5393b3cb4b75 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -89,7 +89,7 @@ class SmParser
void DoStack();
void DoMatrix();
void DoSpecial();
- void DoGlyphSpecial();
+ SmGlyphSpecialNode *DoGlyphSpecial();
// end of grammar
void Error(SmParseError Error);
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index cf1dcc8b4053..a0f43c26f8cc 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -1124,9 +1124,7 @@ void SmParser::DoProduct()
//Let the glyph node know it's a binary operation
m_aCurToken.eType = TBOPER;
m_aCurToken.nGroup = TG::Product;
-
- DoGlyphSpecial();
- pOper = popOrZero(m_aNodeStack);
+ pOper = DoGlyphSpecial();
break;
case TOVERBRACE :
@@ -1660,8 +1658,7 @@ void SmParser::DoUnOper()
//Let the glyph know what it is...
m_aCurToken.eType = TUOPER;
m_aCurToken.nGroup = TG::UnOper;
- DoGlyphSpecial();
- pOper = popOrZero(m_aNodeStack);
+ pOper = DoGlyphSpecial();
break;
case TPLUS :
@@ -2253,10 +2250,11 @@ void SmParser::DoSpecial()
NextToken();
}
-void SmParser::DoGlyphSpecial()
+SmGlyphSpecialNode *SmParser::DoGlyphSpecial()
{
- m_aNodeStack.push_front(o3tl::make_unique<SmGlyphSpecialNode>(m_aCurToken));
+ auto pNode = o3tl::make_unique<SmGlyphSpecialNode>(m_aCurToken);
NextToken();
+ return pNode.release();
}
void SmParser::Error(SmParseError eError)