diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index cc9af3e47090..f34fbc7ff80c 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -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 ) diff --git a/fpicker/source/win32/VistaFilePickerImpl.cxx b/fpicker/source/win32/VistaFilePickerImpl.cxx index b055c67bdeb2..feb054f38c46 100644 --- a/fpicker/source/win32/VistaFilePickerImpl.cxx +++ b/fpicker/source/win32/VistaFilePickerImpl.cxx @@ -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;