summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/inc/queryparam.hxx3
-rw-r--r--sc/source/core/data/table3.cxx12
-rw-r--r--sc/source/core/tool/queryparam.cxx14
-rw-r--r--sc/source/ui/vba/vbarange.cxx23
-rw-r--r--sc/source/ui/view/gridwin.cxx2
5 files changed, 4 insertions, 50 deletions
diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx
index 6c1c09a040a4..5e0899b15bc4 100644
--- a/sc/inc/queryparam.hxx
+++ b/sc/inc/queryparam.hxx
@@ -54,9 +54,8 @@ struct ScQueryParamBase
SC_DLLPUBLIC const ScQueryEntry& GetEntry(SCSIZE n) const;
SC_DLLPUBLIC ScQueryEntry& GetEntry(SCSIZE n);
ScQueryEntry* FindEntryByField(SCCOLROW nField, bool bNew);
- void RemoveEntryByField(SCCOLROW nField);
+ SC_DLLPUBLIC void RemoveEntryByField(SCCOLROW nField);
void Resize(size_t nNew);
- SC_DLLPUBLIC void DeleteQuery(size_t nPos);
void FillInExcelSyntax(const rtl::OUString& aCellStr, SCSIZE nIndex);
protected:
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 8547a9fe6164..f2dc39947dbb 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2105,17 +2105,7 @@ void ScTable::GetFilteredFilterEntries(
{
// remove the entry for this column from the query parameter
ScQueryParam aParam( rParam );
- SCSIZE nEntryCount = aParam.GetEntryCount();
- for ( SCSIZE i = 0; i < nEntryCount && aParam.GetEntry(i).bDoQuery; ++i )
- {
- ScQueryEntry& rEntry = aParam.GetEntry(i);
- if ( rEntry.nField == nCol )
- {
- aParam.DeleteQuery(i);
- break;
- }
- }
- nEntryCount = aParam.GetEntryCount();
+ aParam.RemoveEntryByField(nCol);
lcl_PrepareQuery(pDocument, this, aParam);
bool bHasDates = false;
diff --git a/sc/source/core/tool/queryparam.cxx b/sc/source/core/tool/queryparam.cxx
index b551ddc22b59..d997acb67e35 100644
--- a/sc/source/core/tool/queryparam.cxx
+++ b/sc/source/core/tool/queryparam.cxx
@@ -155,20 +155,6 @@ void ScQueryParamBase::Resize(size_t nNew)
}
}
-void ScQueryParamBase::DeleteQuery(size_t nPos)
-{
- if (nPos >= maEntries.size())
- return;
-
- boost::ptr_vector<ScQueryEntry>::iterator itr = maEntries.begin();
- std::advance(itr, nPos);
- maEntries.erase(itr);
-
- // Don't forget to append an empty entry to make up for the removed one.
- // The size of the entries is not supposed to change.
- maEntries.push_back(new ScQueryEntry);
-}
-
void ScQueryParamBase::FillInExcelSyntax(const rtl::OUString& rStr, SCSIZE nIndex)
{
const String aCellStr = rStr;
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index d18fa5d82167..58518266c1f1 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -4404,31 +4404,10 @@ ScQueryParam lcl_GetQueryParam( ScDocShell* pDocShell, sal_Int16 nSheet )
return aParam;
}
-void lcl_SetAllQueryForField( ScQueryParam& aParam, SCCOLROW nField )
-{
- bool bFound = false;
- SCSIZE i = 0;
- for (; i < aParam.GetEntryCount() && !bFound; ++i)
- {
- ScQueryEntry& rEntry = aParam.GetEntry(i);
- if ( rEntry.nField == nField)
- {
- OSL_TRACE("found at pos %d", i );
- bFound = true;
- }
- }
- if ( bFound )
- {
- OSL_TRACE("field %d to delete at pos %d", nField, ( i - 1 ) );
- aParam.DeleteQuery(--i);
- }
-}
-
-
void lcl_SetAllQueryForField( ScDocShell* pDocShell, SCCOLROW nField, sal_Int16 nSheet )
{
ScQueryParam aParam = lcl_GetQueryParam( pDocShell, nSheet );
- lcl_SetAllQueryForField( aParam, nField );
+ aParam.RemoveEntryByField(nField);
lcl_SelectAll( pDocShell, aParam );
}
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 97f418cce34c..c69302ffbe1a 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1472,7 +1472,7 @@ void ScGridWindow::ExecFilter( sal_uLong nSel,
else
{
if (bFound)
- aParam.DeleteQuery(nQueryPos);
+ aParam.RemoveEntryByField(nCol);
}
// end edit mode - like in ScCellShell::ExecuteDB