summaryrefslogtreecommitdiff
path: root/sc/qa/unit
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-03-18 13:03:28 +0200
committerNoel Grandin <noel@peralex.com>2015-03-19 08:25:03 +0200
commit48bb2913a7459edb17a5f62c2f6e6fbc4f1051e2 (patch)
tree7e2f09fc8998bc1016f4d2ba7fa09e3125663361 /sc/qa/unit
parentbdad6d0fe492a2334cb27ef54fc5d1cba17d1970 (diff)
convert SFX_FILTER_ constants to enum class
Change-Id: I7e53cfc90cefd9da7d6ecd795b09214bd44b1613
Diffstat (limited to 'sc/qa/unit')
-rw-r--r--sc/qa/unit/filters-test.cxx4
-rw-r--r--sc/qa/unit/helper/qahelper.cxx14
-rw-r--r--sc/qa/unit/helper/qahelper.hxx26
-rw-r--r--sc/qa/unit/opencl-test.cxx4
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx4
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx12
6 files changed, 32 insertions, 32 deletions
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 54eabf36842a..bfb2a8acf34c 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -57,7 +57,7 @@ public:
virtual void tearDown() SAL_OVERRIDE;
virtual bool load( const OUString &rFilter, const OUString &rURL,
- const OUString &rUserData, unsigned int nFilterFlags,
+ const OUString &rUserData, SfxFilterFlags nFilterFlags,
SotClipboardFormatId nClipboardID, unsigned int nFilterVersion) SAL_OVERRIDE;
/**
* Ensure CVEs remain unbroken
@@ -113,7 +113,7 @@ private:
};
bool ScFiltersTest::load(const OUString &rFilter, const OUString &rURL,
- const OUString &rUserData, unsigned int nFilterFlags,
+ const OUString &rUserData, SfxFilterFlags nFilterFlags,
SotClipboardFormatId nClipboardID, unsigned int nFilterVersion)
{
ScDocShellRef xDocShRef = ScBootstrapFixture::load(rURL, rFilter, rUserData,
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 11a22a8397cd..d98e43200355 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -533,7 +533,7 @@ OUString toString(
ScDocShellRef ScBootstrapFixture::load( bool bReadWrite,
const OUString& rURL, const OUString& rFilter, const OUString &rUserData,
- const OUString& rTypeName, unsigned int nFilterFlags, SotClipboardFormatId nClipboardID,
+ const OUString& rTypeName, SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID,
sal_uIntPtr nFilterVersion, const OUString* pPassword )
{
SfxFilter* pFilter = new SfxFilter(
@@ -566,7 +566,7 @@ ScDocShellRef ScBootstrapFixture::load( bool bReadWrite,
ScDocShellRef ScBootstrapFixture::load(
const OUString& rURL, const OUString& rFilter, const OUString &rUserData,
- const OUString& rTypeName, unsigned int nFilterFlags, SotClipboardFormatId nClipboardID,
+ const OUString& rTypeName, SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID,
sal_uIntPtr nFilterVersion, const OUString* pPassword )
{
return load( false, rURL, rFilter, rUserData, rTypeName, nFilterFlags, nClipboardID, nFilterVersion, pPassword );
@@ -580,12 +580,12 @@ ScDocShellRef ScBootstrapFixture::loadDoc(
OUString aFileName;
createFileURL( rFileName, aFileExtension, aFileName );
OUString aFilterType(aFileFormats[nFormat].pTypeName, strlen(aFileFormats[nFormat].pTypeName), RTL_TEXTENCODING_UTF8);
- unsigned int nFormatType = aFileFormats[nFormat].nFormatType;
+ SfxFilterFlags nFormatType = aFileFormats[nFormat].nFormatType;
SotClipboardFormatId nClipboardId = SotClipboardFormatId::NONE;
- if (nFormatType)
+ if (nFormatType != SfxFilterFlags::NONE)
nClipboardId = SotClipboardFormatId::STARCALC_8;
- return load(bReadWrite, aFileName, aFilterName, OUString(), aFilterType, nFormatType, nClipboardId, nFormatType);
+ return load(bReadWrite, aFileName, aFilterName, OUString(), aFilterType, nFormatType, nClipboardId, static_cast<sal_uIntPtr>(nFormatType));
}
const FileFormat* ScBootstrapFixture::getFileFormats()
@@ -616,7 +616,7 @@ void ScBootstrapFixture::createCSVPath(const OUString& aFileBase, OUString& rCSV
ScDocShellRef ScBootstrapFixture::saveAndReload(
ScDocShell* pShell, const OUString &rFilter,
- const OUString &rUserData, const OUString& rTypeName, sal_uLong nFormatType)
+ const OUString &rUserData, const OUString& rTypeName, SfxFilterFlags nFormatType)
{
utl::TempFile aTempFile;
@@ -667,7 +667,7 @@ boost::shared_ptr<utl::TempFile> ScBootstrapFixture::exportTo( ScDocShell* pShel
pTempFile->EnableKillingFile();
SfxMedium aStoreMedium( pTempFile->GetURL(), STREAM_STD_WRITE );
SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE;
- sal_Int32 nFormatType = aFileFormats[nFormat].nFormatType;
+ SfxFilterFlags nFormatType = aFileFormats[nFormat].nFormatType;
if (nFormatType == ODS_FORMAT_TYPE)
nExportFormat = SotClipboardFormatId::STARCHART_8;
SfxFilter* pExportFilter = new SfxFilter(
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index 20ab92c9f797..3d3e0dabbfdc 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -40,15 +40,15 @@
#define SCQAHELPER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
#endif
-#define ODS_FORMAT_TYPE 50331943
-#define XLS_FORMAT_TYPE 318767171
-#define XLSX_FORMAT_TYPE 268959811
-#define LOTUS123_FORMAT_TYPE 268435649
-#define CSV_FORMAT_TYPE (SFX_FILTER_IMPORT | SFX_FILTER_EXPORT | SFX_FILTER_ALIEN | SFX_FILTER_USESOPTIONS)
-#define HTML_FORMAT_TYPE (SFX_FILTER_IMPORT | SFX_FILTER_EXPORT | SFX_FILTER_ALIEN | SFX_FILTER_USESOPTIONS)
-#define DIF_FORMAT_TYPE 195
-#define XLS_XML_FORMAT_TYPE (SFX_FILTER_IMPORT | SFX_FILTER_EXPORT | SFX_FILTER_ALIEN)
-#define XLSB_XML_FORMAT_TYPE 268959809
+#define ODS_FORMAT_TYPE static_cast<SfxFilterFlags>(50331943)
+#define XLS_FORMAT_TYPE static_cast<SfxFilterFlags>(318767171)
+#define XLSX_FORMAT_TYPE static_cast<SfxFilterFlags>(268959811)
+#define LOTUS123_FORMAT_TYPE static_cast<SfxFilterFlags>(268435649)
+#define CSV_FORMAT_TYPE (SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::ALIEN | SfxFilterFlags::USESOPTIONS)
+#define HTML_FORMAT_TYPE (SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::ALIEN | SfxFilterFlags::USESOPTIONS)
+#define DIF_FORMAT_TYPE (SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::ALIEN | SfxFilterFlags::USESOPTIONS)
+#define XLS_XML_FORMAT_TYPE (SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::ALIEN)
+#define XLSB_XML_FORMAT_TYPE static_cast<SfxFilterFlags>(268959809)
#define ODS 0
#define XLS 1
@@ -91,7 +91,7 @@ struct TestParam
};
struct FileFormat {
- const char* pName; const char* pFilterName; const char* pTypeName; unsigned int nFormatType;
+ const char* pName; const char* pFilterName; const char* pTypeName; SfxFilterFlags nFormatType;
};
// Printers for the calc data structures. Needed for the EQUAL assertion
@@ -225,12 +225,12 @@ protected:
ScDocShellRef load(
bool bReadWrite, const OUString& rURL, const OUString& rFilter, const OUString &rUserData,
- const OUString& rTypeName, unsigned int nFilterFlags, SotClipboardFormatId nClipboardID,
+ const OUString& rTypeName, SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID,
sal_uIntPtr nFilterVersion = SOFFICE_FILEFORMAT_CURRENT, const OUString* pPassword = NULL );
ScDocShellRef load(
const OUString& rURL, const OUString& rFilter, const OUString &rUserData,
- const OUString& rTypeName, unsigned int nFilterFlags, SotClipboardFormatId nClipboardID,
+ const OUString& rTypeName, SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID,
sal_uIntPtr nFilterVersion = SOFFICE_FILEFORMAT_CURRENT, const OUString* pPassword = NULL );
ScDocShellRef loadDoc(const OUString& rFileName, sal_Int32 nFormat, bool bReadWrite = false );
@@ -246,7 +246,7 @@ public:
void createCSVPath(const OUString& aFileBase, OUString& rCSVPath);
ScDocShellRef saveAndReload(ScDocShell* pShell, const OUString &rFilter,
- const OUString &rUserData, const OUString& rTypeName, sal_uLong nFormatType);
+ const OUString &rUserData, const OUString& rTypeName, SfxFilterFlags nFormatType);
ScDocShellRef saveAndReload( ScDocShell* pShell, sal_Int32 nFormat );
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 44bb074c4954..17b0e1198ecf 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -64,7 +64,7 @@ public:
virtual void tearDown() SAL_OVERRIDE;
virtual bool load( const OUString &rFilter, const OUString &rURL,
- const OUString &rUserData, unsigned int nFilterFlags,
+ const OUString &rUserData, SfxFilterFlags nFilterFlags,
SotClipboardFormatId nClipboardID, unsigned int nFilterVersion) SAL_OVERRIDE;
void testSharedFormulaXLS();
#if 0
@@ -556,7 +556,7 @@ bool ScOpenCLTest::initTestEnv(const OUString& fileName, sal_Int32 nFormat,
}
bool ScOpenCLTest::load(const OUString &rFilter, const OUString &rURL,
- const OUString &rUserData, unsigned int nFilterFlags,
+ const OUString &rUserData, SfxFilterFlags nFilterFlags,
SotClipboardFormatId nClipboardID, unsigned int nFilterVersion)
{
ScDocShellRef xDocShRef = ScBootstrapFixture::load(rURL, rFilter, rUserData,
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 0084145438ae..b9be5419d618 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -83,7 +83,7 @@ public:
virtual void tearDown() SAL_OVERRIDE;
#if !defined MACOSX && !defined DRAGONFLY
- ScDocShellRef saveAndReloadPassword( ScDocShell*, const OUString&, const OUString&, const OUString&, sal_uLong );
+ ScDocShellRef saveAndReloadPassword( ScDocShell*, const OUString&, const OUString&, const OUString&, SfxFilterFlags );
#endif
void test();
@@ -219,7 +219,7 @@ void ScExportTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx)
#if !defined MACOSX && !defined DRAGONFLY
ScDocShellRef ScExportTest::saveAndReloadPassword(ScDocShell* pShell, const OUString &rFilter,
- const OUString &rUserData, const OUString& rTypeName, sal_uLong nFormatType)
+ const OUString &rUserData, const OUString& rTypeName, SfxFilterFlags nFormatType)
{
utl::TempFile aTempFile;
aTempFile.EnableKillingFile();
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 01dae642939f..16a0e08d2264 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -83,7 +83,7 @@ public:
ScFiltersTest();
virtual bool load( const OUString &rFilter, const OUString &rURL,
- const OUString &rUserData, unsigned int nFilterFlags,
+ const OUString &rUserData, SfxFilterFlags nFilterFlags,
SotClipboardFormatId nClipboardID, unsigned int nFilterVersion) SAL_OVERRIDE;
virtual void setUp() SAL_OVERRIDE;
@@ -286,7 +286,7 @@ private:
};
bool ScFiltersTest::load(const OUString &rFilter, const OUString &rURL,
- const OUString &rUserData, unsigned int nFilterFlags,
+ const OUString &rUserData, SfxFilterFlags nFilterFlags,
SotClipboardFormatId nClipboardID, unsigned int nFilterVersion)
{
ScDocShellRef xDocShRef = ScBootstrapFixture::load( rURL, rFilter, rUserData,
@@ -1388,8 +1388,8 @@ void ScFiltersTest::testBrokenQuotesCSV()
OUString aFilterType(getFileFormats()[CSV].pTypeName, strlen(getFileFormats()[CSV].pTypeName), RTL_TEXTENCODING_UTF8);
std::cout << getFileFormats()[CSV].pName << " Test" << std::endl;
- unsigned int nFormatType = getFileFormats()[CSV].nFormatType;
- SotClipboardFormatId nClipboardId = nFormatType ? SotClipboardFormatId::STARCALC_8 : SotClipboardFormatId::NONE;
+ SfxFilterFlags nFormatType = getFileFormats()[CSV].nFormatType;
+ SotClipboardFormatId nClipboardId = bool(nFormatType) ? SotClipboardFormatId::STARCALC_8 : SotClipboardFormatId::NONE;
ScDocShellRef xDocSh = ScBootstrapFixture::load(aFileName, aFilterName, OUString(), aFilterType,
nFormatType, nClipboardId, SOFFICE_FILEFORMAT_CURRENT);
@@ -1415,8 +1415,8 @@ void ScFiltersTest::testCellValueXLSX()
OUString aFilterType(getFileFormats()[XLSX].pTypeName, strlen(getFileFormats()[XLSX].pTypeName), RTL_TEXTENCODING_UTF8);
std::cout << getFileFormats()[XLSX].pName << " Test" << std::endl;
- unsigned int nFormatType = getFileFormats()[XLSX].nFormatType;
- SotClipboardFormatId nClipboardId = nFormatType ? SotClipboardFormatId::STARCALC_8 : SotClipboardFormatId::NONE;
+ SfxFilterFlags nFormatType = getFileFormats()[XLSX].nFormatType;
+ SotClipboardFormatId nClipboardId = bool(nFormatType) ? SotClipboardFormatId::STARCALC_8 : SotClipboardFormatId::NONE;
ScDocShellRef xDocSh = ScBootstrapFixture::load( aFileName, aFilterName, OUString(), aFilterType,
nFormatType, nClipboardId, SOFFICE_FILEFORMAT_CURRENT);