From: <go...@us...> - 2010-11-04 14:05:25
|
Revision: 1258 http://qterm.svn.sourceforge.net/qterm/?rev=1258&view=rev Author: gonwan Date: 2010-11-04 14:05:19 +0000 (Thu, 04 Nov 2010) Log Message: ----------- Fix copy function to return correct ANSI string. The fix only gives the basic fix. ANSI string is not compressed and one-char-two-color is not supported. Modified Paths: -------------- trunk/qterm-qt4/src/qtermtextline.cpp Modified: trunk/qterm-qt4/src/qtermtextline.cpp =================================================================== --- trunk/qterm-qt4/src/qtermtextline.cpp 2010-11-04 13:55:46 UTC (rev 1257) +++ trunk/qterm-qt4/src/qtermtextline.cpp 2010-11-04 14:05:19 UTC (rev 1258) @@ -231,7 +231,7 @@ if (index >= m_length) - return (char *)NULL; + return QString(); //qDebug("index=%d len=%d m_length=%d", index, len, m_length); @@ -248,9 +248,7 @@ int fg = GETFG(tempcp) + 30; int bg = GETBG(tempcp) + 40; - QString strAttr = QString("%1;%2").arg(fg).arg(bg).toLatin1();//QByteArray::setNum(fg)+';'+QByteArray::setNum(bg)+';'; -// cstrAttr.sprintf("%d;%d;", fg, bg ); - strAttr = escape + strAttr; + QString strAttr = escape; if (GETBOLD(tempea)) strAttr += "1;"; @@ -266,17 +264,15 @@ strAttr += "7;"; if (GETINVISIBLE(tempea)) strAttr += "8;"; - strAttr.remove(strAttr.length() - 1, 1); - strAttr += "m"; + strAttr += QString("%1;%2m").arg(fg).arg(bg); str += strAttr; // set attr + // the text str += getText(startx, i - startx); - // reset attr - strAttr = escape + "0m"; - str += strAttr; i--; } + str += escape + "m"; return str; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |