diff options
Diffstat (limited to 'toolkit/source/controls/dialogcontrol.cxx')
-rw-r--r-- | toolkit/source/controls/dialogcontrol.cxx | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index e67f33bef885..fa5a4a17efaa 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -278,8 +278,18 @@ void SAL_CALL UnoControlDialogModel::setFastPropertyValue_NoBroadcast( sal_Int32 if ( nHandle == BASEPROPERTY_IMAGEURL && ImplHasProperty( BASEPROPERTY_GRAPHIC ) ) { OUString sImageURL; - OSL_VERIFY( rValue >>= sImageURL ); - setPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC ), uno::makeAny( ImageHelper::getGraphicAndGraphicObjectFromURL_nothrow( mxGrfObj, sImageURL ) ) ); + uno::Reference<graphic::XGraphic> xGraphic; + if (rValue >>= sImageURL) + { + setPropertyValue( + GetPropertyName(BASEPROPERTY_GRAPHIC), + uno::makeAny(ImageHelper::getGraphicAndGraphicObjectFromURL_nothrow( + mxGrfObj, sImageURL))); + } + else if (rValue >>= xGraphic) + { + setPropertyValue("Graphic", uno::makeAny(xGraphic)); + } } } catch( const css::uno::Exception& ) @@ -616,7 +626,7 @@ void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChang { Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY ); bool bOwnModel = xModel.get() == getModel().get(); - if ( bOwnModel && rEvt.PropertyName == "ImageURL" ) + if (bOwnModel && rEvt.PropertyName == "ImageURL" && !ImplHasProperty(BASEPROPERTY_GRAPHIC)) { OUString aImageURL; Reference< graphic::XGraphic > xGraphic; @@ -629,6 +639,15 @@ void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChang ImplSetPropertyValue( GetPropertyName( BASEPROPERTY_GRAPHIC), uno::makeAny( xGraphic ), true ); break; } + else if (bOwnModel && rEvt.PropertyName == "Graphic") + { + uno::Reference<graphic::XGraphic> xGraphic; + if (ImplGetPropertyValue("Graphic") >>= xGraphic) + { + ImplSetPropertyValue("Graphic", uno::makeAny(xGraphic), true); + } + break; + } } ControlContainerBase::ImplModelPropertiesChanged(rEvents); } |