summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrederic vroman <fvroman@linagora.com>2017-05-12 09:14:32 +0200
committerEike Rathke <erack@redhat.com>2017-05-15 13:55:04 +0200
commitf566e2d579f5385b01d9b124e7055721313325c9 (patch)
treebec5f861a136b45f286a57faa82d26f8d2dd681f
parent1731bfcb6bf4b92e0fcd2ceaa7fbf45b84df0ce8 (diff)
tdf#82326 calc 32bits unable to open files with a lot of cond formatting
The code to build and compute formulas is using an fixed size array. The size of this array has been changed from 512 to 8192 by commit 9c1ca6dca3b553c302a635357e33591605343b99 Since then, LO consumes a LOT of memory while opening scalc files which are making extensive use of conditional formatting. This is a silent issue when working with a 64bits versions of LO because the memory is immediately released at the end of the load phase. However, with 32bits versions, some files can not be opened anymore as it can consume the full process memory space (2GB on windows). The parser is creating ScCondtionEntry objects to store conditional formatting expressions which are immediately compiled in the constructor. However the compile method did not return a flattened token array. Change-Id: Id290bc1f5838c246d4c2322b297b13307defaf88 Reviewed-on: https://gerrit.libreoffice.org/37527 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/core/data/conditio.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index c6a5dc0713b5..e0ad06cf9a77 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -389,7 +389,7 @@ void ScConditionEntry::Compile( const OUString& rExpr1, const OUString& rExpr2,
// temporary formula string as string tokens
//TODO: merge with lcl_ScDocFunc_CreateTokenArrayXML
pFormula1 = new ScTokenArray;
- pFormula1->AddStringXML( rExpr1 );
+ pFormula1->AssignXMLString( rExpr1, rExprNmsp1 );
// bRelRef1 is set when the formula is compiled again (CompileXML)
}
else
@@ -427,7 +427,7 @@ void ScConditionEntry::Compile( const OUString& rExpr1, const OUString& rExpr2,
// temporary formula string as string tokens
//TODO: merge with lcl_ScDocFunc_CreateTokenArrayXML
pFormula2 = new ScTokenArray;
- pFormula2->AddStringXML( rExpr2 );
+ pFormula2->AssignXMLString( rExpr2, rExprNmsp2 );
// bRelRef2 is set when the formula is compiled again (CompileXML)
}
else