diff options
Diffstat (limited to 'toolkit/source')
-rw-r--r-- | toolkit/source/controls/dialogcontrol.cxx | 25 | ||||
-rw-r--r-- | toolkit/source/helper/property.cxx | 2 |
2 files changed, 23 insertions, 4 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); } diff --git a/toolkit/source/helper/property.cxx b/toolkit/source/helper/property.cxx index e6ce48ab826a..ad9ca0c89edf 100644 --- a/toolkit/source/helper/property.cxx +++ b/toolkit/source/helper/property.cxx @@ -161,7 +161,7 @@ static ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount ) DECL_PROP_2 ( "HardLineBreaks", HARDLINEBREAKS, bool, BOUND, MAYBEDEFAULT ), DECL_PROP_2 ( "ImageAlign", IMAGEALIGN, sal_Int16, BOUND, MAYBEDEFAULT), DECL_PROP_2 ( "ImagePosition", IMAGEPOSITION, sal_Int16, BOUND, MAYBEDEFAULT), - DECL_PROP_2 ( "ImageURL", IMAGEURL, OUString, BOUND, MAYBEDEFAULT ), + DECL_PROP_2 ( "ImageURL", IMAGEURL, css::uno::Any, BOUND, MAYBEDEFAULT ), DECL_PROP_3 ( "ItemSeparatorPos", ITEM_SEPARATOR_POS, sal_Int16, BOUND, MAYBEDEFAULT, MAYBEVOID ), DECL_PROP_2 ( "Label", LABEL, OUString, BOUND, MAYBEDEFAULT ), DECL_PROP_3 ( "LineColor", LINECOLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ), |