From 9492c6f5041a1995bb8258b23ec7fee098854b28 Mon Sep 17 00:00:00 2001 From: "kvisco%ziplink.net" Date: Fri, 31 Mar 2000 07:08:44 +0000 Subject: [PATCH] changed the AttributeValueTemplate parsing to be unicode safe --- .../transformiix/source/xsl/expr/ExprParser.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/extensions/transformiix/source/xsl/expr/ExprParser.cpp b/extensions/transformiix/source/xsl/expr/ExprParser.cpp index fab2f16d20b2..04200cb1efc7 100644 --- a/extensions/transformiix/source/xsl/expr/ExprParser.cpp +++ b/extensions/transformiix/source/xsl/expr/ExprParser.cpp @@ -24,7 +24,7 @@ * -- fixed a bug in CreateExpr (@xxx=/yyy was parsed as * @xxx=@xxx/yyy) * - * $Id: ExprParser.cpp,v 1.5 2000/03/29 08:56:07 kvisco%ziplink.net Exp $ + * $Id: ExprParser.cpp,v 1.6 2000/03/31 07:08:44 kvisco%ziplink.net Exp $ */ /** @@ -32,7 +32,7 @@ * This class is used to parse XSL Expressions * @author Keith Visco * @see ExprLexer - * @version $Revision: 1.5 $ $Date: 2000/03/29 08:56:07 $ + * @version $Revision: 1.6 $ $Date: 2000/03/31 07:08:44 $ **/ #include "ExprParser.h" @@ -59,8 +59,6 @@ AttributeValueTemplate* ExprParser::createAttributeValueTemplate AttributeValueTemplate* avt = new AttributeValueTemplate(); Int32 size = attValue.length(); - char* chars = new char[size+1]; - attValue.toChar(chars); int cc = 0; String buffer; MBool inExpr = MB_FALSE; @@ -69,7 +67,7 @@ AttributeValueTemplate* ExprParser::createAttributeValueTemplate char prevCh = '\0'; while ( cc < size) { - char ch = chars[cc++]; + UNICODE_CHAR ch = attValue.charAt(cc++); // if in literal just add ch to buffer if ( inLiteral && (ch != endLiteral) ) { buffer.append(ch); @@ -134,10 +132,6 @@ AttributeValueTemplate* ExprParser::createAttributeValueTemplate } else avt->addExpr(new StringExpr(buffer)); } - - //-- cleanup - delete chars; - return avt; } //-- createAttributeValueTemplate