summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-04-26 19:28:35 +0900
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-05-03 13:06:33 +0200
commit2bf4d69e0bfa98d641939e62945a7f8915441297 (patch)
tree2c64c371f0261bdda2b2adc16abb1b24e5315cb8 /svx
parentf1579d3d6c5f5f3a651825e035b93bee7a4f43c6 (diff)
[API CHANGE] revert and deprecate GraphicURL, modify Graphic prop.
Revert the state of GraphicURL property so it supports setting a external URL, but getting throws and exception. Modify the Graphic property, so it reflects what was used with GraphicURL before. Change-Id: Ia05b8ea37997b5ed8c75215557cce9979630c898 Reviewed-on: https://gerrit.libreoffice.org/53509 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/unodraw/unoshap2.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 6a726a7deca0..fbed04557448 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -38,6 +38,7 @@
#include <vcl/graphicfilter.hxx>
#include <vcl/wmf.hxx>
#include <vcl/cvtgrf.hxx>
+#include <vcl/GraphicLoader.hxx>
#include <svx/svdpool.hxx>
@@ -1363,6 +1364,21 @@ bool SvxGraphicObject::setPropertyValueImpl( const OUString& rName, const SfxIte
break;
}
+ case OWN_ATTR_GRAPHIC_URL:
+ {
+ OUString aURL;
+ if (rValue >>= aURL)
+ {
+ Graphic aGraphic = vcl::graphic::loadFromURL(aURL);
+ if (aGraphic)
+ {
+ static_cast<SdrGrafObj*>(GetSdrObject())->SetGraphic(aGraphic);
+ bOk = true;
+ }
+ }
+ break;
+ }
+
case OWN_ATTR_VALUE_GRAPHIC:
{
Reference< graphic::XGraphic > xGraphic( rValue, uno::UNO_QUERY );
@@ -1531,6 +1547,12 @@ bool SvxGraphicObject::getPropertyValueImpl( const OUString& rName, const SfxIte
break;
}
+ case OWN_ATTR_GRAPHIC_URL:
+ {
+ throw uno::RuntimeException("Getting from this property is not unsupported");
+ break;
+ }
+
case OWN_ATTR_VALUE_GRAPHIC:
{
Reference<graphic::XGraphic> xGraphic;