Kaydet (Commit) fb4302d4 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

handle formula is in new conditional format dlg

Change-Id: Ia492b8fb9ad1406800ba855370daafb40f254093
üst f14bd201
......@@ -219,6 +219,7 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScForm
ScConditionMode eMode = pEntry->GetOperation();
maLbType.SelectEntryPos(1);
maEdVal1.SetText(pEntry->GetExpression(maPos, 0));
SetCondType();
switch(eMode)
{
case SC_COND_EQUAL:
......@@ -255,12 +256,11 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScForm
break;
case SC_COND_DIRECT:
maLbType.SelectEntryPos(2);
SwitchToType(FORMULA);
break;
case SC_COND_NONE:
break;
}
SwitchToType(CONDITION);
SetCondType();
}
else if( pFormatEntry && pFormatEntry->GetType() == condformat::COLORSCALE )
{
......@@ -400,6 +400,8 @@ rtl::OUString getTextForType(ScCondFormatEntryType eType)
return rtl::OUString("Color scale");
case DATABAR:
return rtl::OUString("Data Bar");
case FORMULA:
return rtl::OUString("Formula is");
default:
break;
}
......@@ -517,6 +519,7 @@ void ScCondFrmtEntry::SetHeight()
switch (meType)
{
case CONDITION:
case FORMULA:
aSize.Height() = 120;
break;
case COLORSCALE:
......@@ -591,6 +594,18 @@ void ScCondFrmtEntry::SetDataBarType()
maBtOptions.Show();
}
void ScCondFrmtEntry::SetFormulaType()
{
SwitchToType(FORMULA);
HideColorScaleElements();
HideDataBarElements();
maEdVal1.Show();
maEdVal2.Hide();
maLbCondType.Hide();
maLbStyle.Show();
maWdPreview.Show();
}
void ScCondFrmtEntry::Select()
{
SetControlForeground(Color(COL_RED));
......@@ -730,6 +745,18 @@ ScFormatEntry* ScCondFrmtEntry::createDatabarEntry() const
return pDataBar;
}
ScFormatEntry* ScCondFrmtEntry::createFormulaEntry() const
{
ScConditionMode eMode = SC_COND_DIRECT;
rtl::OUString aFormula = maEdVal1.GetText();
if(aFormula.isEmpty())
return NULL;
rtl::OUString aExpr2;
ScFormatEntry* pEntry = new ScCondFormatEntry(eMode, aFormula, aExpr2, mpDoc, maPos, maLbStyle.GetSelectEntry());
return pEntry;
}
ScFormatEntry* ScCondFrmtEntry::GetEntry() const
{
switch(meType)
......@@ -743,6 +770,9 @@ ScFormatEntry* ScCondFrmtEntry::GetEntry() const
case DATABAR:
return createDatabarEntry();
break;
case FORMULA:
return createFormulaEntry();
break;
default:
break;
}
......@@ -764,7 +794,7 @@ IMPL_LINK_NOARG(ScCondFrmtEntry, TypeListHdl)
SetDataBarType();
break;
case 2:
SetCondType();
SetFormulaType();
break;
default:
break;
......
......@@ -51,6 +51,7 @@ enum ScCondFormatEntryType
CONDITION,
COLORSCALE,
DATABAR,
FORMULA,
COLLAPSED
};
......@@ -107,6 +108,7 @@ private:
void SetCondType();
void SetColorScaleType();
void SetDataBarType();
void SetFormulaType();
void HideCondElements();
void HideColorScaleElements();
void HideDataBarElements();
......@@ -117,6 +119,7 @@ private:
ScFormatEntry* createConditionEntry() const;
ScFormatEntry* createColorscaleEntry() const;
ScFormatEntry* createDatabarEntry() const;
ScFormatEntry* createFormulaEntry() const;
ScDocument* mpDoc;
ScAddress maPos;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment