summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-05-18 00:03:32 +0200
committerEike Rathke <erack@redhat.com>2017-05-18 15:15:06 +0200
commit202c5747d23df7fae477f097648135b0bd675c07 (patch)
treecc4de33326fb9ba513f7e8c3af1e5dba4aff3868
parent891998d48e2b7cd3c48273b4706b92735033ad17 (diff)
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/37739 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 63843a97262ccfa38d838a9cbbc3faadba8290a6) Reviewed-on: https://gerrit.libreoffice.org/37755 Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/ui/unoobj/condformatuno.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/sc/source/ui/unoobj/condformatuno.cxx b/sc/source/ui/unoobj/condformatuno.cxx
index e97311a6cff1..549fb6710fd4 100644
--- a/sc/source/ui/unoobj/condformatuno.cxx
+++ b/sc/source/ui/unoobj/condformatuno.cxx
@@ -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);
}