sc/inc/document.hxx                           |    4 --
 sc/sdi/cellsh.sdi                             |    3 --
 sc/source/core/data/documen2.cxx              |    1 
 sc/source/ui/condformat/condformateasydlg.cxx |    6 +---
 sc/source/ui/condformat/condformatmgr.cxx     |   37 +++++++++-----------------
 sc/source/ui/inc/condformateasydlg.hxx        |    1 
 sc/source/ui/inc/condformatmgr.hxx            |    3 --
 sc/source/ui/view/cellsh3.cxx                 |    9 ------
 sc/uiconfig/scalc/ui/condformatmanager.ui     |    1 
 9 files changed, 20 insertions(+), 45 deletions(-)

New commits:
commit ec1b094127765333d7720aa7bc97832ab84babc6
Author:     Pranam Lashkari <[email protected]>
AuthorDate: Mon Nov 25 19:45:06 2024 +0530
Commit:     Pranam Lashkari <[email protected]>
CommitDate: Tue Dec 3 16:08:36 2024 +0100

    Revert "sc: now formula conditions can be managed
    
    ...from condition format manager"
    
    This reverts commit 8374dd472cb4a2e2edab969a73ca88ffeaadbcd8.
    
    Change-Id: I532c17596adccfa5c88baaf2df897f3ffbee0fe6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177288
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177339
    Tested-by: Pranam Lashkari <[email protected]>

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index e7d67bc7d4b0..678652e47fe7 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -229,12 +229,10 @@ struct ScConditionEasyDialogData
 {
     ScConditionMode* Mode = nullptr;
     bool IsManaged : 1 = false;
-    OUString Formula;
 
-    ScConditionEasyDialogData(ScConditionMode* mode, bool isManaged, const 
OUString& formula = "")
+    ScConditionEasyDialogData(ScConditionMode* mode, bool isManaged)
         : Mode(mode)
         , IsManaged(isManaged)
-        , Formula(formula)
     {
     }
 
diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi
index 017e26028376..8908dc424e23 100644
--- a/sc/sdi/cellsh.sdi
+++ b/sc/sdi/cellsh.sdi
@@ -220,8 +220,7 @@ interface CellSelection
     SfxVoidItem ConditionalFormatEasy SID_EASY_CONDITIONAL_FORMAT_DIALOG
     (
         SfxInt16Item FormatRule FN_PARAM_1,
-        SfxBoolItem  Managed FN_PARAM_2,
-        SfxStringItem Formula FN_PARAM_3
+        SfxBoolItem  Managed FN_PARAM_2
     )
     [
         ExecMethod = Execute;
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index aca2b03e0148..bab0668a38e9 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -1189,7 +1189,6 @@ void ScDocument::SetEasyConditionalFormatDialogData(const 
ScConditionEasyDialogD
 {
     pConditionalFormatDialogData.Mode = data.Mode;
     pConditionalFormatDialogData.IsManaged = data.IsManaged;
-    pConditionalFormatDialogData.Formula = data.Formula;
 }
 
 void ScDocument::SetChangeViewSettings(const ScChangeViewSettings& rNew)
diff --git a/sc/source/ui/condformat/condformateasydlg.cxx 
b/sc/source/ui/condformat/condformateasydlg.cxx
index faef213042ef..67a51f42ea9b 100644
--- a/sc/source/ui/condformat/condformateasydlg.cxx
+++ b/sc/source/ui/condformat/condformateasydlg.cxx
@@ -118,7 +118,6 @@ 
ConditionalFormatEasyDialog::ConditionalFormatEasyDialog(SfxBindings* pBindings,
     {
         meMode = *CurrentData.Mode;
         mbIsManaged = CurrentData.IsManaged;
-        msFormula = CurrentData.Formula;
     }
     mxNumberEntry2->hide();
     switch (meMode)
@@ -373,9 +372,8 @@ IMPL_LINK(ConditionalFormatEasyDialog, ButtonPressed, 
weld::Button&, rButton, vo
         }
         else if (meMode == ScConditionMode::Formula)
         {
-            xEntry.reset(new ScCondFormatEntry(ScConditionMode::Direct, 
msFormula, OUString(),
-                                               mrDocument, maPosition,
-                                               mxStyles->get_active_text()));
+            xEntry.reset(new ScCondFormatEntry(ScConditionMode::Direct, "", 
OUString(), mrDocument,
+                                               maPosition, 
mxStyles->get_active_text()));
         }
         else
         {
diff --git a/sc/source/ui/condformat/condformatmgr.cxx 
b/sc/source/ui/condformat/condformatmgr.cxx
index c74087daa5a2..4aaf1b32932c 100644
--- a/sc/source/ui/condformat/condformatmgr.cxx
+++ b/sc/source/ui/condformat/condformatmgr.cxx
@@ -20,7 +20,6 @@
 #include <sfx2/viewsh.hxx>
 #include <svl/eitem.hxx>
 #include <svl/intitem.hxx>
-#include <svl/stritem.hxx>
 #include <unotools/viewoptions.hxx>
 #include <iostream>
 
@@ -95,13 +94,15 @@ void ScCondFormatManagerWindow::setColSizes()
     mrTreeView.set_column_fixed_widths(aWidths);
 }
 
-ScCondFormatManagerDlg::ScCondFormatManagerDlg(weld::Window* pParent, 
ScDocument& rDoc, const ScConditionalFormatList* pFormatList)
-    : GenericDialogController(pParent, 
u"modules/scalc/ui/condformatmanager.ui"_ustr, u"CondFormatManager"_ustr)
+ScCondFormatManagerDlg::ScCondFormatManagerDlg(weld::Window* pParent, 
ScDocument& rDoc,
+                                               const ScConditionalFormatList* 
pFormatList)
+    : GenericDialogController(pParent, 
u"modules/scalc/ui/condformatmanager.ui"_ustr,
+                              u"CondFormatManager"_ustr)
     , m_bModified(false)
-    , m_xFormatList( pFormatList ? new ScConditionalFormatList(*pFormatList) : 
nullptr)
+    , m_xFormatList(pFormatList ? new ScConditionalFormatList(*pFormatList) : 
nullptr)
     , m_xConditionalType(m_xBuilder->weld_combo_box("type"))
     , m_xConditionalCellValue(m_xBuilder->weld_combo_box("typeis"))
-    , m_xConditionalFormula(new 
formula::RefEdit(m_xBuilder->weld_entry("formula")))
+    , m_xConditionalFormula(m_xBuilder->weld_entry("formula"))
     , m_xConditionalDate(m_xBuilder->weld_combo_box("datetype"))
     , m_xBtnAdd(m_xBuilder->weld_button(u"add"_ustr))
     , m_xBtnRemove(m_xBuilder->weld_button(u"remove"_ustr))
@@ -171,10 +172,9 @@ void ScCondFormatManagerDlg::ShowEasyConditionalDialog()
         case 1: // Formula
         {
             SfxInt16Item FormatRule(FN_PARAM_1, 
static_cast<sal_Int16>(ScConditionMode::Formula));
-            SfxStringItem Formula(FN_PARAM_3, 
m_xConditionalFormula->GetText());
             SfxViewShell::Current()->GetDispatcher()->ExecuteList(
                 SID_EASY_CONDITIONAL_FORMAT_DIALOG, SfxCallMode::ASYNCHRON,
-                { &FormatRule, &IsManaged, &Formula });
+                { &FormatRule, &IsManaged });
         }
         break;
         case 2: // Date
@@ -229,21 +229,21 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, ComboHdl, 
weld::ComboBox&, void)
         case 0:
         {
             m_xConditionalCellValue->set_visible(true);
-            m_xConditionalFormula->GetWidget()->set_visible(false);
+            m_xConditionalFormula->set_visible(false);
             m_xConditionalDate->set_visible(false);
         }
         break;
         case 1:
         {
             m_xConditionalCellValue->set_visible(false);
-            m_xConditionalFormula->GetWidget()->set_visible(true);
+            m_xConditionalFormula->set_visible(true);
             m_xConditionalDate->set_visible(false);
         }
         break;
         case 2:
         {
             m_xConditionalCellValue->set_visible(false);
-            m_xConditionalFormula->GetWidget()->set_visible(false);
+            m_xConditionalFormula->set_visible(false);
             m_xConditionalDate->set_visible(true);
         }
         break;
@@ -268,20 +268,9 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, EntryFocus, 
weld::TreeView&, void)
     {
         const ScCondFormatEntry* conditionEntry = dynamic_cast<const 
ScCondFormatEntry*>(entry);
         auto conditionType = conditionEntry->GetOperation();
-
-        if (conditionType == ScConditionMode::Direct) // Formula conditions
-        {
-            m_xConditionalType->set_active(1);
-            ComboHdl(*m_xConditionalType);
-            m_xConditionalFormula->SetText(
-                conditionEntry->GetExpression(conditionEntry->GetSrcPos(), 0));
-        }
-        else
-        {
-            m_xConditionalType->set_active(0);
-            ComboHdl(*m_xConditionalType);
-            
m_xConditionalCellValue->set_active(static_cast<int>(conditionType));
-        }
+        m_xConditionalType->set_active(0);
+        ComboHdl(*m_xConditionalType);
+        m_xConditionalCellValue->set_active(static_cast<int>(conditionType));
     }
     else if (type == ScFormatEntry::Type::Date)
     {
diff --git a/sc/source/ui/inc/condformateasydlg.hxx 
b/sc/source/ui/inc/condformateasydlg.hxx
index 2b34a15fefee..772312040c88 100644
--- a/sc/source/ui/inc/condformateasydlg.hxx
+++ b/sc/source/ui/inc/condformateasydlg.hxx
@@ -40,7 +40,6 @@ private:
     ScDocument& mrDocument;
     ScConditionMode meMode;
     bool mbIsManaged;
-    OUString msFormula;
     ScAddress maPosition;
 
     std::unique_ptr<weld::Entry> mxNumberEntry;
diff --git a/sc/source/ui/inc/condformatmgr.hxx 
b/sc/source/ui/inc/condformatmgr.hxx
index 26345d55894a..7361fb6830c7 100644
--- a/sc/source/ui/inc/condformatmgr.hxx
+++ b/sc/source/ui/inc/condformatmgr.hxx
@@ -10,7 +10,6 @@
 #pragma once
 
 #include <vcl/weld.hxx>
-#include <formula/funcutl.hxx>
 
 class ScDocument;
 class ScConditionalFormat;
@@ -53,7 +52,7 @@ private:
 
     std::unique_ptr<weld::ComboBox> m_xConditionalType;
     std::unique_ptr<weld::ComboBox> m_xConditionalCellValue;
-    std::unique_ptr<formula::RefEdit> m_xConditionalFormula;
+    std::unique_ptr<weld::Entry> m_xConditionalFormula;
     std::unique_ptr<weld::ComboBox> m_xConditionalDate;
     std::unique_ptr<weld::Button> m_xBtnAdd;
     std::unique_ptr<weld::Button> m_xBtnRemove;
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 6206ace72f65..98a67f26e32a 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -468,15 +468,8 @@ void ScCellShell::Execute( SfxRequest& rReq )
                             bManaged = static_cast<const 
SfxBoolItem*>(pManaged)->GetValue();
                         }
 
-                        const SfxPoolItem* pFormula;
-                        OUString formula;
-                        if (pReqArgs->HasItem(FN_PARAM_3, &pFormula))
-                        {
-                            formula = static_cast<const 
SfxStringItem*>(pFormula)->GetValue();
-                        }
-
                         
GetViewData().GetDocument().SetEasyConditionalFormatDialogData(
-                            ScConditionEasyDialogData(&nFormat, bManaged, 
formula));
+                            ScConditionEasyDialogData(&nFormat, bManaged));
 
                         pScMod->SetRefDialog( nId, pWindow == nullptr );
                     }
diff --git a/sc/uiconfig/scalc/ui/condformatmanager.ui 
b/sc/uiconfig/scalc/ui/condformatmanager.ui
index a0160fa8aa67..ae6904641090 100644
--- a/sc/uiconfig/scalc/ui/condformatmanager.ui
+++ b/sc/uiconfig/scalc/ui/condformatmanager.ui
@@ -229,6 +229,7 @@
                         <property name="can-focus">True</property>
                         <property name="no-show-all">True</property>
                         <property name="hexpand">True</property>
+                        <property name="visibility">False</property>
                         <property name="truncate-multiline">True</property>
                         <child internal-child="accessible">
                           <object class="AtkObject" id="formula-atkobject">

Reply via email to