diff options
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu | 57 | ||||
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu | 14 | ||||
-rw-r--r-- | sc/Library_sc.mk | 1 | ||||
-rw-r--r-- | sc/UIConfig_scalc.mk | 2 | ||||
-rw-r--r-- | sc/inc/document.hxx | 4 | ||||
-rw-r--r-- | sc/inc/sc.hrc | 3 | ||||
-rw-r--r-- | sc/sdi/cellsh.sdi | 9 | ||||
-rw-r--r-- | sc/sdi/scalc.sdi | 31 | ||||
-rw-r--r-- | sc/source/core/data/documen2.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/app/scdll.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/condformat/condformateasydlg.cxx | 192 | ||||
-rw-r--r-- | sc/source/ui/inc/condformateasydlg.hxx | 54 | ||||
-rw-r--r-- | sc/source/ui/inc/reffact.hxx | 7 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh3.cxx | 20 | ||||
-rw-r--r-- | sc/source/ui/view/reffact.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshc.cxx | 6 | ||||
-rw-r--r-- | sc/uiconfig/scalc/popupmenu/conditional.xml | 2 | ||||
-rw-r--r-- | sc/uiconfig/scalc/popupmenu/conditional_easy.xml | 17 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/conditionaleasydialog.ui | 237 | ||||
-rw-r--r-- | static/CustomTarget_emscripten_fs_image.mk | 2 |
21 files changed, 663 insertions, 3 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu index 89e66c5be42e..7bd5215d627e 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu @@ -642,7 +642,7 @@ <value>1</value> </prop> </node> - <node oor:name=".uno:ConditionalFormatDialog" oor:op="replace"> + <node oor:name=".uno:ConditionalFormatConditionMenu" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Conditional Formatting: Condition</value> </prop> @@ -653,6 +653,61 @@ <value>1</value> </prop> </node> + <node oor:name=".uno:ConditionalFormatEasy?FormatRule:short=2" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Conditional Formatting: Greater Than</value> + </prop> + <prop oor:name="ContextLabel" oor:type="xs:string"> + <value xml:lang="en-US">Greater than...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ConditionalFormatEasy?FormatRule:short=1" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Conditional Formatting: Condition Less Than</value> + </prop> + <prop oor:name="ContextLabel" oor:type="xs:string"> + <value xml:lang="en-US">Less than...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ConditionalFormatEasy?FormatRule:short=0" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Conditional Formatting: Condition Equals</value> + </prop> + <prop oor:name="ContextLabel" oor:type="xs:string"> + <value xml:lang="en-US">Equals...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ConditionalFormatEasy?FormatRule:short=6" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Conditional Formatting: Between</value> + </prop> + <prop oor:name="ContextLabel" oor:type="xs:string"> + <value xml:lang="en-US">Between...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ConditionalFormatDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Conditional Formatting: More Rules</value> + </prop> + <prop oor:name="ContextLabel" oor:type="xs:string"> + <value xml:lang="en-US">More rules...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> <node oor:name=".uno:CurrentConditionalFormatDialog" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Conditional Formatting...</value> diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu index 956b1641bb43..2d99b67a7368 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu @@ -604,6 +604,20 @@ <value>distributebar</value> </prop> </node> + <node oor:name="ConditionalFormatCondition" oor:op="replace"> + <prop oor:name="Command"> + <value>.uno:ConditionalFormatConditionMenu</value> + </prop> + <prop oor:name="Module"> + <value>com.sun.star.sheet.SpreadsheetDocument</value> + </prop> + <prop oor:name="Controller"> + <value>com.sun.star.comp.framework.ResourceMenuController</value> + </prop> + <prop oor:name="Value"> + <value>conditional_easy</value> + </prop> + </node> </node> <node oor:name="ToolBar"> <node oor:name="lo.writer.ScrollToPrevious" oor:op="replace"> diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk index 2b4082d3688e..ff53d9b63ef1 100644 --- a/sc/Library_sc.mk +++ b/sc/Library_sc.mk @@ -398,6 +398,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\ sc/source/ui/condformat/condformatdlg \ sc/source/ui/condformat/condformatdlgentry \ sc/source/ui/condformat/condformatdlgitem \ + sc/source/ui/condformat/condformateasydlg \ sc/source/ui/condformat/condformathelper \ sc/source/ui/condformat/colorformat \ sc/source/ui/dataprovider/csvdataprovider \ diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index 0b9f514d0fd5..12cc9825f0c5 100644 --- a/sc/UIConfig_scalc.mk +++ b/sc/UIConfig_scalc.mk @@ -21,6 +21,7 @@ $(eval $(call gb_UIConfig_add_popupmenufiles,modules/scalc,\ sc/uiconfig/scalc/popupmenu/colheader \ sc/uiconfig/scalc/popupmenu/column_operations \ sc/uiconfig/scalc/popupmenu/conditional \ + sc/uiconfig/scalc/popupmenu/conditional_easy \ sc/uiconfig/scalc/popupmenu/draw \ sc/uiconfig/scalc/popupmenu/drawtext \ sc/uiconfig/scalc/popupmenu/form \ @@ -102,6 +103,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ sc/uiconfig/scalc/ui/colorrowdialog \ sc/uiconfig/scalc/ui/colwidthdialog \ sc/uiconfig/scalc/ui/condformatmanager \ + sc/uiconfig/scalc/ui/conditionaleasydialog \ sc/uiconfig/scalc/ui/conditionalformatdialog \ sc/uiconfig/scalc/ui/conditionalentry \ sc/uiconfig/scalc/ui/conditionaliconset \ diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 70a4827ce87f..1cff7a3ce4e4 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -210,6 +210,7 @@ struct ScFilterEntries; typedef o3tl::sorted_vector<sal_uInt32> ScCondFormatIndexes; struct ScSheetLimits; struct ScDataAreaExtras; +enum class ScConditionMode; namespace sc { @@ -425,6 +426,7 @@ private: std::unique_ptr<ScExtDocOptions> pExtDocOptions; // for import etc. std::unique_ptr<ScClipOptions> mpClipOptions; // clipboard options std::unique_ptr<ScConsolidateParam> pConsolidateDlgData; + std::unique_ptr<ScConditionMode> pConditionalFormatDialogMode; std::unique_ptr<ScAutoNameCache> pAutoNameCache; // for automatic name lookup during CompileXML @@ -652,6 +654,8 @@ public: void SetConsolidateDlgData( std::unique_ptr<ScConsolidateParam> pData ); const ScConsolidateParam* GetConsolidateDlgData() const { return pConsolidateDlgData.get(); } + void SetEasyConditionalFormatDialogData(std::unique_ptr<ScConditionMode> pMode); + const ScConditionMode* GetEasyConditionalFormatDialogData() const { return pConditionalFormatDialogMode.get(); } void Clear( bool bFromDestructor = false ); diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index d1b13b767eb0..f9c04a6e2e53 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -240,7 +240,8 @@ class SvxZoomSliderItem; #define SID_FOURIER_ANALYSIS_DIALOG (SC_MESSAGE_START + 88) #define SID_SPARKLINE_DIALOG (SC_MESSAGE_START + 89) #define SID_SPARKLINE_DATA_RANGE_DIALOG (SC_MESSAGE_START + 90) - +#define SID_POPUP_EASY_CONDITIONAL_FORMAT (SC_MESSAGE_START + 91) +#define SID_EASY_CONDITIONAL_FORMAT_DIALOG (SC_MESSAGE_START + 92) // functions diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index 9b8198587621..84217c63c949 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -212,6 +212,15 @@ interface CellSelection SID_START_FORMULA [ ExecMethod = Execute; ] SID_TOGGLE_REL [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] SID_POPUP_CONDFRMT [] + SID_POPUP_EASY_CONDITIONAL_FORMAT [] + SfxVoidItem ConditionalFormatEasy SID_EASY_CONDITIONAL_FORMAT_DIALOG + ( + SfxInt16Item FormatRule FN_PARAM_1 + ) + [ + ExecMethod = Execute; + StateMethod = GetState; + ] SID_COLUMN_OPERATIONS [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] SID_ROW_OPERATIONS [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] SID_OPENDLG_CURRENTCONDFRMT [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index cfd0f43f580b..4da6e21b162e 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -719,6 +719,37 @@ SfxVoidItem ConditionalFormatMenu SID_POPUP_CONDFRMT GroupId = SfxGroupId::Format; ] +SfxVoidItem ConditionalFormatConditionMenu SID_POPUP_EASY_CONDITIONAL_FORMAT +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + NoRecord; + + AccelConfig = FALSE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::Format; +] + +SfxVoidItem ConditionalFormatEasy SID_EASY_CONDITIONAL_FORMAT_DIALOG +(SfxInt16Item FormatRule FN_PARAM_1) +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::Format; +] SfxVoidItem ConditionalFormatDialog SID_OPENDLG_CONDFRMT () diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index c53dc6b3e305..3b9b24cfec49 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -1172,6 +1172,11 @@ void ScDocument::SetConsolidateDlgData( std::unique_ptr<ScConsolidateParam> pDat pConsolidateDlgData = std::move(pData); } +void ScDocument::SetEasyConditionalFormatDialogData(std::unique_ptr<ScConditionMode> pMode) +{ + pConditionalFormatDialogMode = std::move(pMode); +} + void ScDocument::SetChangeViewSettings(const ScChangeViewSettings& rNew) { if (pChangeViewSettings==nullptr) diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index 2256ee2e125b..f2fbe8d74c81 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -210,6 +210,7 @@ void ScDLL::Init() ScFourierAnalysisDialogWrapper ::RegisterChildWindow(false, pMod); sc::SparklineDialogWrapper ::RegisterChildWindow(false, pMod); sc::SparklineDataRangeDialogWrapper ::RegisterChildWindow(false, pMod); + sc::ConditionalFormatEasyDialogWrapper ::RegisterChildWindow(false, pMod); // Redlining Window ScAcceptChgDlgWrapper ::RegisterChildWindow(false, pMod); diff --git a/sc/source/ui/condformat/condformateasydlg.cxx b/sc/source/ui/condformat/condformateasydlg.cxx new file mode 100644 index 000000000000..8ddb297269dc --- /dev/null +++ b/sc/source/ui/condformat/condformateasydlg.cxx @@ -0,0 +1,192 @@ +#include <docfunc.hxx> +#include <condformateasydlg.hxx> +#include <stlpool.hxx> +#include <viewdata.hxx> +#include <reffact.hxx> +#include <svl/style.hxx> + +namespace +{ +void FillStyleListBox(const ScDocument* pDocument, weld::ComboBox& rCombo) +{ + std::set<OUString> aStyleNames; + SfxStyleSheetIterator aStyleIter(pDocument->GetStyleSheetPool(), SfxStyleFamily::Para); + for (SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next()) + { + aStyleNames.insert(pStyle->GetName()); + } + for (const auto& rStyleName : aStyleNames) + { + rCombo.append_text(rStyleName); + } +} + +void UpdateStyleList(const ScDocument* pDocument, weld::ComboBox& rCombo) +{ + OUString sSelectedStyle = rCombo.get_active_text(); + for (sal_Int32 i = rCombo.get_count(); i > 1; --i) + rCombo.remove(i - 1); + FillStyleListBox(pDocument, rCombo); + rCombo.set_active_text(sSelectedStyle); +} + +ScTabViewShell* GetTabViewShell(const SfxBindings* pBindings) +{ + if (!pBindings) + return nullptr; + SfxDispatcher* pDispacher = pBindings->GetDispatcher(); + if (!pDispacher) + return nullptr; + SfxViewFrame* pFrame = pDispacher->GetFrame(); + if (!pFrame) + return nullptr; + SfxViewShell* pViewShell = pFrame->GetViewShell(); + if (!pViewShell) + return nullptr; + return dynamic_cast<ScTabViewShell*>(pViewShell); +} +} + +namespace sc +{ +ConditionalFormatEasyDialog::ConditionalFormatEasyDialog(SfxBindings* pBindings, + SfxChildWindow* pChildWindow, + weld::Window* pParent, + ScViewData* pViewData) + : ScAnyRefDlgController(pBindings, pChildWindow, pParent, + "modules/scalc/ui/conditionaleasydialog.ui", "CondFormatEasyDlg") + , mpViewData(pViewData) + , mpDocument(&mpViewData->GetDocument()) + , mxNumberEntry(m_xBuilder->weld_spin_button("entryNumber")) + , mxNumberEntry2(m_xBuilder->weld_spin_button("entryNumber2")) + , mxRangeEntry(new formula::RefEdit(m_xBuilder->weld_entry("entryRange"))) + , mxStyles(m_xBuilder->weld_combo_box("themeCombo")) + , mxDescription(m_xBuilder->weld_label("description")) + , mxButtonOk(m_xBuilder->weld_button("ok")) + , mxButtonCancel(m_xBuilder->weld_button("cancel")) +{ + mpTabViewShell = GetTabViewShell(pBindings); + if (!mpTabViewShell) + mpTabViewShell = dynamic_cast<ScTabViewShell*>(SfxViewShell::Current()); + OSL_ENSURE(mpTabViewShell, "Missing view shell!"); + const ScConditionMode* pCurrentMode + = pViewData->GetDocument().GetEasyConditionalFormatDialogData(); + if (!pCurrentMode) + { + SAL_WARN( + "sc", + "Condition mode not set for easy conditional format dialog, this should not happen"); + meMode = ScConditionMode::Greater; + } + else + { + meMode = *pCurrentMode; + } + mxNumberEntry2->hide(); + mxNumberEntry->set_range(SAL_MIN_INT64, SAL_MAX_INT64); + mxNumberEntry2->set_range(SAL_MIN_INT64, SAL_MAX_INT64); + mxNumberEntry->set_increments(1, 0); + mxNumberEntry2->set_increments(1, 0); + switch (meMode) + { + case ScConditionMode::Greater: + mxDescription->set_label(mxDescription->get_label() + " greater than "); + break; + case ScConditionMode::Less: + mxDescription->set_label(mxDescription->get_label() + " less than "); + break; + case ScConditionMode::Equal: + mxDescription->set_label(mxDescription->get_label() + " equal to "); + break; + case ScConditionMode::Between: + mxDescription->set_label(mxDescription->get_label() + " between "); + mxNumberEntry2->show(); + break; + default: + SAL_WARN("sc", + "ConditionalFormatEasyDialog::ConditionalFormatEasyDialog: invalid format"); + break; + } + + mxButtonOk->connect_clicked(LINK(this, ConditionalFormatEasyDialog, ButtonPressed)); + mxButtonCancel->connect_clicked(LINK(this, ConditionalFormatEasyDialog, ButtonPressed)); + + ScRangeList aRange; + mpViewData->GetMarkData().FillRangeListWithMarks(&aRange, false); + if (aRange.empty()) + { + ScAddress aPosition(mpViewData->GetCurX(), mpViewData->GetCurY(), mpViewData->GetTabNo()); + aRange.push_back(ScRange(aPosition)); + } + maPosition = aRange.GetTopLeftCorner(); + + OUString sRangeString; + aRange.Format(sRangeString, ScRefFlags::VALID, *mpDocument, mpDocument->GetAddressConvention()); + mxRangeEntry->SetText(sRangeString); + + StartListening(*mpDocument->GetStyleSheetPool(), DuplicateHandling::Prevent); + FillStyleListBox(mpDocument, *mxStyles); + + mxStyles->set_active(1); +} + +ConditionalFormatEasyDialog::~ConditionalFormatEasyDialog() {} + +void ConditionalFormatEasyDialog::Notify(SfxBroadcaster&, const SfxHint& rHint) +{ + if (rHint.GetId() == SfxHintId::StyleSheetModified) + UpdateStyleList(mpDocument, *mxStyles); +} + +void ConditionalFormatEasyDialog::SetReference(const ScRange& rRange, ScDocument&) +{ + formula::RefEdit* pEdit = mxRangeEntry.get(); + if (rRange.aStart != rRange.aEnd) + RefInputStart(pEdit); + + ScRefFlags nFlags = ScRefFlags::RANGE_ABS; + const ScDocument& rDoc = mpViewData->GetDocument(); + OUString sRange( + rRange.Format(rDoc, nFlags, ScAddress::Details(mpDocument->GetAddressConvention(), 0, 0))); + pEdit->SetRefString(sRange); + maPosition = rRange.aStart; +} + +void ConditionalFormatEasyDialog::SetActive() +{ + mxRangeEntry->GrabFocus(); + RefInputDone(); +} + +void ConditionalFormatEasyDialog::Close() +{ + DoClose(ConditionalFormatEasyDialogWrapper::GetChildWindowId()); +} + +IMPL_LINK(ConditionalFormatEasyDialog, ButtonPressed, weld::Button&, rButton, void) +{ + if (&rButton == mxButtonOk.get()) + { + std::unique_ptr<ScConditionalFormat> pFormat(new ScConditionalFormat(0, mpDocument)); + ScFormatEntry* pEntry + = new ScCondFormatEntry(meMode, mxNumberEntry->get_text(), mxNumberEntry2->get_text(), + *mpDocument, maPosition, mxStyles->get_active_text()); + ScRangeList aRange; + ScRefFlags nFlags + = aRange.Parse(mxRangeEntry->GetText(), mpViewData->GetDocument(), + mpViewData->GetDocument().GetAddressConvention(), maPosition.Tab()); + if ((nFlags & ScRefFlags::VALID) && !aRange.empty()) + { + pFormat->AddEntry(pEntry); + pFormat->SetRange(aRange); + auto& rRangeList = pFormat->GetRange(); + mpViewData->GetDocShell()->GetDocFunc().ReplaceConditionalFormat( + 0, std::move(pFormat), maPosition.Tab(), rRangeList); + } + m_xDialog->response(RET_OK); + } + else if (&rButton == mxButtonCancel.get()) + m_xDialog->response(RET_CANCEL); +} + +} // namespace sc
\ No newline at end of file diff --git a/sc/source/ui/inc/condformateasydlg.hxx b/sc/source/ui/inc/condformateasydlg.hxx new file mode 100644 index 000000000000..001414396522 --- /dev/null +++ b/sc/source/ui/inc/condformateasydlg.hxx @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include "anyrefdg.hxx" +#include <svl/lstner.hxx> +#include <conditio.hxx> + +class ScViewData; +class ScConditionalFormat; +class ScTabViewShell; + +namespace sc +{ +class ConditionalFormatEasyDialog : public ScAnyRefDlgController, public SfxListener +{ +public: + ConditionalFormatEasyDialog(SfxBindings*, SfxChildWindow*, weld::Window*, ScViewData*); + virtual ~ConditionalFormatEasyDialog() override; + + virtual void SetReference(const ScRange&, ScDocument&) override; + virtual void SetActive() override; + virtual void Close() override; + + virtual void Notify(SfxBroadcaster&, const SfxHint&) override; + + DECL_LINK(ButtonPressed, weld::Button&, void); + +private: + ScViewData* mpViewData; + ScDocument* mpDocument; + ScConditionMode meMode; + ScAddress maPosition; + ScTabViewShell* mpTabViewShell; + + std::unique_ptr<weld::SpinButton> mxNumberEntry; + std::unique_ptr<weld::SpinButton> mxNumberEntry2; + std::unique_ptr<formula::RefEdit> mxRangeEntry; + std::unique_ptr<weld::ComboBox> mxStyles; + std::unique_ptr<weld::Label> mxDescription; + std::unique_ptr<weld::Button> mxButtonOk; + std::unique_ptr<weld::Button> mxButtonCancel; +}; + +} // namespace sc + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx index d6c2b1d2c788..4fbe965c15d9 100644 --- a/sc/source/ui/inc/reffact.hxx +++ b/sc/source/ui/inc/reffact.hxx @@ -165,6 +165,13 @@ private: SparklineDataRangeDialogWrapper() = delete; }; +/** Wrapper for the easy conditional format dialog */ +class ConditionalFormatEasyDialogWrapper : + public ChildControllerWrapper<SID_EASY_CONDITIONAL_FORMAT_DIALOG> +{ +private: + ConditionalFormatEasyDialogWrapper() = delete; +}; } class ScAcceptChgDlgWrapper : public SfxChildWindow diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index 8b088e226d18..2b78e258aff0 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -44,6 +44,7 @@ #include <funcdesc.hxx> #include <markdata.hxx> #include <scabstdlg.hxx> +#include <condformateasydlg.hxx> #include <columnspanset.hxx> #include <comphelper/lok.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> @@ -447,6 +448,25 @@ void ScCellShell::Execute( SfxRequest& rReq ) } break; + case SID_EASY_CONDITIONAL_FORMAT_DIALOG: + { + if (pReqArgs != nullptr) + { + const SfxPoolItem* pFormat; + if (pReqArgs->HasItem( FN_PARAM_1, &pFormat)) + { + sal_Int16 nFormat = static_cast<const SfxInt16Item*>(pFormat)->GetValue(); + sal_uInt16 nId = sc::ConditionalFormatEasyDialogWrapper::GetChildWindowId(); + SfxViewFrame& rViewFrame = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWindow = rViewFrame.GetChildWindow( nId ); + GetViewData().GetDocument().SetEasyConditionalFormatDialogData(std::make_unique<ScConditionMode>(static_cast<ScConditionMode>(nFormat))); + + pScMod->SetRefDialog( nId, pWindow == nullptr ); + } + } + } + break; + case FID_CELL_FORMAT: { if ( pReqArgs != nullptr ) diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx index 487f8c8e1812..3834e3b8c33f 100644 --- a/sc/source/ui/view/reffact.cxx +++ b/sc/source/ui/view/reffact.cxx @@ -115,6 +115,7 @@ IMPL_CONTROLLER_CHILD_CTOR( ScPrintAreasDlgWrapper, SID_OPENDLG_EDIT_PRINTAREA ) IMPL_CONTROLLER_CHILD_CTOR( ScFormulaDlgWrapper, SID_OPENDLG_FUNCTION ) + // ScSimpleRefDlgWrapper static bool bScSimpleRefFlag; diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx index f948d8326002..f64b960485a1 100644 --- a/sc/source/ui/view/tabvwsh.cxx +++ b/sc/source/ui/view/tabvwsh.cxx @@ -81,6 +81,7 @@ void ScTabViewShell::InitInterface_Impl() GetStaticInterface()->RegisterChildWindow(ScSpellDialogChildWindow::GetChildWindowId()); GetStaticInterface()->RegisterChildWindow(ScValidityRefChildWin::GetChildWindowId()); GetStaticInterface()->RegisterChildWindow(sc::SearchResultsDlgWrapper::GetChildWindowId()); + GetStaticInterface()->RegisterChildWindow(sc::ConditionalFormatEasyDialogWrapper::GetChildWindowId()); GetStaticInterface()->RegisterChildWindow(ScRandomNumberGeneratorDialogWrapper::GetChildWindowId()); GetStaticInterface()->RegisterChildWindow(ScSamplingDialogWrapper::GetChildWindowId()); diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index bb3824d8e6a5..47a15f64a7c9 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -48,6 +48,7 @@ #include <markdata.hxx> #include <reffact.hxx> #include <condformatdlg.hxx> +#include <condformateasydlg.hxx> #include <xmlsourcedlg.hxx> #include <condformatdlgitem.hxx> #include <formdata.hxx> @@ -322,6 +323,11 @@ std::shared_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont xResult = std::make_shared<ScConsolidateDlg>(pB, pCW, pParent, aArgSet); break; } + case SID_EASY_CONDITIONAL_FORMAT_DIALOG: + { + xResult = std::make_shared<sc::ConditionalFormatEasyDialog>(pB, pCW, pParent, &GetViewData()); + break; + } case SID_FILTER: { diff --git a/sc/uiconfig/scalc/popupmenu/conditional.xml b/sc/uiconfig/scalc/popupmenu/conditional.xml index 69309cf310c5..428157c79b01 100644 --- a/sc/uiconfig/scalc/popupmenu/conditional.xml +++ b/sc/uiconfig/scalc/popupmenu/conditional.xml @@ -8,7 +8,7 @@ * --> <menu:menupopup xmlns:menu="http://openoffice.org/2001/menu"> - <menu:menuitem menu:id=".uno:ConditionalFormatDialog"/> + <menu:menuitem menu:id=".uno:ConditionalFormatConditionMenu"/> <menu:menuitem menu:id=".uno:ColorScaleFormatDialog"/> <menu:menuitem menu:id=".uno:DataBarFormatDialog"/> <menu:menuitem menu:id=".uno:IconSetFormatDialog"/> diff --git a/sc/uiconfig/scalc/popupmenu/conditional_easy.xml b/sc/uiconfig/scalc/popupmenu/conditional_easy.xml new file mode 100644 index 000000000000..3346fa9441bb --- /dev/null +++ b/sc/uiconfig/scalc/popupmenu/conditional_easy.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * +--> +<menu:menupopup xmlns:menu="http://openoffice.org/2001/menu"> + <menu:menuitem menu:id=".uno:ConditionalFormatEasy?FormatRule:short=2"/> + <menu:menuitem menu:id=".uno:ConditionalFormatEasy?FormatRule:short=1"/> + <menu:menuitem menu:id=".uno:ConditionalFormatEasy?FormatRule:short=0"/> + <menu:menuitem menu:id=".uno:ConditionalFormatEasy?FormatRule:short=6"/> + <menu:menuseparator/> + <menu:menuitem menu:id=".uno:ConditionalFormatDialog"/> +</menu:menupopup> diff --git a/sc/uiconfig/scalc/ui/conditionaleasydialog.ui b/sc/uiconfig/scalc/ui/conditionaleasydialog.ui new file mode 100644 index 000000000000..8f3da05b2ce8 --- /dev/null +++ b/sc/uiconfig/scalc/ui/conditionaleasydialog.ui @@ -0,0 +1,237 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.40.0 --> +<interface domain="sc"> + <requires lib="gtk+" version="3.20"/> + <object class="GtkDialog" id="CondFormatEasyDlg"> + <property name="can-focus">False</property> + <property name="border-width">6</property> + <property name="title" translatable="yes" context="stock">Apply conditional formatting...</property> + <property name="type-hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox"> + <property name="can-focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child internal-child="action_area"> + <object class="GtkButtonBox"> + <property name="can-focus">False</property> + <property name="layout-style">end</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label" translatable="yes" context="stock">_OK</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="has-default">True</property> + <property name="receives-default">True</property> + <property name="use-underline">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="ok-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="conditionaleasydialog|extended_tip|ok">Saves all changes and closes dialog.</property> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <property name="label" translatable="yes" context="stock">_Cancel</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + <property name="use-underline">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="cancel-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="conditionaleasydialog|extended_tip|cancel">Closes dialog and discards all changes.</property> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <object class="GtkFrame"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="spacing">12</property> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="spacing">12</property> + <child> + <object class="GtkSpinButton" id="entryNumber"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <accessibility> + <relation type="labelled-by" target="description"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="entryNumber2"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <accessibility> + <relation type="labelled-by" target="description"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="spacing">12</property> + <child> + <object class="GtkLabel" id="with"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="stock">with</property> + <accessibility> + <relation type="label-for" target="themeCombo"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="themeCombo"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <accessibility> + <relation type="labelled-by" target="with"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="description"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="stock">Apply conditional formatting to cells</property> + <accessibility> + <relation type="label-for" target="entryNumber"/> + <relation type="label-for" target="entryNumber2"/> + </accessibility> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <child> + <object class="GtkEntry" id="entryRange"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <accessibility> + <relation type="labelled-by" target="range"/> + </accessibility> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="range"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="stock">Range:</property> + <accessibility> + <relation type="label-for" target="entryRange"/> + </accessibility> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + </child> + </object> +</interface> diff --git a/static/CustomTarget_emscripten_fs_image.mk b/static/CustomTarget_emscripten_fs_image.mk index ecdfddddab0e..8366e28fb542 100644 --- a/static/CustomTarget_emscripten_fs_image.mk +++ b/static/CustomTarget_emscripten_fs_image.mk @@ -859,6 +859,7 @@ gb_emscripten_fs_image_files += \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/scalc/popupmenu/colheader.xml \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/scalc/popupmenu/column_operations.xml \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/scalc/popupmenu/conditional.xml \ + $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/scalc/popupmenu/conditional_easy.xml \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/scalc/popupmenu/draw.xml \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/scalc/popupmenu/drawtext.xml \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/scalc/popupmenu/form.xml \ @@ -930,6 +931,7 @@ gb_emscripten_fs_image_files += \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/scalc/ui/colwidthdialog.ui \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/scalc/ui/condformatmanager.ui \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/scalc/ui/conditionalentry.ui \ + $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/scalc/ui/conditionalformateasy.ui \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/scalc/ui/conditionalformatdialog.ui \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/scalc/ui/conditionaliconset.ui \ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/config/soffice.cfg/modules/scalc/ui/conflictsdialog.ui \ |