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

remaining ui parts for conditional date formats

Conflicts:
	sc/inc/globstr.hrc
	sc/source/ui/condformat/condformatdlgentry.cxx

Change-Id: Ibc1dc80faa64d97e3d600ce40a97a716804cfac8
üst 9cacd767
...@@ -613,14 +613,27 @@ ...@@ -613,14 +613,27 @@
#define STR_COND_CONTAINS 488 #define STR_COND_CONTAINS 488
#define STR_COND_NOT_CONTAINS 489 #define STR_COND_NOT_CONTAINS 489
#define STR_COND_DATE 490 #define STR_COND_DATE 490
#define STR_COND_TODAY 491
#define STR_ERR_CONDFORMAT_PROTECTED 491 #define STR_COND_YESTERDAY 492
#define STR_EDIT_EXISTING_COND_FORMATS 492 #define STR_COND_TOMORROW 493
#define STR_COND_LAST7DAYS 494
#define STR_QUERY_FORMULA_RECALC_ONLOAD_ODS 493 #define STR_COND_THISWEEK 495
#define STR_QUERY_FORMULA_RECALC_ONLOAD_XLS 494 #define STR_COND_LASTWEEK 496
#define STR_ALWAYS_PERFORM_SELECTED 495 #define STR_COND_NEXTWEEK 497
#define STR_COND_THISMONTH 498
#define STR_COUNT 496 #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 #endif
...@@ -90,6 +90,16 @@ rtl::OUString getExpression(sal_Int32 nIndex) ...@@ -90,6 +90,16 @@ rtl::OUString getExpression(sal_Int32 nIndex)
return rtl::OUString(); 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) rtl::OUString ScCondFormatHelper::GetExpression(const ScConditionalFormat& rFormat, const ScAddress& rPos)
...@@ -139,7 +149,12 @@ rtl::OUString ScCondFormatHelper::GetExpression(const ScConditionalFormat& rForm ...@@ -139,7 +149,12 @@ rtl::OUString ScCondFormatHelper::GetExpression(const ScConditionalFormat& rForm
aBuffer.append(getTextForType(ICONSET)); aBuffer.append(getTextForType(ICONSET));
break; break;
case condformat::DATE: 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; break;
} }
} }
...@@ -171,6 +186,10 @@ rtl::OUString ScCondFormatHelper::GetExpression( ScCondFormatEntryType eType, sa ...@@ -171,6 +186,10 @@ rtl::OUString ScCondFormatHelper::GetExpression( ScCondFormatEntryType eType, sa
{ {
aBuffer.append(" ").append(aStr1); aBuffer.append(" ").append(aStr1);
} }
else if(eType == DATE)
{
aBuffer.append(getDateString(nIndex));
}
return aBuffer.makeStringAndClear(); return aBuffer.makeStringAndClear();
} }
......
...@@ -1942,6 +1942,58 @@ Resource RID_GLOBSTR ...@@ -1942,6 +1942,58 @@ Resource RID_GLOBSTR
{ {
Text [ en-US ] = "Not Contains"; 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 String STR_ERR_CONDFORMAT_PROTECTED
{ {
Text [ en-US ] = "Conditional Formats can not be created, deleted or changed in protected sheets!"; Text [ en-US ] = "Conditional Formats can not be created, deleted or changed in protected sheets!";
......
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