Kaydet (Commit) 657a7913 authored tarafından Takeshi Abe's avatar Takeshi Abe

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/35029Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTakeshi Abe <tabe@fixedpoint.jp>
üst 0ae45758
......@@ -89,7 +89,7 @@ class SmParser
void DoStack();
void DoMatrix();
void DoSpecial();
void DoGlyphSpecial();
SmGlyphSpecialNode *DoGlyphSpecial();
// end of grammar
void Error(SmParseError Error);
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment