diff options
author | Carsten Driesner <cd@openoffice.org> | 2010-07-27 18:11:00 +0200 |
---|---|---|
committer | Carsten Driesner <cd@openoffice.org> | 2010-07-27 18:11:00 +0200 |
commit | 64910a778a9a37dee885fca38af04205367bae9f (patch) | |
tree | eb56d0da8b4b35f6a782b170db67ae5deec55e1b /unotools/source/config/configpathes.cxx | |
parent | a1e6cecc361c2f6e26ee6738231184022f6b18dd (diff) |
fwk151: Fixed problems that configuration changes notifications were not correctly sent/processed
Diffstat (limited to 'unotools/source/config/configpathes.cxx')
-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; } |