dba33h: #i114022# properly handle new/empty images
This commit is contained in:
@@ -523,7 +523,13 @@ Any OImageControlModel::translateDbColumnToControlValue()
|
|||||||
{
|
{
|
||||||
switch ( lcl_getImageStoreType( getFieldType() ) )
|
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:
|
case ImageStoreLink:
|
||||||
{
|
{
|
||||||
::rtl::OUString sImageLink( m_xColumn->getString() );
|
::rtl::OUString sImageLink( m_xColumn->getString() );
|
||||||
@@ -634,10 +640,10 @@ void SAL_CALL OImageControlModel::startProduction( ) throw (RuntimeException)
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
IMPL_LINK( OImageControlModel, OnImageImportDone, ::Graphic*, i_pGraphic )
|
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(
|
setPropertyValue(
|
||||||
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Graphic" ) ),
|
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Graphic" ) ),
|
||||||
makeAny( Image( i_pGraphic->GetBitmapEx() ).GetXGraphic() )
|
makeAny( xGraphic )
|
||||||
);
|
);
|
||||||
return 1L;
|
return 1L;
|
||||||
}
|
}
|
||||||
|
@@ -351,6 +351,9 @@ void ImageProducer::startProduction() throw(::com::sun::star::uno::RuntimeExcept
|
|||||||
// delete interfaces in temporary list
|
// delete interfaces in temporary list
|
||||||
for( pCons = aTmp.First(); pCons; pCons = aTmp.Next() )
|
for( pCons = aTmp.First(); pCons; pCons = aTmp.Next() )
|
||||||
delete (::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer > *) pCons;
|
delete (::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer > *) pCons;
|
||||||
|
|
||||||
|
if ( maDoneHdl.IsSet() )
|
||||||
|
maDoneHdl.Call( NULL );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user