You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openoffice.apache.org by Rajath Shashidhara <ra...@gmail.com> on 2013/06/18 14:18:06 UTC

DataSink Object

Hello,
http://www.openoffice.org/ucb/docs/ucb-api-usage.html#GetDataStream
There are two types of datasinks:
1. XActiveDataSink
2. XOutputStream

Which one to use in my ucp? the active one or the passive one?
or implement both like file ucp?
code from file ucp:
Reference< io::XOutputStream > outputStream(
aCommandArgument.Sink,UNO_QUERY );
            if( outputStream.is() )
            {
                m_pMyShell->page( nMyCommandIdentifier,
                                  m_aUncPath,
                                  outputStream );
            }

            sal_Bool bLock = ( aCommandArgument.Mode !=
OpenMode::DOCUMENT_SHARE_DENY_NONE );

            Reference< io::XActiveDataSink > activeDataSink(
aCommandArgument.Sink,UNO_QUERY );
            if( activeDataSink.is() )
            {
                activeDataSink->setInputStream( m_pMyShell->open(
nMyCommandIdentifier,

m_aUncPath,
                                                                  bLock ) );
            }

            Reference< io::XActiveDataStreamer > activeDataStreamer(
aCommandArgument.Sink,UNO_QUERY );
            if( activeDataStreamer.is() )
            {
                activeDataStreamer->setStream( m_pMyShell->open_rw(
nMyCommandIdentifier,

m_aUncPath,
                                                                    bLock )
);
            }

-- 
Rajath S,
M.Sc(Hons.) Physics,
Birla Institute of Technology and Science - Pilani,
Pilani