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

Kohei Yoshida kohei at kemper.freedesktop.org
Mon Jan 9 09:05:33 PST 2012


 sc/inc/dbdata.hxx                |    1 +
 sc/inc/document.hxx              |    2 --
 sc/source/core/data/documen3.cxx |    8 --------
 sc/source/core/data/table2.cxx   |    3 ++-
 sc/source/core/tool/dbdata.cxx   |   17 ++++++++++++++++-
 5 files changed, 19 insertions(+), 12 deletions(-)

New commits:
commit 0d6e8c35133c10b3b4e0ef69bbca51ac7506b5d2
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Mon Jan 9 12:03:48 2012 -0500

    fdo#44545: Skip filtered cells during auto-fill.
    
    Regression from 3.4.5.

diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx
index 1aab271..cef02e1 100644
--- a/sc/inc/dbdata.hxx
+++ b/sc/inc/dbdata.hxx
@@ -213,6 +213,7 @@ public:
         const_iterator end() const;
         const ScDBData* findAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) const;
         const ScDBData* findByRange(const ScRange& rRange) const;
+        const ScDBData* findByTable(SCTAB nTab) const;
         ScDBData* getByRange(const ScRange& rRange);
         void insert(ScDBData* p);
         void erase(iterator itr);
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 8e41fea..2d232e7 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -492,8 +492,6 @@ public:
     ScDBData* GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly = false);
     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);
-    const ScDBData* GetFilterDBAtTable(SCTAB nTab) const;
-
 
     SC_DLLPUBLIC const ScRangeData* GetRangeAtBlock( const ScRange& rBlock, rtl::OUString* pName=NULL ) const;
 
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 63d926a..66973de 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -311,14 +311,6 @@ ScDBData* ScDocument::GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nC
         return NULL;
 }
 
-const ScDBData* ScDocument::GetFilterDBAtTable(SCTAB nTab) const
-{
-    if (pDBCollection)
-        return pDBCollection->GetFilterDBAtTable(nTab);
-    else
-        return NULL;
-}
-
 ScDPCollection* ScDocument::GetDPCollection()
 {
     if (!pDPCollection)
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 2b5fbed..2c40a5c 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -2652,7 +2652,8 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, bool bShow)
 bool ScTable::IsDataFiltered() const
 {
     bool bAnyQuery = false;
-    const ScDBData* pDBData = pDocument->GetFilterDBAtTable(nTab);
+    const ScDBCollection* pDBs = pDocument->GetDBCollection();
+    const ScDBData* pDBData = pDBs->GetFilterDBAtTable(nTab);
     if ( pDBData )
     {
         ScQueryParam aParam;
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index 288fbac..c612d32 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -808,6 +808,13 @@ const ScDBData* ScDBCollection::AnonDBs::findByRange(const ScRange& rRange) cons
     return itr == maDBs.end() ? NULL : &(*itr);
 }
 
+const ScDBData* ScDBCollection::AnonDBs::findByTable(SCTAB nTab) const
+{
+    DBsType::const_iterator itr = find_if(
+        maDBs.begin(), maDBs.end(), FindFilterDBByTable(nTab));
+    return itr == maDBs.end() ? NULL : &(*itr);
+}
+
 ScDBData* ScDBCollection::AnonDBs::getByRange(const ScRange& rRange)
 {
     const ScDBData* pData = findByRange(rRange);
@@ -972,7 +979,15 @@ const ScDBData* ScDBCollection::GetFilterDBAtTable(SCTAB nTab) const
     NamedDBs::DBsType::const_iterator itr = find_if(
         maNamedDBs.begin(), maNamedDBs.end(), FindFilterDBByTable(nTab));
 
-    return itr == maNamedDBs.end() ? NULL : &(*itr);
+    const ScDBData* pData = itr == maNamedDBs.end() ? NULL : &(*itr);
+    if (pData)
+        return pData;
+
+    pData = pDoc->GetAnonymousDBData(nTab);
+    if (pData)
+        return pData;
+
+    return getAnonDBs().findByTable(nTab);
 }
 
 void ScDBCollection::DeleteOnTab( SCTAB nTab )


More information about the Libreoffice-commits mailing list