summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2010-11-16 09:18:45 +0100
committerVladimir Glazunov <vg@openoffice.org>2010-11-16 09:18:45 +0100
commited82e3fdceba985d06ace98120a8b8bb1f13045a (patch)
treea6a6e09d270ab0ab28e50b43d78e2f5ac674a7a7
parent0e5566e9ff510bedc9837e12ee37103c553897da (diff)
parent60851227548d3576a92898b13b0e1c15cc719f44 (diff)
#i10000# changes from OOO330 m15
Notes
split repo tag: calc_ooo/DEV300_m94
-rw-r--r--sc/source/core/data/documen4.cxx7
-rw-r--r--[-rwxr-xr-x]sc/source/core/data/dptablecache.cxx14
-rw-r--r--sc/source/ui/view/output2.cxx13
3 files changed, 29 insertions, 5 deletions
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 148cc367534c..e8b58b0f71d3 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
diff --git a/sc/source/core/data/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx
index 8f25b70e41b6..8d2a5ec070f5 100755..100644
--- 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;
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 61289cc7f931..b0df298315bf 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)