diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-05-13 19:10:45 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-05-29 17:18:22 +0200 |
commit | b1d039c2ce986424a8a7c6e9460924291318ceb7 (patch) | |
tree | 8a9396b9117a4b12951b5a10860a812e53731014 /sc | |
parent | a45fedeb9e7ae451b3b719e7830108ee7aff03b9 (diff) |
import stream on the LibreOffice side, tdf#107827
This adds support for all LibreOffice content providers and non-ascii file names.
Change-Id: I0a0fd0ab0c78ef039679516e7a3e880929e8f725
Reviewed-on: https://gerrit.libreoffice.org/37578
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
(cherry picked from commit 5e9178f765b327a8aba17476d135ba3b1f881bf7)
Reviewed-on: https://gerrit.libreoffice.org/37582
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/orcus/orcusfiltersimpl.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sc/source/filter/orcus/orcusfiltersimpl.cxx b/sc/source/filter/orcus/orcusfiltersimpl.cxx index b38926aa7a0d..b77ec878296c 100644 --- a/sc/source/filter/orcus/orcusfiltersimpl.cxx +++ b/sc/source/filter/orcus/orcusfiltersimpl.cxx @@ -88,14 +88,24 @@ bool ScOrcusFiltersImpl::importGnumeric(ScDocument& rDoc, SfxMedium& rMedium) co { ScOrcusFactory aFactory(rDoc); aFactory.setStatusIndicator(getStatusIndicator(rMedium)); - OString aSysPath = toSystemPath(rMedium.GetName()); - const char* path = aSysPath.getStr(); + SvStream* pStream = rMedium.GetInStream(); + pStream->Seek(0); + static const size_t nReadBuffer = 1024*32; + OStringBuffer aBuffer((int(nReadBuffer))); + size_t nRead = 0; + do + { + char pData[nReadBuffer]; + nRead = pStream->ReadBytes(pData, nReadBuffer); + aBuffer.append(static_cast<sal_Char*>(pData), nRead); + } + while (nRead == nReadBuffer); try { rDoc.ClearTabs(); orcus::orcus_gnumeric filter(&aFactory); - filter.read_file(path); + filter.read_stream(aBuffer.getStr(), aBuffer.getLength()); } catch (const std::exception& e) { |