diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-11-04 14:59:14 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-11-04 16:33:17 +0100 |
commit | 14b78ada71d0a6fff0336c7bccd4dfdbc32d33bd (patch) | |
tree | a67160baa5de6ad2a7da6cbc59ef12453cbf212f | |
parent | 7365db393b5c9f7035c9a8ea36e44904e641a269 (diff) |
add the new cond formats to the dialogs
Change-Id: I5383d74abaa1d568a4be8271d0e081f914ac4067
-rw-r--r-- | sc/inc/globstr.hrc | 8 | ||||
-rw-r--r-- | sc/source/ui/condformat/condformatdlgentry.cxx | 27 | ||||
-rw-r--r-- | sc/source/ui/condformat/condformathelper.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/src/condformatdlg.src | 4 | ||||
-rw-r--r-- | sc/source/ui/src/globstr.src | 16 |
5 files changed, 62 insertions, 5 deletions
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index 5e27e71928bf..ea2d87050601 100644 --- a/sc/inc/globstr.hrc +++ b/sc/inc/globstr.hrc @@ -608,9 +608,13 @@ #define STR_COND_BELOW_AVERAGE 483 #define STR_COND_ERROR 484 #define STR_COND_NOERROR 485 +#define STR_COND_BEGINS_WITH 486 +#define STR_COND_ENDS_WITH 487 +#define STR_COND_CONTAINS 488 +#define STR_COND_NOT_CONTAINS 489 -#define STR_ERR_CONDFORMAT_PROTECTED 486 +#define STR_ERR_CONDFORMAT_PROTECTED 490 -#define STR_COUNT 487 +#define STR_COUNT 491 #endif 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) diff --git a/sc/source/ui/src/condformatdlg.src b/sc/source/ui/src/condformatdlg.src index 1cc7c6766868..8318cc1ebee3 100644 --- a/sc/source/ui/src/condformatdlg.src +++ b/sc/source/ui/src/condformatdlg.src @@ -149,6 +149,10 @@ Control RID_COND_ENTRY "below average"; "Error"; "No Error"; + "Begins with"; + "Ends with"; + "Contains"; + "Not Contains"; }; }; Edit ED_VAL1 diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src index 2212b42f0bb6..226bb1ab920d 100644 --- a/sc/source/ui/src/globstr.src +++ b/sc/source/ui/src/globstr.src @@ -1931,6 +1931,22 @@ Resource RID_GLOBSTR { Text [ en-US ] = "not an Error code"; }; + String STR_COND_BEGINS_WITH + { + Text [ en-US ] = "Begins with"; + }; + String STR_COND_ENDS_WITH + { + Text [ en-US ] = "Ends with"; + }; + String STR_COND_CONTAINS + { + Text [ en-US ] = "Contains"; + }; + String STR_COND_NOT_CONTAINS + { + Text [ en-US ] = "Not Contains"; + }; String STR_ERR_CONDFORMAT_PROTECTED { Text [ en-US ] = "Conditional Formats can not be created, deleted or changed in protected sheets!"; |