diff options
author | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2021-05-11 11:52:30 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2021-05-11 13:35:45 +0200 |
commit | 518d0d8283b6d732cffa102c6b7c2fe01d1ec348 (patch) | |
tree | 920db4c75a145a9cb83ab29145d3715eede494d3 /sc | |
parent | 0111565f560a4978ee664403ba86af1e72a2ba05 (diff) |
tdf#76258 Skip color items in filter dialog for now
Change-Id: Iada39f065dbb9b975ada90bcc4135c39b9710def
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115393
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/queryentry.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/queryentry.cxx | 20 | ||||
-rw-r--r-- | sc/source/ui/dbgui/filtdlg.cxx | 9 |
3 files changed, 31 insertions, 0 deletions
diff --git a/sc/inc/queryentry.hxx b/sc/inc/queryentry.hxx index f7a7f6896934..1855744f78f7 100644 --- a/sc/inc/queryentry.hxx +++ b/sc/inc/queryentry.hxx @@ -79,7 +79,9 @@ struct SC_DLLPUBLIC ScQueryEntry void SetQueryByNonEmpty(); bool IsQueryByNonEmpty() const; void SetQueryByTextColor(Color color); + bool IsQueryByTextColor() const; void SetQueryByBackgroundColor(Color color); + bool IsQueryByBackgroundColor() const; const Item& GetQueryItem() const { return GetQueryItemImpl(); } Item& GetQueryItem() { return GetQueryItemImpl(); } void Clear(); diff --git a/sc/source/core/tool/queryentry.cxx b/sc/source/core/tool/queryentry.cxx index 836b2caf7dd8..5853a9760c1d 100644 --- a/sc/source/core/tool/queryentry.cxx +++ b/sc/source/core/tool/queryentry.cxx @@ -128,6 +128,16 @@ void ScQueryEntry::SetQueryByTextColor(Color color) rItem.maColor = color; } +bool ScQueryEntry::IsQueryByTextColor() const +{ + if (maQueryItems.size() != 1) + return false; + + const Item& rItem = maQueryItems[0]; + return eOp == SC_EQUAL && + rItem.meType == ByTextColor; +} + void ScQueryEntry::SetQueryByBackgroundColor(Color color) { eOp = SC_EQUAL; @@ -139,6 +149,16 @@ void ScQueryEntry::SetQueryByBackgroundColor(Color color) rItem.maColor = color; } +bool ScQueryEntry::IsQueryByBackgroundColor() const +{ + if (maQueryItems.size() != 1) + return false; + + const Item& rItem = maQueryItems[0]; + return eOp == SC_EQUAL && + rItem.meType == ByBackgroundColor; +} + ScQueryEntry::Item& ScQueryEntry::GetQueryItemImpl() const { if (maQueryItems.size() != 1) diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx index 322c617aa2f9..db015dcaa268 100644 --- a/sc/source/ui/dbgui/filtdlg.cxx +++ b/sc/source/ui/dbgui/filtdlg.cxx @@ -233,6 +233,11 @@ void ScFilterDlg::Init( const SfxItemSet& rArgSet ) aValStr = aStrNotEmpty; maCondLbArr[i]->set_sensitive(false); } + else if (rEntry.IsQueryByTextColor() || rEntry.IsQueryByBackgroundColor()) + { + // No support for color filters in filter dialog currently + continue; + } else { const ScQueryEntry::Item& rItem = rEntry.GetQueryItem(); @@ -1247,6 +1252,10 @@ void ScFilterDlg::RefreshEditRow( size_t nOffset ) aValStr = aStrNotEmpty; maCondLbArr[i]->set_sensitive(false); } + else if (rEntry.IsQueryByTextColor() || rEntry.IsQueryByBackgroundColor()) + { + continue; + } else { SetValString(aQueryStr, rItem, aValStr); |