[Libreoffice-commits] core.git: sc/inc sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Aug 7 15:35:38 UTC 2018
sc/inc/compiler.hxx | 9 +++++----
sc/source/core/tool/compiler.cxx | 6 +++++-
2 files changed, 10 insertions(+), 5 deletions(-)
New commits:
commit 1d531077d97e247ebfd14b18a5dc72c45f41ea15
Author: Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Tue Aug 7 14:48:56 2018 +0200
Commit: Luboš Luňák <l.lunak at collabora.com>
CommitDate: Tue Aug 7 17:35:16 2018 +0200
more robust implicit intersection optimizing
For example, FormulaCompiler::MergeRangeReference() may replace
the parameter tokens and merge two into one.
Change-Id: Ie2933dec3ef73b5b605160e86a8ab3b5b1d17c1c
Reviewed-on: https://gerrit.libreoffice.org/58684
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak at collabora.com>
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 969bd41d838a..394f532b57fc 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -305,10 +305,11 @@ private:
// be important. Store candidate parameters and the operation they are the argument for.
struct PendingImplicitIntersectionOptimization
{
- PendingImplicitIntersectionOptimization(formula::FormulaToken** p, const formula::FormulaToken* o)
- : parameter( p ), operation( o ) {}
- formula::FormulaToken** parameter;
- const formula::FormulaToken* operation;
+ PendingImplicitIntersectionOptimization(formula::FormulaToken** p, formula::FormulaToken* o)
+ : parameterLocation( p ), parameter( *p ), operation( o ) {}
+ formula::FormulaToken** parameterLocation;
+ formula::FormulaTokenRef parameter;
+ formula::FormulaTokenRef operation;
};
std::vector< PendingImplicitIntersectionOptimization > mPendingImplicitIntersectionOptimizations;
std::set<formula::FormulaTokenRef> mUnhandledPossibleImplicitIntersections;
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 446f1b08f86f..6568f2db0da0 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -5971,10 +5971,14 @@ void ScCompiler::PostProcessCode()
{
for( const PendingImplicitIntersectionOptimization& item : mPendingImplicitIntersectionOptimizations )
{
+ if( *item.parameterLocation != item.parameter ) // the parameter has been changed somehow
+ continue;
+ if( item.parameterLocation >= pCode ) // the location is not inside the code (pCode points after the end)
+ continue;
// E.g. "SUMPRODUCT(I5:I6+1)" shouldn't do implicit intersection.
if( item.operation->IsInForceArray())
continue;
- ReplaceDoubleRefII( item.parameter );
+ ReplaceDoubleRefII( item.parameterLocation );
}
mPendingImplicitIntersectionOptimizations.clear();
}
More information about the Libreoffice-commits
mailing list