[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sc/inc sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Sep 28 05:00:20 UTC 2018
sc/inc/formularesult.hxx | 2 --
sc/source/core/tool/formularesult.cxx | 28 ++++------------------------
2 files changed, 4 insertions(+), 26 deletions(-)
New commits:
commit 1abdff93273b4f97692b02e5fc00254b56cd6802
Author: Aron Budea <aron.budea at collabora.com>
AuthorDate: Fri Sep 28 06:51:23 2018 +0200
Commit: Aron Budea <aron.budea at collabora.com>
CommitDate: Fri Sep 28 06:51:23 2018 +0200
Revert "Allow fast result return for formula-cells with..."
This reverts commit 3d92276f4591ec6f949abcd440ef1544f9282c0b.
diff --git a/sc/inc/formularesult.hxx b/sc/inc/formularesult.hxx
index a7b5ea8f3da8..4797b5939522 100644
--- a/sc/inc/formularesult.hxx
+++ b/sc/inc/formularesult.hxx
@@ -76,8 +76,6 @@ class ScFormulaResult
bool mbEmpty :1; // empty cell result
bool mbEmptyDisplayedAsString :1; // only if mbEmpty
Multiline meMultiline :2; // result is multiline
- // If set it implies that the result is a simple double (in mfValue) and no error
- bool mbValueCached :1;
/** Reset mnError, mbEmpty and mbEmptyDisplayedAsString to their defaults
prior to assigning other types */
diff --git a/sc/source/core/tool/formularesult.cxx b/sc/source/core/tool/formularesult.cxx
index 7c0f1a1a570d..1b3fcd995f8a 100644
--- a/sc/source/core/tool/formularesult.cxx
+++ b/sc/source/core/tool/formularesult.cxx
@@ -22,15 +22,13 @@ FormulaResultValue::FormulaResultValue( FormulaError nErr ) : meType(Error), mfV
ScFormulaResult::ScFormulaResult() :
mpToken(nullptr), mnError(FormulaError::NONE), mbToken(true),
mbEmpty(false), mbEmptyDisplayedAsString(false),
- meMultiline(MULTILINE_UNKNOWN),
- mbValueCached(false) {}
+ meMultiline(MULTILINE_UNKNOWN) {}
ScFormulaResult::ScFormulaResult( const ScFormulaResult & r ) :
mnError( r.mnError), mbToken( r.mbToken),
mbEmpty( r.mbEmpty),
mbEmptyDisplayedAsString( r.mbEmptyDisplayedAsString),
- meMultiline( r.meMultiline),
- mbValueCached( r.mbValueCached)
+ meMultiline( r.meMultiline)
{
if (mbToken)
{
@@ -58,7 +56,7 @@ ScFormulaResult::ScFormulaResult( const ScFormulaResult & r ) :
ScFormulaResult::ScFormulaResult( const formula::FormulaToken* p ) :
mnError(FormulaError::NONE), mbToken(false), mbEmpty(false), mbEmptyDisplayedAsString(false),
- meMultiline(MULTILINE_UNKNOWN), mbValueCached(false)
+ meMultiline(MULTILINE_UNKNOWN)
{
SetToken( p);
}
@@ -75,7 +73,6 @@ void ScFormulaResult::ResetToDefaults()
mbEmpty = false;
mbEmptyDisplayedAsString = false;
meMultiline = MULTILINE_UNKNOWN;
- mbValueCached = false;
}
void ScFormulaResult::ResolveToken( const formula::FormulaToken * p )
@@ -110,7 +107,6 @@ void ScFormulaResult::ResolveToken( const formula::FormulaToken * p )
p->DecRef();
mbToken = false;
meMultiline = MULTILINE_FALSE;
- mbValueCached = true;
break;
default:
mpToken = p;
@@ -152,7 +148,7 @@ void ScFormulaResult::Assign( const ScFormulaResult & r )
SetDouble( r.mfValue);
// If there was an error there will be an error, no matter what Set...()
// methods did.
- SetResultError(r.mnError);
+ mnError = r.mnError;
}
void ScFormulaResult::SetToken( const formula::FormulaToken* p )
@@ -217,7 +213,6 @@ void ScFormulaResult::SetDouble( double f )
mfValue = f;
mbToken = false;
meMultiline = MULTILINE_FALSE;
- mbValueCached = true;
}
}
@@ -332,12 +327,6 @@ bool ScFormulaResult::IsMultiline() const
bool ScFormulaResult::GetErrorOrDouble( FormulaError& rErr, double& rVal ) const
{
- if (mbValueCached)
- {
- rVal = mfValue;
- return true;
- }
-
if (mnError != FormulaError::NONE)
{
rErr = mnError;
@@ -371,9 +360,6 @@ bool ScFormulaResult::GetErrorOrDouble( FormulaError& rErr, double& rVal ) const
sc::FormulaResultValue ScFormulaResult::GetResult() const
{
- if (mbValueCached)
- return sc::FormulaResultValue(mfValue);
-
if (mnError != FormulaError::NONE)
return sc::FormulaResultValue(mnError);
@@ -430,8 +416,6 @@ FormulaError ScFormulaResult::GetResultError() const
void ScFormulaResult::SetResultError( FormulaError nErr )
{
mnError = nErr;
- if (mnError != FormulaError::NONE)
- mbValueCached = false;
}
formula::FormulaConstTokenRef ScFormulaResult::GetToken() const
@@ -451,9 +435,6 @@ formula::FormulaConstTokenRef ScFormulaResult::GetCellResultToken() const
double ScFormulaResult::GetDouble() const
{
- if (mbValueCached)
- return mfValue;
-
if (mbToken)
{
// Should really not be of type formula::svDouble here.
@@ -545,7 +526,6 @@ void ScFormulaResult::SetHybridDouble( double f )
mfValue = f;
mbToken = false;
meMultiline = MULTILINE_FALSE;
- mbValueCached = true;
}
}
More information about the Libreoffice-commits
mailing list