diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-11-07 21:45:17 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-11-09 04:12:13 +0100 |
commit | b9f84939fd9b45f07003cf115f9c39c8e2e83254 (patch) | |
tree | 79f514d32d7233398182080681f86c87b1031a03 /sc/qa/unit | |
parent | b5809563ecdddd633ede17617d8e13f0275afde9 (diff) |
make the eport test easier to use
Change-Id: I10a524c49169611e2bf2e34988667e46474e17a8
Diffstat (limited to 'sc/qa/unit')
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index b3fd4de596f7..6ef97c12aea5 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -87,6 +87,8 @@ public: private: rtl::OUString m_aBaseString; uno::Reference<uno::XInterface> m_xCalcComponent; + + ScDocShellRef saveAndReload( ScDocShell* pShell, sal_Int32 nFormat ); }; /* @@ -197,6 +199,17 @@ ScDocShellRef ScExportTest::saveAndReload(ScDocShell* pShell, const rtl::OUStrin return xDocShRef; } +ScDocShellRef ScExportTest::saveAndReload( ScDocShell* pShell, sal_Int32 nFormat ) +{ + rtl::OUString aFileExtension(aFileFormats[nFormat].pName, strlen(aFileFormats[nFormat].pName), RTL_TEXTENCODING_UTF8 ); + rtl::OUString aFilterName(aFileFormats[nFormat].pFilterName, strlen(aFileFormats[nFormat].pFilterName), RTL_TEXTENCODING_UTF8) ; + rtl::OUString aFilterType(aFileFormats[nFormat].pTypeName, strlen(aFileFormats[nFormat].pTypeName), RTL_TEXTENCODING_UTF8); + ScDocShellRef xDocSh = saveAndReload(pShell, aFilterName, rtl::OUString(), aFilterType, aFileFormats[nFormat].nFormatType); + + CPPUNIT_ASSERT(xDocSh.Is()); + return xDocSh; +} + void ScExportTest::test() { ScDocShell* pShell = new ScDocShell( @@ -210,11 +223,7 @@ void ScExportTest::test() pDoc->SetValue(0,0,0, 1.0); CPPUNIT_ASSERT(pDoc); - sal_Int32 nFormat = ODS; - rtl::OUString aFileExtension(aFileFormats[nFormat].pName, strlen(aFileFormats[nFormat].pName), RTL_TEXTENCODING_UTF8 ); - rtl::OUString aFilterName(aFileFormats[nFormat].pFilterName, strlen(aFileFormats[nFormat].pFilterName), RTL_TEXTENCODING_UTF8) ; - rtl::OUString aFilterType(aFileFormats[nFormat].pTypeName, strlen(aFileFormats[nFormat].pTypeName), RTL_TEXTENCODING_UTF8); - ScDocShellRef xDocSh = saveAndReload(pShell, aFilterName, rtl::OUString(), aFilterType, aFileFormats[nFormat].nFormatType); + ScDocShellRef xDocSh = saveAndReload( pShell, ODS ); CPPUNIT_ASSERT(xDocSh.Is()); ScDocument* pLoadedDoc = xDocSh->GetDocument(); |