From 4671c863815826c1fbbb4343b53f9d74803aaa7d Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Sat, 21 Apr 2018 14:10:23 +0900 Subject: Get rid of GraphicObject URL in extensions - PropertyController MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of that, use "Graphic" property and set an XGraphic. Change-Id: Ib3084d22b422b82b69be3d410560caac303e780d Reviewed-on: https://gerrit.libreoffice.org/53240 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- extensions/source/propctrlr/formcomponenthandler.cxx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'extensions/source/propctrlr/formcomponenthandler.cxx') 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 #include -#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; } -- cgit