cvs chaos
Ralf Habacker
ralf.habacker at freenet.de
Fri Feb 11 23:43:18 CET 2005
On Friday 11 February 2005 22:53, Ralf Habacker wrote:
> Hi all,
>
<snip>
> I decided to create a reverse patch, because deleting revisions could make
> things much more complicating as applying an additional patch.
>
> Unfortunally I was bound last week by an intranet projet working 12 hours a
> day, so I had not found any time to apply this patch. It will probably now
> happens this weekend.
>
While looking trough the patches I found out some which may be outdated. Can
anyone tell me if the following patch containing only debug messages is
required ?
Thanks
Ralf
===================================================================
RCS file: /c/temp/kde-cygwin/qt-3/src/kernel/qpainter.cpp,v
retrieving revision 1.1.1.13
retrieving revision 1.1.1.12
diff -u -3 -p -B -u -b -B -r1.1.1.13 -r1.1.1.12
--- src/kernel/qpainter.cpp 29 Jan 2005 11:13:04 -0000 1.1.1.13
+++ src/kernel/qpainter.cpp 15 Oct 2004 16:38:26 -0000 1.1.1.12
@@ -65,6 +65,8 @@ typedef QPtrStack<QWMatrix> QWMatrixStac
# undef truncate
#endif
+//#define QPAINTER_DEBUG
+
/*!
\class QPainter qpainter.h
\brief The QPainter class does low-level painting e.g. on widgets.
@@ -2875,7 +2877,13 @@ void qt_format_text( const QFont& font,
tabstops = fm.width('x')*8;
}
+#ifdef QPAINTER_DEBUG
+ qDebug ("qt_format_text: str=%s", str.latin1 ());
+#endif
if ( noaccel || showprefix ) {
+#ifdef QPAINTER_DEBUG
+ qDebug ("showPrefix on");
+#endif
if ( maxUnderlines > 32 )
underlinePositions = new int[maxUnderlines];
QChar *cout = (QChar*)text.unicode();
@@ -2898,6 +2906,9 @@ void qt_format_text( const QFont& font,
uint newlen = cout - text.unicode();
if ( newlen != text.length())
text.setLength( newlen );
+#ifdef QPAINTER_DEBUG
+ qDebug ("New text=%s", text.latin1 ());
+#endif
}
// no need to do extra work for underlines if we don't paint
@@ -2936,20 +2947,28 @@ void qt_format_text( const QFont& font,
int desc = fm.descent();
height = -leading;
- //qDebug("\n\nbeginLayout: lw = %d, rectwidth=%d", lineWidth , r.width());
+#ifdef QPAINTER_DEBUG
+ qDebug("\n\nbeginLayout: lw = %d, rectwidth=%d", lineWidth , r.width());
+#endif
while ( !textLayout.atEnd() ) {
height += leading;
textLayout.beginLine( lineWidth == INT_MAX ? lineWidth : lineWidth );
- //qDebug("-----beginLine( %d )-----", lineWidth );
+#ifdef QPAINTER_DEBUG
+ qDebug("-----beginLine( %d )-----", lineWidth );
+#endif
bool linesep = FALSE;
while ( 1 ) {
QTextItem ti = textLayout.currentItem();
- //qDebug("item: from=%d, ch=%x", ti.from(), text.unicode()
[ti.from()].unicode() );
+#ifdef QPAINTER_DEBUG
+ qDebug("item: from=%d, ch=%x", ti.from(), text.unicode()
[ti.from()].unicode() );
+#endif
if ( expandtabs && ti.isTab() ) {
int tw = 0;
int x = textLayout.widthUsed();
if ( tabarraylen ) {
-// qDebug("tabarraylen=%d", tabarraylen );
+#ifdef QPAINTER_DEBUG
+ qDebug("tabarraylen=%d", tabarraylen );
+#endif
int tab = 0;
while ( tab < tabarraylen ) {
if ( tabarray[tab] > x ) {
@@ -2961,7 +2980,9 @@ void qt_format_text( const QFont& font,
} else {
tw = tabstops - (x % tabstops);
}
- //qDebug("tw = %d", tw );
+#ifdef QPAINTER_DEBUG
+ qDebug("tw = %d", tw );
+#endif
if ( tw )
ti.setWidth( tw );
}
@@ -2976,7 +2997,9 @@ void qt_format_text( const QFont& font,
textLayout.setLineWidth( r.width()-rb-lb );
textLayout.endLine( 0, height, tf, &ascent, &descent,
&lineLeft, &lineRight );
- //qDebug("finalizing line: lw=%d ascent = %d, descent=%d lineleft=%d
lineright=%d", lineWidth, ascent, descent,lineLeft, lineRight );
+#ifdef QPAINTER_DEBUG
+ qDebug("finalizing line: lw=%d ascent = %d, descent=%d lineleft=%d
lineright=%d", lineWidth, ascent, descent,lineLeft, lineRight );
+#endif
left = QMIN( left, lineLeft );
right = QMAX( right, lineRight );
height += ascent + descent + 1;
@@ -2993,7 +3016,9 @@ void qt_format_text( const QFont& font,
if ( brect ) {
*brect = QRect( r.x() + left, r.y() + yoff, right-left + lb+rb, height );
- //qDebug("br = %d %d %d/%d, left=%d, right=%d", brect->x(), brect->y(),
brect->width(), brect->height(), left, right);
+#ifdef QPAINTER_DEBUG
+ qDebug("br = %d %d %d/%d, left=%d, right=%d", brect->x(), brect->y(),
brect->width(), brect->height(), left, right);
+#endif
}
if (!(tf & QPainter::DontPrint)) {
@@ -3029,15 +3054,22 @@ void qt_format_text( const QFont& font,
if (fnt.overline()) _tf |= Qt::Overline;
if (fnt.strikeOut()) _tf |= Qt::StrikeOut;
- //qDebug("have %d items",textLayout.numItems());
+#ifdef QPAINTER_DEBUG
+ qDebug("have %d items",textLayout.numItems());
+#endif
for ( int i = 0; i < textLayout.numItems(); i++ ) {
QTextItem ti = textLayout.itemAt( i );
- //qDebug("Item %d: from=%d, length=%d, space=%d x=%d", i, ti.from(),
ti.length(), ti.isSpace(), ti.x() );
+#ifdef QPAINTER_DEBUG
+ qDebug("Item %d: from=%d, length=%d, space=%d x=%d", i, ti.from(),
ti.length(), ti.isSpace(), ti.x() );
+#endif
if ( ti.isTab() || ti.isObject() )
continue;
int textFlags = _tf;
if ( !noaccel && numUnderlines > cUlChar && ti.from() ==
underlinePositions[cUlChar] ) {
textFlags |= Qt::Underline;
+#ifdef QPAINTER_DEBUG
+ qDebug ("adding underline");
+#endif
cUlChar++;
}
#if defined(Q_WS_X11) || defined(Q_WS_QWS)
@@ -3045,6 +3077,11 @@ void qt_format_text( const QFont& font,
qt_draw_background( painter, r.x()+lb + ti.x(), r.y() + yoff + ti.y() -
ti.ascent(),
ti.width(), ti.ascent() + ti.descent() + 1);
#endif
+#ifdef QPAINTER_DEBUG
+ qDebug ("r.x()=%d, lb = %d, ti.x()=%d ti.width()=%d", r.x(), lb,
ti.x(), ti.width ());
+ qDebug ("r.y()=%d, yoff = %d, ti.y()=%d ti.ascent()=%d", r.y(),
yoff, ti.y(), ti.ascent ());
+ qDebug ("textFlags = %d", textFlags);
+#endif
painter->drawTextItem( r.x()+lb, r.y() + yoff, ti, textFlags );
}
More information about the kde-cygwin
mailing list