summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2024-09-13 08:14:47 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2024-09-13 11:23:11 +0200
commit27be65a7d5326608f75839e3964ac322e88224a1 (patch)
tree5c7b13b6b830a0e439e76d6b3685553d0f9b0f9e /sc/source/ui
parent0874f235e6779317ae215c438b6e642694b40af1 (diff)
tdf#162938: Revert "tdf#61313 Replace the static ">="...
... with a dropdown of different operators" Why was this patch submitted in the first place? It added a call to convertToOldCondFormat in testTdf101104, testComplexIconSetsXLSX and testTdf64401 to make those tests pass but the issue was already reproducible with those files This reverts commit fcc5770dd1e33dcb4f4f0c28683569af5d1d8368. Change-Id: Ifd8904de26d39d23e52ec2188d917bec34ad93b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173310 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/condformat/condformatdlgentry.cxx29
1 files changed, 16 insertions, 13 deletions
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index 605b960c15de..0bff49e32f44 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -1250,9 +1250,9 @@ protected:
private:
std::unique_ptr<weld::Container> mxGrid;
std::unique_ptr<weld::Image> mxImgIcon;
+ std::unique_ptr<weld::Label> mxFtEntry;
std::unique_ptr<weld::Entry> mxEdEntry;
std::unique_ptr<weld::ComboBox> mxLbEntryType;
- std::unique_ptr<weld::ComboBox> mxConditionMode;
weld::Container* mpContainer;
public:
@@ -1268,6 +1268,8 @@ public:
}
ScColorScaleEntry* CreateEntry(ScDocument& rDoc, const ScAddress& rPos) const;
+
+ void SetFirstEntry();
};
ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry(weld::Container* pParent, ScIconSetType eType, const ScDocument* pDoc, sal_Int32 i, const ScColorScaleEntry* pEntry)
@@ -1276,17 +1278,11 @@ ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry(weld::Container* pParent, ScIconS
, mxImgIcon(mxBuilder->weld_image(u"icon"_ustr))
, mxEdEntry(mxBuilder->weld_entry(u"entry"_ustr))
, mxLbEntryType(mxBuilder->weld_combo_box(u"listbox"_ustr))
- , mxConditionMode(mxBuilder->weld_combo_box(u"conditionMode"_ustr))
, mpContainer(pParent)
{
mxImgIcon->set_from_icon_name(ScIconSetFormat::getIconName(eType, i));
if(pEntry)
{
- if (pEntry->GetMode() >= ScConditionMode::Equal && pEntry->GetMode() <= ScConditionMode::NotEqual)
- mxConditionMode->set_active(static_cast<int>(pEntry->GetMode()));
- else
- assert(false && "ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry: Invalid condition mode");
-
switch(pEntry->GetType())
{
case COLORSCALE_VALUE:
@@ -1312,7 +1308,6 @@ ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry(weld::Container* pParent, ScIconS
else
{
mxLbEntryType->set_active(1);
- mxConditionMode->set_active(0);
}
}
@@ -1323,8 +1318,7 @@ ScIconSetFrmtDataEntry::~ScIconSetFrmtDataEntry()
ScColorScaleEntry* ScIconSetFrmtDataEntry::CreateEntry(ScDocument& rDoc, const ScAddress& rPos) const
{
- sal_Int32 nTypePos = mxLbEntryType->get_active();
- sal_Int32 nModePos = mxConditionMode->get_active();
+ sal_Int32 nPos = mxLbEntryType->get_active();
OUString aText = mxEdEntry->get_text();
ScColorScaleEntry* pEntry = new ScColorScaleEntry();
@@ -1334,7 +1328,7 @@ ScColorScaleEntry* ScIconSetFrmtDataEntry::CreateEntry(ScDocument& rDoc, const S
(void)pNumberFormatter->IsNumberFormat(aText, nIndex, nVal);
pEntry->SetValue(nVal);
- switch(nTypePos)
+ switch(nPos)
{
case 0:
pEntry->SetType(COLORSCALE_VALUE);
@@ -1353,11 +1347,18 @@ ScColorScaleEntry* ScIconSetFrmtDataEntry::CreateEntry(ScDocument& rDoc, const S
assert(false);
}
- pEntry->SetMode(static_cast<ScConditionMode>(nModePos));
-
return pEntry;
}
+void ScIconSetFrmtDataEntry::SetFirstEntry()
+{
+ mxEdEntry->hide();
+ mxLbEntryType->hide();
+ mxFtEntry->hide();
+ mxEdEntry->set_text("0");
+ mxLbEntryType->set_active(1);
+}
+
ScIconSetFrmtEntry::ScIconSetFrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScIconSetFormat* pFormat)
: ScCondFrmtEntry(pParent, pDoc, rPos)
, mxLbColorFormat(mxBuilder->weld_combo_box(u"colorformat"_ustr))
@@ -1384,6 +1385,7 @@ ScIconSetFrmtEntry::ScIconSetFrmtEntry(ScCondFormatList* pParent, ScDocument* pD
mxIconParent.get(), eType, pDoc, i, pIconSetFormatData->m_Entries[i].get()));
maEntries[i]->set_grid_top_attach(i);
}
+ maEntries[0]->SetFirstEntry();
}
else
IconSetTypeHdl(*mxLbIconSetType);
@@ -1417,6 +1419,7 @@ IMPL_LINK_NOARG( ScIconSetFrmtEntry, IconSetTypeHdl, weld::ComboBox&, void )
maEntries[i]->set_grid_top_attach(i);
maEntries[i]->Show();
}
+ maEntries[0]->SetFirstEntry();
}
OUString ScIconSetFrmtEntry::GetExpressionString()