diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-01-09 12:03:48 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-01-09 12:05:56 -0500 |
commit | 0d6e8c35133c10b3b4e0ef69bbca51ac7506b5d2 (patch) | |
tree | 340788a6de43750bc8657e96077b77b9cfdd5b79 | |
parent | 0ee79ba6a79fa7277b468bdd8918a88aafa6d5f7 (diff) |
fdo#44545: Skip filtered cells during auto-fill.
Regression from 3.4.5.
-rw-r--r-- | sc/inc/dbdata.hxx | 1 | ||||
-rw-r--r-- | sc/inc/document.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/documen3.cxx | 8 | ||||
-rw-r--r-- | sc/source/core/data/table2.cxx | 3 | ||||
-rw-r--r-- | sc/source/core/tool/dbdata.cxx | 17 |
5 files changed, 19 insertions, 12 deletions
diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx index 1aab2713a0ea..cef02e1effcc 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 8e41fea45158..2d232e7a0d66 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 63d926ad94f1..66973deed196 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 2b5fbedc5357..2c40a5ca3033 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 288fbacb40d9..c612d32d9c9b 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 ) |