sc/source/core/tool/dbdata.cxx | 7 +++++-- sc/source/ui/view/cellsh.cxx | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-)
New commits: commit 9b5ad708118edaa3a5d5c8095330870b062ef2b2 Author: Balazs Varga <balazs.varga...@gmail.com> AuthorDate: Wed Jan 27 20:45:09 2021 +0100 Commit: Gabor Kelemen <kelemen.gab...@nisz.hu> CommitDate: Thu Apr 22 16:05:20 2021 +0200 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 <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> (cherry picked from commit f604e1a305bd858bbe424811dc06b611caf8cd2b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114496 Tested-by: Gabor Kelemen <kelemen.gab...@nisz.hu> Reviewed-by: Gabor Kelemen <kelemen.gab...@nisz.hu> diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index 51b2ecc6be62..22e547d4bda6 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -83,7 +83,7 @@ ScDBData::ScDBData( const OUString& rName, bAutoFilter (false), bModified (false), mbTableColumnNamesDirty(true), - nFilteredRowCount(0) + nFilteredRowCount(SCSIZE_MAX) { aUpper = ScGlobal::getCharClassPtr()->uppercase(aUpper); } @@ -937,7 +937,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 a9dfdc4db199..bd8fb545b51b 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; pDoc->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 ) ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits