sc/inc/column.hxx               |    2 --
 sc/source/core/data/column3.cxx |   14 +++++++-------
 2 files changed, 7 insertions(+), 9 deletions(-)

New commits:
commit 2085e90fe8ac129bc4dbac4612d1ea7544335dae
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Wed Jul 27 18:01:11 2022 +0200
Commit:     Eike Rathke <er...@redhat.com>
CommitDate: Wed Jul 27 20:19:45 2022 +0200

    FilteredRow is not a property of the column, tdf#117276 follow-up
    
    It's only needed in the FilterEntriesHandler, so pass it there.
    
    Change-Id: I5554ad13a43ccce6aafbba82b33418f060173a43
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137512
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins

diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index a67a166646e2..ba964cdfee89 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -204,7 +204,6 @@ class ScColumn : protected ScColumnData
     SCTAB           nTab;
 
     bool mbFiltering : 1; // it is true if there is a filtering in the column
-    bool mbFilteredRow : 1; // it is true if the actual row of the filtered 
column is hidden
     bool mbEmptyBroadcastersPending : 1; // a broadcaster not removed during 
EnableDelayDeletingBroadcasters()
 
 friend class ScDocument;                    // for FillInfo
@@ -256,7 +255,6 @@ public:
     SCTAB GetTab() const { return nTab; }
     SCCOL GetCol() const { return nCol; }
     bool HasFiltering() const { return mbFiltering; }
-    bool IsFilteredRow() const { return mbFilteredRow; }
     sc::CellStoreType& GetCellStore() { return maCells; }
     const sc::CellStoreType& GetCellStore() const { return maCells; }
     sc::CellTextAttrStoreType& GetCellAttrStore() { return maCellTextAttrs; }
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 1d255233bf58..ceb06b11b481 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2488,6 +2488,7 @@ class FilterEntriesHandler
 {
     ScColumn& mrColumn;
     ScFilterEntries& mrFilterEntries;
+    bool mbFilteredRow;
 
     void processCell(const ScColumn& rColumn, SCROW nRow, ScRefCellValue& 
rCell)
     {
@@ -2559,7 +2560,7 @@ class FilterEntriesHandler
 
         if (rCell.hasString())
         {
-            mrFilterEntries.push_back(ScTypedStrData(std::move(aStr), 0.0, 
0.0, ScTypedStrData::Standard, false, mrColumn.IsFilteredRow()));
+            mrFilterEntries.push_back(ScTypedStrData(std::move(aStr), 0.0, 
0.0, ScTypedStrData::Standard, false, mbFilteredRow));
             return;
         }
 
@@ -2617,14 +2618,14 @@ class FilterEntriesHandler
         }
         // store the formatted/rounded value for filtering
         if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0 && !bDate)
-            mrFilterEntries.push_back(ScTypedStrData(std::move(aStr), fVal, 
rColumn.GetDoc().RoundValueAsShown(fVal, nFormat), ScTypedStrData::Value, 
bDate, mrColumn.IsFilteredRow()));
+            mrFilterEntries.push_back(ScTypedStrData(std::move(aStr), fVal, 
rColumn.GetDoc().RoundValueAsShown(fVal, nFormat), ScTypedStrData::Value, 
bDate, mbFilteredRow));
         else
-            mrFilterEntries.push_back(ScTypedStrData(std::move(aStr), fVal, 
fVal, ScTypedStrData::Value, bDate, mrColumn.IsFilteredRow()));
+            mrFilterEntries.push_back(ScTypedStrData(std::move(aStr), fVal, 
fVal, ScTypedStrData::Value, bDate, mbFilteredRow));
     }
 
 public:
-    FilterEntriesHandler(ScColumn& rColumn, ScFilterEntries& rFilterEntries) :
-        mrColumn(rColumn), mrFilterEntries(rFilterEntries) {}
+    FilterEntriesHandler(ScColumn& rColumn, ScFilterEntries& rFilterEntries, 
bool bFilteredRow) :
+        mrColumn(rColumn), mrFilterEntries(rFilterEntries), 
mbFilteredRow(bFilteredRow) {}
 
     void operator() (size_t nRow, double fVal)
     {
@@ -2673,8 +2674,7 @@ void ScColumn::GetFilterEntries(
     ScFilterEntries& rFilterEntries, bool bFiltering, bool bFilteredRow )
 {
     mbFiltering = bFiltering;
-    mbFilteredRow = bFilteredRow;
-    FilterEntriesHandler aFunc(*this, rFilterEntries);
+    FilterEntriesHandler aFunc(*this, rFilterEntries, bFilteredRow);
     rBlockPos.miCellPos =
         sc::ParseAll(rBlockPos.miCellPos, maCells, nStartRow, nEndRow, aFunc, 
aFunc);
 }

Reply via email to