last private:resource ... bitmapex user is gone

so drop private:resource ... bitmapex example and update docs

Change-Id: I244c575573cffda5eb8ca52afd2f4a04a9b18f14
This commit is contained in:
Caolán McNamara
2017-04-27 11:07:35 +01:00
parent 0d95753e42
commit b100796c39
2 changed files with 1 additions and 55 deletions

View File

@@ -41,11 +41,10 @@ published service MediaProperties
<p>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:
<ul>
<li><code>private:graphicrepository/<em>&lt;path_in_repository&gt;</em></code></li>
<li>private:resource/projectshortname/bitmapex/12345</li>
</ul>
And additionally, GraphicObject scheme URLs like
<ul> <li>vnd.sun.star.GraphicObject:10000000000001940000012FB99807BD</li> </ul>

View File

@@ -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<ResMgr> 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 );