From 2b61ae38d410e0748e53ac3c0d361ab622da1fb5 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 2 Jun 2017 11:19:36 +0100 Subject: 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 --- vcl/workben/fftester.cxx | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'vcl/workben') 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( - 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( + aLibrary.getFunctionSymbol("TestImportQPW")); + aLibrary.release(); + } + SvFileStream aFileStream(out, StreamMode::READ); + ret = (int) (*pfnImport)(aFileStream); } else if (strcmp(argv[2], "hwp") == 0) { -- cgit v1.2.3