[Libreoffice-commits] core.git: vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Feb 8 18:37:55 UTC 2019
vcl/source/graphic/UnoGraphicProvider.cxx | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
New commits:
commit db6e0348a3c5d41e6a5d38a7902645e8e3c22b4a
Author: Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Sat Jan 26 00:27:11 2019 +0100
Commit: Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Fri Feb 8 19:37:25 2019 +0100
getToken+comparison+copy ==> startsWith
Change-Id: I3d243cecc21b0364b2ceac1f64cbfa1764c3ddf1
Reviewed-on: https://gerrit.libreoffice.org/66938
Tested-by: Jenkins
Reviewed-by: Matteo Casalin <matteo.casalin at yahoo.com>
diff --git a/vcl/source/graphic/UnoGraphicProvider.cxx b/vcl/source/graphic/UnoGraphicProvider.cxx
index c89e83004bf0..0da9c020155d 100644
--- a/vcl/source/graphic/UnoGraphicProvider.cxx
+++ b/vcl/source/graphic/UnoGraphicProvider.cxx
@@ -151,11 +151,10 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadMemory( const OUS
uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadRepositoryImage( const OUString& rResourceURL )
{
uno::Reference< ::graphic::XGraphic > xRet;
- sal_Int32 nIndex = 0;
- if( rResourceURL.getToken( 0, '/', nIndex ) == "private:graphicrepository" )
+ OUString sPathName;
+ if( rResourceURL.startsWith("private:graphicrepository/", &sPathName) )
{
- OUString sPathName( rResourceURL.copy( nIndex ) );
BitmapEx aBitmap;
if ( vcl::ImageRepository::loadImage( sPathName, aBitmap ) )
{
@@ -169,11 +168,10 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadRepositoryImage(
uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadStandardImage( const OUString& rResourceURL )
{
uno::Reference< ::graphic::XGraphic > xRet;
- sal_Int32 nIndex = 0;
- if( rResourceURL.getToken( 0, '/', nIndex ) == "private:standardimage" )
+ OUString sImageName;
+ if( rResourceURL.startsWith("private:standardimage/", &sImageName) )
{
- OUString sImageName( rResourceURL.copy( nIndex ) );
if ( sImageName == "info" )
{
xRet = Graphic(GetStandardInfoBoxImage().GetBitmapEx()).GetXGraphic();
More information about the Libreoffice-commits
mailing list