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

improve showing the condition text when the entry is collapsed

Change-Id: I298f80c9df39156f950880a530076e0b0edf27b5
üst 90306e95
......@@ -289,7 +289,7 @@ ScFormatEntry* ScConditionFrmtEntry::createConditionEntry() const
rtl::OUString ScConditionFrmtEntry::GetExpressionString()
{
return ScCondFormatHelper::GetExpression(CONDITION, maLbCondType.GetSelectEntryPos());
return ScCondFormatHelper::GetExpression(CONDITION, maLbCondType.GetSelectEntryPos(), maEdVal1.GetText(), maEdVal2.GetText());
}
ScFormatEntry* ScConditionFrmtEntry::GetEntry() const
......@@ -483,7 +483,7 @@ ScFormatEntry* ScFormulaFrmtEntry::GetEntry() const
rtl::OUString ScFormulaFrmtEntry::GetExpressionString()
{
return ScCondFormatHelper::GetExpression(FORMULA, 0);
return ScCondFormatHelper::GetExpression(FORMULA, 0, maEdFormula.GetText());
}
void ScFormulaFrmtEntry::SetActive()
......
......@@ -91,7 +91,7 @@ rtl::OUString ScCondFormatHelper::GetExpression(const ScConditionalFormat& rForm
aBuffer.append(rtl::OUString(" and "));
aBuffer.append(pEntry->GetExpression(rPos, 1));
}
else
else if(eMode <= SC_COND_NOTEQUAL)
{
aBuffer.append(pEntry->GetExpression(rPos, 0));
}
......@@ -110,12 +110,27 @@ rtl::OUString ScCondFormatHelper::GetExpression(const ScConditionalFormat& rForm
return aBuffer.makeStringAndClear();
}
rtl::OUString ScCondFormatHelper::GetExpression( ScCondFormatEntryType eType, sal_Int32 nIndex )
rtl::OUString ScCondFormatHelper::GetExpression( ScCondFormatEntryType eType, sal_Int32 nIndex,
rtl::OUString aStr1, rtl::OUString aStr2 )
{
rtl::OUStringBuffer aBuffer(getTextForType(eType));
aBuffer.append(rtl::OUString(" "));
if(eType == CONDITION)
{
aBuffer.append(getExpression(nIndex));
if(nIndex <= 7)
{
aBuffer.append(" ").append(aStr1);
if(nIndex == 6 || nIndex == 7)
{
aBuffer.append(" and ").append(aStr2);
}
}
}
else if(eType == FORMULA)
{
aBuffer.append(" ").append(aStr1);
}
return aBuffer.makeStringAndClear();
}
......
......@@ -26,7 +26,8 @@ class ScCondFormatHelper
public:
static SC_DLLPUBLIC rtl::OUString GetExpression(const ScConditionalFormat& rFormat, const ScAddress& rPos);
static SC_DLLPUBLIC rtl::OUString GetExpression( ScCondFormatEntryType eType, sal_Int32 nIndex );
static SC_DLLPUBLIC rtl::OUString GetExpression( ScCondFormatEntryType eType, sal_Int32 nIndex,
rtl::OUString aStr1 = rtl::OUString(), rtl::OUString aStr2 = rtl::OUString() );
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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