summaryrefslogtreecommitdiff
path: root/sc/source/core/data/dptablecache.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/data/dptablecache.cxx')
-rw-r--r--[-rwxr-xr-x]sc/source/core/data/dptablecache.cxx14
1 files changed, 12 insertions, 2 deletions
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;