diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-06-23 21:47:18 +0200 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-06-28 10:04:24 +0000 |
commit | 0b6233afdc65030fd7c4a57c5a2155f0d32b18df (patch) | |
tree | 6fb6d2946f900004c76d5c8f9a150bdbc60072c5 /sc | |
parent | afa685c2a3bca8fb73a1c2cde536a2da4cd43b13 (diff) |
we don't need this hack without inherited number formats, fdo#66076
Change-Id: If315ce28a4182019002141c7330475e0843f9a40
(cherry picked from commit 3f0b5770790dfcb408d169df1265546d6e8e3ece)
Reviewed-on: https://gerrit.libreoffice.org/4593
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/formulacell.hxx | 7 | ||||
-rw-r--r-- | sc/inc/formularesult.hxx | 2 | ||||
-rw-r--r-- | sc/inc/token.hxx | 14 | ||||
-rw-r--r-- | sc/qa/unit/data/contentCSV/cachedValue.csv | 2 | ||||
-rw-r--r-- | sc/source/core/tool/formularesult.cxx | 17 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlcelli.cxx | 5 |
6 files changed, 2 insertions, 45 deletions
diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx index c6d3aa7bfdf6..747d67f977d6 100644 --- a/sc/inc/formulacell.hxx +++ b/sc/inc/formulacell.hxx @@ -261,13 +261,6 @@ public: const formula::FormulaGrammar::Grammar eGrammar ) { aResult.SetHybridFormula( r); eTempGrammar = eGrammar; } - /** - * For import only: use for formula cells that return a number - * formatted as some kind of string - */ - void SetHybridValueString( double nVal, const OUString& r ) - { aResult.SetHybridValueString( nVal, r ); } - void SetResultMatrix( SCCOL nCols, SCROW nRows, const ScConstMatrixRef& pMat, formula::FormulaToken* pUL ) { aResult.SetMatrix(nCols, nRows, pMat, pUL); diff --git a/sc/inc/formularesult.hxx b/sc/inc/formularesult.hxx index b337d2f73d49..a88f82de0705 100644 --- a/sc/inc/formularesult.hxx +++ b/sc/inc/formularesult.hxx @@ -177,8 +177,6 @@ public: SetHybridFormula() for formula string to be compiled later. */ SC_DLLPUBLIC void SetHybridFormula( const String & rFormula ); - void SetHybridValueString( double nVal, const OUString& rStr ); - SC_DLLPUBLIC void SetMatrix( SCCOL nCols, SCROW nRows, const ScConstMatrixRef& pMat, formula::FormulaToken* pUL ); /** Get the const ScMatrixFormulaCellToken* if token is of that type, else diff --git a/sc/inc/token.hxx b/sc/inc/token.hxx index abd3cd5c06cc..109980fce92a 100644 --- a/sc/inc/token.hxx +++ b/sc/inc/token.hxx @@ -430,20 +430,6 @@ public: virtual FormulaToken* Clone() const { return new ScHybridCellToken(*this); } }; -class SC_DLLPUBLIC ScHybridValueCellToken : public ScToken -{ -private: - double mfValue; - String maString; -public: - ScHybridValueCellToken (double f, const OUString& rStr ): - ScToken( formula::svHybridValueCell ), - mfValue( f ), maString( rStr ) {} - - virtual double GetDouble() const { return mfValue; } - virtual const String & GetString() const { return maString; } -}; - // Simplify argument passing to RefUpdate methods with ScSingleRefToken or // ScDoubleRefToken class SingleDoubleRefModifier diff --git a/sc/qa/unit/data/contentCSV/cachedValue.csv b/sc/qa/unit/data/contentCSV/cachedValue.csv index 183391b00d6e..7fed884cef02 100644 --- a/sc/qa/unit/data/contentCSV/cachedValue.csv +++ b/sc/qa/unit/data/contentCSV/cachedValue.csv @@ -1,2 +1,2 @@ 1.00,200.00%,$3.00,1/3/00,00:00,6.00E+000,7 1/5,TRUE,9,1000%,01-10 -1,200.00%,$3.00,01/03/00,120:00:00,6.00E+000,7 1/5,TRUE,9,1000.00%,01/10/00 +1,200.00%,$3.00,01/03/00,12:00:00 AM,6.00E+000,7 1/5,TRUE,9,1000.00%,01/10/00 diff --git a/sc/source/core/tool/formularesult.cxx b/sc/source/core/tool/formularesult.cxx index e0ca0beefc63..a7c70e64b8d6 100644 --- a/sc/source/core/tool/formularesult.cxx +++ b/sc/source/core/tool/formularesult.cxx @@ -430,23 +430,6 @@ void ScFormulaResult::SetHybridFormula( const String & rFormula ) mbToken = true; } -void ScFormulaResult::SetHybridValueString( double nVal, const OUString& rStr ) -{ - if(GetType() == formula::svMatrixCell) - { - SetDouble(nVal); - return; - } - - ResetToDefaults(); - if (mbToken && mpToken) - mpToken->DecRef(); - - mpToken = new ScHybridValueCellToken( nVal, rStr ); - mpToken->IncRef(); - mbToken = true; -} - void ScFormulaResult::SetMatrix( SCCOL nCols, SCROW nRows, const ScConstMatrixRef& pMat, formula::FormulaToken* pUL ) { ResetToDefaults(); diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 1e838a0f350c..0fef98fac854 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -993,10 +993,7 @@ void ScXMLTableRowCellContext::SetFormulaCell(ScFormulaCell* pFCell) const } else if (!rtl::math::isNan(fValue)) { - if (mbEditEngineHasText) - pFCell->SetHybridValueString(fValue, mpEditEngine->GetText(0)); - else - pFCell->SetHybridDouble(fValue); + pFCell->SetHybridDouble(fValue); pFCell->ResetDirty(); } pFCell->StartListeningTo(rXMLImport.GetDocument()); |