+//---------------------------------------------------------------------------
+// wxOleInputStream
+//---------------------------------------------------------------------------
+
+wxOleInputStream::wxOleInputStream( GNOME_Stream stream )
+{
+ m_gstream = stream;
+ m_error = (m_gstream);
+}
+
+wxOleInputStream::~wxOleInputStream()
+{
+ /* we don't create the stream so we
+ don't destroy it either. */
+}
+
+size_t wxOleInputStream::OnSysRead( void *buffer, size_t size )
+{
+ GNOME_Stream_iobuf *gbuffer = GNOME_Stream_iobuf__alloc();
+
+ CORBA_Environment ev;
+ CORBA_exception_init( &ev );
+
+ GNOME_Stream_read( m_gstream, size, &gbuffer, &ev );
+
+ CORBA_exception_free( &ev );
+
+ memcpy( buffer, gbuffer->_buffer, gbuffer->_length );
+
+ m_error = (gbuffer->_length != size);
+
+ CORBA_free( gbuffer );
+}
+
+off_t wxOleInputStream::OnSysSeek( off_t pos, wxSeekMode mode )
+{
+ CORBA_Environment ev;
+ CORBA_exception_init( &ev );
+
+ GNOME_Stream_seek( m_gstream, pos /* offset */, 0 /* whence */, &ev );
+
+ CORBA_exception_free( &ev );
+}
+
+off_t wxOleInputStream::OnSysTell() const
+{
+ return 0; /* oh well */
+}
+
+