From 40035bbbbc4b81a285905fb26eeb5e68640ef508 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 7 Feb 2017 21:58:28 +0100 Subject: 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 --- extensions/source/logging/loggerconfig.cxx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'extensions') 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 ); } } -- cgit