bool CMarkup::_ParseData(wchar_t*& pstrText, wchar_t*& pstrDest, char cEnd) { while( *pstrText != _T('\0') && *pstrText != cEnd ) { if( *pstrText == _T('&') ) { while( *pstrText == _T('&') ) { _ParseMetaChar(++pstrText, pstrDest); } if (*pstrText == cEnd) break; } if( *pstrText == _T(' ') ) { *pstrDest++ = *pstrText++; if( !m_bPreserveWhitespace ) _SkipWhitespace(pstrText); } else { wchar_t* pstrTemp = ::CharNextW(pstrText); while( pstrText < pstrTemp) { *pstrDest++ = *pstrText++; } } } // Make sure that MapAttributes() works correctly when it parses // over a value that has been transformed. wchar_t* pstrFill = pstrDest + 1; while( pstrFill < pstrText ) *pstrFill++ = _T(' '); return true; }
bool CMarkup::_ParseData(LPTSTR& pstrText, LPTSTR& pstrDest, char cEnd) { while( *pstrText != '\0' && *pstrText != cEnd ) { if( *pstrText == '&' ) { _ParseMetaChar(++pstrText, pstrDest); } if( *pstrText == ' ' ) { *pstrDest++ = *pstrText++; if( !m_bPreserveWhitespace ) _SkipWhitespace(pstrText); } else { *pstrDest++ = *pstrText++; #ifdef _MBCS if( ::IsDBCSLeadByte(*(pstrText - 1)) ) *pstrDest++ = *pstrText++; #endif // _MBCS } } // Make sure that MapAttributes() works correctly when it parses // over a value that has been transformed. LPTSTR pstrFill = pstrDest + 1; while( pstrFill < pstrText ) *pstrFill++ = ' '; return true; }