Bug#43277: crash in coutputwidget when doing automake/autoconf

Roland Krause rokrau at yahoo.com
Sun Jun 2 23:52:05 UTC 2002


Harry,
please apply this patch first, I have a feeling it may fix the crash
problem for empty lines too.

Roland

--- Harald Fernengel <harry at kdevelop.org> wrote:
> Hi,
> 
> On Friday 31 May 2002 21:53, Kuba Ober wrote:
> > I consider the COutputWidget broken, because it passes unknown text
> > (generated by make / autoconf / whatever) to QMultiLineEdit, and
> > QMultiLineEdit may consider it rich text because of some funny
> characters
> > that go in there.
> 
> oops... that's right.
> 
> I attached a (pretty trivial) patch, if no one complains, I'll commit
> it 
> tomorrow.
> 
> Best regards,
> Harry> Index: coutputwidget.cpp
> ===================================================================
> RCS file: /home/kde/kdevelop/kdevelop/coutputwidget.cpp,v
> retrieving revision 1.3.2.4.2.10.2.17
> diff -u -3 -p -r1.3.2.4.2.10.2.17 coutputwidget.cpp
> --- coutputwidget.cpp 2002/05/19 20:34:08 1.3.2.4.2.10.2.17
> +++ coutputwidget.cpp 2002/06/02 13:25:19
> @@ -23,6 +23,7 @@
>  #include <qpainter.h>
>  #include <qpixmap.h>
>  #include <qfont.h>
> +#include <qstylesheet.h>
>  
>  COutputWidget::COutputWidget(QWidget* parent, const char* name) :
>  //  KEdit(parent,name)
> @@ -111,6 +112,10 @@ void CMakeOutputWidget::insertAtEnd(cons
>      int row = (numLines() < 1)? 0 : numLines()-1;
>      int col = qstrlen(textLine(row));
>      bool displayAdditions=atEnd();
> +    
> +    // escapes the string 
> +    line = QStyleSheet::convertFromPlainText( line );
> +
>      insertAt(line, row, col);
>      if (displayAdditions)
>        setCursorPosition(numLines()+1,0);
> @@ -121,6 +126,9 @@ void CMakeOutputWidget::insertAtEnd(cons
>      getCursorPosition(&currentPara, &index);
>      int paraCount = paragraphs()-1;
>      bool displayAdditions = (paraCount == currentPara);
> +
> +    // escape rich edit tags like "&", "<", ">"
> +    line = QStyleSheet::escape( line );
>  
>      switch (lineType(paraCount))
>      {
> 

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com




More information about the KDevelop-devel mailing list