[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sc/source

Balazs Varga (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 29 11:35: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 2750fde01dffc502492250e222c3b7f75b26b0f6
Author:     Balazs Varga <balazs.varga991 at gmail.com>
AuthorDate: Wed Jan 27 20:45:09 2021 +0100
Commit:     Gabor Kelemen <kelemen.gabor2 at nisz.hu>
CommitDate: Tue Jun 29 13:34:35 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 <nemeth at numbertext.org>
    Reviewed-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit f604e1a305bd858bbe424811dc06b611caf8cd2b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118096
    Tested-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
    Reviewed-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>

diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index 5a6a28448579..1af154bc79f2 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 cd46db595914..40ef53336bd4 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