diff options
author | Balazs Varga <balazs.varga.extern@allotropia.de> | 2022-06-29 08:17:40 +0200 |
---|---|---|
committer | Balazs Varga <balazs.varga.extern@allotropia.de> | 2022-07-22 08:11:35 +0200 |
commit | 2d1df9f3dccc10f13b8585ad18afce1542ebc4d1 (patch) | |
tree | d0c98601015ead00d9e5effcc73df4868e3d7381 /sc/inc | |
parent | f96a1389ce2b9f09a76998db5f86586cd519f6eb (diff) |
tdf#117276 sc: Show hidden filter elements as inactive elements
Showing hidden values in the autofilter dropdown (as inactive when
it was hidden by another row) - without changing the behaviour of
autofilter. First those which belongs to non-hidden rows, then those
which belongs to hidden rows.
TODO: maybe we can add a global option where the user can switch on/off this feature.
Change-Id: Iafeb43176efe7ab422b22697d399c68c95d0319d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136595
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/column.hxx | 4 | ||||
-rw-r--r-- | sc/inc/typedstrdata.hxx | 14 |
2 files changed, 14 insertions, 4 deletions
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 9303575a5d9d..56aa1f9fc65e 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -204,6 +204,7 @@ 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 @@ -255,6 +256,7 @@ 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; } @@ -598,7 +600,7 @@ public: void GetFilterEntries( sc::ColumnBlockConstPosition& rBlockPos, SCROW nStartRow, SCROW nEndRow, - ScFilterEntries& rFilterEntries, bool bFiltering ); + ScFilterEntries& rFilterEntries, bool bFiltering, bool bHiddenRow = false ); bool GetDataEntries( SCROW nRow, std::set<ScTypedStrData>& rStrings) const; diff --git a/sc/inc/typedstrdata.hxx b/sc/inc/typedstrdata.hxx index 7918b5501fca..25406d0e5f52 100644 --- a/sc/inc/typedstrdata.hxx +++ b/sc/inc/typedstrdata.hxx @@ -26,22 +26,29 @@ public: }; ScTypedStrData( - OUString&& rStr, double fVal = 0.0, double fRVal = 0.0, StringType nType = Standard, bool bDate = false ) : + OUString&& rStr, double fVal = 0.0, double fRVal = 0.0, StringType nType = Standard, bool bDate = false, bool bIsHiddenByFilter = false ) : maStrValue(std::move(rStr)), mfValue(fVal), mfRoundedValue(fRVal), meStrType(nType), - mbIsDate( bDate ) {} + mbIsDate( bDate ), + mbIsHiddenByFilter(bIsHiddenByFilter) {} ScTypedStrData( const OUString& rStr, double fVal = 0.0, double fRVal = 0.0, StringType eType = Standard, - bool bDate = false ); + bool bDate = false, bool bIsHiddenByFilter = false ); bool IsDate() const { return mbIsDate;} + bool IsHiddenByFilter() const { return mbIsHiddenByFilter;} const OUString& GetString() const { return maStrValue;} StringType GetStringType() const { return meStrType;} double GetValue() const { return mfValue; } double GetRoundedValue() const { return mfRoundedValue; } + struct LessHiddenRows + { + bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const; + }; + struct LessCaseSensitive { bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const; @@ -70,6 +77,7 @@ private: double mfRoundedValue; // rounded value by format code StringType meStrType; bool mbIsDate; + bool mbIsHiddenByFilter; }; class FindTypedStrData |