[Libreoffice-commits] .: 2 commits - sc/inc sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Jan 28 04:46:11 PST 2013
sc/inc/compiler.hxx | 1
sc/inc/globstr.hrc | 31 +++++++++++-----
sc/source/core/tool/compiler.cxx | 10 -----
sc/source/ui/condformat/condformathelper.cxx | 21 ++++++++++
sc/source/ui/src/globstr.src | 52 +++++++++++++++++++++++++++
5 files changed, 95 insertions(+), 20 deletions(-)
New commits:
commit 8877e4aeda044c2d74468b4a37bad9e96d7d6f3a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Jan 28 03:11:18 2013 +0100
no need for the String version of this function anymore
Change-Id: Ic661a5cb492c25a049dfaf1da0a501ceeae83c2c
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 10af901..c70d184 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -426,7 +426,6 @@ public:
maExternalLinks = rLinks;
}
- void CreateStringFromXMLTokenArray( String& rFormula, String& rFormulaNmsp );
void CreateStringFromXMLTokenArray( rtl::OUString& rFormula, rtl::OUString& rFormulaNmsp );
void SetExtendedErrorDetection( ExtendedErrorDetection eVal ) { meExtendedErrorDetection = eVal; }
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index ac0d10b..e19eb19 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -3718,7 +3718,7 @@ bool ScCompiler::NextNewToken( bool bInArray )
return true;
}
-void ScCompiler::CreateStringFromXMLTokenArray( String& rFormula, String& rFormulaNmsp )
+void ScCompiler::CreateStringFromXMLTokenArray( rtl::OUString& rFormula, rtl::OUString& rFormulaNmsp )
{
bool bExternal = GetGrammar() == FormulaGrammar::GRAM_EXTERNAL;
sal_uInt16 nExpectedCount = bExternal ? 2 : 1;
@@ -3733,14 +3733,6 @@ void ScCompiler::CreateStringFromXMLTokenArray( String& rFormula, String& rFormu
}
}
-void ScCompiler::CreateStringFromXMLTokenArray( rtl::OUString& rFormula, rtl::OUString& rFormulaNmsp )
-{
- String sFormula, aFormulaNmsp;
- CreateStringFromXMLTokenArray(sFormula, aFormulaNmsp);
- rFormula = sFormula;
- rFormulaNmsp = aFormulaNmsp;
-}
-
namespace {
class ExternalFileInserter : std::unary_function<sal_uInt16, void>
commit c842966fa466d5f0be2bf66746da5e663eceb205
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Nov 16 15:08:07 2012 +0100
remaining ui parts for conditional date formats
Conflicts:
sc/inc/globstr.hrc
sc/source/ui/condformat/condformatdlgentry.cxx
Change-Id: Ibc1dc80faa64d97e3d600ce40a97a716804cfac8
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index 4b8031d..bf0451cc 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 b594910..0c6b77e 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 9f9b259..6d53c05 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!";
More information about the Libreoffice-commits
mailing list