diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-11-06 15:15:10 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-11-07 10:02:50 +0100 |
commit | c96c7c8b6bfc3a12745c505937e1d3b8dc6591ab (patch) | |
tree | c9336e99baae3c23e34b7e141dd3590f9945bd98 /sc | |
parent | b4f43c09170281863b3cd76812e63fb2d8716287 (diff) |
add 1-2-3 wks to fftester
Change-Id: I4deb6831a809d516d286a90903b7b89c8e07b2b0
Reviewed-on: https://gerrit.libreoffice.org/44367
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/excel/excel.cxx | 14 | ||||
-rw-r--r-- | sc/source/filter/lotus/lotus.cxx | 19 |
2 files changed, 20 insertions, 13 deletions
diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx index ca4262d8cbaa..fb72a5cd73f3 100644 --- a/sc/source/filter/excel/excel.cxx +++ b/sc/source/filter/excel/excel.cxx @@ -266,4 +266,18 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportXLS(SvStream& rStream) return bRet; } +extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportWKS(SvStream& rStream) +{ + ScDLL::Init(); + SfxMedium aMedium; + css::uno::Reference<css::io::XInputStream> xStm(new utl::OInputStreamWrapper(rStream)); + aMedium.GetItemSet()->Put(SfxUsrAnyItem(SID_INPUTSTREAM, css::uno::makeAny(xStm))); + ScDocument aDocument; + ScDocOptions aDocOpt = aDocument.GetDocOptions(); + aDocOpt.SetLookUpColRowNames(false); + aDocument.SetDocOptions(aDocOpt); + aDocument.MakeTable(0); + return ScFormatFilter::Get().ScImportLotus123(aMedium, &aDocument, RTL_TEXTENCODING_ASCII_US) == ERRCODE_NONE; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/lotus/lotus.cxx b/sc/source/filter/lotus/lotus.cxx index 89d1d6a985fb..4eca011a212f 100644 --- a/sc/source/filter/lotus/lotus.cxx +++ b/sc/source/filter/lotus/lotus.cxx @@ -22,6 +22,7 @@ #include <sfx2/docfile.hxx> #include <tools/urlobj.hxx> +#include <unotools/configmgr.hxx> #include <scerrors.hxx> #include <root.hxx> @@ -30,16 +31,10 @@ ErrCode ScFormatFilterPluginImpl::ScImportLotus123( SfxMedium& rMedium, ScDocument* pDocument, rtl_TextEncoding eSrc ) { - ScFilterOptions aFilterOpt; - bool bWithWK3 = aFilterOpt.GetWK3Flag(); - - SvStream* pStream = rMedium.GetInStream(); - - if( !pStream ) + SvStream* pStream = rMedium.GetInStream(); + if (!pStream) return SCERR_IMPORT_OPEN; - ErrCode eRet; - pStream->Seek( 0 ); pStream->SetBufferSize( 32768 ); @@ -48,7 +43,9 @@ ErrCode ScFormatFilterPluginImpl::ScImportLotus123( SfxMedium& rMedium, ScDocume ImportLotus aLotusImport(aContext, *pStream, pDocument, eSrc); - if( bWithWK3 ) + const bool bWithWK3 = utl::ConfigManager::IsAvoidConfig() || ScFilterOptions().GetWK3Flag(); + ErrCode eRet; + if (bWithWK3) eRet = aLotusImport.Read(); else eRet = ErrCode(0xFFFFFFFF); // force WK1 /WKS @@ -57,13 +54,9 @@ ErrCode ScFormatFilterPluginImpl::ScImportLotus123( SfxMedium& rMedium, ScDocume if( eRet == ErrCode(0xFFFFFFFF) ) { pStream->Seek( 0 ); - pStream->SetBufferSize( 32768 ); - eRet = ScImportLotus123old(aContext, *pStream, pDocument, eSrc); - pStream->SetBufferSize( 0 ); - return eRet; } |