add lwp to fftester

Change-Id: I1b31d486de3964a1198fe34e355e9c9542c16c00
This commit is contained in:
Caolán McNamara
2015-08-21 20:09:52 +01:00
parent 7c473eb789
commit ade2c591ec
2 changed files with 21 additions and 0 deletions

View File

@@ -90,6 +90,13 @@ bool SAL_CALL LotusWordProImportFilter::importImpl( const Sequence< ::com::sun::
}
extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportLWP(const OUString &rURL)
{
SvFileStream aFileStream(rURL, StreamMode::READ);
uno::Reference< XDocumentHandler > xHandler;
return ( ReadWordproFile(aFileStream, xHandler) == 0 );
}
sal_Bool SAL_CALL LotusWordProImportFilter::filter( const Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
throw (RuntimeException, std::exception)
{

View File

@@ -347,6 +347,20 @@ try_again:
}
ret = (int) (*pfnImport)(out);
}
else if (strcmp(argv[2], "lwp") == 0)
{
static HFilterCall pfnImport(0);
if (!pfnImport)
{
osl::Module aLibrary;
aLibrary.loadRelative(&thisModule, "liblwpftlo.so", SAL_LOADMODULE_LAZY);
pfnImport = reinterpret_cast<HFilterCall>(
aLibrary.getFunctionSymbol("TestImportLWP"));
aLibrary.release();
}
ret = (int) (*pfnImport)(out);
}
}
/* To signal successful completion of a run, we need to deliver