tdf#171853 Use endsWith instead of checking lastIndexOf at string in fpicker
Change-Id: Idb8ffafa585bdb032ddb9c187b29eb5fb0a3f45d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209462 Reviewed-by: Neil Roberts <nroberts@libreoffice.org> Tested-by: Jenkins
This commit is contained in:
@@ -1065,8 +1065,8 @@ void RemoteFilesDialog::UpdateControls( const OUString& rURL )
|
||||
{
|
||||
//WebDAV folders path ends in '/', so strip it
|
||||
OUString aFolderName = rFolder.maURL;
|
||||
if( rFolder.mbIsFolder && ( ( aFolderName.lastIndexOf( '/' ) + 1 ) == aFolderName.getLength() ) )
|
||||
aFolderName = aFolderName.copy( 0, aFolderName.getLength() - 1 );
|
||||
if ( rFolder.mbIsFolder )
|
||||
aFolderName.endsWith('/', &aFolderName);
|
||||
|
||||
int nTitleStart = aFolderName.lastIndexOf( '/' );
|
||||
if( nTitleStart != -1 )
|
||||
|
||||
@@ -895,8 +895,7 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(Request& rRequest)
|
||||
if (m_sFilename.getLength())
|
||||
{
|
||||
OUString aFileURL(m_sDirectory);
|
||||
sal_Int32 nIndex = aFileURL.lastIndexOf('/');
|
||||
if (nIndex != aFileURL.getLength()-1)
|
||||
if (!aFileURL.endsWith('/'))
|
||||
aFileURL += "/";
|
||||
aFileURL += m_sFilename;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user