From: <hep...@us...> - 2008-07-19 10:20:29
|
Revision: 517 http://qterm.svn.sourceforge.net/qterm/?rev=517&view=rev Author: hephooey Date: 2008-07-19 10:20:25 +0000 (Sat, 19 Jul 2008) Log Message: ----------- crash-- Modified Paths: -------------- trunk/qterm-qt4/src/qtermtextline.cpp Modified: trunk/qterm-qt4/src/qtermtextline.cpp =================================================================== --- trunk/qterm-qt4/src/qtermtextline.cpp 2008-07-19 10:18:49 UTC (rev 516) +++ trunk/qterm-qt4/src/qtermtextline.cpp 2008-07-19 10:20:25 UTC (rev 517) @@ -249,9 +249,10 @@ tempea = m_attr.at(i); // get str of the same attribute while ( tempcp == m_color.at(i) && - tempea == m_attr.at(i) && - i < m_length ) + tempea == m_attr.at(i) ) { i++; + if (i >= m_length) break; + } int fg = GETFG(tempcp)+30; int bg = GETBG(tempcp)+40; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hep...@us...> - 2009-02-23 17:57:04
|
Revision: 628 http://qterm.svn.sourceforge.net/qterm/?rev=628&view=rev Author: hephooey Date: 2009-02-23 17:57:00 +0000 (Mon, 23 Feb 2009) Log Message: ----------- Just in case we try to replace with an empty string. Modified Paths: -------------- trunk/qterm-qt4/src/qtermtextline.cpp Modified: trunk/qterm-qt4/src/qtermtextline.cpp =================================================================== --- trunk/qterm-qt4/src/qtermtextline.cpp 2009-02-23 17:56:55 UTC (rev 627) +++ trunk/qterm-qt4/src/qtermtextline.cpp 2009-02-23 17:57:00 UTC (rev 628) @@ -104,6 +104,9 @@ void TextLine::replaceText(const QString & str, short attribute, int index, int len) { // set attribute + if (str.isEmpty()) { // Return if the string is empty + return; + } if (attribute != -1) { m_curColor = GETCOLOR(attribute); if (m_curColor == '\0') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hep...@us...> - 2009-02-25 03:21:15
|
Revision: 639 http://qterm.svn.sourceforge.net/qterm/?rev=639&view=rev Author: hephooey Date: 2009-02-25 03:21:05 +0000 (Wed, 25 Feb 2009) Log Message: ----------- use "len" everywhere Modified Paths: -------------- trunk/qterm-qt4/src/qtermtextline.cpp Modified: trunk/qterm-qt4/src/qtermtextline.cpp =================================================================== --- trunk/qterm-qt4/src/qtermtextline.cpp 2009-02-25 03:20:42 UTC (rev 638) +++ trunk/qterm-qt4/src/qtermtextline.cpp 2009-02-25 03:21:05 UTC (rev 639) @@ -144,12 +144,12 @@ tmp.fill(NO_COLOR, index + len - m_length); m_color.append(tmp); - tmp.fill(m_curColor, newlen); + tmp.fill(m_curColor, len); m_color.replace(index, len, tmp); tmp.fill(NO_ATTR, index + len - m_length); m_attr.append(tmp); - tmp.fill(m_curAttr, newlen); + tmp.fill(m_curAttr, len); m_attr.replace(index, len, tmp); m_length = m_text.length(); @@ -164,9 +164,9 @@ m_length = m_text.length(); - tmp.fill(m_curColor, newlen); + tmp.fill(m_curColor, len); m_color.replace(index, len, tmp); - tmp.fill(m_curAttr, newlen); + tmp.fill(m_curAttr, len); m_attr.replace(index, len, tmp); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hep...@us...> - 2009-03-01 23:31:38
|
Revision: 664 http://qterm.svn.sourceforge.net/qterm/?rev=664&view=rev Author: hephooey Date: 2009-03-01 23:31:31 +0000 (Sun, 01 Mar 2009) Log Message: ----------- Try to fix the page state bug: the page state function keep reporting current page state is 2 after a while. Turns out it is because the color state keeps increasing. Modified Paths: -------------- trunk/qterm-qt4/src/qtermtextline.cpp Modified: trunk/qterm-qt4/src/qtermtextline.cpp =================================================================== --- trunk/qterm-qt4/src/qtermtextline.cpp 2009-02-27 05:25:23 UTC (rev 663) +++ trunk/qterm-qt4/src/qtermtextline.cpp 2009-03-01 23:31:31 UTC (rev 664) @@ -136,7 +136,7 @@ if (len == -1) // replace with str len = newlen; - if (index + len >= m_length) { + if (index + len > m_length) { //qDebug() << "index: " << index << " len: " << len << " string: " << str; m_text.replace(index, len, str); @@ -154,20 +154,27 @@ m_length = m_text.length(); + //if ( m_color.length() != m_text.length()) { + // qDebug() << "=================================color length: " << m_color.length() << ", tmp: " << tmp.length() << ", old length: " << tmplen; + //} + } else { //qDebug() << "string : " << m_text.string() << " old length: " << m_text.length(); //qDebug() << "index: " << index << " len: " << len << " string: " << str; m_text.replace(index, len, str); //qDebug() << "new length: " << m_text.length() << "," << newlen; + int delta = m_length - m_text.length(); setChanged(index, qMax(m_length, m_text.length())); - m_length = m_text.length(); - tmp.fill(m_curColor, len); - m_color.replace(index, len, tmp); + m_color.replace(index, len + delta, tmp); + //if ( m_color.length() != m_text.length()) { + // qDebug() << "=======================color length: " << m_color.length() << ", tmp: " << tmp.length(); + //} tmp.fill(m_curAttr, len); - m_attr.replace(index, len, tmp); + m_attr.replace(index, len + delta, tmp); + m_length = m_text.length(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hep...@us...> - 2009-03-06 02:24:38
|
Revision: 679 http://qterm.svn.sourceforge.net/qterm/?rev=679&view=rev Author: hephooey Date: 2009-03-06 02:24:37 +0000 (Fri, 06 Mar 2009) Log Message: ----------- We can have front color 0 and background color 0 at the same time Modified Paths: -------------- trunk/qterm-qt4/src/qtermtextline.cpp Modified: trunk/qterm-qt4/src/qtermtextline.cpp =================================================================== --- trunk/qterm-qt4/src/qtermtextline.cpp 2009-03-06 02:24:30 UTC (rev 678) +++ trunk/qterm-qt4/src/qtermtextline.cpp 2009-03-06 02:24:37 UTC (rev 679) @@ -42,8 +42,6 @@ // set attribute if (attribute != -1) { m_curColor = GETCOLOR(attribute); - if (m_curColor == '\0') - m_curColor = NO_COLOR; m_curAttr = GETATTR(attribute); if (m_curAttr == '\0') m_curAttr = NO_ATTR; @@ -109,8 +107,6 @@ } if (attribute != -1) { m_curColor = GETCOLOR(attribute); - if (m_curColor == '\0') - m_curColor = NO_COLOR; m_curAttr = GETATTR(attribute); if (m_curAttr == '\0') m_curAttr = NO_ATTR; @@ -366,8 +362,6 @@ void TextLine::setAttr(short attr, int index) { char tmpColor = GETCOLOR(attr); - if (tmpColor == '\0') - tmpColor = NO_COLOR; char tmpAttr = GETATTR(attr); if (tmpAttr == '\0') tmpAttr = NO_ATTR; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hep...@us...> - 2009-03-28 15:37:52
|
Revision: 687 http://qterm.svn.sourceforge.net/qterm/?rev=687&view=rev Author: hephooey Date: 2009-03-28 15:37:41 +0000 (Sat, 28 Mar 2009) Log Message: ----------- Crash -- Modified Paths: -------------- trunk/qterm-qt4/src/qtermtextline.cpp Modified: trunk/qterm-qt4/src/qtermtextline.cpp =================================================================== --- trunk/qterm-qt4/src/qtermtextline.cpp 2009-03-28 15:37:34 UTC (rev 686) +++ trunk/qterm-qt4/src/qtermtextline.cpp 2009-03-28 15:37:41 UTC (rev 687) @@ -205,7 +205,7 @@ // if len == -1, get the rest from index QString TextLine::getText(int index, int len) { - if (m_text.isEmpty()) { + if (m_text.isEmpty()||len == 0) { return QString(); } QString str; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <go...@us...> - 2010-11-04 13:18:26
|
Revision: 1256 http://qterm.svn.sourceforge.net/qterm/?rev=1256&view=rev Author: gonwan Date: 2010-11-04 13:18:19 +0000 (Thu, 04 Nov 2010) Log Message: ----------- Fix potential bug which can cause inconsistent data. Modified Paths: -------------- trunk/qterm-qt4/src/qtermtextline.cpp Modified: trunk/qterm-qt4/src/qtermtextline.cpp =================================================================== --- trunk/qterm-qt4/src/qtermtextline.cpp 2010-10-05 09:27:18 UTC (rev 1255) +++ trunk/qterm-qt4/src/qtermtextline.cpp 2010-11-04 13:18:19 UTC (rev 1256) @@ -73,19 +73,19 @@ tmp.fill(NO_COLOR, index - m_length); m_color.append(tmp); tmp.fill(m_curColor, len); - m_color.insert(index, tmp.data()); + m_color.insert(index, tmp); tmp.fill(NO_ATTR, index - m_length); m_attr.append(tmp); tmp.fill(m_curAttr, len); - m_attr.insert(index, tmp.data()); + m_attr.insert(index, tmp); } else { m_text.insert(index, str); m_length = m_text.length(); tmp.fill(m_curColor, len); - m_color.insert(index, tmp.data()); + m_color.insert(index, tmp); tmp.fill(m_curAttr, len); - m_attr.insert(index, tmp.data()); + m_attr.insert(index, tmp); } start = index; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |