[Libreoffice-commits] core.git: sc/source
Balazs Varga (via logerrit)
logerrit at kemper.freedesktop.org
Sun Feb 28 10:26:08 UTC 2021
sc/source/core/tool/dbdata.cxx | 7 +++++--
sc/source/ui/view/cellsh.cxx | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)
New commits:
commit f604e1a305bd858bbe424811dc06b611caf8cd2b
Author: Balazs Varga <balazs.varga991 at gmail.com>
AuthorDate: Wed Jan 27 20:45:09 2021 +0100
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Sun Feb 28 11:25:29 2021 +0100
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 at numbertext.org>
Reviewed-by: László Németh <nemeth at numbertext.org>
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 ) );
More information about the Libreoffice-commits
mailing list