summaryrefslogtreecommitdiff
path: root/sc/source/ui/condformat
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-11-04 14:59:14 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-11-04 16:33:17 +0100
commit14b78ada71d0a6fff0336c7bccd4dfdbc32d33bd (patch)
treea67160baa5de6ad2a7da6cbc59ef12453cbf212f /sc/source/ui/condformat
parent7365db393b5c9f7035c9a8ea36e44904e641a269 (diff)
add the new cond formats to the dialogs
Change-Id: I5383d74abaa1d568a4be8271d0e081f914ac4067
Diffstat (limited to 'sc/source/ui/condformat')
-rw-r--r--sc/source/ui/condformat/condformatdlgentry.cxx27
-rw-r--r--sc/source/ui/condformat/condformathelper.cxx12
2 files changed, 36 insertions, 3 deletions
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index 180b1fcf2bd3..817da0b999dc 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -227,6 +227,18 @@ ScConditionFrmtEntry::ScConditionFrmtEntry( Window* pParent, ScDocument* pDoc, c
maEdVal1.Hide();
maLbCondType.SelectEntryPos(17);
break;
+ case SC_COND_BEGINS_WITH:
+ maLbCondType.SelectEntryPos(18);
+ break;
+ case SC_COND_ENDS_WITH:
+ maLbCondType.SelectEntryPos(19);
+ break;
+ case SC_COND_CONTAINS_TEXT:
+ maLbCondType.SelectEntryPos(20);
+ break;
+ case SC_COND_NOT_CONTAINS_TEXT:
+ maLbCondType.SelectEntryPos(21);
+ break;
case SC_COND_NONE:
break;
}
@@ -331,6 +343,18 @@ ScFormatEntry* ScConditionFrmtEntry::createConditionEntry() const
case 17:
eMode = SC_COND_NOERROR;
break;
+ case 18:
+ eMode = SC_COND_BEGINS_WITH;
+ break;
+ case 19:
+ eMode = SC_COND_ENDS_WITH;
+ break;
+ case 20:
+ eMode = SC_COND_CONTAINS_TEXT;
+ break;
+ case 21:
+ eMode = SC_COND_NOT_CONTAINS_TEXT;
+ break;
default:
assert(false); // this cannot happen
return NULL;
@@ -977,7 +1001,8 @@ IMPL_LINK_NOARG( ScConditionFrmtEntry, ConditionTypeSelectHdl )
maEdVal2.Hide();
maEdVal1.Hide();
}
- else if(nSelectPos < 6 || (nSelectPos >= 10 && nSelectPos <= 13))
+ else if(nSelectPos <= 5 || (nSelectPos >= 10 && nSelectPos <= 13)
+ || nSelectPos >= 18)
{
maEdVal1.Show();
maEdVal2.Hide();
diff --git a/sc/source/ui/condformat/condformathelper.cxx b/sc/source/ui/condformat/condformathelper.cxx
index 3d8b5eeb2135..09eaa24859df 100644
--- a/sc/source/ui/condformat/condformathelper.cxx
+++ b/sc/source/ui/condformat/condformathelper.cxx
@@ -76,6 +76,14 @@ rtl::OUString getExpression(sal_Int32 nIndex)
return ScGlobal::GetRscString(STR_COND_ERROR);
case 18:
return ScGlobal::GetRscString(STR_COND_NOERROR);
+ case 19:
+ return ScGlobal::GetRscString(STR_COND_BEGINS_WITH);
+ case 20:
+ return ScGlobal::GetRscString(STR_COND_ENDS_WITH);
+ case 21:
+ return ScGlobal::GetRscString(STR_COND_CONTAINS);
+ case 22:
+ return ScGlobal::GetRscString(STR_COND_NOT_CONTAINS);
}
return rtl::OUString();
}
@@ -111,7 +119,7 @@ rtl::OUString ScCondFormatHelper::GetExpression(const ScConditionalFormat& rForm
aBuffer.append(rtl::OUString(" and "));
aBuffer.append(pEntry->GetExpression(rPos, 1));
}
- else if(eMode <= SC_COND_NOTEQUAL)
+ else if(eMode <= SC_COND_NOTEQUAL || eMode >= SC_COND_BEGINS_WITH)
{
aBuffer.append(pEntry->GetExpression(rPos, 0));
}
@@ -141,7 +149,7 @@ rtl::OUString ScCondFormatHelper::GetExpression( ScCondFormatEntryType eType, sa
if(eType == CONDITION)
{
aBuffer.append(getExpression(nIndex));
- if(nIndex <= 7)
+ if(nIndex <= 7 || nIndex >= 19)
{
aBuffer.append(" ").append(aStr1);
if(nIndex == 6 || nIndex == 7)