summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/inc/queryentry.hxx2
-rw-r--r--sc/source/core/tool/queryentry.cxx20
-rw-r--r--sc/source/ui/dbgui/filtdlg.cxx9
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);