[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerperfect/qa
David Tardon
dtardon at redhat.com
Wed Jun 4 10:10:52 PDT 2014
writerperfect/qa/unit/WpftImportTestBase.cxx | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
New commits:
commit d98ca8a4746073008aa02daa6225c87421dc7dc7
Author: David Tardon <dtardon at redhat.com>
Date: Wed Jun 4 19:07:31 2014 +0200
pass UCBContent to the filters too
Change-Id: I75e4b3226d47ba9cc19e8c6b0e38938e4d7ceb17
(cherry picked from commit 4df5e1b959fb9e9b2258657f6c7784b04e6c3c6f)
diff --git a/writerperfect/qa/unit/WpftImportTestBase.cxx b/writerperfect/qa/unit/WpftImportTestBase.cxx
index 4a05d05..de82980 100644
--- a/writerperfect/qa/unit/WpftImportTestBase.cxx
+++ b/writerperfect/qa/unit/WpftImportTestBase.cxx
@@ -21,9 +21,11 @@
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/ucb/SimpleFileAccess.hpp>
+#include <com/sun/star/ucb/XContent.hpp>
#include <com/sun/star/util/XCloseable.hpp>
+#include <ucbhelper/content.hxx>
+
#include "WpftImportTestBase.hxx"
namespace beans = com::sun::star::beans;
@@ -46,7 +48,6 @@ WpftImportTestBase::WpftImportTestBase(const rtl::OUString &rFactoryURL)
, ::test::BootstrapFixture()
, m_aFactoryURL(rFactoryURL)
, m_xDesktop()
- , m_xFileAccess()
, m_xFilter()
, m_xTypeMap()
{
@@ -57,7 +58,6 @@ void WpftImportTestBase::setUp()
::test::BootstrapFixture::setUp();
m_xDesktop = frame::theDesktop::get(m_xContext);
- m_xFileAccess = ucb::SimpleFileAccess::create(m_xContext);
const uno::Reference<document::XTypeDetection> xTypeDetection(
m_xFactory->createInstanceWithContext("com.sun.star.document.TypeDetection", m_xContext),
@@ -113,13 +113,15 @@ bool WpftImportTestBase::load(const OUString &, const OUString &rURL, const OUSt
xImporter->setTargetDocument(xDoc);
- uno::Sequence<beans::PropertyValue> aDescriptor(2);
+ uno::Sequence<beans::PropertyValue> aDescriptor(3);
+ ucbhelper::Content aContent(rURL, uno::Reference<ucb::XCommandEnvironment>(), m_xContext);
+
aDescriptor[0].Name = "URL";
aDescriptor[0].Value <<= rURL;
-
- const uno::Reference<io::XInputStream> xInputStream(m_xFileAccess->openFileRead(rURL), uno::UNO_QUERY_THROW);
aDescriptor[1].Name = "InputStream";
- aDescriptor[1].Value <<= xInputStream;
+ aDescriptor[1].Value <<= aContent.openStream();
+ aDescriptor[2].Name = "UCBContent";
+ aDescriptor[2].Value <<= aContent.get();
const uno::Reference<document::XExtendedFilterDetection> xDetector(m_xFilter, uno::UNO_QUERY_THROW);
More information about the Libreoffice-commits
mailing list