cui/source/options/optjava.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
New commits: commit a25105e6c003bb6eef454136bfdf0f46df45df79 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Mon Aug 26 22:12:52 2019 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Mon Aug 26 23:40:32 2019 +0200 Directly compare filesystem pathanmes in SvxJavaClassPathDlg::IsPathDuplicate ...instead of going back and forth between filesystem pathnames and file URLs Change-Id: I9afb00a48b4de907af31ebd571891dc6be0a0f49 Reviewed-on: https://gerrit.libreoffice.org/78158 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index 992403d27e94..1f718a9b5122 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -801,7 +801,7 @@ IMPL_LINK_NOARG(SvxJavaClassPathDlg, AddArchiveHdl_Impl, weld::Button&, void) OUString sURL = aDlg.GetPath(); INetURLObject aURL( sURL ); OUString sFile = aURL.getFSysPath( FSysStyle::Detect ); - if ( !IsPathDuplicate( sURL ) ) + if ( !IsPathDuplicate( sFile ) ) { m_xPathList->append("", sFile, SvFileInformationManager::GetImageId(aURL)); m_xPathList->select(m_xPathList->n_children() - 1); @@ -837,7 +837,7 @@ IMPL_LINK_NOARG(SvxJavaClassPathDlg, AddPathHdl_Impl, weld::Button&, void) OUString sFolderURL( xFolderPicker->getDirectory() ); INetURLObject aURL( sFolderURL ); OUString sNewFolder = aURL.getFSysPath( FSysStyle::Detect ); - if ( !IsPathDuplicate( sFolderURL ) ) + if ( !IsPathDuplicate( sNewFolder ) ) { m_xPathList->append("", sNewFolder, SvFileInformationManager::GetImageId(aURL)); m_xPathList->select(m_xPathList->n_children() - 1); @@ -880,12 +880,10 @@ IMPL_LINK_NOARG(SvxJavaClassPathDlg, SelectHdl_Impl, weld::TreeView&, void) bool SvxJavaClassPathDlg::IsPathDuplicate( const OUString& _rPath ) { bool bRet = false; - INetURLObject aFileObj( _rPath ); int nCount = m_xPathList->n_children(); for (int i = 0; i < nCount; ++i) { - INetURLObject aOtherObj(m_xPathList->get_text(i), FSysStyle::Detect); - if ( aOtherObj == aFileObj ) + if ( m_xPathList->get_text(i) == _rPath ) { bRet = true; break; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits