diff options
author | Noel Grandin <noel@peralex.com> | 2012-08-28 13:50:47 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-03 15:55:04 +0200 |
commit | 278379697d82e4b4a3204e82fcdababebe2340f3 (patch) | |
tree | ee847794cdd14bbb11e11c5d2269213cdb2719aa /ucb | |
parent | 9b07288138228af56e58f50dc6ba50865b52fdfb (diff) |
fdo#46808, Adapt io::Pipe UNO service to new style
Create a merged XPipe interface for this service to implement.
Which is backwards-compatible, but does not require creating a new service.
Change-Id: I682633c6252aab503eb2469c9bd2ba771f10bc4b
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/core/ucbcmds.cxx | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx index 221a4299fdea..56f6d915a63d 100644 --- a/ucb/source/core/ucbcmds.cxx +++ b/ucb/source/core/ucbcmds.cxx @@ -33,6 +33,7 @@ *************************************************************************/ #include <osl/diagnose.h> +#include <comphelper/componentcontext.hxx> #include <cppuhelper/implbase1.hxx> #include <cppuhelper/exc_hlp.hxx> #include <rtl/ustring.h> @@ -43,6 +44,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/beans/XPropertySetInfo.hpp> +#include <com/sun/star/io/Pipe.hpp> #include <com/sun/star/io/XActiveDataSink.hpp> #include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/io/XSeekable.hpp> @@ -966,29 +968,23 @@ uno::Reference< io::XInputStream > getInputStream( try { - uno::Reference< io::XOutputStream > xOutputStream( - rContext.xSMgr->createInstance( - rtl::OUString("com.sun.star.io.Pipe") ), - uno::UNO_QUERY ); + uno::Reference< io::XOutputStream > xOutputStream( io::Pipe::create(comphelper::ComponentContext(rContext.xSMgr).getUNOContext()), uno::UNO_QUERY_THROW ); - if ( xOutputStream.is() ) - { - ucb::OpenCommandArgument2 aArg; - aArg.Mode = ucb::OpenMode::DOCUMENT; - aArg.Priority = 0; // unused - aArg.Sink = xOutputStream; - aArg.Properties = uno::Sequence< beans::Property >( 0 ); - - ucb::Command aOpenCommand( - rtl::OUString("open"), - -1, - uno::makeAny( aArg ) ); + ucb::OpenCommandArgument2 aArg; + aArg.Mode = ucb::OpenMode::DOCUMENT; + aArg.Priority = 0; // unused + aArg.Sink = xOutputStream; + aArg.Properties = uno::Sequence< beans::Property >( 0 ); + + ucb::Command aOpenCommand( + rtl::OUString("open"), + -1, + uno::makeAny( aArg ) ); - xCommandProcessorS->execute( aOpenCommand, 0, rContext.xEnv ); + xCommandProcessorS->execute( aOpenCommand, 0, rContext.xEnv ); - xInputStream = uno::Reference< io::XInputStream >( - xOutputStream, uno::UNO_QUERY ); - } + xInputStream = uno::Reference< io::XInputStream >( + xOutputStream, uno::UNO_QUERY ); } catch ( uno::RuntimeException const & ) { |