diff --git a/lib/jkqtmathtext/jkqtmathtext.cpp b/lib/jkqtmathtext/jkqtmathtext.cpp index ba7be4a7b7..bc494a7fdb 100644 --- a/lib/jkqtmathtext/jkqtmathtext.cpp +++ b/lib/jkqtmathtext/jkqtmathtext.cpp @@ -1225,7 +1225,8 @@ JKQTMathTextNode* JKQTMathText::parseLatexString(bool get, JKQTMathTextBraceType if (currentToken==MTTtext) { if (currentTokenName.size()>0) { bool tokenWasNoBrace=false; - if (TokenNameMatchesJKQTMathTextBraceType(currentTokenName[0], quitOnClosingBrace, true, &tokenWasNoBrace)) { + const QString firstTokenChar(currentTokenName[0]); + if (TokenNameMatchesJKQTMathTextBraceType(firstTokenChar, quitOnClosingBrace, true, &tokenWasNoBrace)) { //std::cout<<"found \\right '"<0) { - const JKQTMathTextBraceType bracetype=TokenName2JKQTMathTextBraceType(currentTokenName[0]); + const QString firstTokenChar(currentTokenName[0]); + const JKQTMathTextBraceType bracetype=TokenName2JKQTMathTextBraceType(firstTokenChar); if (bracetype==MTBTNone) { currentTokenName=currentTokenName.right(currentTokenName.size()-1); JKQTMathTextNode* cn=parseLatexString(currentTokenName.size()<=0, MTBTAny);