diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2010-08-25 16:14:14 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2010-08-25 16:14:14 +0200 |
commit | 96a48f7977616c3484d590c2bc3f70298af0cc94 (patch) | |
tree | 41e25d22205ce8d52918cfaedef3e6c91f2609d5 /forms | |
parent | 356027851e5bddcf89435a207d83201f8aed9557 (diff) |
dba33h: #i114022# properly handle new/empty images
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/component/ImageControl.cxx | 12 | ||||
-rw-r--r-- | forms/source/component/imgprod.cxx | 3 |
2 files changed, 12 insertions, 3 deletions
diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx index f74e82135708..13155d54cf48 100644 --- a/forms/source/component/ImageControl.cxx +++ b/forms/source/component/ImageControl.cxx @@ -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; } diff --git a/forms/source/component/imgprod.cxx b/forms/source/component/imgprod.cxx index 7e0293be334e..07abd703281d 100644 --- a/forms/source/component/imgprod.cxx +++ b/forms/source/component/imgprod.cxx @@ -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 ); } } } |