diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2019-02-27 08:08:53 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2019-04-06 23:43:41 +0200 |
commit | 63497d3a60dfb045cafd6db9ce89c4bff0dc8507 (patch) | |
tree | 05ddbb35c2bbf262c24633f6dec4e8a88cce8f34 /framework | |
parent | 83f1068ff62f644bc38e54211c48c87362276012 (diff) |
Simplify: avoid OUString copy() and get just needed tokens
Change-Id: I708f222e408223cfaeaac56f87d68375f1d0503f
Reviewed-on: https://gerrit.libreoffice.org/69237
Tested-by: Jenkins
Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/layoutmanager/helpers.cxx | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/framework/source/layoutmanager/helpers.cxx b/framework/source/layoutmanager/helpers.cxx index a5e4762f2e8b..7659be20cf04 100644 --- a/framework/source/layoutmanager/helpers.cxx +++ b/framework/source/layoutmanager/helpers.cxx @@ -197,11 +197,8 @@ OUString getElementTypeFromResourceURL( const OUString& aResourceURL ) OUString aUIResourceURL( UIRESOURCE_URL ); if ( aResourceURL.startsWith( aUIResourceURL ) ) { - sal_Int32 nIndex = 0; - OUString aPathPart = aResourceURL.copy( aUIResourceURL.getLength() ); - aPathPart.getToken( 0, '/', nIndex ); - - return aPathPart.getToken( 0, '/', nIndex ); + sal_Int32 nIndex{ aUIResourceURL.getLength() }; + return aResourceURL.getToken( 1, '/', nIndex ); } return OUString(); @@ -212,12 +209,9 @@ void parseResourceURL( const OUString& aResourceURL, OUString& aElementType, OUS OUString aUIResourceURL( UIRESOURCE_URL ); if ( aResourceURL.startsWith( aUIResourceURL ) ) { - sal_Int32 nIndex = 0; - OUString aPathPart = aResourceURL.copy( aUIResourceURL.getLength() ); - aPathPart.getToken( 0, '/', nIndex ); - - aElementType = aPathPart.getToken( 0, '/', nIndex ); - aElementName = aPathPart.getToken( 0, '/', nIndex ); + sal_Int32 nIndex{ aUIResourceURL.getLength() }; + aElementType = aResourceURL.getToken( 1, '/', nIndex ); + aElementName = aResourceURL.getToken( 0, '/', nIndex ); } } |