[yast-commit] r62880 - in /branches/SuSE-SLE-10-SP4-Branch/ncurses: VERSION package/yast2-ncurses.changes src/NCRichText.cc
Author: gs Date: Wed Nov 24 11:43:44 2010 New Revision: 62880 URL: http://svn.opensuse.org/viewcvs/yast?rev=62880&view=rev Log: Bugfix for RichText widget: show complete license text (bnc #655453), show DOS file format correctly Modified: branches/SuSE-SLE-10-SP4-Branch/ncurses/VERSION branches/SuSE-SLE-10-SP4-Branch/ncurses/package/yast2-ncurses.changes branches/SuSE-SLE-10-SP4-Branch/ncurses/src/NCRichText.cc Modified: branches/SuSE-SLE-10-SP4-Branch/ncurses/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP4-Branch/ncurses/VERSION?rev=62880&r1=62879&r2=62880&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP4-Branch/ncurses/VERSION (original) +++ branches/SuSE-SLE-10-SP4-Branch/ncurses/VERSION Wed Nov 24 11:43:44 2010 @@ -1 +1 @@ -2.13.70 +2.13.71 Modified: branches/SuSE-SLE-10-SP4-Branch/ncurses/package/yast2-ncurses.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP4-Branch/ncurses/package/yast2-ncurses.changes?rev=62880&r1=62879&r2=62880&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP4-Branch/ncurses/package/yast2-ncurses.changes (original) +++ branches/SuSE-SLE-10-SP4-Branch/ncurses/package/yast2-ncurses.changes Wed Nov 24 11:43:44 2010 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Nov 24 11:13:34 CET 2010 - gs@suse.de + +- Bugfix for RichText widget: show complete license text + (bnc #655453), show DOS file format correctly +- 2.13.71 + +------------------------------------------------------------------- Fri Nov 27 19:22:52 CET 2009 - ma@suse.de - Work around 32768 lines limit in ncurses table. (bnc #550733) Modified: branches/SuSE-SLE-10-SP4-Branch/ncurses/src/NCRichText.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP4-Branch/ncurses/src/NCRichText.cc?rev=62880&r1=62879&r2=62880&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP4-Branch/ncurses/src/NCRichText.cc (original) +++ branches/SuSE-SLE-10-SP4-Branch/ncurses/src/NCRichText.cc Wed Nov 24 11:43:44 2010 @@ -392,6 +392,9 @@ void NCRichText::PadPlainTXT( const wchar_t * osch, const unsigned olen ) { wstring wtxt( osch, olen ); + // resolve the entities even in PRE (#71718) + wtxt = filterEntities( wtxt ); + NCstring nctxt( wtxt ); NCtext ftext( nctxt ); @@ -404,12 +407,15 @@ const wchar_t * sch = wtxt.data(); while ( *sch ) { - myPad()->addwstr( sch, 1 ); // add one wide chararacter - cc += wcwidth(*sch); - - if ( *sch == L'\n' ) + if ( *sch != L'\r' ) // skip carriage return { - PadNL(); // add a new line + myPad()->addwstr( sch, 1 ); // add one wide chararacter + cc += wcwidth(*sch); + + if ( *sch == L'\n' ) + { + PadNL(); // add a new line + } } ++sch; } @@ -496,8 +502,11 @@ } else { - myPad()->addwstr( wch, 1 ); // add one wide chararacter - ++cc; + if ( *wch != L'\r' ) // skip carriage return + { + myPad()->addwstr( wch, 1 ); // add one wide chararacter + cc += wcwidth( *wch ); + } ++wch; } break; @@ -521,10 +530,7 @@ { SkipPreTXT( wch ); - // resolve the entities even in PRE (#71718) - wstring txt = filterEntities( wstring(swch, wch-swch) ); - - PadPlainTXT( txt.c_str (), textWidth( txt ) ); + PadPlainTXT( swch, wch - swch ); } break; } @@ -637,9 +643,12 @@ // // // METHOD NAME : NCRichText::textWidth -// METHOD TYPE : void +// METHOD TYPE : size_t // -// DESCRIPTION : +// DESCRIPTION : Get the number of columns needed to print a 'wstring'. +// Attention: only use textWidth() to calculate space, not +// for iterating through a text or to get the length of a text +// (real text length includes new lines). // size_t NCRichText::textWidth( wstring wstr ) { -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
gs@svn2.opensuse.org