summaryrefslogtreecommitdiff
path: root/editeng/source/items/frmitems.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'editeng/source/items/frmitems.cxx')
-rw-r--r--editeng/source/items/frmitems.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index d6da0edc1bc6..0813021dd4e3 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3314,6 +3314,11 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
rVal <<= ( aColor.GetTransparency() == 0xff );
break;
+ case MID_GRAPHIC_URL:
+ {
+ throw uno::RuntimeException("Getting from this property is not unsupported");
+ }
+ break;
case MID_GRAPHIC:
{
uno::Reference<graphic::XGraphic> xGraphic;
@@ -3396,13 +3401,24 @@ bool SvxBrushItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
aColor.SetTransparency( Any2Bool( rVal ) ? 0xff : 0 );
break;
+ case MID_GRAPHIC_URL:
case MID_GRAPHIC:
{
- if (rVal.getValueType() == cppu::UnoType<graphic::XGraphic>::get())
+ Graphic aGraphic;
+
+ if (rVal.getValueType() == ::cppu::UnoType<OUString>::get())
+ {
+ OUString aURL = rVal.get<OUString>();
+ aGraphic = vcl::graphic::loadFromURL(aURL);
+ }
+ else if (rVal.getValueType() == cppu::UnoType<graphic::XGraphic>::get())
{
auto xGraphic = rVal.get<uno::Reference<graphic::XGraphic>>();
+ aGraphic = Graphic(xGraphic);
+ }
- Graphic aGraphic(xGraphic);
+ if (aGraphic)
+ {
maStrLink.clear();
std::unique_ptr<GraphicObject> xOldGrfObj(std::move(xGraphicObject));