summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2021-01-27 20:45:09 +0100
committerLászló Németh <nemeth@numbertext.org>2021-02-28 11:25:29 +0100
commitf604e1a305bd858bbe424811dc06b611caf8cd2b (patch)
treeb229bd09ef261c1ac25bbc437892f8181eb139d0 /sc
parentdbc28bc2960f882753a11bb4d8cfbaae5edd7c0d (diff)
tdf#124701 sc status bar: hide bad filtered row count
After loading the document, positioning the cell cursor on filtered data, the status bar showed always the maximum amount of the filtered data, e.g. "9 of 9 records found", regardless of the real result, e.g. "6 of 9 records found", because the ScTable::Query() function will not run until we refresh the filters. As a workaround, we hide the (often false) data in the meantime. Change-Id: I904ca0c55e3afb276b11491c05430f985557f914 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110032 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/dbdata.cxx7
-rw-r--r--sc/source/ui/view/cellsh.cxx2
2 files changed, 6 insertions, 3 deletions
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index 9f8b68215856..f5ffea0984be 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -82,7 +82,7 @@ ScDBData::ScDBData( const OUString& rName,
bAutoFilter (false),
bModified (false),
mbTableColumnNamesDirty(true),
- nFilteredRowCount(0)
+ nFilteredRowCount(SCSIZE_MAX)
{
aUpper = ScGlobal::getCharClassPtr()->uppercase(aUpper);
}
@@ -936,7 +936,10 @@ void ScDBData::GetFilterSelCount( SCSIZE& nSelected, SCSIZE& nTotal )
nTotal = nEndRow - nStartRow + 1;
if ( bHasHeader )
nTotal -= 1;
- nSelected = nTotal - nFilteredRowCount;
+ if( nFilteredRowCount != SCSIZE_MAX )
+ nSelected = nTotal - nFilteredRowCount;
+ else
+ nSelected = nFilteredRowCount;
}
namespace {
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index f4194d3b4706..65640e0e87bf 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -781,7 +781,7 @@ void ScCellShell::GetState(SfxItemSet &rSet)
{
SCSIZE nSelected, nTotal;
rDoc.GetFilterSelCount( nPosX, nPosY, nTab, nSelected, nTotal );
- if( nTotal )
+ if( nTotal && nSelected != SCSIZE_MAX )
{
OUString aStr = ScResId( STR_FILTER_SELCOUNT );
aStr = aStr.replaceAll( "$1", OUString::number( nSelected ) );