summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrederic vroman <fvroman@linagora.com>2017-05-12 09:14:32 +0200
committerAndras Timar <andras.timar@collabora.com>2017-05-16 10:16:38 +0200
commitda608e10855b8b2af22db147e8b67db447c83ac8 (patch)
tree85bb619ed38e31b42217d2a3566903ddbe3db8a8
parentf4585e24be0f49e896ae54c7b270de33e40f4f65 (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> (cherry picked from commit f566e2d579f5385b01d9b124e7055721313325c9) Reviewed-on: https://gerrit.libreoffice.org/37644 (cherry picked from commit 4366a6bcc175886680ff1b727207ed1ae4f97ce9)
-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 f4f0f116ba61..c970520f3377 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