summaryrefslogtreecommitdiff
path: root/writerperfect/qa
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2014-06-04 19:07:31 +0200
committerDavid Tardon <dtardon@redhat.com>2014-06-04 19:08:00 +0200
commit4df5e1b959fb9e9b2258657f6c7784b04e6c3c6f (patch)
tree4e863dbd9cd192c5c55b47ab021cd3f75f119d01 /writerperfect/qa
parent457c6ebfef707d9187b9e8903886d79a80d24938 (diff)
pass UCBContent to the filters too
Change-Id: I75e4b3226d47ba9cc19e8c6b0e38938e4d7ceb17
Diffstat (limited to 'writerperfect/qa')
-rw-r--r--writerperfect/qa/unit/WpftImportTestBase.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/writerperfect/qa/unit/WpftImportTestBase.cxx b/writerperfect/qa/unit/WpftImportTestBase.cxx
index 4a05d05b8f23..de82980537e6 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);