[Libreoffice-commits] core.git: sc/inc sc/source

Eike Rathke erack at redhat.com
Wed Sep 2 07:11:15 PDT 2015


 sc/inc/dbdata.hxx                  |   16 +++++++++----
 sc/inc/document.hxx                |    5 ++--
 sc/source/core/data/documen3.cxx   |   12 ++++-----
 sc/source/core/tool/compiler.cxx   |    2 -
 sc/source/core/tool/dbdata.cxx     |   45 ++++++++++++++++++++-----------------
 sc/source/ui/dbgui/dbnamdlg.cxx    |    2 -
 sc/source/ui/docshell/dbdocfun.cxx |    6 ++--
 sc/source/ui/docshell/docsh5.cxx   |    2 -
 sc/source/ui/undo/undodat.cxx      |    2 -
 sc/source/ui/view/cellsh2.cxx      |    2 -
 sc/source/ui/view/dbfunc.cxx       |    2 -
 sc/source/ui/view/dbfunc3.cxx      |    4 +--
 sc/source/ui/view/gridwin.cxx      |    6 ++--
 sc/source/ui/view/gridwin4.cxx     |    4 +--
 14 files changed, 62 insertions(+), 48 deletions(-)

New commits:
commit 26e84b3852bbb9585fab76e8d3dba5dcd77f0357
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Sep 2 15:58:07 2015 +0200

    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

diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx
index 967ba30..efe0d2f 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 a2b7800..9ea6729 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 2b8dc9a..32791da 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 a166a41..67cf1d7 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 f9c69b2..825e6ca 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 4ebe1d0..f35e764 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 e7bf8fa..5d308af 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 c66fc65..cbef197 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 f636c59..849e9f7 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 e106cb3..28dd99d 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 da44ac4..f9c3c4b 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 26466f6..367b5ca 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 00ad26e..995b174 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 3cb269d..f82668a 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 )


More information about the Libreoffice-commits mailing list