summaryrefslogtreecommitdiff
path: root/sc/source/filter/excel/excel.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-06-02 11:19:36 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-06-02 11:20:57 +0100
commit2b61ae38d410e0748e53ac3c0d361ab622da1fb5 (patch)
treebce6a76319086c59208f2f89399129eff9ca602b /sc/source/filter/excel/excel.cxx
parent1d5c3028dcff26b16bccd9d11380ece5abfadf14 (diff)
rework ScQProReader to take SvStream instead of SfxMedium
its only uses the stream anyway and this makes it far easier to build a fuzzer on Change-Id: I4aa8b56d4b041708c4de1730d503641ab23c14e8
Diffstat (limited to 'sc/source/filter/excel/excel.cxx')
-rw-r--r--sc/source/filter/excel/excel.cxx17
1 files changed, 10 insertions, 7 deletions
diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx
index e5462e838a0e..8988935f80f0 100644
--- a/sc/source/filter/excel/excel.cxx
+++ b/sc/source/filter/excel/excel.cxx
@@ -219,18 +219,21 @@ FltError ScFormatFilterPluginImpl::ScExportExcel5( SfxMedium& rMedium, ScDocumen
return eRet;
}
-extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportSpreadsheet(const OUString &rURL, const OUString &rFlt)
+extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportQPW(SvStream &rStream)
+{
+ ScDLL::Init();
+ ScDocument aDocument;
+ aDocument.MakeTable(0);
+ return ScFormatFilter::Get().ScImportQuattroPro(&rStream, &aDocument) == eERR_OK;
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportXLS(const OUString &rURL)
{
ScDLL::Init();
SfxMedium aMedium(rURL, StreamMode::READ);
ScDocument aDocument;
aDocument.MakeTable(0);
- FltError eError(eERR_OK);
- if (rFlt == "xls")
- eError = ScFormatFilter::Get().ScImportExcel(aMedium, &aDocument, EIF_AUTO);
- else if (rFlt == "wb2")
- eError = ScFormatFilter::Get().ScImportQuattroPro(aMedium, &aDocument);
- return eError == eERR_OK;
+ return ScFormatFilter::Get().ScImportExcel(aMedium, &aDocument, EIF_AUTO) == eERR_OK;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */