[Libreoffice-commits] .: Branch 'libreoffice-3-3' - 6 commits - sc/source

Jan Holesovsky kendy at kemper.freedesktop.org
Tue Nov 16 00:05:35 PST 2010


 sc/source/core/data/documen4.cxx     |    7 ++++++-
 sc/source/core/data/dptablecache.cxx |   14 ++++++++++++--
 sc/source/ui/view/output2.cxx        |   13 +++++++++++--
 3 files changed, 29 insertions(+), 5 deletions(-)

New commits:
commit 5a946db883d73807253caafa44d197f7acfb48da
Merge: b4feaa9... b6ea51b...
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Tue Nov 16 09:00:38 2010 +0100

    Merge commit 'ooo/OOO330_m15' into libreoffice-3-3

commit b6ea51bd625595ff923a1695b2137e476aaa0d52
Merge: c74ef57... e89b22d...
Author: obo <obo at openoffice.org>
Date:   Fri Nov 12 07:50:26 2010 +0100

    CWS-TOOLING: integrate CWS calc63

commit e89b22dab8ee99c494150d5ccd1f78ba0c8fe502
Author: Niklas Nebel <nn at openoffice.org>
Date:   Thu Nov 11 13:13:58 2010 +0100

    calc63: #i115512# RoundValueAsShown: don't round to -1 digits for unlimited precision

diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index cbd55fd..d2cbca2 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -505,7 +505,7 @@ double ScDocument::RoundValueAsShown( double fVal, ULONG nFormat )
       && nType != NUMBERFORMAT_TIME && nType != NUMBERFORMAT_DATETIME )
     {
         short nPrecision;
-        if ( nFormat )
+        if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
         {
             nPrecision = (short)GetFormatTable()->GetFormatPrecision( nFormat );
             switch ( nType )
@@ -524,7 +524,12 @@ double ScDocument::RoundValueAsShown( double fVal, ULONG nFormat )
             }
         }
         else
+        {
             nPrecision = (short)GetDocOptions().GetStdPrecision();
+            // #i115512# no rounding for automatic decimals
+            if (nPrecision == static_cast<short>(SvNumberFormatter::UNLIMITED_PRECISION))
+                return fVal;
+        }
         double fRound = ::rtl::math::round( fVal, nPrecision );
         if ( ::rtl::math::approxEqual( fVal, fRound ) )
             return fVal;		// durch Rundung hoechstens Fehler
commit c74ef5767ef2f670aab7401bb331bf8a0ba83c17
Merge: 2d9884e... a92726b...
Author: obo <obo at openoffice.org>
Date:   Tue Nov 9 12:20:56 2010 +0100

    CWS-TOOLING: integrate CWS calc62

commit a92726be8f251b1cd4d8c0c9413308ee3011ef55
Author: Niklas Nebel <nn at openoffice.org>
Date:   Mon Nov 8 17:59:01 2010 +0100

    calc62: #i115431# if #VALUE! doesn't fit into the cell, always use hashes

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index e26056b..aff5a5a 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -529,9 +529,18 @@ void ScDrawStringsVars::SetTextToWidthOrHash( ScBaseCell* pCell, long nWidth )
         // must be a value or formula cell.
         return;
 
-    if (eType == CELLTYPE_FORMULA && !static_cast<ScFormulaCell*>(pCell)->IsValue())
+    if (eType == CELLTYPE_FORMULA)
+    {
+        ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell);
+        if (pFCell->GetErrCode() != 0)
+        {
+            SetHashText();      // If the error string doesn't fit, always use "###"
+            return;
+        }
         // If it's formula, the result must be a value.
-        return;
+        if (!pFCell->IsValue())
+            return;
+    }
 
     ULONG nFormat = GetValueFormat();
     if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
commit e939353f9c1486f149a481b25a2c57103189c9bb
Author: Niklas Nebel <nn at openoffice.org>
Date:   Mon Nov 8 16:24:12 2010 +0100

    calc62: #i115431# treat DataPilot filter field numbers as relative to the sheet, set MK_ERR bit for errors

diff --git a/sc/source/core/data/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx
old mode 100755
new mode 100644
index f350e86..4f445e8
--- a/sc/source/core/data/dptablecache.cxx
+++ b/sc/source/core/data/dptablecache.cxx
@@ -201,8 +201,11 @@ ScDPItemData::ScDPItemData( ScDocument* pDoc, SCROW nRow, USHORT nCol, USHORT nD
     ScBaseCell* pCell = pDoc->GetCell( aPos );
 
     if ( pCell && pCell->GetCellType() == CELLTYPE_FORMULA && ((ScFormulaCell*)pCell)->GetErrCode() )
+    {
         SetString ( aDocStr );      //[SODC_19347] add liyi
         //bErr = TRUE;              //[SODC_19347] del liyi
+        mbFlag |= MK_ERR;
+    }
     else if ( pDoc->HasValueData( nCol, nRow, nDocTab ) )
     {
         double fVal = pDoc->GetValue(ScAddress(nCol, nRow, nDocTab));
@@ -672,8 +675,15 @@ bool ScDPTableDataCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam, BOO
         {
             ScQueryEntry& rEntry = rParam.GetEntry(i);
             // we can only handle one single direct query
-            SCROW nId = GetItemDataId( (SCCOL)rEntry.nField, nRow, FALSE ); 
-            const ScDPItemData* pCellData = GetItemDataById(  (SCCOL)rEntry.nField, nId); 
+            // #i115431# nField in QueryParam is the sheet column, not the field within the source range
+            SCCOL nQueryCol = (SCCOL)rEntry.nField;
+            if ( nQueryCol < rParam.nCol1 )
+                nQueryCol = rParam.nCol1;
+            if ( nQueryCol > rParam.nCol2 )
+                nQueryCol = rParam.nCol2;
+            SCCOL nSourceField = nQueryCol - rParam.nCol1;
+            SCROW nId = GetItemDataId( nSourceField, nRow, FALSE ); 
+            const ScDPItemData* pCellData = GetItemDataById( nSourceField, nId ); 
 
             BOOL bOk = FALSE;
             BOOL bTestEqual = FALSE;


More information about the Libreoffice-commits mailing list