Kaydet (Commit) f566e2d5 authored tarafından frederic vroman's avatar frederic vroman Kaydeden (comit) Eike Rathke

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
9c1ca6dc

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/37527Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
üst 1731bfcb
...@@ -389,7 +389,7 @@ void ScConditionEntry::Compile( const OUString& rExpr1, const OUString& rExpr2, ...@@ -389,7 +389,7 @@ void ScConditionEntry::Compile( const OUString& rExpr1, const OUString& rExpr2,
// temporary formula string as string tokens // temporary formula string as string tokens
//TODO: merge with lcl_ScDocFunc_CreateTokenArrayXML //TODO: merge with lcl_ScDocFunc_CreateTokenArrayXML
pFormula1 = new ScTokenArray; pFormula1 = new ScTokenArray;
pFormula1->AddStringXML( rExpr1 ); pFormula1->AssignXMLString( rExpr1, rExprNmsp1 );
// bRelRef1 is set when the formula is compiled again (CompileXML) // bRelRef1 is set when the formula is compiled again (CompileXML)
} }
else else
...@@ -427,7 +427,7 @@ void ScConditionEntry::Compile( const OUString& rExpr1, const OUString& rExpr2, ...@@ -427,7 +427,7 @@ void ScConditionEntry::Compile( const OUString& rExpr1, const OUString& rExpr2,
// temporary formula string as string tokens // temporary formula string as string tokens
//TODO: merge with lcl_ScDocFunc_CreateTokenArrayXML //TODO: merge with lcl_ScDocFunc_CreateTokenArrayXML
pFormula2 = new ScTokenArray; pFormula2 = new ScTokenArray;
pFormula2->AddStringXML( rExpr2 ); pFormula2->AssignXMLString( rExpr2, rExprNmsp2 );
// bRelRef2 is set when the formula is compiled again (CompileXML) // bRelRef2 is set when the formula is compiled again (CompileXML)
} }
else else
......
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