diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-10-12 11:57:07 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-10-13 04:33:33 +0200 |
commit | 979c4753831eec5e05df685880cc2052bea64307 (patch) | |
tree | d7b656051b51cd81bf22e2b0f00cdea8e350ce80 /sc | |
parent | 90306e95c6896c1f3b7f6369581d7bada8f15d7c (diff) |
improve showing the condition text when the entry is collapsed
Change-Id: I298f80c9df39156f950880a530076e0b0edf27b5
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/condformat/condformatdlgentry.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/condformat/condformathelper.cxx | 19 | ||||
-rw-r--r-- | sc/source/ui/inc/condformathelper.hxx | 3 |
3 files changed, 21 insertions, 5 deletions
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 646f928a4b01..58f59bb18940 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -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() diff --git a/sc/source/ui/condformat/condformathelper.cxx b/sc/source/ui/condformat/condformathelper.cxx index 1ec8607759dc..1f658e326456 100644 --- a/sc/source/ui/condformat/condformathelper.cxx +++ b/sc/source/ui/condformat/condformathelper.cxx @@ -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(); } diff --git a/sc/source/ui/inc/condformathelper.hxx b/sc/source/ui/inc/condformathelper.hxx index 48c269de0bd6..297d032d88ad 100644 --- a/sc/source/ui/inc/condformathelper.hxx +++ b/sc/source/ui/inc/condformathelper.hxx @@ -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: */ |