summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2021-05-10 17:56:34 +0530
committerDennis Francis <dennis.francis@collabora.com>2021-05-13 16:24:45 +0200
commitebff4e5181b102e5184277f57fda32fcce60431f (patch)
tree086a73ea4b67d3604761125bdb4f77a50a40e331 /sc/source/core
parent06c360d4d27ab0dadfdcd5f9d4f0c87288d3cb75 (diff)
tdf#142214: autoinput: remove search/entry count limits
Change-Id: Ib41f7c04b9a3802982105cbbfef3ae638bdb286f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115345 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Dennis Francis <dennis.francis@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115545 Tested-by: Jenkins
Diffstat (limited to 'sc/source/core')
-rw-r--r--sc/source/core/data/column3.cxx54
-rw-r--r--sc/source/core/data/documen3.cxx8
-rw-r--r--sc/source/core/data/table3.cxx4
3 files changed, 23 insertions, 43 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 51bc475d135f..de6870a6a9c9 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2697,14 +2697,8 @@ public:
}
// GetDataEntries - Strings from continuous Section around nRow
-
-// DATENT_MAX - max. number of entries in list for auto entry
-// DATENT_SEARCH - max. number of cells that get transparent - new: only count Strings
-#define DATENT_MAX 200
-#define DATENT_SEARCH 2000
-
bool ScColumn::GetDataEntries(
- SCROW nStartRow, std::set<ScTypedStrData>& rStrings, bool bLimit ) const
+ SCROW nStartRow, std::set<ScTypedStrData>& rStrings) const
{
// Start at the specified row position, and collect all string values
// going upward and downward directions in parallel. The start position
@@ -2722,44 +2716,30 @@ bool ScColumn::GetDataEntries(
bMoveDown = aItrDown.next(); // Find the next string cell position.
bool bFound = false;
- size_t nCellsSearched = 0;
- while (bMoveUp || bMoveDown)
+ while (bMoveUp)
{
- if (bMoveUp)
+ // Get the current string and move up.
+ OUString aStr = aItrUp.get();
+ if (!aStr.isEmpty())
{
- // Get the current string and move up.
- OUString aStr = aItrUp.get();
- if (!aStr.isEmpty())
- {
- bool bInserted = rStrings.insert(ScTypedStrData(aStr)).second;
- if (bInserted && bLimit && rStrings.size() >= DATENT_MAX)
- return true; // Maximum reached
+ if (rStrings.insert(ScTypedStrData(aStr)).second)
bFound = true;
- }
-
- if (bLimit && ++nCellsSearched >= DATENT_SEARCH)
- return bFound; // max search cell count reached.
-
- bMoveUp = aItrUp.prev();
}
- if (bMoveDown)
+ bMoveUp = aItrUp.prev();
+ }
+
+ while (bMoveDown)
+ {
+ // Get the current string and move down.
+ OUString aStr = aItrDown.get();
+ if (!aStr.isEmpty())
{
- // Get the current string and move down.
- OUString aStr = aItrDown.get();
- if (!aStr.isEmpty())
- {
- bool bInserted = rStrings.insert(ScTypedStrData(aStr)).second;
- if (bInserted && bLimit && rStrings.size() >= DATENT_MAX)
- return true; // Maximum reached
+ if (rStrings.insert(ScTypedStrData(aStr)).second)
bFound = true;
- }
-
- if (bLimit && ++nCellsSearched >= DATENT_SEARCH)
- return bFound; // max search cell count reached.
-
- bMoveDown = aItrDown.next();
}
+
+ bMoveDown = aItrDown.next();
}
return bFound;
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index b47c03c0e6fe..8de06d151d78 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1616,12 +1616,12 @@ void ScDocument::GetFilterEntriesArea(
*/
void ScDocument::GetDataEntries(
SCCOL nCol, SCROW nRow, SCTAB nTab,
- std::vector<ScTypedStrData>& rStrings, bool bLimit )
+ std::vector<ScTypedStrData>& rStrings, bool bValidation )
{
- if( !bLimit )
+ if( bValidation )
{
/* Try to generate the list from list validation. This part is skipped,
- if bLimit==true, because in that case this function is called to get
+ if bValidation==false, because in that case this function is called to get
cell values for auto completion on input. */
sal_uInt32 nValidation = GetAttr( nCol, nRow, nTab, ATTR_VALIDDATA )->GetValue();
if( nValidation )
@@ -1644,7 +1644,7 @@ void ScDocument::GetDataEntries(
return;
std::set<ScTypedStrData> aStrings;
- if (maTabs[nTab]->GetDataEntries(nCol, nRow, aStrings, bLimit))
+ if (maTabs[nTab]->GetDataEntries(nCol, nRow, aStrings))
{
rStrings.insert(rStrings.end(), aStrings.begin(), aStrings.end());
sortAndRemoveDuplicates(rStrings, true/*bCaseSens*/);
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 54c0850931ee..552abe5b0370 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -3570,9 +3570,9 @@ void ScTable::GetFilteredFilterEntries(
}
}
-bool ScTable::GetDataEntries(SCCOL nCol, SCROW nRow, std::set<ScTypedStrData>& rStrings, bool bLimit)
+bool ScTable::GetDataEntries(SCCOL nCol, SCROW nRow, std::set<ScTypedStrData>& rStrings)
{
- return aCol[nCol].GetDataEntries( nRow, rStrings, bLimit );
+ return aCol[nCol].GetDataEntries( nRow, rStrings);
}
sal_uLong ScTable::GetCellCount() const