diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-02-07 21:58:28 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-02-08 10:14:20 +0100 |
commit | 40035bbbbc4b81a285905fb26eeb5e68640ef508 (patch) | |
tree | b0221f5f9424e70b22def02a08d62ea65a89e694 /extensions | |
parent | 55717b14e0482c085595069d124ac9dd0c4e69c5 (diff) |
Drop bogus check for escaped $
This apparently wanted to check whether the $ starting a potential pattern
occurrence was escaped by a preceding $. However:
* The check itself was broken, erratically looking into sPattern instead of
_inout_rFileURL for the $.
* The check was bogus, as it would have misinterpreted e.g. "$$$(loggername)".
* The resulting string is documented (in
officecfg/registry/schema/org/openoffice/Office/Logging.xcs) to be passed
through css.util.PathSubstitution. However, neither the PathSubstitution
service's documentation (in offapi/com/sun/star/util/PathSubstitution.idl) nor
its implementation (SubstitutePathVariables::impl_substituteVariable in
framework/source/services/substitutepathvars.cxx) appear to support esacping
$ with a preceding $. So it looks more reasonable to remove the check
completely here.
Change-Id: I445493d444904cd54f166adcbf870a918d1f9982
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/logging/loggerconfig.cxx | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/extensions/source/logging/loggerconfig.cxx b/extensions/source/logging/loggerconfig.cxx index 71f14c60ac9a..cdf6df55488e 100644 --- a/extensions/source/logging/loggerconfig.cxx +++ b/extensions/source/logging/loggerconfig.cxx @@ -145,13 +145,8 @@ namespace logging { OUString sPattern( aVariable.pVariablePattern, aVariable.nPatternLength, aVariable.eEncoding ); sal_Int32 nVariableIndex = _inout_rFileURL.indexOf( sPattern ); - if ( ( nVariableIndex == 0 ) - || ( ( nVariableIndex > 0 ) - && ( sPattern[ nVariableIndex - 1 ] != '$' ) - ) - ) + if (nVariableIndex >= 0) { - // found an (unescaped) variable _inout_rFileURL = _inout_rFileURL.replaceAt( nVariableIndex, sPattern.getLength(), aVariable.sVariableValue ); } } |