[Libreoffice-commits] core.git: sc/inc sc/source

Samuel Mehrbrodt (via logerrit) logerrit at kemper.freedesktop.org
Tue May 11 11:36:28 UTC 2021


 sc/inc/queryentry.hxx              |    2 ++
 sc/source/core/tool/queryentry.cxx |   20 ++++++++++++++++++++
 sc/source/ui/dbgui/filtdlg.cxx     |    9 +++++++++
 3 files changed, 31 insertions(+)

New commits:
commit 518d0d8283b6d732cffa102c6b7c2fe01d1ec348
Author:     Samuel Mehrbrodt <samuel.mehrbrodt at allotropia.de>
AuthorDate: Tue May 11 11:52:30 2021 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbrodt at allotropia.de>
CommitDate: Tue May 11 13:35:45 2021 +0200

    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 at allotropia.de>

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);


More information about the Libreoffice-commits mailing list