[Libreoffice-commits] core.git: sc/source vcl/workben

Caolán McNamara caolanm at redhat.com
Tue Oct 24 07:55:38 UTC 2017


 sc/source/filter/excel/excel.cxx |    7 +++++--
 vcl/workben/fftester.cxx         |    8 ++++----
 2 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 3168ba6c6eb995060842614a11c7bc5a780812d3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 23 20:50:40 2017 +0100

    rework TestImportXLS to take a SvStream arg
    
    Change-Id: I65d02604ac489d8c8649673f3f851d1a6650406e

diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx
index cb818217a393..5f9addb25489 100644
--- a/sc/source/filter/excel/excel.cxx
+++ b/sc/source/filter/excel/excel.cxx
@@ -32,6 +32,7 @@
 #include <com/sun/star/document/XImporter.hpp>
 #include <scitems.hxx>
 #include <svl/stritem.hxx>
+#include <unotools/streamwrap.hxx>
 #include <filter.hxx>
 #include <document.hxx>
 #include <optuno.hxx>
@@ -243,10 +244,12 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportCalcRTF(SvStream &rStrea
     return ScFormatFilter::Get().ScImportRTF(rStream, OUString(), &aDocument, aRange) == ERRCODE_NONE;
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportXLS(const OUString &rURL)
+extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportXLS(SvStream& rStream)
 {
     ScDLL::Init();
-    SfxMedium aMedium(rURL, StreamMode::READ);
+    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);
diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx
index 295a3bcb0231..de87da8c476c 100644
--- a/vcl/workben/fftester.cxx
+++ b/vcl/workben/fftester.cxx
@@ -55,7 +55,6 @@ using namespace cppu;
 extern "C" { static void SAL_CALL thisModule() {} }
 #endif
 
-typedef bool (*WFilterCall)(const OUString &rUrl);
 typedef bool (*FFilterCall)(SvStream &rStream);
 
 SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
@@ -404,16 +403,17 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
         }
         else if (strcmp(argv[2], "xls") == 0)
         {
-            static WFilterCall pfnImport(nullptr);
+            static FFilterCall pfnImport(nullptr);
             if (!pfnImport)
             {
                 osl::Module aLibrary;
                 aLibrary.loadRelative(&thisModule, "libscfiltlo.so", SAL_LOADMODULE_LAZY);
-                pfnImport = reinterpret_cast<WFilterCall>(
+                pfnImport = reinterpret_cast<FFilterCall>(
                     aLibrary.getFunctionSymbol("TestImportXLS"));
                 aLibrary.release();
             }
-            ret = (int) (*pfnImport)(out);
+            SvFileStream aFileStream(out, StreamMode::READ);
+            ret = (int) (*pfnImport)(aFileStream);
         }
         else if (strcmp(argv[2], "hwp") == 0)
         {


More information about the Libreoffice-commits mailing list