summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-04-21 14:10:23 +0900
committerTomaž Vajngerl <quikee@gmail.com>2018-04-21 16:51:27 +0200
commit4671c863815826c1fbbb4343b53f9d74803aaa7d (patch)
treeae5001915d5da013b79caecb6536323dddcd9e21 /extensions
parentde07f40030bbd604bc42d58f0e954cca284a2646 (diff)
Get rid of GraphicObject URL in extensions - PropertyController
Instead of that, use "Graphic" property and set an XGraphic. Change-Id: Ib3084d22b422b82b69be3d410560caac303e780d Reviewed-on: https://gerrit.libreoffice.org/53240 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.cxx11
-rw-r--r--extensions/source/propctrlr/formstrings.hxx1
2 files changed, 4 insertions, 8 deletions
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index 9d8a6f43292b..06e7cb3d6398 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -103,8 +103,6 @@
#include <limits>
#include <memory>
-#define GRAPHOBJ_URLPREFIX "vnd.sun.star.GraphicObject:"
-
extern "C" void createRegistryInfo_FormComponentPropertyHandler()
{
::pcr::FormComponentPropertyHandler::registerImplementation();
@@ -319,9 +317,7 @@ namespace pcr
if ( PROPERTY_ID_IMAGE_URL == nPropId && ( _rValue >>= xGrfObj ) )
{
DBG_ASSERT( xGrfObj.is(), "FormComponentPropertyHandler::setPropertyValue() xGrfObj is invalid");
- OUString sObjectID( GRAPHOBJ_URLPREFIX );
- sObjectID = sObjectID + xGrfObj->getUniqueID();
- m_xComponent->setPropertyValue( _rPropertyName, uno::makeAny( sObjectID ) );
+ m_xComponent->setPropertyValue(PROPERTY_GRAPHIC, uno::makeAny(xGrfObj->getGraphic()));
}
else if ( PROPERTY_ID_FONT == nPropId )
{
@@ -2726,7 +2722,7 @@ namespace pcr
OUString sCurValue;
OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_IMAGE_URL ) >>= sCurValue );
- if ( !sCurValue.isEmpty() && !sCurValue.startsWith(GRAPHOBJ_URLPREFIX) )
+ if (!sCurValue.isEmpty())
{
aFileDlg.SetDisplayDirectory( sCurValue );
// TODO: need to set the display directory _and_ the default name
@@ -2743,12 +2739,11 @@ namespace pcr
if ( !bIsLink )
{
Graphic aGraphic;
- aFileDlg.GetGraphic( aGraphic );
+ aFileDlg.GetGraphic(aGraphic);
Reference< graphic::XGraphicObject > xGrfObj = graphic::GraphicObject::create( m_xContext );
xGrfObj->setGraphic( aGraphic.GetXGraphic() );
-
_out_rNewValue <<= xGrfObj;
}
diff --git a/extensions/source/propctrlr/formstrings.hxx b/extensions/source/propctrlr/formstrings.hxx
index a4d8955b348d..ad06d8989b32 100644
--- a/extensions/source/propctrlr/formstrings.hxx
+++ b/extensions/source/propctrlr/formstrings.hxx
@@ -73,6 +73,7 @@ namespace pcr
#define PROPERTY_SUBMIT_METHOD "SubmitMethod"
#define PROPERTY_SUBMIT_ENCODING "SubmitEncoding"
#define PROPERTY_IMAGE_URL "ImageURL"
+ #define PROPERTY_GRAPHIC "Graphic"
#define PROPERTY_EMPTY_IS_NULL "ConvertEmptyToNull"
#define PROPERTY_LISTSOURCETYPE "ListSourceType"
#define PROPERTY_LISTSOURCE "ListSource"