Kaydet (Commit) 96a48f79 authored tarafından Frank Schoenheit [fs]'s avatar Frank Schoenheit [fs]

dba33h: #i114022# properly handle new/empty images

üst 35602785
......@@ -523,7 +523,13 @@ Any OImageControlModel::translateDbColumnToControlValue()
{
switch ( lcl_getImageStoreType( getFieldType() ) )
{
case ImageStoreBinary: return makeAny( m_xColumn->getBinaryStream() );
case ImageStoreBinary:
{
Reference< XInputStream > xImageStream( m_xColumn->getBinaryStream() );
if ( m_xColumn->wasNull() )
xImageStream.clear();
return makeAny( xImageStream );
}
case ImageStoreLink:
{
::rtl::OUString sImageLink( m_xColumn->getString() );
......@@ -634,10 +640,10 @@ void SAL_CALL OImageControlModel::startProduction( ) throw (RuntimeException)
//------------------------------------------------------------------------------
IMPL_LINK( OImageControlModel, OnImageImportDone, ::Graphic*, i_pGraphic )
{
ENSURE_OR_RETURN( i_pGraphic, "OImageControlModel::OnImageImportDone: illegal graphic!", 0L );
const Reference< XGraphic > xGraphic( i_pGraphic != NULL ? Image( i_pGraphic->GetBitmapEx() ).GetXGraphic() : NULL );
setPropertyValue(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Graphic" ) ),
makeAny( Image( i_pGraphic->GetBitmapEx() ).GetXGraphic() )
makeAny( xGraphic )
);
return 1L;
}
......
......@@ -351,6 +351,9 @@ void ImageProducer::startProduction() throw(::com::sun::star::uno::RuntimeExcept
// delete interfaces in temporary list
for( pCons = aTmp.First(); pCons; pCons = aTmp.Next() )
delete (::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer > *) pCons;
if ( maDoneHdl.IsSet() )
maDoneHdl.Call( NULL );
}
}
}
......
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