From b48dc80c770a3ce3296caed24987d2e451a6278c Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Thu, 8 Mar 2018 18:33:18 +0900 Subject: svx: convert "ThumbnailGraphicURL" prop. to "ThumbnailGraphic" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id77768e6ad58c8ed7bd35478a8f0cf78ce4b1feb Reviewed-on: https://gerrit.libreoffice.org/50934 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- svx/source/unodraw/unoprov.cxx | 8 ++++---- svx/source/unodraw/unoshap4.cxx | 27 +++++++++------------------ 2 files changed, 13 insertions(+), 22 deletions(-) (limited to 'svx/source/unodraw') diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx index 83e1ffdf95ab..9d9b1eeffbf4 100644 --- a/svx/source/unodraw/unoprov.cxx +++ b/svx/source/unodraw/unoprov.cxx @@ -451,7 +451,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxOle2PropertyMap() TEXT_PROPERTIES FONTWORK_PROPERTIES - { OUString("ThumbnailGraphicURL"), OWN_ATTR_THUMBNAIL , cppu::UnoType::get(), 0, 0 }, + { OUString("ThumbnailGraphic"), OWN_ATTR_THUMBNAIL , cppu::UnoType::get(), 0, 0 }, { OUString("Model"), OWN_ATTR_OLEMODEL , cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, { OUString("EmbeddedObject"), OWN_ATTR_OLE_EMBEDDED_OBJECT, cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, { OUString("EmbeddedObjectNoNewClient"),OWN_ATTR_OLE_EMBEDDED_OBJECT_NONEWCLIENT, cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, @@ -483,7 +483,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxPluginPropertyMap() { OUString(UNO_NAME_LINKDISPLAYBITMAP), OWN_ATTR_LDBITMAP , cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, { OUString(UNO_NAME_LINKDISPLAYNAME), OWN_ATTR_LDNAME , cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, { OUString(UNO_NAME_OLE2_METAFILE), OWN_ATTR_METAFILE , cppu::UnoType>::get(), css::beans::PropertyAttribute::READONLY, 0}, - { OUString("ThumbnailGraphicURL"), OWN_ATTR_THUMBNAIL , cppu::UnoType::get(), 0, 0 }, + { OUString("ThumbnailGraphic"), OWN_ATTR_THUMBNAIL , cppu::UnoType::get(), 0, 0 }, { OUString(UNO_NAME_MISC_OBJ_MOVEPROTECT), SDRATTR_OBJMOVEPROTECT, cppu::UnoType::get(),0, 0}, { OUString(UNO_NAME_MISC_OBJ_SIZEPROTECT), SDRATTR_OBJSIZEPROTECT, cppu::UnoType::get(),0, 0}, { OUString(UNO_NAME_OLE2_PERSISTNAME), OWN_ATTR_PERSISTNAME , cppu::UnoType::get(), 0, 0 }, @@ -517,7 +517,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxFramePropertyMap() { OUString(UNO_NAME_LINKDISPLAYBITMAP), OWN_ATTR_LDBITMAP , cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, { OUString(UNO_NAME_LINKDISPLAYNAME), OWN_ATTR_LDNAME , cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, { OUString(UNO_NAME_OLE2_METAFILE), OWN_ATTR_METAFILE , cppu::UnoType>::get(), css::beans::PropertyAttribute::READONLY, 0}, - { OUString("ThumbnailGraphicURL"), OWN_ATTR_THUMBNAIL , cppu::UnoType::get(), 0, 0 }, + { OUString("ThumbnailGraphic"), OWN_ATTR_THUMBNAIL , cppu::UnoType::get(), 0, 0 }, { OUString(UNO_NAME_MISC_OBJ_MOVEPROTECT), SDRATTR_OBJMOVEPROTECT, cppu::UnoType::get(),0, 0}, { OUString(UNO_NAME_MISC_OBJ_SIZEPROTECT), SDRATTR_OBJSIZEPROTECT, cppu::UnoType::get(),0, 0}, { OUString(UNO_NAME_OLE2_PERSISTNAME), OWN_ATTR_PERSISTNAME , cppu::UnoType::get(), 0, 0 }, @@ -550,7 +550,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxAppletPropertyMap() { OUString(UNO_NAME_LINKDISPLAYBITMAP), OWN_ATTR_LDBITMAP , cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, { OUString(UNO_NAME_LINKDISPLAYNAME), OWN_ATTR_LDNAME , cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, { OUString(UNO_NAME_OLE2_METAFILE), OWN_ATTR_METAFILE , cppu::UnoType>::get(), css::beans::PropertyAttribute::READONLY, 0}, - { OUString("ThumbnailGraphicURL"), OWN_ATTR_THUMBNAIL , cppu::UnoType::get(), 0, 0 }, + { OUString("ThumbnailGraphic"), OWN_ATTR_THUMBNAIL , cppu::UnoType::get(), 0, 0 }, { OUString(UNO_NAME_MISC_OBJ_MOVEPROTECT), SDRATTR_OBJMOVEPROTECT, cppu::UnoType::get(),0, 0}, { OUString(UNO_NAME_MISC_OBJ_SIZEPROTECT), SDRATTR_OBJSIZEPROTECT, cppu::UnoType::get(),0, 0}, { OUString(UNO_NAME_OLE2_PERSISTNAME), OWN_ATTR_PERSISTNAME , cppu::UnoType::get(), 0, 0 }, diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx index 11d2f62e35b3..a5ef378525f7 100644 --- a/svx/source/unodraw/unoshap4.cxx +++ b/svx/source/unodraw/unoshap4.cxx @@ -140,11 +140,11 @@ bool SvxOle2Shape::setPropertyValueImpl( const OUString& rName, const SfxItemPro } case OWN_ATTR_THUMBNAIL: { - OUString aURL; - if( rValue >>= aURL ) + uno::Reference< graphic::XGraphic > xGraphic( rValue, uno::UNO_QUERY ); + if( xGraphic.is() ) { - GraphicObject aGrafObj( GraphicObject::CreateGraphicObjectFromURL( aURL ) ); - static_cast(mpObj.get())->SetGraphic(aGrafObj.GetGraphic()); + const Graphic aGraphic(xGraphic); + static_cast(mpObj.get())->SetGraphic(aGraphic); return true; } break; @@ -324,20 +324,11 @@ bool SvxOle2Shape::getPropertyValueImpl( const OUString& rName, const SfxItemPro case OWN_ATTR_THUMBNAIL: { - OUString aURL; - SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >( mpObj.get() ); - if( pOle ) - { - const Graphic* pGraphic = pOle->GetGraphic(); - - if( pGraphic ) - { - GraphicObject aObj( *pGraphic ); - aURL = UNO_NAME_GRAPHOBJ_URLPREFIX; - aURL += OStringToOUString(aObj.GetUniqueID(), RTL_TEXTENCODING_ASCII_US); - } - } - rValue <<= aURL; + uno::Reference< graphic::XGraphic > xGraphic; + const Graphic* pGraphic = static_cast( mpObj.get() )->GetGraphic(); + if( pGraphic ) + xGraphic = pGraphic->GetXGraphic(); + rValue <<= xGraphic; break; } case OWN_ATTR_PERSISTNAME: -- cgit