From: Leon W. <moo...@us...> - 2004-10-12 08:46:41
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5092 Modified Files: ArrayParser.cpp Log Message: Fix: All the instances of a tag on a line are replaced instead of only the first. Index: ArrayParser.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ArrayParser.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ArrayParser.cpp 8 May 2003 12:00:56 -0000 1.3 --- ArrayParser.cpp 12 Oct 2004 08:45:35 -0000 1.4 *************** *** 153,167 **** CString CArrayParser::HelpMeParse(LPCSTR shortStr,LPCSTR fullStr) { CString parseStr = shortStr; CString full = fullStr; ! int pos = full.Find(parseStr,0); ! if(pos == -1) ! return full; - CString repStr = GetValueForShort(parseStr); - CString leftStr = full.Left(pos); - CString rightStr = full.Right(full.GetLength()-pos-parseStr.GetLength()); - full = leftStr + repStr + rightStr; return full; } --- 153,168 ---- CString CArrayParser::HelpMeParse(LPCSTR shortStr,LPCSTR fullStr) { + int pos; CString parseStr = shortStr; CString full = fullStr; ! while( -1 != ( pos = full.Find(parseStr,0) ) ) ! { ! CString repStr = GetValueForShort(parseStr); ! CString leftStr = full.Left(pos); ! CString rightStr = full.Right(full.GetLength()-pos-parseStr.GetLength()); ! full = leftStr + repStr + rightStr; ! } return full; } |