[Libreoffice-commits] core.git: Branch 'feature/inherited-number-format-removal' - 2 commits - sc/qa sc/source

Markus Mohrhard markus.mohrhard at googlemail.com
Fri May 24 14:43:26 PDT 2013


 sc/qa/unit/ucalc.cxx                |    2 +-
 sc/source/core/data/formulacell.cxx |    5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 5afb5253704c7ace10fc652ed349bb1330ad40e0
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri May 24 23:39:13 2013 +0200

    CPPUNIT_ASSERT_EQUAL gives a more helpful error message
    
    Change-Id: Ic7bc7d0298e6983e377b55f0362f34983de3df7a

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 3fcc260..091872f 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -1129,7 +1129,7 @@ void testFuncINDIRECT(ScDocument* pDoc)
         for (size_t i = 0; i < SAL_N_ELEMENTS(aChecks); ++i)
         {
             OUString aVal = pDoc->GetString(0, i, 0);
-            CPPUNIT_ASSERT_MESSAGE("Wrong value!", aVal == *aChecks[i]);
+            CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong value!", *aChecks[i], aVal);
         }
     }
 
commit 8fa826d699f6ff4ed002011358872e14472a7252
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri May 24 23:38:08 2013 +0200

    don't set hard format for text formats
    
    Gets rid of some test failures that are the result of dirty test
    environments.
    
    Change-Id: I45ed4bbe46c8aa598e074c3eac7903811cbb2620

diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 446c89d..abb9561 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1298,7 +1298,10 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
             sal_uInt16 nFormatType = p->GetRetFormatType();
             sal_Int32 nFormatIndex = p->GetRetFormatIndex();
 
-            if((nFormatIndex % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
+            // don't set text format as hard format
+            if(nFormatType == NUMBERFORMAT_TEXT)
+                nFormatIndex = 0;
+            else if((nFormatIndex % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
                 nFormatIndex = ScGlobal::GetStandardFormat(*pDocument->GetFormatTable(),
                         nFormatIndex, nFormatType);
 


More information about the Libreoffice-commits mailing list