From 7d92e8553afa713d61c4fdd526f1efa532df4276 Mon Sep 17 00:00:00 2001 From: Jörg Barfurth Date: Fri, 6 Jul 2001 07:42:02 +0000 Subject: Fallback for case of failing to decode an encoded name --- officecfg/org/openoffice/configuration/Decoder.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'officecfg') diff --git a/officecfg/org/openoffice/configuration/Decoder.java b/officecfg/org/openoffice/configuration/Decoder.java index 649e69343db9..d153d1f8844d 100644 --- a/officecfg/org/openoffice/configuration/Decoder.java +++ b/officecfg/org/openoffice/configuration/Decoder.java @@ -2,9 +2,9 @@ * * $RCSfile: Decoder.java,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: dg $ $Date: 2001-07-05 11:51:31 $ + * last change: $Author: jb $ $Date: 2001-07-06 08:42:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -215,7 +215,7 @@ public class Decoder extends Object } // return null, if the string was invalid - public static String decode(String sSource) + public static String decodeValid(String sSource) { StringBuffer aTarget = new StringBuffer(); @@ -263,6 +263,14 @@ public class Decoder extends Object } } + // return the original value, if the string was invalid + public static String decode(String sSource) + { + String sResult = decodeValid(sSource); + + return sResult != null ? sResult : sSource; + } + public static void main(String args[]) { if (args.length != 1) -- cgit