diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-03-08 18:33:18 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-03-09 05:11:31 +0100 |
commit | b48dc80c770a3ce3296caed24987d2e451a6278c (patch) | |
tree | 5370f5d380c416cef0e97f2df862799ed171a91b /svx/source/unodraw | |
parent | fb29e6eeeaad5255bb924ff59162a83ed80bfb0a (diff) |
svx: convert "ThumbnailGraphicURL" prop. to "ThumbnailGraphic"
Change-Id: Id77768e6ad58c8ed7bd35478a8f0cf78ce4b1feb
Reviewed-on: https://gerrit.libreoffice.org/50934
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'svx/source/unodraw')
-rw-r--r-- | svx/source/unodraw/unoprov.cxx | 8 | ||||
-rw-r--r-- | svx/source/unodraw/unoshap4.cxx | 27 |
2 files changed, 13 insertions, 22 deletions
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<OUString>::get(), 0, 0 }, + { OUString("ThumbnailGraphic"), OWN_ATTR_THUMBNAIL , cppu::UnoType<css::graphic::XGraphic>::get(), 0, 0 }, { OUString("Model"), OWN_ATTR_OLEMODEL , cppu::UnoType<css::frame::XModel>::get(), css::beans::PropertyAttribute::READONLY, 0}, { OUString("EmbeddedObject"), OWN_ATTR_OLE_EMBEDDED_OBJECT, cppu::UnoType<css::embed::XEmbeddedObject>::get(), css::beans::PropertyAttribute::READONLY, 0}, { OUString("EmbeddedObjectNoNewClient"),OWN_ATTR_OLE_EMBEDDED_OBJECT_NONEWCLIENT, cppu::UnoType<css::embed::XEmbeddedObject>::get(), css::beans::PropertyAttribute::READONLY, 0}, @@ -483,7 +483,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxPluginPropertyMap() { OUString(UNO_NAME_LINKDISPLAYBITMAP), OWN_ATTR_LDBITMAP , cppu::UnoType<css::awt::XBitmap>::get(), css::beans::PropertyAttribute::READONLY, 0}, { OUString(UNO_NAME_LINKDISPLAYNAME), OWN_ATTR_LDNAME , cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY, 0}, { OUString(UNO_NAME_OLE2_METAFILE), OWN_ATTR_METAFILE , cppu::UnoType<css::uno::Sequence<sal_Int8>>::get(), css::beans::PropertyAttribute::READONLY, 0}, - { OUString("ThumbnailGraphicURL"), OWN_ATTR_THUMBNAIL , cppu::UnoType<OUString>::get(), 0, 0 }, + { OUString("ThumbnailGraphic"), OWN_ATTR_THUMBNAIL , cppu::UnoType<css::graphic::XGraphic>::get(), 0, 0 }, { OUString(UNO_NAME_MISC_OBJ_MOVEPROTECT), SDRATTR_OBJMOVEPROTECT, cppu::UnoType<bool>::get(),0, 0}, { OUString(UNO_NAME_MISC_OBJ_SIZEPROTECT), SDRATTR_OBJSIZEPROTECT, cppu::UnoType<bool>::get(),0, 0}, { OUString(UNO_NAME_OLE2_PERSISTNAME), OWN_ATTR_PERSISTNAME , cppu::UnoType<OUString>::get(), 0, 0 }, @@ -517,7 +517,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxFramePropertyMap() { OUString(UNO_NAME_LINKDISPLAYBITMAP), OWN_ATTR_LDBITMAP , cppu::UnoType<css::awt::XBitmap>::get(), css::beans::PropertyAttribute::READONLY, 0}, { OUString(UNO_NAME_LINKDISPLAYNAME), OWN_ATTR_LDNAME , cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY, 0}, { OUString(UNO_NAME_OLE2_METAFILE), OWN_ATTR_METAFILE , cppu::UnoType<css::uno::Sequence<sal_Int8>>::get(), css::beans::PropertyAttribute::READONLY, 0}, - { OUString("ThumbnailGraphicURL"), OWN_ATTR_THUMBNAIL , cppu::UnoType<OUString>::get(), 0, 0 }, + { OUString("ThumbnailGraphic"), OWN_ATTR_THUMBNAIL , cppu::UnoType<css::graphic::XGraphic>::get(), 0, 0 }, { OUString(UNO_NAME_MISC_OBJ_MOVEPROTECT), SDRATTR_OBJMOVEPROTECT, cppu::UnoType<bool>::get(),0, 0}, { OUString(UNO_NAME_MISC_OBJ_SIZEPROTECT), SDRATTR_OBJSIZEPROTECT, cppu::UnoType<bool>::get(),0, 0}, { OUString(UNO_NAME_OLE2_PERSISTNAME), OWN_ATTR_PERSISTNAME , cppu::UnoType<OUString>::get(), 0, 0 }, @@ -550,7 +550,7 @@ SfxItemPropertyMapEntry const * ImplGetSvxAppletPropertyMap() { OUString(UNO_NAME_LINKDISPLAYBITMAP), OWN_ATTR_LDBITMAP , cppu::UnoType<css::awt::XBitmap>::get(), css::beans::PropertyAttribute::READONLY, 0}, { OUString(UNO_NAME_LINKDISPLAYNAME), OWN_ATTR_LDNAME , cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY, 0}, { OUString(UNO_NAME_OLE2_METAFILE), OWN_ATTR_METAFILE , cppu::UnoType<css::uno::Sequence<sal_Int8>>::get(), css::beans::PropertyAttribute::READONLY, 0}, - { OUString("ThumbnailGraphicURL"), OWN_ATTR_THUMBNAIL , cppu::UnoType<OUString>::get(), 0, 0 }, + { OUString("ThumbnailGraphic"), OWN_ATTR_THUMBNAIL , cppu::UnoType<css::graphic::XGraphic>::get(), 0, 0 }, { OUString(UNO_NAME_MISC_OBJ_MOVEPROTECT), SDRATTR_OBJMOVEPROTECT, cppu::UnoType<bool>::get(),0, 0}, { OUString(UNO_NAME_MISC_OBJ_SIZEPROTECT), SDRATTR_OBJSIZEPROTECT, cppu::UnoType<bool>::get(),0, 0}, { OUString(UNO_NAME_OLE2_PERSISTNAME), OWN_ATTR_PERSISTNAME , cppu::UnoType<OUString>::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<SdrOle2Obj*>(mpObj.get())->SetGraphic(aGrafObj.GetGraphic()); + const Graphic aGraphic(xGraphic); + static_cast<SdrOle2Obj*>(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<SdrOle2Obj*>( mpObj.get() )->GetGraphic(); + if( pGraphic ) + xGraphic = pGraphic->GetXGraphic(); + rValue <<= xGraphic; break; } case OWN_ATTR_PERSISTNAME: |