diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2017-03-06 17:36:44 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2017-03-07 02:48:53 +0000 |
commit | 39ec34b867ee60a5da68fd1e5e08b476f0b0c0ca (patch) | |
tree | cae3d7fc5cb9976cf6cd09bdd4d2f5de3836428e /starmath/source/parse.cxx | |
parent | c8267b8b65a2adcad97ea767669dabbdc4b2b27e (diff) |
starmath: Avoid creating SmFontNode with a default token
when an unexpected token is found.
Change-Id: I1a11c08ce54c55bb32289498fbb26af019396b83
Reviewed-on: https://gerrit.libreoffice.org/34918
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath/source/parse.cxx')
-rw-r--r-- | starmath/source/parse.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx index a2ba86971b11..76c4b243332a 100644 --- a/starmath/source/parse.cxx +++ b/starmath/source/parse.cxx @@ -1802,7 +1802,10 @@ void SmParser::DoColor() NextToken(); } else + { Error(SmParseError::ColorExpected); + return; + } } while (m_aCurToken.eType == TCOLOR); m_aNodeStack.push_front(o3tl::make_unique<SmFontNode>(aToken)); @@ -1822,7 +1825,10 @@ void SmParser::DoFont() NextToken(); } else + { Error(SmParseError::FontExpected); + return; + } } while (m_aCurToken.eType == TFONT); m_aNodeStack.push_front(o3tl::make_unique<SmFontNode>(aToken)); |