From: Takashi Sawanaka Date: Thu, 15 Aug 2019 00:13:55 +0000 (+0900) Subject: Improve UNICODE character support using icu.dll usable from Windows 10 Creators Updat... X-Git-Tag: 2.16.5~146^2~4 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=25871f80cf4fd572585979d0478e17fb3600077d;p=winmerge-jp%2Fwinmerge-jp.git Improve UNICODE character support using icu.dll usable from Windows 10 Creators Update (2) --HG-- branch : ICU --- diff --git a/Externals/crystaledit/editlib/ccrystaltextview.cpp b/Externals/crystaledit/editlib/ccrystaltextview.cpp index 0a782f052..dd278811f 100644 --- a/Externals/crystaledit/editlib/ccrystaltextview.cpp +++ b/Externals/crystaledit/editlib/ccrystaltextview.cpp @@ -919,8 +919,7 @@ ExpandChars (LPCTSTR pszChars, int nOffset, int nCount, CString & line, int nAct pszChars += nOffset; int nLength = nCount; - int i; - for (i = 0; i < nLength; i++) + for (int i = 0; i < nLength; i++) { TCHAR c = pszChars[i]; if (c == _T('\t')) @@ -937,8 +936,9 @@ ExpandChars (LPCTSTR pszChars, int nOffset, int nCount, CString & line, int nAct if (nCount > nLength || m_bViewTabs || m_bViewEols) { ICUBreakIterator iter(UBRK_CHARACTER, "en", reinterpret_cast(pszChars), nLength); - for (i = 0; i < nLength; i = iter.next()) + for (int i = 0, next = 0; i < nLength; i = next) { + next = iter.next(); if (pszChars[i] == _T('\t')) { int nSpaces = nTabSize - (nActualOffset + nCurPos) % nTabSize; @@ -988,18 +988,21 @@ ExpandChars (LPCTSTR pszChars, int nOffset, int nCount, CString & line, int nAct } else { - line += pszChars[i]; nCurPos += GetCharCellCountFromChar(pszChars[i]); + for (; i < next; ++i) + line += pszChars[i]; } } } else { ICUBreakIterator iter(UBRK_CHARACTER, "en", reinterpret_cast(pszChars), nLength); - for (int i1=0; i1 nWidths(nCount1 + 2); - for ( ; i < nCount1 + ibegin ; i = iter.next()) + int next = i; + for ( ; i < nCount1 + ibegin ; i = next) { + next = iter.next(); if (line[i] == '\t') // Escape sequence leadin? { // Substitute a space narrowed to half the width of a character cell.