Kaydet (Commit) 63843a97 authored tarafından Julien Nabet's avatar Julien Nabet Kaydeden (comit) Eike Rathke

tdf#107920: Crash when using ScCompiler in condformat

Just call SetGrammar from ScCompiler object with grammar of document
See bt in https://bugs.documentfoundation.org/attachment.cgi?id=133382

Change-Id: Iedf4b88f2821bbcf728e4b1c023041fd6f10e5f3
Reviewed-on: https://gerrit.libreoffice.org/37739Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
üst e4e093b9
......@@ -717,6 +717,7 @@ void SAL_CALL ScConditionEntryObj::setPropertyValue(
if ((aValue >>= aFormula) && !aFormula.isEmpty())
{
ScCompiler aComp(&mpDocShell->GetDocument(), getCoreObject()->GetSrcPos());
aComp.SetGrammar(mpDocShell->GetDocument().GetGrammar());
std::unique_ptr<ScTokenArray> pArr(aComp.CompileString(aFormula));
getCoreObject()->SetFormula1(*pArr);
}
......@@ -728,6 +729,7 @@ void SAL_CALL ScConditionEntryObj::setPropertyValue(
if ((aValue >>= aFormula) && !aFormula.isEmpty())
{
ScCompiler aComp(&mpDocShell->GetDocument(), getCoreObject()->GetSrcPos());
aComp.SetGrammar(mpDocShell->GetDocument().GetGrammar());
std::unique_ptr<ScTokenArray> pArr(aComp.CompileString(aFormula));
getCoreObject()->SetFormula2(*pArr);
}
......
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