diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-04-26 22:04:27 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-05-07 16:30:35 +0200 |
commit | 7a8ed362eb163ac15a000ba1cfc74b58315800a1 (patch) | |
tree | 79c1543ac1edd99a7cf3fe7f26573828b4b2be1e /editeng | |
parent | 3e7bea5ece847dcd7234f7e7fd310b1daab0eec1 (diff) |
[API CHANGE] revert and deprecate *BackGraphicURL add *BackGraphic
*BackGraphicURL include the following properties:
- BackGraphicURL
- FooterBackGraphicURL
- HeaderBackGraphicURL
- ParaBackGraphicURL
This were removed, but for backwards compatibility this commit
adds them back again and depreactes them in the UNO API. The
behaviour also changes as internal vnd.sun.star.GraphicObject
scheme URLs aren't supported so this properties can only be set
and only if a external URL is provided. If getting such a property
then a RuntimeException will be thrown.
[ Miklos Vajna: fixed up sw/qa and writerfilter bits. ]
Change-Id: If60011837da96197b576bfe2671ecafccad736c7
Reviewed-on: https://gerrit.libreoffice.org/53511
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/items/frmitems.cxx | 20 |
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)); |