summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-11-16 15:08:07 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-01-28 13:47:27 +0100
commitc842966fa466d5f0be2bf66746da5e663eceb205 (patch)
treec3178ff12d5ada95097246fdba2ccd56f6f84440 /sc
parent9cacd76701360e30cbee2ccee61a3722b19b4531 (diff)
remaining ui parts for conditional date formats
Conflicts: sc/inc/globstr.hrc sc/source/ui/condformat/condformatdlgentry.cxx Change-Id: Ibc1dc80faa64d97e3d600ce40a97a716804cfac8
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/globstr.hrc31
-rw-r--r--sc/source/ui/condformat/condformathelper.cxx21
-rw-r--r--sc/source/ui/src/globstr.src52
3 files changed, 94 insertions, 10 deletions
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index 4b8031dede58..bf0451ccc1f0 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -613,14 +613,27 @@
#define STR_COND_CONTAINS 488
#define STR_COND_NOT_CONTAINS 489
#define STR_COND_DATE 490
-
-#define STR_ERR_CONDFORMAT_PROTECTED 491
-#define STR_EDIT_EXISTING_COND_FORMATS 492
-
-#define STR_QUERY_FORMULA_RECALC_ONLOAD_ODS 493
-#define STR_QUERY_FORMULA_RECALC_ONLOAD_XLS 494
-#define STR_ALWAYS_PERFORM_SELECTED 495
-
-#define STR_COUNT 496
+#define STR_COND_TODAY 491
+#define STR_COND_YESTERDAY 492
+#define STR_COND_TOMORROW 493
+#define STR_COND_LAST7DAYS 494
+#define STR_COND_THISWEEK 495
+#define STR_COND_LASTWEEK 496
+#define STR_COND_NEXTWEEK 497
+#define STR_COND_THISMONTH 498
+#define STR_COND_LASTMONTH 499
+#define STR_COND_NEXTMONTH 500
+#define STR_COND_THISYEAR 501
+#define STR_COND_LASTYEAR 502
+#define STR_COND_NEXTYEAR 503
+
+#define STR_ERR_CONDFORMAT_PROTECTED 504
+#define STR_EDIT_EXISTING_COND_FORMATS 505
+
+#define STR_QUERY_FORMULA_RECALC_ONLOAD_ODS 506
+#define STR_QUERY_FORMULA_RECALC_ONLOAD_XLS 507
+#define STR_ALWAYS_PERFORM_SELECTED 508
+
+#define STR_COUNT 509
#endif
diff --git a/sc/source/ui/condformat/condformathelper.cxx b/sc/source/ui/condformat/condformathelper.cxx
index b5949108ed84..0c6b77eeb008 100644
--- a/sc/source/ui/condformat/condformathelper.cxx
+++ b/sc/source/ui/condformat/condformathelper.cxx
@@ -90,6 +90,16 @@ rtl::OUString getExpression(sal_Int32 nIndex)
return rtl::OUString();
}
+rtl::OUString getDateString(sal_Int32 nIndex)
+{
+ sal_Int32 nStringIndex = STR_COND_TODAY + nIndex;
+ if(nStringIndex <= STR_COND_NEXTYEAR)
+ return ScGlobal::GetRscString(nStringIndex);
+
+ assert(false);
+ return rtl::OUString();
+}
+
}
rtl::OUString ScCondFormatHelper::GetExpression(const ScConditionalFormat& rFormat, const ScAddress& rPos)
@@ -139,7 +149,12 @@ rtl::OUString ScCondFormatHelper::GetExpression(const ScConditionalFormat& rForm
aBuffer.append(getTextForType(ICONSET));
break;
case condformat::DATE:
- aBuffer.append(getTextForType(DATE));
+ {
+ aBuffer.append(getTextForType(DATE));
+ aBuffer.append(" ");
+ sal_Int32 nDateEntry = static_cast<sal_Int32>(static_cast<const ScCondDateFormatEntry*>(rFormat.GetEntry(0))->GetDateType());
+ aBuffer.append(getDateString(nDateEntry));
+ }
break;
}
}
@@ -171,6 +186,10 @@ rtl::OUString ScCondFormatHelper::GetExpression( ScCondFormatEntryType eType, sa
{
aBuffer.append(" ").append(aStr1);
}
+ else if(eType == DATE)
+ {
+ aBuffer.append(getDateString(nIndex));
+ }
return aBuffer.makeStringAndClear();
}
diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src
index 9f9b259d2c67..6d53c05c40d9 100644
--- a/sc/source/ui/src/globstr.src
+++ b/sc/source/ui/src/globstr.src
@@ -1942,6 +1942,58 @@ Resource RID_GLOBSTR
{
Text [ en-US ] = "Not Contains";
};
+ String STR_COND_TODAY
+ {
+ Text [ en-US ] = "today";
+ };
+ String STR_COND_YESTERDAY
+ {
+ Text [ en-US ] = "yesterday";
+ };
+ String STR_COND_TOMORROW
+ {
+ Text [ en-US ] = "tomorrow";
+ };
+ String STR_COND_LAST7DAYS
+ {
+ Text [ en-US ] = "in the last 7 days";
+ };
+ String STR_COND_THISWEEK
+ {
+ Text [ en-US ] = "this week";
+ };
+ String STR_COND_LASTWEEK
+ {
+ Text [ en-US ] = "last week";
+ };
+ String STR_COND_NEXTWEEK
+ {
+ Text [ en-US ] = "next week";
+ };
+ String STR_COND_THISMONTH
+ {
+ Text [ en-US ] = "this month";
+ };
+ String STR_COND_LASTMONTH
+ {
+ Text [ en-US ] = "last month";
+ };
+ String STR_COND_NEXTMONTH
+ {
+ Text [ en-US ] = "next month";
+ };
+ String STR_COND_THISYEAR
+ {
+ Text [ en-US ] = "this year";
+ };
+ String STR_COND_LASTYEAR
+ {
+ Text [ en-US ] = "last year";
+ };
+ String STR_COND_NEXTYEAR
+ {
+ Text [ en-US ] = "next year";
+ };
String STR_ERR_CONDFORMAT_PROTECTED
{
Text [ en-US ] = "Conditional Formats can not be created, deleted or changed in protected sheets!";