summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-09-02 15:58:07 +0200
committerEike Rathke <erack@redhat.com>2015-09-02 16:10:34 +0200
commit26e84b3852bbb9585fab76e8d3dba5dcd77f0357 (patch)
tree809407dc6eba799715c69b56f757cc431ec24a94
parentc4afb5d19342d249fae841c24575a5f9ecacdfe2 (diff)
TableRef: introduce ScDBDataPortion enum
... to replace * bool bStartonly=false with ScDBDataPortion::AREA * bool bStartonly=true with ScDBDataPortion::TOP_LEFT and provide means to look at header row only with ScDBDataPortion::HEADER as needed for TableRef. Change-Id: I9f6affd04c15a6204193687b2379160eb975f56e
-rw-r--r--sc/inc/dbdata.hxx16
-rw-r--r--sc/inc/document.hxx5
-rw-r--r--sc/source/core/data/documen3.cxx12
-rw-r--r--sc/source/core/tool/compiler.cxx2
-rw-r--r--sc/source/core/tool/dbdata.cxx45
-rw-r--r--sc/source/ui/dbgui/dbnamdlg.cxx2
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx6
-rw-r--r--sc/source/ui/docshell/docsh5.cxx2
-rw-r--r--sc/source/ui/undo/undodat.cxx2
-rw-r--r--sc/source/ui/view/cellsh2.cxx2
-rw-r--r--sc/source/ui/view/dbfunc.cxx2
-rw-r--r--sc/source/ui/view/dbfunc3.cxx4
-rw-r--r--sc/source/ui/view/gridwin.cxx6
-rw-r--r--sc/source/ui/view/gridwin4.cxx4
14 files changed, 62 insertions, 48 deletions
diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx
index 967ba3033a18..efe0d2f5052e 100644
--- a/sc/inc/dbdata.hxx
+++ b/sc/inc/dbdata.hxx
@@ -37,6 +37,14 @@ struct ScQueryParam;
struct ScSubTotalParam;
struct ScImportParam;
+/** Enum used to indicate which portion of the DBArea is to be considered. */
+enum class ScDBDataPortion
+{
+ TOP_LEFT, ///< top left cell of area
+ HEADER, ///< header row of area, if headers are present
+ AREA ///< entire area
+};
+
class ScDBData : public ScRefreshTimer
{
private:
@@ -151,7 +159,7 @@ public:
void GetImportParam(ScImportParam& rImportParam) const;
void SetImportParam(const ScImportParam& rImportParam);
- bool IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) const;
+ bool IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion) const;
bool IsDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const;
bool HasImportParam() const;
@@ -242,7 +250,7 @@ public:
iterator end();
const_iterator begin() const;
const_iterator end() const;
- const ScDBData* findAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) const;
+ const ScDBData* findAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion) const;
const ScDBData* findByRange(const ScRange& rRange) const;
void deleteOnTab(SCTAB nTab);
ScDBData* getByRange(const ScRange& rRange);
@@ -269,8 +277,8 @@ public:
AnonDBs& getAnonDBs() { return maAnonDBs;}
const AnonDBs& getAnonDBs() const { return maAnonDBs;}
- const ScDBData* GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) const;
- ScDBData* GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly);
+ const ScDBData* GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion) const;
+ ScDBData* GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion);
const ScDBData* GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const;
ScDBData* GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
ScDBData* GetDBNearCursor(SCCOL nCol, SCROW nRow, SCTAB nTab );
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index a2b78006d142..9ea6729f6377 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -189,6 +189,7 @@ struct ScSubTotalParam;
struct ScQueryParam;
class ScHint;
class SvtBroadcaster;
+enum class ScDBDataPortion;
namespace com { namespace sun { namespace star {
namespace lang {
@@ -565,8 +566,8 @@ public:
SC_DLLPUBLIC ScDBCollection* GetDBCollection() const { return pDBCollection;}
void SetDBCollection( ScDBCollection* pNewDBCollection,
bool bRemoveAutoFilter = false );
- const ScDBData* GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly = false) const;
- ScDBData* GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly = false);
+ const ScDBData* GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion) const;
+ ScDBData* GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion);
const ScDBData* GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const;
ScDBData* GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 2b8dc9afa57c..32791dab34d1 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -281,18 +281,18 @@ void ScDocument::SetDBCollection( ScDBCollection* pNewDBCollection, bool bRemove
pDBCollection = pNewDBCollection;
}
-const ScDBData* ScDocument::GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) const
+const ScDBData* ScDocument::GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion) const
{
if (pDBCollection)
- return pDBCollection->GetDBAtCursor(nCol, nRow, nTab, bStartOnly);
+ return pDBCollection->GetDBAtCursor(nCol, nRow, nTab, ePortion);
else
return NULL;
}
-ScDBData* ScDocument::GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly)
+ScDBData* ScDocument::GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion)
{
if (pDBCollection)
- return pDBCollection->GetDBAtCursor(nCol, nRow, nTab, bStartOnly);
+ return pDBCollection->GetDBAtCursor(nCol, nRow, nTab, ePortion);
else
return NULL;
}
@@ -1413,7 +1413,7 @@ bool ScDocument::CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n
bool ScDocument::HasAutoFilter( SCCOL nCurCol, SCROW nCurRow, SCTAB nCurTab )
{
- const ScDBData* pDBData = GetDBAtCursor( nCurCol, nCurRow, nCurTab );
+ const ScDBData* pDBData = GetDBAtCursor( nCurCol, nCurRow, nCurTab, ScDBDataPortion::AREA );
bool bHasAutoFilter = (pDBData != NULL);
if ( pDBData )
@@ -1465,7 +1465,7 @@ bool ScDocument::GetFilterEntries(
{
if ( ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] && pDBCollection )
{
- ScDBData* pDBData = pDBCollection->GetDBAtCursor(nCol, nRow, nTab, false); //!??
+ ScDBData* pDBData = pDBCollection->GetDBAtCursor(nCol, nRow, nTab, ScDBDataPortion::AREA); //!??
if (pDBData)
{
pDBData->ExtendDataArea(this);
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index a166a41a5807..67cf1d7c11e2 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4705,7 +4705,7 @@ void ScCompiler::CreateStringFromSingleRef( OUStringBuffer& rBuffer, const Formu
if (aStr.isEmpty())
{
// Hope that there's still the original column name available.
- const ScDBData* pData = pDoc->GetDBAtCursor( aAbs.Col(), aAbs.Row(), aAbs.Tab());
+ const ScDBData* pData = pDoc->GetDBAtCursor( aAbs.Col(), aAbs.Row(), aAbs.Tab(), ScDBDataPortion::HEADER);
if (pData)
aStr = pData->GetTableColumnName( aAbs.Col());
}
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index f9c69b20d338..825e6ca51124 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -430,15 +430,19 @@ void ScDBData::SetImportParam(const ScImportParam& rImportParam)
mpImportParam.reset(new ScImportParam(rImportParam));
}
-bool ScDBData::IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) const
+bool ScDBData::IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion) const
{
if (nTab == nTable)
{
- if ( bStartOnly )
- return ( nCol == nStartCol && nRow == nStartRow );
- else
- return ( nCol >= nStartCol && nCol <= nEndCol &&
- nRow >= nStartRow && nRow <= nEndRow );
+ switch (ePortion)
+ {
+ case ScDBDataPortion::TOP_LEFT:
+ return nCol == nStartCol && nRow == nStartRow;
+ case ScDBDataPortion::HEADER:
+ return HasHeader() && nRow == nStartRow && nCol >= nStartCol && nCol <= nEndCol;
+ case ScDBDataPortion::AREA:
+ return nCol >= nStartCol && nCol <= nEndCol && nRow >= nStartRow && nRow <= nEndRow;
+ }
}
return false;
@@ -812,14 +816,14 @@ class FindByCursor : public unary_function<std::unique_ptr<ScDBData>, bool>
SCCOL mnCol;
SCROW mnRow;
SCTAB mnTab;
- bool mbStartOnly;
+ ScDBDataPortion mePortion;
public:
- FindByCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) :
- mnCol(nCol), mnRow(nRow), mnTab(nTab), mbStartOnly(bStartOnly) {}
+ FindByCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion) :
+ mnCol(nCol), mnRow(nRow), mnTab(nTab), mePortion(ePortion) {}
bool operator() (std::unique_ptr<ScDBData> const& p)
{
- return p->IsDBAtCursor(mnCol, mnRow, mnTab, mbStartOnly);
+ return p->IsDBAtCursor(mnCol, mnRow, mnTab, mePortion);
}
};
@@ -980,10 +984,11 @@ ScDBCollection::AnonDBs::const_iterator ScDBCollection::AnonDBs::end() const
return m_DBs.end();
}
-const ScDBData* ScDBCollection::AnonDBs::findAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) const
+const ScDBData* ScDBCollection::AnonDBs::findAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab,
+ ScDBDataPortion ePortion) const
{
DBsType::const_iterator itr = find_if(
- m_DBs.begin(), m_DBs.end(), FindByCursor(nCol, nRow, nTab, bStartOnly));
+ m_DBs.begin(), m_DBs.end(), FindByCursor(nCol, nRow, nTab, ePortion));
return itr == m_DBs.end() ? nullptr : itr->get();
}
@@ -1062,22 +1067,22 @@ ScDBCollection::ScDBCollection(ScDocument* pDocument) :
ScDBCollection::ScDBCollection(const ScDBCollection& r) :
pDoc(r.pDoc), nEntryIndex(r.nEntryIndex), maNamedDBs(r.maNamedDBs), maAnonDBs(r.maAnonDBs) {}
-const ScDBData* ScDBCollection::GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) const
+const ScDBData* ScDBCollection::GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion) const
{
// First, search the global named db ranges.
NamedDBs::DBsType::const_iterator itr = find_if(
- maNamedDBs.begin(), maNamedDBs.end(), FindByCursor(nCol, nRow, nTab, bStartOnly));
+ maNamedDBs.begin(), maNamedDBs.end(), FindByCursor(nCol, nRow, nTab, ePortion));
if (itr != maNamedDBs.end())
return itr->get();
// Check for the sheet-local anonymous db range.
const ScDBData* pNoNameData = pDoc->GetAnonymousDBData(nTab);
if (pNoNameData)
- if (pNoNameData->IsDBAtCursor(nCol,nRow,nTab,bStartOnly))
+ if (pNoNameData->IsDBAtCursor(nCol,nRow,nTab,ePortion))
return pNoNameData;
// Check the global anonymous db ranges.
- const ScDBData* pData = getAnonDBs().findAtCursor(nCol, nRow, nTab, bStartOnly);
+ const ScDBData* pData = getAnonDBs().findAtCursor(nCol, nRow, nTab, ePortion);
if (pData)
return pData;
@@ -1086,22 +1091,22 @@ const ScDBData* ScDBCollection::GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab
return NULL;
}
-ScDBData* ScDBCollection::GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly)
+ScDBData* ScDBCollection::GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion)
{
// First, search the global named db ranges.
NamedDBs::DBsType::iterator itr = find_if(
- maNamedDBs.begin(), maNamedDBs.end(), FindByCursor(nCol, nRow, nTab, bStartOnly));
+ maNamedDBs.begin(), maNamedDBs.end(), FindByCursor(nCol, nRow, nTab, ePortion));
if (itr != maNamedDBs.end())
return itr->get();
// Check for the sheet-local anonymous db range.
ScDBData* pNoNameData = pDoc->GetAnonymousDBData(nTab);
if (pNoNameData)
- if (pNoNameData->IsDBAtCursor(nCol,nRow,nTab,bStartOnly))
+ if (pNoNameData->IsDBAtCursor(nCol,nRow,nTab,ePortion))
return pNoNameData;
// Check the global anonymous db ranges.
- const ScDBData* pData = getAnonDBs().findAtCursor(nCol, nRow, nTab, bStartOnly);
+ const ScDBData* pData = getAnonDBs().findAtCursor(nCol, nRow, nTab, ePortion);
if (pData)
return const_cast<ScDBData*>(pData);
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index 4ebe1d0e89e7..f35e7649b518 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -230,7 +230,7 @@ void ScDbNameDlg::Init()
if ( pDBColl )
{
// Feststellen, ob definierter DB-Bereich markiert wurde:
- pDBData = pDBColl->GetDBAtCursor( nStartCol, nStartRow, nStartTab, true );
+ pDBData = pDBColl->GetDBAtCursor( nStartCol, nStartRow, nStartTab, ScDBDataPortion::TOP_LEFT );
if ( pDBData )
{
ScAddress& rStart = theCurArea.aStart;
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index e7bf8faecbe2..5d308af5f19a 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -323,7 +323,7 @@ bool ScDBDocFunc::RepeatDB( const OUString& rDBName, bool bRecord, bool bApi, bo
if (bQuery && !aQueryParam.bInplace)
{
ScDBData* pDest = rDoc.GetDBAtCursor( aQueryParam.nDestCol, aQueryParam.nDestRow,
- aQueryParam.nDestTab, true );
+ aQueryParam.nDestTab, ScDBDataPortion::TOP_LEFT );
if (pDest && pDest->IsDoSize())
{
pDest->GetArea( aOldQuery );
@@ -432,7 +432,7 @@ bool ScDBDocFunc::RepeatDB( const OUString& rDBName, bool bRecord, bool bApi, bo
if (bQuerySize)
{
ScDBData* pDest = rDoc.GetDBAtCursor( aQueryParam.nDestCol, aQueryParam.nDestRow,
- aQueryParam.nDestTab, true );
+ aQueryParam.nDestTab, ScDBDataPortion::TOP_LEFT );
if (pDest)
{
pDest->GetArea( aNewQuery );
@@ -678,7 +678,7 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
}
pDestData = rDoc.GetDBAtCursor( rQueryParam.nDestCol, rQueryParam.nDestRow,
- rQueryParam.nDestTab, true );
+ rQueryParam.nDestTab, ScDBDataPortion::TOP_LEFT );
if (pDestData)
{
pDestData->GetArea( aOldDest );
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index c66fc6578ac0..cbef1979ee13 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -523,7 +523,7 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, bool bRecord )
ScDocShellModificator aModificator( *this );
ScRange aOldDest;
- ScDBData* pDestData = aDocument.GetDBAtCursor( rParam.nCol, rParam.nRow, rParam.nTab, true );
+ ScDBData* pDestData = aDocument.GetDBAtCursor( rParam.nCol, rParam.nRow, rParam.nTab, ScDBDataPortion::TOP_LEFT );
if (pDestData)
pDestData->GetArea(aOldDest);
diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx
index f636c596f9ba..849e9f764ab3 100644
--- a/sc/source/ui/undo/undodat.cxx
+++ b/sc/source/ui/undo/undodat.cxx
@@ -792,7 +792,7 @@ void ScUndoQuery::Undo()
nDestEndRow = aQueryParam.nDestRow + ( aQueryParam.nRow2-aQueryParam.nRow1 );
ScDBData* pData = rDoc.GetDBAtCursor( aQueryParam.nDestCol, aQueryParam.nDestRow,
- aQueryParam.nDestTab, true );
+ aQueryParam.nDestTab, ScDBDataPortion::TOP_LEFT );
if (pData)
{
ScRange aNewDest;
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index e106cb3cd823..28dd99d6eda6 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -1159,7 +1159,7 @@ void ScCellShell::GetDBState( SfxItemSet& rSet )
ScDBData* pDBData = bSelected
? rDoc.GetDBAtArea( nStartTab, nStartCol, nStartRow, nEndCol, nEndRow )
- : rDoc.GetDBAtCursor( nStartCol, nStartRow, nStartTab );
+ : rDoc.GetDBAtCursor( nStartCol, nStartRow, nStartTab, ScDBDataPortion::AREA );
if ( pDBData )
{
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index da44ac4a43b9..f9c3c4b7f099 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -259,7 +259,7 @@ void ScDBFunc::Query( const ScQueryParam& rQueryParam, const ScRange* pAdvSource
ScDocument& rDoc = pDocSh->GetDocument();
ScDBData* pDestData = rDoc.GetDBAtCursor(
rQueryParam.nDestCol, rQueryParam.nDestRow,
- rQueryParam.nDestTab, true );
+ rQueryParam.nDestTab, ScDBDataPortion::TOP_LEFT );
if (pDestData)
{
ScRange aDestRange;
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 26466f66c094..367b5caf668b 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -2088,7 +2088,7 @@ void ScDBFunc::RepeatDB( bool bRecord )
if (bQuery && !aQueryParam.bInplace)
{
ScDBData* pDest = pDoc->GetDBAtCursor( aQueryParam.nDestCol, aQueryParam.nDestRow,
- aQueryParam.nDestTab, true );
+ aQueryParam.nDestTab, ScDBDataPortion::TOP_LEFT );
if (pDest && pDest->IsDoSize())
{
pDest->GetArea( aOldQuery );
@@ -2199,7 +2199,7 @@ void ScDBFunc::RepeatDB( bool bRecord )
if (bQuerySize)
{
ScDBData* pDest = pDoc->GetDBAtCursor( aQueryParam.nDestCol, aQueryParam.nDestRow,
- aQueryParam.nDestTab, true );
+ aQueryParam.nDestTab, ScDBDataPortion::TOP_LEFT );
if (pDest)
{
pDest->GetArea( aNewQuery );
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 00ad26ed51f0..995b174e5ea1 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -717,7 +717,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
pViewData->GetMergeSizePixel(nCol, nRow, nSizeX, nSizeY);
Rectangle aCellRect(OutputToScreenPixel(aPos), Size(nSizeX, nSizeY));
- ScDBData* pDBData = pDoc->GetDBAtCursor(nCol, nRow, nTab);
+ ScDBData* pDBData = pDoc->GetDBAtCursor(nCol, nRow, nTab, ScDBDataPortion::AREA);
if (!pDBData)
return;
@@ -1242,7 +1242,7 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow, bool bDataSelec
if (!bDataSelect) // AutoFilter: Select active entry
{
- ScDBData* pDBData = pDoc->GetDBAtCursor( nCol, nRow, nTab );
+ ScDBData* pDBData = pDoc->GetDBAtCursor( nCol, nRow, nTab, ScDBDataPortion::AREA );
if (pDBData)
{
ScQueryParam aParam;
@@ -1412,7 +1412,7 @@ void ScGridWindow::ExecFilter( sal_uLong nSel,
ScDocument* pDoc = pViewData->GetDocument();
svl::SharedStringPool& rPool = pDoc->GetSharedStringPool();
- ScDBData* pDBData = pDoc->GetDBAtCursor( nCol, nRow, nTab );
+ ScDBData* pDBData = pDoc->GetDBAtCursor( nCol, nRow, nTab, ScDBDataPortion::AREA );
if (pDBData)
{
ScQueryParam aParam;
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 3cb269d1d4a8..f82668a4058d 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1364,7 +1364,7 @@ void ScGridWindow::DrawButtons(SCCOL nX1, SCCOL nX2, const ScTableInfo& rTabInfo
}
if (bNewData)
{
- pDBData = pDoc->GetDBAtCursor( nCol, nRow, nTab );
+ pDBData = pDoc->GetDBAtCursor( nCol, nRow, nTab, ScDBDataPortion::AREA );
if (pDBData)
pDBData->GetQueryParam( *pQueryParam );
else
@@ -1514,7 +1514,7 @@ Rectangle ScGridWindow::GetListValButtonRect( const ScAddress& rButtonPos )
bool ScGridWindow::IsAutoFilterActive( SCCOL nCol, SCROW nRow, SCTAB nTab )
{
ScDocument* pDoc = pViewData->GetDocument();
- ScDBData* pDBData = pDoc->GetDBAtCursor( nCol, nRow, nTab );
+ ScDBData* pDBData = pDoc->GetDBAtCursor( nCol, nRow, nTab, ScDBDataPortion::AREA );
ScQueryParam aQueryParam;
if ( pDBData )