Kaydet (Commit) 63497d3a authored tarafından Matteo Casalin's avatar Matteo Casalin

Simplify: avoid OUString copy() and get just needed tokens

Change-Id: I708f222e408223cfaeaac56f87d68375f1d0503f
Reviewed-on: https://gerrit.libreoffice.org/69237
Tested-by: Jenkins
Reviewed-by: 's avatarMatteo Casalin <matteo.casalin@yahoo.com>
üst 83f1068f
......@@ -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 );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment