Kaydet (Commit) 03802af7 authored tarafından Michael Stahl's avatar Michael Stahl

xmlhelp: apparently "picture.jar" hasn't existed for a long time

Change-Id: I9ac46ffcf21e8af2cb3b92d4068981cafb271ebc
üst 6a87d1d7
......@@ -421,11 +421,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
else if ( rProp.Name == "IsErrorDocument" )
xRow->appendBoolean( rProp, m_aURLParameter.isErrorDocument() );
else if ( rProp.Name == "MediaType" )
if( m_aURLParameter.isPicture() )
xRow->appendString(
rProp,
OUString( "image/gif" ) );
else if( m_aURLParameter.isActive() )
if( m_aURLParameter.isActive() )
xRow->appendString(
rProp,
OUString( "text/plain" ) );
......
......@@ -396,60 +396,16 @@ void URLParameter::open( const Command& aCommand,
if( ! xDataSink.is() )
return;
if( isPicture() )
// a standard document or else an active help text, plug in the new input stream
InputStreamTransformer* p = new InputStreamTransformer( this,m_pDatabases,isRoot() );
try
{
Reference< XInputStream > xStream;
Reference< XHierarchicalNameAccess > xNA =
m_pDatabases->jarFile( OUString( "picture.jar" ),
get_language() );
OUString path = get_path();
if( xNA.is() )
{
try
{
Any aEntry = xNA->getByHierarchicalName( path );
Reference< XActiveDataSink > xSink;
if( ( aEntry >>= xSink ) && xSink.is() )
xStream = xSink->getInputStream();
}
catch ( NoSuchElementException & )
{
}
}
if( xStream.is() )
{
sal_Int32 ret;
Sequence< sal_Int8 > aSeq( 4096 );
while( true )
{
try
{
ret = xStream->readBytes( aSeq,4096 );
xDataSink->writeBytes( aSeq );
if( ret < 4096 )
break;
}
catch( const Exception& )
{
break;
}
}
}
xDataSink->writeBytes( Sequence< sal_Int8 >( p->getData(),p->getLen() ) );
}
else
catch( const Exception& )
{
// a standard document or else an active help text, plug in the new input stream
InputStreamTransformer* p = new InputStreamTransformer( this,m_pDatabases,isRoot() );
try
{
xDataSink->writeBytes( Sequence< sal_Int8 >( p->getData(),p->getLen() ) );
}
catch( const Exception& )
{
}
delete p;
}
delete p;
xDataSink->closeOutput();
}
......@@ -464,32 +420,8 @@ void URLParameter::open( const Command& aCommand,
(void)CommandId;
(void)Environment;
if( isPicture() )
{
Reference< XInputStream > xStream;
Reference< XHierarchicalNameAccess > xNA =
m_pDatabases->jarFile( OUString( "picture.jar" ),
get_language() );
OUString path = get_path();
if( xNA.is() )
{
try
{
Any aEntry = xNA->getByHierarchicalName( path );
Reference< XActiveDataSink > xSink;
if( ( aEntry >>= xSink ) && xSink.is() )
xStream = xSink->getInputStream();
}
catch ( NoSuchElementException & )
{
}
}
xDataSink->setInputStream( turnToSeekable(xStream) );
}
else
// a standard document or else an active help text, plug in the new input stream
xDataSink->setInputStream( new InputStreamTransformer( this,m_pDatabases,isRoot() ) );
// a standard document or else an active help text, plug in the new input stream
xDataSink->setInputStream( new InputStreamTransformer( this,m_pDatabases,isRoot() ) );
}
......
......@@ -116,7 +116,6 @@ namespace chelp {
Databases* pDatabases )
throw( com::sun::star::ucb::IllegalIdentifierException );
bool isPicture() const { return m_aModule == "picture"; }
bool isActive() const { return !m_aActive.isEmpty() && m_aActive == "true"; }
bool isQuery() const { return m_aId.isEmpty() && !m_aQuery.isEmpty(); }
bool isFile() const { return !m_aId.isEmpty(); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment