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
|
//WebDAV folders path ends in '/', so strip it
|
||||||
OUString aFolderName = rFolder.maURL;
|
OUString aFolderName = rFolder.maURL;
|
||||||
if( rFolder.mbIsFolder && ( ( aFolderName.lastIndexOf( '/' ) + 1 ) == aFolderName.getLength() ) )
|
if ( rFolder.mbIsFolder )
|
||||||
aFolderName = aFolderName.copy( 0, aFolderName.getLength() - 1 );
|
aFolderName.endsWith('/', &aFolderName);
|
||||||
|
|
||||||
int nTitleStart = aFolderName.lastIndexOf( '/' );
|
int nTitleStart = aFolderName.lastIndexOf( '/' );
|
||||||
if( nTitleStart != -1 )
|
if( nTitleStart != -1 )
|
||||||
|
|||||||
@@ -895,8 +895,7 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(Request& rRequest)
|
|||||||
if (m_sFilename.getLength())
|
if (m_sFilename.getLength())
|
||||||
{
|
{
|
||||||
OUString aFileURL(m_sDirectory);
|
OUString aFileURL(m_sDirectory);
|
||||||
sal_Int32 nIndex = aFileURL.lastIndexOf('/');
|
if (!aFileURL.endsWith('/'))
|
||||||
if (nIndex != aFileURL.getLength()-1)
|
|
||||||
aFileURL += "/";
|
aFileURL += "/";
|
||||||
aFileURL += m_sFilename;
|
aFileURL += m_sFilename;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user