tdf#157930 sc: Add easy to use conditional formatting menu
Add menu options that open a dialog that can add conditional formatting in a cell range with common options. Change-Id: Ia54baba08e4b78c4c6e37fa7bff744af8cf06037 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156831 Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
This commit is contained in:
committed by
Szymon Kłos
parent
334d3aff8d
commit
217f23f643
@@ -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>
|
||||
|
@@ -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">
|
||||
|
@@ -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 \
|
||||
|
@@ -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 \
|
||||
|
@@ -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 );
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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; ]
|
||||
|
@@ -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
|
||||
()
|
||||
|
@@ -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)
|
||||
|
@@ -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);
|
||||
|
192
sc/source/ui/condformat/condformateasydlg.cxx
Normal file
192
sc/source/ui/condformat/condformateasydlg.cxx
Normal file
@@ -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
|
54
sc/source/ui/inc/condformateasydlg.hxx
Normal file
54
sc/source/ui/inc/condformateasydlg.hxx
Normal file
@@ -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: */
|
@@ -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
|
||||
|
@@ -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 )
|
||||
|
@@ -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;
|
||||
|
@@ -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());
|
||||
|
@@ -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:
|
||||
{
|
||||
|
||||
|
@@ -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"/>
|
||||
|
17
sc/uiconfig/scalc/popupmenu/conditional_easy.xml
Normal file
17
sc/uiconfig/scalc/popupmenu/conditional_easy.xml
Normal file
@@ -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>
|
237
sc/uiconfig/scalc/ui/conditionaleasydialog.ui
Normal file
237
sc/uiconfig/scalc/ui/conditionaleasydialog.ui
Normal file
@@ -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>
|
@@ -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 \
|
||||
|
Reference in New Issue
Block a user