[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sc/inc sc/qa sc/source

Markus Mohrhard markus.mohrhard at googlemail.com
Fri Jun 28 03:04:45 PDT 2013


 sc/inc/formulacell.hxx                     |    7 -------
 sc/inc/formularesult.hxx                   |    2 --
 sc/inc/token.hxx                           |   14 --------------
 sc/qa/unit/data/contentCSV/cachedValue.csv |    2 +-
 sc/source/core/tool/formularesult.cxx      |   17 -----------------
 sc/source/filter/xml/xmlcelli.cxx          |    5 +----
 6 files changed, 2 insertions(+), 45 deletions(-)

New commits:
commit 0b6233afdc65030fd7c4a57c5a2155f0d32b18df
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Jun 23 21:47:18 2013 +0200

    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 at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index c6d3aa7..747d67f 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 b337d2f..a88f82d 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 abd3cd5..109980f 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 183391b..7fed884 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 e0ca0be..a7c70e6 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 1e838a0..0fef98f 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());


More information about the Libreoffice-commits mailing list