diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-11-08 11:45:56 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-11-08 15:34:39 +0100 |
commit | 958c09acc1058a4a0eba28ac94f2883fff64d600 (patch) | |
tree | 475bf9ccd9f16a055c2cd6ff0780b5599f9afb39 | |
parent | 657ead3c4d8770117067d5b05a3bdd6dddb75a8b (diff) |
add dif support to fftester
Change-Id: I1428dcaea579c73712f5228dd6de73c7369a7948
Reviewed-on: https://gerrit.libreoffice.org/44457
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sc/source/filter/excel/excel.cxx | 11 | ||||
-rw-r--r-- | vcl/workben/fftester.cxx | 14 |
2 files changed, 25 insertions, 0 deletions
diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx index fb72a5cd73f3..5c590dd407c9 100644 --- a/sc/source/filter/excel/excel.cxx +++ b/sc/source/filter/excel/excel.cxx @@ -280,4 +280,15 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportWKS(SvStream& rStream) return ScFormatFilter::Get().ScImportLotus123(aMedium, &aDocument, RTL_TEXTENCODING_ASCII_US) == ERRCODE_NONE; } +extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportDIF(SvStream &rStream) +{ + ScDLL::Init(); + ScDocument aDocument; + ScDocOptions aDocOpt = aDocument.GetDocOptions(); + aDocOpt.SetLookUpColRowNames(false); + aDocument.SetDocOptions(aDocOpt); + aDocument.MakeTable(0); + return ScFormatFilter::Get().ScImportDif(rStream, &aDocument, ScAddress(0, 0, 0), RTL_TEXTENCODING_IBM_850) == ERRCODE_NONE; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx index 952988f32341..7b61bbb8c40b 100644 --- a/vcl/workben/fftester.cxx +++ b/vcl/workben/fftester.cxx @@ -514,6 +514,20 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) SvFileStream aFileStream(out, StreamMode::READ); ret = (int) (*pfnImport)(aFileStream); } + else if (strcmp(argv[2], "dif") == 0) + { + static FFilterCall pfnImport(nullptr); + if (!pfnImport) + { + osl::Module aLibrary; + aLibrary.loadRelative(&thisModule, "libscfiltlo.so", SAL_LOADMODULE_LAZY); + pfnImport = reinterpret_cast<FFilterCall>( + aLibrary.getFunctionSymbol("TestImportDIF")); + aLibrary.release(); + } + SvFileStream aFileStream(out, StreamMode::READ); + ret = (int) (*pfnImport)(aFileStream); + } else if (strcmp(argv[2], "sc-rtf") == 0) { static FFilterCall pfnImport(nullptr); |