File: yudit-2.7.2.patch1.txt Emergency: medium Usage: patch -p0 < yudit-2.7.2.patch1.txt From: Gaspar Sinai <gsinai@yudit.org> Date: Tokyo 2002-12-14 This patch fixes the following bug: When you convert the line ending with the DOS/PS/UNIX button only seen portion of the text and the last line is converted. If you do not use this conversion feature, or all lines has been seen everything works fine. Workaround: before or after doing such a conversion, go to the beginning of the file and press page down till all the lines has been seen. *** yudit-2.7.2/stoolkit/SParagraph.cpp- Tue Dec 3 13:35:50 2002 --- yudit-2.7.2/stoolkit/SParagraph.cpp Sat Dec 14 17:53:17 2002 *************** *** 336,344 **** SParagraph::getChars() const { if (!expanded) { ! return SV_UCS4(ucs4Glyphs); } - SV_UCS4 ret; const SGlyph* g0 = 0; for (unsigned int i=0; i<size(); i++) --- 336,391 ---- SParagraph::getChars() const { + SV_UCS4 ret; if (!expanded) { ! unsigned int len = ucs4Glyphs.size(); ! ret = ucs4Glyphs; ! if (len >= 2 && ret[len-2] == SD_CD_CR && ret[len-1] == SD_CD_LF) ! { ! /* no change */ ! if (paraSep == SS_PS_CRLF) return SV_UCS4(ret); ! ret.truncate (len-2); ! } ! else if (len >= 1 && ret[len-1] == SD_CD_LF) ! { ! /* no change */ ! if (paraSep == SS_PS_LF) return SV_UCS4(ret); ! ret.truncate (len-1); ! } ! else if (len >= 1 && ret[len-1] == SD_CD_CR) ! { ! /* no change */ ! if (paraSep == SS_PS_CR) return SV_UCS4(ret); ! ret.truncate (len-1); ! } ! else if (len >= 1 && ret[len-1] == SD_CD_PS) ! { ! /* no change */ ! if (paraSep == SS_PS_PS) return SV_UCS4(ret); ! ret.truncate (len-1); ! } else { /* no eol */ ! return SV_UCS4(ret); ! } ! /* we are here because we need to append paraSep */ ! switch (paraSep) ! { ! case SS_PS_LF: ! ret.append (SD_CD_LF); ! break; ! case SS_PS_CR: ! ret.append (SD_CD_CR); ! break; ! case SS_PS_CRLF: ! ret.append (SD_CD_CR); ! ret.append (SD_CD_LF); ! break; ! case SS_PS_PS: ! ret.append (SD_CD_PS); ! break; ! default: ! return SV_UCS4(ret);; ! } ! return SV_UCS4(ret);; } const SGlyph* g0 = 0; for (unsigned int i=0; i<size(); i++)