Kaydet (Commit) 408c0a76 authored tarafından Noel Grandin's avatar Noel Grandin

convert StringType to scoped enum

and drop unused FormulaValue enumerator

Change-Id: Ide6026b841db224947d7d559c110dfc7da3cd975
Reviewed-on: https://gerrit.libreoffice.org/34467Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 2009cf1b
...@@ -116,6 +116,7 @@ def is_ignore(srcLoc): ...@@ -116,6 +116,7 @@ def is_ignore(srcLoc):
"codemaker/source/javamaker/classfile.hxx", # AccessFlags "codemaker/source/javamaker/classfile.hxx", # AccessFlags
"basic/source/inc/filefmt.hxx", # FileOffset "basic/source/inc/filefmt.hxx", # FileOffset
"basic/source/inc/opcodes.hxx", # SbiOpcode "basic/source/inc/opcodes.hxx", # SbiOpcode
"sc/source/filter/inc/flttypes.hxx", # BiffTyp
# unit test code # unit test code
"cppu/source/uno/check.cxx", "cppu/source/uno/check.cxx",
# general weird nonsense going on # general weird nonsense going on
...@@ -145,6 +146,8 @@ def is_ignore(srcLoc): ...@@ -145,6 +146,8 @@ def is_ignore(srcLoc):
"connectivity/source/inc/odbc/OTools.hxx", # ODBC3SQLFunctionId "connectivity/source/inc/odbc/OTools.hxx", # ODBC3SQLFunctionId
"include/formula/grammar.hxx", # FormulaGrammar::Grammar "include/formula/grammar.hxx", # FormulaGrammar::Grammar
"basic/source/sbx/sbxres.hxx", # StringId "basic/source/sbx/sbxres.hxx", # StringId
"sc/source/core/tool/chartpos.cxx", # CellState
"sc/source/core/data/global2.cxx", # State
# Windows or OSX only # Windows or OSX only
"include/canvas/rendering/icolorbuffer.hxx", "include/canvas/rendering/icolorbuffer.hxx",
"include/vcl/commandevent.hxx", "include/vcl/commandevent.hxx",
......
...@@ -112,7 +112,7 @@ public: ...@@ -112,7 +112,7 @@ public:
CPPUNIT_ASSERT_MESSAGE(createErrorMessage(mnCol, mnRow, mnTab).getStr(), false); CPPUNIT_ASSERT_MESSAGE(createErrorMessage(mnCol, mnRow, mnTab).getStr(), false);
} }
} }
else if (meStringType == PureString) else if (meStringType == StringType::PureString)
{ {
OUString aCSVString(p, n, RTL_TEXTENCODING_UTF8); OUString aCSVString(p, n, RTL_TEXTENCODING_UTF8);
OUString aString = mpDoc->GetString(mnCol, mnRow, mnTab); OUString aString = mpDoc->GetString(mnCol, mnRow, mnTab);
...@@ -135,12 +135,9 @@ public: ...@@ -135,12 +135,9 @@ public:
OUString aString; OUString aString;
switch (meStringType) switch (meStringType)
{ {
case StringValue: case StringType::StringValue:
aString = mpDoc->GetString(mnCol, mnRow, mnTab); aString = mpDoc->GetString(mnCol, mnRow, mnTab);
break; break;
case FormulaValue:
mpDoc->GetFormula(mnCol, mnRow, mnTab, aString);
break;
default: default:
break; break;
} }
......
...@@ -169,7 +169,7 @@ void testFormats(ScBootstrapFixture* pTest, ScDocument* pDoc, sal_Int32 nFormat) ...@@ -169,7 +169,7 @@ void testFormats(ScBootstrapFixture* pTest, ScDocument* pDoc, sal_Int32 nFormat)
//test Sheet1 with csv file //test Sheet1 with csv file
OUString aCSVFileName; OUString aCSVFileName;
pTest->createCSVPath("numberFormat.", aCSVFileName); pTest->createCSVPath("numberFormat.", aCSVFileName);
testFile(aCSVFileName, *pDoc, 0, PureString); testFile(aCSVFileName, *pDoc, 0, StringType::PureString);
//need to test the color of B3 //need to test the color of B3
//it's not a font color! //it's not a font color!
//formatting for B5: # ??/100 gets lost during import //formatting for B5: # ??/100 gets lost during import
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
#define FORMAT_XLSB 9 #define FORMAT_XLSB 9
#define FORMAT_FODS 10 #define FORMAT_FODS 10
enum StringType { PureString, FormulaValue, StringValue }; enum class StringType { PureString, StringValue };
SCQAHELPER_DLLPUBLIC bool testEqualsWithTolerance( long nVal1, long nVal2, long nTol ); SCQAHELPER_DLLPUBLIC bool testEqualsWithTolerance( long nVal1, long nVal2, long nTol );
...@@ -119,7 +119,7 @@ SCQAHELPER_DLLPUBLIC std::ostream& operator<<(std::ostream& rStrm, const OpCode& ...@@ -119,7 +119,7 @@ SCQAHELPER_DLLPUBLIC std::ostream& operator<<(std::ostream& rStrm, const OpCode&
SCQAHELPER_DLLPUBLIC void loadFile(const OUString& aFileName, std::string& aContent); SCQAHELPER_DLLPUBLIC void loadFile(const OUString& aFileName, std::string& aContent);
SCQAHELPER_DLLPUBLIC void testFile(OUString& aFileName, ScDocument& rDoc, SCTAB nTab, StringType aStringFormat = StringValue); SCQAHELPER_DLLPUBLIC void testFile(OUString& aFileName, ScDocument& rDoc, SCTAB nTab, StringType aStringFormat = StringType::StringValue);
//need own handler because conditional formatting strings must be generated //need own handler because conditional formatting strings must be generated
SCQAHELPER_DLLPUBLIC void testCondFile(OUString& aFileName, ScDocument* pDoc, SCTAB nTab); SCQAHELPER_DLLPUBLIC void testCondFile(OUString& aFileName, ScDocument* pDoc, SCTAB nTab);
......
...@@ -547,13 +547,13 @@ void ScFiltersTest::testFunctionsODS() ...@@ -547,13 +547,13 @@ void ScFiltersTest::testFunctionsODS()
testFile(aCSVFileName, rDoc, 1); testFile(aCSVFileName, rDoc, 1);
//test mathematical functions //test mathematical functions
createCSVPath("mathematical-functions.", aCSVFileName); createCSVPath("mathematical-functions.", aCSVFileName);
testFile(aCSVFileName, rDoc, 2, PureString); testFile(aCSVFileName, rDoc, 2, StringType::PureString);
//test information functions //test information functions
createCSVPath("information-functions.", aCSVFileName); createCSVPath("information-functions.", aCSVFileName);
testFile(aCSVFileName, rDoc, 3); testFile(aCSVFileName, rDoc, 3);
// text functions // text functions
createCSVPath("text-functions.", aCSVFileName); createCSVPath("text-functions.", aCSVFileName);
testFile(aCSVFileName, rDoc, 4, PureString); testFile(aCSVFileName, rDoc, 4, StringType::PureString);
// statistical functions // statistical functions
createCSVPath("statistical-functions.", aCSVFileName); createCSVPath("statistical-functions.", aCSVFileName);
testFile(aCSVFileName, rDoc, 5); testFile(aCSVFileName, rDoc, 5);
...@@ -578,7 +578,7 @@ void ScFiltersTest::testFunctionsODS() ...@@ -578,7 +578,7 @@ void ScFiltersTest::testFunctionsODS()
xDocSh->DoHardRecalc(true); xDocSh->DoHardRecalc(true);
ScDocument& rDoc3 = xDocSh->GetDocument(); ScDocument& rDoc3 = xDocSh->GetDocument();
createCSVPath("date-time-functions.", aCSVFileName); createCSVPath("date-time-functions.", aCSVFileName);
testFile(aCSVFileName, rDoc3, 0, PureString); testFile(aCSVFileName, rDoc3, 0, StringType::PureString);
xDocSh->DoClose(); xDocSh->DoClose();
...@@ -631,13 +631,13 @@ void ScFiltersTest::testCachedFormulaResultsODS() ...@@ -631,13 +631,13 @@ void ScFiltersTest::testCachedFormulaResultsODS()
testFile(aCSVFileName, rDoc, 1); testFile(aCSVFileName, rDoc, 1);
//test cached formula results of mathematical functions //test cached formula results of mathematical functions
createCSVPath("mathematical-functions.", aCSVFileName); createCSVPath("mathematical-functions.", aCSVFileName);
testFile(aCSVFileName, rDoc, 2, PureString); testFile(aCSVFileName, rDoc, 2, StringType::PureString);
//test cached formula results of information functions //test cached formula results of information functions
createCSVPath("information-functions.", aCSVFileName); createCSVPath("information-functions.", aCSVFileName);
testFile(aCSVFileName, rDoc, 3); testFile(aCSVFileName, rDoc, 3);
// text functions // text functions
createCSVPath("text-functions.", aCSVFileName); createCSVPath("text-functions.", aCSVFileName);
testFile(aCSVFileName, rDoc, 4, PureString); testFile(aCSVFileName, rDoc, 4, StringType::PureString);
xDocSh->DoClose(); xDocSh->DoClose();
} }
...@@ -1480,7 +1480,7 @@ void ScFiltersTest::testBrokenQuotesCSV() ...@@ -1480,7 +1480,7 @@ void ScFiltersTest::testBrokenQuotesCSV()
OUString aCSVPath; OUString aCSVPath;
createCSVPath( aSheet2CSV, aCSVPath ); createCSVPath( aSheet2CSV, aCSVPath );
// fdo#48621 // fdo#48621
testFile( aCSVPath, rDoc, 0, PureString); testFile( aCSVPath, rDoc, 0, StringType::PureString);
xDocSh->DoClose(); xDocSh->DoClose();
} }
......
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