tdf#171853 use endsWith instead of lastIndexOf+getLength in comphelper
Change-Id: I8e18fab55e86d912673698b284ddc89b59342bef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204354 Reviewed-by: Neil Roberts <nroberts@libreoffice.org> Tested-by: Jenkins
This commit is contained in:
@@ -120,12 +120,8 @@ namespace comphelper {
|
||||
Reference< XStorable > xDocStorable( _rxDocument, UNO_QUERY_THROW );
|
||||
sDocURL = xDocStorable->getLocation();
|
||||
}
|
||||
sDocURL.endsWith(u"/", &sDocURL);
|
||||
sal_Int32 nLastSepPos = sDocURL.lastIndexOf( '/' );
|
||||
if ( ( nLastSepPos != -1 ) && ( nLastSepPos == sDocURL.getLength() - 1 ) )
|
||||
{
|
||||
sDocURL = sDocURL.copy( 0, nLastSepPos );
|
||||
nLastSepPos = sDocURL.lastIndexOf( '/' );
|
||||
}
|
||||
sTitle = sDocURL.copy( nLastSepPos + 1 );
|
||||
|
||||
if ( !sTitle.isEmpty() )
|
||||
|
||||
Reference in New Issue
Block a user