diff options
Diffstat (limited to 'cui/source/options/optjava.cxx')
-rw-r--r-- | cui/source/options/optjava.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index c1528138f326..631d085c3bfb 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -944,13 +944,30 @@ void SvxJavaClassPathDlg::SetClassPath( const OUString& _rPath ) sal_Int32 nIdx = 0; do { - OUString sToken = _rPath.getToken( 0, CLASSPATH_DELIMITER, nIdx ); + sal_Int32 nextColon = _rPath.indexOf(CLASSPATH_DELIMITER, nIdx); + OUString sToken( + _rPath.subView(nIdx, nextColon > 0 ? nextColon - nIdx : _rPath.getLength() - nIdx)); + + // Detect open bootstrap variables - they might contain colons - we need to skip those. + sal_Int32 nBootstrapVarStart = sToken.indexOf("${"); + if (nBootstrapVarStart >= 0) + { + sal_Int32 nBootstrapVarEnd = sToken.indexOf("}"); + if (nBootstrapVarEnd == -1) + { + // Current colon is part of bootstrap variable - skip it! + nextColon = _rPath.indexOf(CLASSPATH_DELIMITER, nextColon + 1); + sToken = _rPath.subView(nIdx, nextColon > 0 ? nextColon - nIdx + : _rPath.getLength() - nIdx); + } + } OUString sURL; osl::FileBase::getFileURLFromSystemPath(sToken, sURL); // best effort INetURLObject aURL( sURL ); m_xPathList->append("", sToken, SvFileInformationManager::GetImageId(aURL)); + nIdx = nextColon + 1; } - while (nIdx>=0); + while (nIdx > 0); // select first entry m_xPathList->select(0); } |