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/qa for easier review.

Change-Id: Ifd773700654565ad31424dfe854bee8486a2330b
Reviewed-on: https://gerrit.libreoffice.org/54095
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
This commit is contained in:
Gabor Kelemen
2018-05-09 22:03:34 +02:00
committed by Julien Nabet
parent 15032b197c
commit 6cbb674e63
2 changed files with 16 additions and 14 deletions

View File

@@ -27,6 +27,7 @@
#include <attrib.hxx>
#include <dpshttab.hxx>
#include <globstr.hrc>
#include <scresid.hxx>
#include <test/xmltesttools.hxx>
#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
@@ -2309,7 +2310,7 @@ void ScPivotTableFiltersTest::testTdf112106()
CPPUNIT_ASSERT(pDim);
const boost::optional<OUString> & pLayoutName = pDim->GetLayoutName();
CPPUNIT_ASSERT(pLayoutName);
CPPUNIT_ASSERT_EQUAL(ScGlobal::GetRscString(STR_PIVOT_DATA), (*pLayoutName));
CPPUNIT_ASSERT_EQUAL(ScResId(STR_PIVOT_DATA), (*pLayoutName));
xDocSh->DoClose();
}

View File

@@ -15,6 +15,7 @@
#include <clipparam.hxx>
#include <globstr.hrc>
#include <scresid.hxx>
#include <docfunc.hxx>
#include <scitems.hxx>
#include <attrib.hxx>
@@ -100,7 +101,7 @@ void Test::testCondFormatINSDEL()
ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc);
ScRangeList aRangeList(ScRange(0,0,0,0,3,0));
pFormat->SetRange(aRangeList);
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT));
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
m_pDoc->AddCondFormatData(pFormat->GetRange(), 0, 1);
@@ -125,7 +126,7 @@ void Test::testCondFormatInsertCol()
ScRangeList aRangeList(ScRange(0,0,0,3,3,0));
pFormat->SetRange(aRangeList);
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT));
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
m_pDoc->AddCondFormatData(pFormat->GetRange(), 0, 1);
@@ -147,7 +148,7 @@ void Test::testCondFormatInsertRow()
ScRangeList aRangeList(ScRange(0,0,0,3,3,0));
pFormat->SetRange(aRangeList);
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT));
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
m_pDoc->AddCondFormatData(pFormat->GetRange(), 0, 1);
@@ -172,7 +173,7 @@ void Test::testCondFormatInsertDeleteSheets()
// Add condition in which if the value equals 2, set the "Result" style.
ScCondFormatEntry* pEntry = new ScCondFormatEntry(
ScConditionMode::Equal, "=2", "" , m_pDoc, ScAddress(0,0,0), ScGlobal::GetRscString(STR_STYLENAME_RESULT));
ScConditionMode::Equal, "=2", "" , m_pDoc, ScAddress(0,0,0), ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
// Apply the format to the range.
@@ -275,7 +276,7 @@ void Test::testCondCopyPaste()
ScRangeList aRangeList(aCondFormatRange);
pFormat->SetRange(aRangeList);
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT));
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
sal_uLong nIndex = m_pDoc->AddCondFormat(pFormat, 0);
@@ -314,7 +315,7 @@ void Test::testCondCopyPasteSingleCell()
ScRangeList aRangeList(aCondFormatRange);
pFormat->SetRange(aRangeList);
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT));
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
sal_uLong nIndex = m_pDoc->AddCondFormat(pFormat, 0);
@@ -353,7 +354,7 @@ void Test::testCondCopyPasteSingleCellToRange()
ScRangeList aRangeList(aCondFormatRange);
pFormat->SetRange(aRangeList);
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT));
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
sal_uLong nIndex = m_pDoc->AddCondFormat(pFormat, 0);
@@ -398,7 +399,7 @@ void Test::testCondCopyPasteSingleCellIntoSameFormatRange()
ScRangeList aRangeList(aCondFormatRange);
pFormat->SetRange(aRangeList);
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct, "=B2", "", m_pDoc, ScAddress(0, 0, 0), ScGlobal::GetRscString(STR_STYLENAME_RESULT));
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct, "=B2", "", m_pDoc, ScAddress(0, 0, 0), ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
sal_uLong nIndex = m_pDoc->AddCondFormat(pFormat, 0);
@@ -435,7 +436,7 @@ void Test::testCondCopyPasteSingleRowToRange()
ScRangeList aRangeList(aCondFormatRange);
pFormat->SetRange(aRangeList);
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT));
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
m_pDoc->AddCondFormat(pFormat, 0);
@@ -466,7 +467,7 @@ void Test::testCondCopyPasteSingleRowToRange2()
ScRangeList aRangeList(aCondFormatRange);
pFormat->SetRange(aRangeList);
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT));
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
m_pDoc->AddCondFormat(pFormat, 0);
@@ -496,7 +497,7 @@ void Test::testCondCopyPasteSheetBetweenDoc()
ScRangeList aRangeList(aCondFormatRange);
pFormat->SetRange(aRangeList);
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT));
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
m_pDoc->AddCondFormat(pFormat, 0);
@@ -518,7 +519,7 @@ void Test::testCondCopyPasteSheet()
ScRangeList aRangeList(aCondFormatRange);
pFormat->SetRange(aRangeList);
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT));
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
m_pDoc->AddCondFormat(pFormat, 0);
@@ -1116,7 +1117,7 @@ sal_uInt32 addSingleCellCondFormat(ScDocument* pDoc, const ScAddress& rAddr, sal
pFormat->SetRange(aRangeList);
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct, rCondition, "",
pDoc, ScAddress(0,0,0), ScGlobal::GetRscString(STR_STYLENAME_RESULT));
pDoc, ScAddress(0,0,0), ScResId(STR_STYLENAME_RESULT));
pFormat->AddEntry(pEntry);
return pDoc->AddCondFormat(pFormat, 0);
}