diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-06-02 11:19:36 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-06-02 11:20:57 +0100 |
commit | 2b61ae38d410e0748e53ac3c0d361ab622da1fb5 (patch) | |
tree | bce6a76319086c59208f2f89399129eff9ca602b /vcl/workben | |
parent | 1d5c3028dcff26b16bccd9d11380ece5abfadf14 (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 'vcl/workben')
-rw-r--r-- | vcl/workben/fftester.cxx | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx index 0251274b0ee9..eae827a81e9f 100644 --- a/vcl/workben/fftester.cxx +++ b/vcl/workben/fftester.cxx @@ -66,7 +66,7 @@ using namespace cppu; extern "C" { static void SAL_CALL thisModule() {} } #endif -typedef bool (*WFilterCall)(const OUString &rUrl, const OUString &rFlt); +typedef bool (*WFilterCall)(const OUString &rUrl); typedef bool (*FFilterCall)(SvStream &rStream); /* This constant specifies the number of inputs to process before restarting. @@ -379,8 +379,7 @@ try_again: SvFileStream aFileStream(out, StreamMode::READ); ret = (int) (*pfnImport)(aFileStream); } - else if ( (strcmp(argv[2], "xls") == 0) || - (strcmp(argv[2], "wb2") == 0) ) + else if (strcmp(argv[2], "xls") == 0) { static WFilterCall pfnImport(nullptr); if (!pfnImport) @@ -388,10 +387,24 @@ try_again: osl::Module aLibrary; aLibrary.loadRelative(&thisModule, "libscfiltlo.so", SAL_LOADMODULE_LAZY); pfnImport = reinterpret_cast<WFilterCall>( - aLibrary.getFunctionSymbol("TestImportSpreadsheet")); + aLibrary.getFunctionSymbol("TestImportXLS")); aLibrary.release(); } - ret = (int) (*pfnImport)(out, OUString(argv[2], strlen(argv[2]), RTL_TEXTENCODING_UTF8)); + ret = (int) (*pfnImport)(out); + } + else if (strcmp(argv[2], "ww2") == 0) + { + static FFilterCall pfnImport(nullptr); + if (!pfnImport) + { + osl::Module aLibrary; + aLibrary.loadRelative(&thisModule, "libscfiltlo.so", SAL_LOADMODULE_LAZY); + pfnImport = reinterpret_cast<FFilterCall>( + aLibrary.getFunctionSymbol("TestImportQPW")); + aLibrary.release(); + } + SvFileStream aFileStream(out, StreamMode::READ); + ret = (int) (*pfnImport)(aFileStream); } else if (strcmp(argv[2], "hwp") == 0) { |