ofz#27892 recursion too deep

which appeared after...

commit 8c716704df4aaa83fcd198cc8d92cd3e1e542de9
    tdf#38885 Remove createTextFromNode

Change-Id: I741135cec946c72e6643437eb2941cf3548901bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106816
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 4ac2686..a2c4e33 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -1266,6 +1266,8 @@ std::unique_ptr<SmNode> SmParser::DoRelation()
    if (aDepthGuard.TooDeep())
        throw std::range_error("parser depth limit");

    int nDepthLimit = m_nParseDepth;

    auto xFirst = DoSum();
    while (TokenInGroup(TG::Relation))
    {
@@ -1274,7 +1276,14 @@ std::unique_ptr<SmNode> SmParser::DoRelation()
        auto xThird = DoSum();
        xSNode->SetSubNodes(std::move(xFirst), std::move(xSecond), std::move(xThird));
        xFirst = std::move(xSNode);

        ++m_nParseDepth;
        if (aDepthGuard.TooDeep())
            throw std::range_error("parser depth limit");
    }

    m_nParseDepth = nDepthLimit;

    return xFirst;
}