From 4145a857791df2100d5df9defb79e1160f89249f Mon Sep 17 00:00:00 2001 From: Gabor Kelemen Date: Fri, 11 May 2018 15:38:02 +0200 Subject: Replace ScGlobal::GetRscString with simple ScResId calls After the gettext migration there is no point to have two APIs for reading the same .mo file. This patch is for sc/source/ui/[a-d]* for easier review. Change-Id: If268fb87ab09ca430a5bdb5cdd53a233e9158bfe Reviewed-on: https://gerrit.libreoffice.org/54134 Tested-by: Jenkins Reviewed-by: Julien Nabet --- sc/source/ui/condformat/condformatdlgentry.cxx | 8 ++-- sc/source/ui/condformat/condformathelper.cxx | 55 +++++++++++++------------- sc/source/ui/condformat/condformatmgr.cxx | 5 ++- 3 files changed, 35 insertions(+), 33 deletions(-) (limited to 'sc/source/ui/condformat') diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index d4bc1bc3bcdd..e8651496c864 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -305,7 +305,7 @@ IMPL_LINK(ScConditionFrmtEntry, OnEdChanged, Edit&, rEdit, void) if( aFormula.isEmpty() ) { - maFtVal->SetText(ScGlobal::GetRscString(STR_ENTER_VALUE)); + maFtVal->SetText(ScResId(STR_ENTER_VALUE)); return; } @@ -316,7 +316,7 @@ IMPL_LINK(ScConditionFrmtEntry, OnEdChanged, Edit&, rEdit, void) if( ta->GetCodeError() != FormulaError::NONE || ( ta->GetLen() == 0 ) ) { rEdit.SetControlBackground(COL_LIGHTRED); - maFtVal->SetText(ScGlobal::GetRscString(STR_VALID_DEFERROR)); + maFtVal->SetText(ScResId(STR_VALID_DEFERROR)); return; } @@ -329,7 +329,7 @@ IMPL_LINK(ScConditionFrmtEntry, OnEdChanged, Edit&, rEdit, void) ) { rEdit.SetControlBackground(COL_YELLOW); - maFtVal->SetText(ScGlobal::GetRscString(STR_UNQUOTED_STRING)); + maFtVal->SetText(ScResId(STR_UNQUOTED_STRING)); return; } @@ -480,7 +480,7 @@ void StyleSelect( ListBox& rLbStyle, const ScDocument* pDoc, SvxFontPrevWindow& { // call new style dialog SfxUInt16Item aFamilyItem( SID_STYLE_FAMILY, sal_uInt16(SfxStyleFamily::Para) ); - SfxStringItem aRefItem( SID_STYLE_REFERENCE, ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ); + SfxStringItem aRefItem( SID_STYLE_REFERENCE, ScResId(STR_STYLENAME_STANDARD) ); // unlock the dispatcher so SID_STYLE_NEW can be executed // (SetDispatcherLock would affect all Calc documents) diff --git a/sc/source/ui/condformat/condformathelper.cxx b/sc/source/ui/condformat/condformathelper.cxx index 804811b0a925..5b8e192ba044 100644 --- a/sc/source/ui/condformat/condformathelper.cxx +++ b/sc/source/ui/condformat/condformathelper.cxx @@ -10,6 +10,7 @@ #include #include #include +#include namespace { @@ -18,17 +19,17 @@ OUString getTextForType(ScCondFormatEntryType eType) switch(eType) { case CONDITION: - return ScGlobal::GetRscString(STR_COND_CONDITION); + return ScResId(STR_COND_CONDITION); case COLORSCALE: - return ScGlobal::GetRscString(STR_COND_COLORSCALE); + return ScResId(STR_COND_COLORSCALE); case DATABAR: - return ScGlobal::GetRscString(STR_COND_DATABAR); + return ScResId(STR_COND_DATABAR); case FORMULA: - return ScGlobal::GetRscString(STR_COND_FORMULA); + return ScResId(STR_COND_FORMULA); case ICONSET: - return ScGlobal::GetRscString(STR_COND_ICONSET); + return ScResId(STR_COND_ICONSET); case DATE: - return ScGlobal::GetRscString(STR_COND_DATE); + return ScResId(STR_COND_DATE); default: break; } @@ -53,42 +54,42 @@ OUString getExpression(sal_Int32 nIndex) case 5: return OUString("!="); case 6: - return ScGlobal::GetRscString(STR_COND_BETWEEN); + return ScResId(STR_COND_BETWEEN); case 7: - return ScGlobal::GetRscString(STR_COND_NOTBETWEEN); + return ScResId(STR_COND_NOTBETWEEN); case 8: - return ScGlobal::GetRscString(STR_COND_DUPLICATE); + return ScResId(STR_COND_DUPLICATE); case 9: - return ScGlobal::GetRscString(STR_COND_UNIQUE); + return ScResId(STR_COND_UNIQUE); case 11: - return ScGlobal::GetRscString(STR_COND_TOP10); + return ScResId(STR_COND_TOP10); case 12: - return ScGlobal::GetRscString(STR_COND_BOTTOM10); + return ScResId(STR_COND_BOTTOM10); case 13: - return ScGlobal::GetRscString(STR_COND_TOP_PERCENT); + return ScResId(STR_COND_TOP_PERCENT); case 14: - return ScGlobal::GetRscString(STR_COND_BOTTOM_PERCENT); + return ScResId(STR_COND_BOTTOM_PERCENT); case 15: - return ScGlobal::GetRscString(STR_COND_ABOVE_AVERAGE); + return ScResId(STR_COND_ABOVE_AVERAGE); case 16: - return ScGlobal::GetRscString(STR_COND_BELOW_AVERAGE); + return ScResId(STR_COND_BELOW_AVERAGE); case 17: - return ScGlobal::GetRscString(STR_COND_ABOVE_EQUAL_AVERAGE); + return ScResId(STR_COND_ABOVE_EQUAL_AVERAGE); case 18: - return ScGlobal::GetRscString(STR_COND_BELOW_EQUAL_AVERAGE); + return ScResId(STR_COND_BELOW_EQUAL_AVERAGE); case 19: - return ScGlobal::GetRscString(STR_COND_ERROR); + return ScResId(STR_COND_ERROR); case 20: - return ScGlobal::GetRscString(STR_COND_NOERROR); + return ScResId(STR_COND_NOERROR); case 21: - return ScGlobal::GetRscString(STR_COND_BEGINS_WITH); + return ScResId(STR_COND_BEGINS_WITH); case 22: - return ScGlobal::GetRscString(STR_COND_ENDS_WITH); + return ScResId(STR_COND_ENDS_WITH); case 23: - return ScGlobal::GetRscString(STR_COND_CONTAINS); + return ScResId(STR_COND_CONTAINS); case 24: - return ScGlobal::GetRscString(STR_COND_NOT_CONTAINS); + return ScResId(STR_COND_NOT_CONTAINS); case 10: assert(false); @@ -116,7 +117,7 @@ OUString getDateString(sal_Int32 nIndex) }; if (nIndex >= 0 && static_cast(nIndex) < SAL_N_ELEMENTS(aCondStrs)) - return ScGlobal::GetRscString(aCondStrs[nIndex]); + return ScResId(aCondStrs[nIndex]); assert(false); return OUString(); } @@ -150,7 +151,7 @@ OUString ScCondFormatHelper::GetExpression(const ScConditionalFormat& rFormat, c { aBuffer.append(pEntry->GetExpression(rPos, 0)); aBuffer.append(" "); - aBuffer.append(ScGlobal::GetRscString(STR_COND_AND)); + aBuffer.append(ScResId(STR_COND_AND)); aBuffer.append(" "); aBuffer.append(pEntry->GetExpression(rPos, 1)); } @@ -202,7 +203,7 @@ OUString ScCondFormatHelper::GetExpression( ScCondFormatEntryType eType, sal_Int if(nIndex == 6 || nIndex == 7) { aBuffer.append(" "); - aBuffer.append(ScGlobal::GetRscString(STR_COND_AND)); + aBuffer.append(ScResId(STR_COND_AND)); aBuffer.append(" "); aBuffer.append(aStr2); } diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx index d6370799ac06..db83d606220e 100644 --- a/sc/source/ui/condformat/condformatmgr.cxx +++ b/sc/source/ui/condformat/condformatmgr.cxx @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -18,8 +19,8 @@ ScCondFormatManagerWindow::ScCondFormatManagerWindow(SvSimpleTableContainer& rPa , mpDoc(pDoc) , mpFormatList(pFormatList) { - OUString aConditionStr(ScGlobal::GetRscString(STR_HEADER_COND)); - OUString aRangeStr(ScGlobal::GetRscString(STR_HEADER_RANGE)); + OUString aConditionStr(ScResId(STR_HEADER_COND)); + OUString aRangeStr(ScResId(STR_HEADER_RANGE)); OUStringBuffer sHeader; sHeader.append(aRangeStr).append("\t").append(aConditionStr); -- cgit