diff options
author | Caolán McNamara <cmc@openoffice.org> | 2010-08-30 15:20:46 +0100 |
---|---|---|
committer | Caolán McNamara <cmc@openoffice.org> | 2010-08-30 15:20:46 +0100 |
commit | 970139fb34ad299bbafe13c30e86810e57af8969 (patch) | |
tree | d9a8207a5a482bccb00d56e833759c5f58830e0a /unotools/source | |
parent | b06645b8dc544d13a46edb2635a4c97e5a782f70 (diff) | |
parent | fa4b286294a272b085c2f74e12581edc2343fc18 (diff) |
cmcfixes78: merge with DEV300 m87
Diffstat (limited to 'unotools/source')
-rw-r--r-- | unotools/source/config/configpathes.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/unotools/source/config/configpathes.cxx b/unotools/source/config/configpathes.cxx index dc66854a8d43..5e7a4c80813e 100644 --- a/unotools/source/config/configpathes.cxx +++ b/unotools/source/config/configpathes.cxx @@ -154,7 +154,7 @@ sal_Bool splitLastFromConfigurationPath(OUString const& _sInPath, } //---------------------------------------------------------------------------- -OUString extractFirstFromConfigurationPath(OUString const& _sInPath) +OUString extractFirstFromConfigurationPath(OUString const& _sInPath, OUString* _sOutPath) { sal_Int32 nSep = _sInPath.indexOf('/'); sal_Int32 nBracket = _sInPath.indexOf('['); @@ -179,8 +179,7 @@ OUString extractFirstFromConfigurationPath(OUString const& _sInPath) nBracket = nEnd; } OSL_ENSURE(nEnd > nStart && _sInPath[nBracket] == ']', "Invalid config path: improper mismatch of quote or bracket"); - OSL_DEBUG_ONLY(nSep = nBracket+1); - OSL_ENSURE(nSep == _sInPath.getLength() || _sInPath[nSep] == '/', "Invalid config path: brackets not followed by slash"); + OSL_ENSURE((nBracket+1 == _sInPath.getLength() && nSep == -1) || (_sInPath[nBracket+1] == '/' && nSep == nBracket+1), "Invalid config path: brackets not followed by slash"); } else // ... but our initial element name is in simple form nStart = 0; @@ -188,6 +187,12 @@ OUString extractFirstFromConfigurationPath(OUString const& _sInPath) OUString sResult = (nEnd >= 0) ? _sInPath.copy(nStart, nEnd-nStart) : _sInPath; lcl_resolveCharEntities(sResult); + + if (_sOutPath != 0) + { + *_sOutPath = (nSep >= 0) ? _sInPath.copy(nSep + 1) : OUString(); + } + return sResult; } |