From dcce675e302501f30da75bf07bc17b18df45e809 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 git-svn-id: svn://10.0.0.236/trunk@64710 18797224-902f-48f8-a5cc-f745e15eee43 --- .../transformiix/source/xsl/expr/ExprParser.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/mozilla/extensions/transformiix/source/xsl/expr/ExprParser.cpp b/mozilla/extensions/transformiix/source/xsl/expr/ExprParser.cpp index a1f22bca2a0..bad4d2ea4e6 100644 --- a/mozilla/extensions/transformiix/source/xsl/expr/ExprParser.cpp +++ b/mozilla/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