diff options
author | Niklas Nebel <nn@openoffice.org> | 2010-11-08 16:24:12 +0100 |
---|---|---|
committer | Niklas Nebel <nn@openoffice.org> | 2010-11-08 16:24:12 +0100 |
commit | e939353f9c1486f149a481b25a2c57103189c9bb (patch) | |
tree | aa80c16174a403f51904df392bc53b7df7b87fba | |
parent | 2d9884e79d5885ee708e29dbd21b13ad0c3e6631 (diff) |
calc62: #i115431# treat DataPilot filter field numbers as relative to the sheet, set MK_ERR bit for errors
-rw-r--r--[-rwxr-xr-x] | sc/source/core/data/dptablecache.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sc/source/core/data/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx index f350e8649..4f445e899 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; |