From b100796c3922fe8fe83628053fc0294bd48b044a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 27 Apr 2017 11:07:35 +0100 Subject: [PATCH] last private:resource ... bitmapex user is gone so drop private:resource ... bitmapex example and update docs Change-Id: I244c575573cffda5eb8ca52afd2f4a04a9b18f14 --- .../com/sun/star/graphic/MediaProperties.idl | 3 +- svtools/source/graphic/provider.cxx | 53 ------------------- 2 files changed, 1 insertion(+), 55 deletions(-) diff --git a/offapi/com/sun/star/graphic/MediaProperties.idl b/offapi/com/sun/star/graphic/MediaProperties.idl index aa0182ad9e3c..590d6fb999ce 100644 --- a/offapi/com/sun/star/graphic/MediaProperties.idl +++ b/offapi/com/sun/star/graphic/MediaProperties.idl @@ -41,11 +41,10 @@ published service MediaProperties

In addition to the normal protocols like file:// or http:// you can use private URLs as follows to get access to graphics - lying inside the resource system within an Office context: + lying inside the graphicrepository system within an Office context:

And additionally, GraphicObject scheme URLs like diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index 12f3dfa413de..6106bef363a8 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -83,7 +83,6 @@ private: static css::uno::Reference< css::graphic::XGraphic > implLoadMemory( const OUString& rResourceURL ); static css::uno::Reference< css::graphic::XGraphic > implLoadGraphicObject( const OUString& rResourceURL ); - static css::uno::Reference< css::graphic::XGraphic > implLoadResource( const OUString& rResourceURL ); static css::uno::Reference< css::graphic::XGraphic > implLoadRepositoryImage( const OUString& rResourceURL ); static css::uno::Reference< css::graphic::XGraphic > implLoadBitmap( const css::uno::Reference< css::awt::XBitmap >& rBitmap ); static css::uno::Reference< css::graphic::XGraphic > implLoadStandardImage( const OUString& rResourceURL ); @@ -247,53 +246,6 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadBitmap( const uno return xRet; } - -uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadResource( const OUString& rResourceURL ) -{ - uno::Reference< ::graphic::XGraphic > xRet; - sal_Int32 nIndex = 0; - - if( rResourceURL.getToken( 0, '/', nIndex ) == "private:resource" ) - { - OString aResMgrName(OUStringToOString( - rResourceURL.getToken(0, '/', nIndex), RTL_TEXTENCODING_ASCII_US)); - - std::unique_ptr pResMgr(ResMgr::CreateResMgr( aResMgrName.getStr(), Application::GetSettings().GetUILanguageTag() )); - - if( pResMgr ) - { - const OUString aResourceType( rResourceURL.getToken( 0, '/', nIndex ) ); - const ResId aResId( rResourceURL.getToken( 0, '/', nIndex ).toInt32(), *pResMgr ); - - if( !aResourceType.isEmpty() ) - { - BitmapEx aBmpEx; - - if (aResourceType == "bitmapex") - { - aResId.SetRT( RSC_BITMAP ); - - if( pResMgr->IsAvailable( aResId ) ) - { - aBmpEx = BitmapEx( aResId ); - } - } - - if( !aBmpEx.IsEmpty() ) - { - ::unographic::Graphic* pUnoGraphic = new ::unographic::Graphic; - - pUnoGraphic->init( aBmpEx ); - xRet = pUnoGraphic; - } - } - } - } - - return xRet; -} - - uno::Reference< beans::XPropertySet > SAL_CALL GraphicProvider::queryGraphicDescriptor( const uno::Sequence< beans::PropertyValue >& rMediaProperties ) { uno::Reference< beans::XPropertySet > xRet; @@ -332,8 +284,6 @@ uno::Reference< beans::XPropertySet > SAL_CALL GraphicProvider::queryGraphicDesc else if( !aURL.isEmpty() ) { uno::Reference< ::graphic::XGraphic > xGraphic( implLoadMemory( aURL ) ); - if( !xGraphic.is() ) - xGraphic = implLoadResource( aURL ); if( !xGraphic.is() ) xGraphic = implLoadGraphicObject( aURL ); @@ -437,9 +387,6 @@ uno::Reference< ::graphic::XGraphic > SAL_CALL GraphicProvider::queryGraphic( co if( !xRet.is() ) xRet = implLoadGraphicObject( aPath ); - if( !xRet.is() ) - xRet = implLoadResource( aPath ); - if ( !xRet.is() ) xRet = implLoadRepositoryImage( aPath );