summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate/libkate
Side-by-side diff
Diffstat (limited to 'noncore/apps/tinykate/libkate') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/document/katedocument.h2
-rw-r--r--noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp80
2 files changed, 44 insertions, 38 deletions
diff --git a/noncore/apps/tinykate/libkate/document/katedocument.h b/noncore/apps/tinykate/libkate/document/katedocument.h
index 9d8ec6a..969be87 100644
--- a/noncore/apps/tinykate/libkate/document/katedocument.h
+++ b/noncore/apps/tinykate/libkate/document/katedocument.h
@@ -73,13 +73,13 @@ public:
}
int width(QChar c) {
uchar cell=c.cell();
uchar row=c.row();
short *wa=warray[row];
if (!wa) {
- // qDebug("create row: %d",row);
+ // odebug << "create row: " << row << oendl;
wa=warray[row]=new short[256];
for (int i=0; i<256; i++) wa[i]=-1;
}
if (wa[cell]<0) wa[cell]=(short) QFontMetrics::width(c);
return (int)wa[cell];
}
diff --git a/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp b/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp
index a2c680f..78635b2 100644
--- a/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp
+++ b/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp
@@ -35,26 +35,32 @@
**
**********************************************************************/
#if QT_VERSION >=300
#error QRegExp3 is now in QT 3 use QRegExp instead
#endif
-#include "qarray.h"
-#include "qbitarray.h"
-#include "qcache.h"
-#include "qintdict.h"
-#include "qmap.h"
#if QT_VERSION < 300
#include "./qregexp3.h"
#else
#include "qregexp.h"
#endif
-#include "qstring.h"
-#include "qtl.h"
-#include "qvector.h"
+/* OPIE */
+#include <opie2/odebug.h>
+
+/* QT */
+#include <qarray.h>
+#include <qbitarray.h>
+#include <qcache.h>
+#include <qintdict.h>
+#include <qmap.h>
+#include <qstring.h>
+#include <qtl.h>
+#include <qvector.h>
+
+/* STD */
#include <limits.h>
/*
WARNING! Be sure to read qregexp.tex before modifying this file.
*/
@@ -1428,56 +1434,56 @@ void QRegExpEngine::heuristicallyChooseHeuristic()
#endif
#if defined(QT_DEBUG)
void QRegExpEngine::dump() const
{
int i, j;
- qDebug( "Case %ssensitive engine", cs ? "" : "in" );
- qDebug( " States" );
+ odebug << "Case " << (cs ? "" : "in") << "sensitive engine" << oendl;
+ odebug << " States" << oendl;
for ( i = 0; i < ns; i++ ) {
- qDebug( " %d%s", i,
- i == InitialState ? " (initial)" :
- i == FinalState ? " (final)" : "" );
+ odebug << " " << i
+ << (i == InitialState ? " (initial)" : i == FinalState ? " (final)" : "") << oendl;
+
#ifndef QT_NO_REGEXP_CAPTURE
- qDebug( " in atom %d", s[i]->atom );
+ odebug << " in atom " << s[i]->atom << oendl;
#endif
int m = s[i]->match;
if ( (m & CharClassBit) != 0 ) {
- qDebug( " match character class %d", m ^ CharClassBit );
+ odebug << " match character class " << (m ^ CharClassBit) << oendl;
#ifndef QT_NO_REGEXP_CCLASS
cl[m ^ CharClassBit]->dump();
#else
- qDebug( " negative character class" );
+ odebug << " negative character class" << oendl;
#endif
} else if ( (m & BackRefBit) != 0 ) {
- qDebug( " match back-reference %d", m ^ BackRefBit );
+ odebug << " match back-reference " << (m ^ BackRefBit) << oendl;
} else if ( m >= 0x20 && m <= 0x7e ) {
- qDebug( " match 0x%.4x (%c)", m, m );
+ odebug << " match " << QString().sprintf( "0x%.4x", m) << " (" << m << ")" << oendl;
+
} else {
- qDebug( " match 0x%.4x", m );
+ odebug << " match " << QString().sprintf( "0x%.4x", m) << oendl;
}
for ( j = 0; j < (int) s[i]->outs.size(); j++ ) {
int next = s[i]->outs[j];
- qDebug( " -> %d", next );
+ odebug << " -> " << next << oendl;
if ( s[i]->reenter != 0 && s[i]->reenter->contains(next) )
- qDebug( " [reenter %d]", (*s[i]->reenter)[next] );
+ odebug << " [reenter " << (*s[i]->reenter)[next] << "]" << oendl;
if ( s[i]->anchors != 0 && at(*s[i]->anchors, next) != 0 )
- qDebug( " [anchors 0x%.8x]", (*s[i]->anchors)[next] );
+ odebug << " [anchors " << QString().sprintf( "0x%.8x]", (*s[i]->anchors)[next] ) << oendl;
}
}
#ifndef QT_NO_REGEXP_CAPTURE
if ( nf > 0 ) {
- qDebug( " Atom Parent Capture" );
+ odebug << " Atom Parent Capture" << oendl;
for ( i = 0; i < nf; i++ )
- qDebug( " %6d %6d %6d", i, f[i].parent, f[i].capture );
+ odebug << QString().sprintf(" %6d %6d %6d", i, f[i].parent, f[i].capture ) << oendl;
}
#endif
#ifndef QT_NO_REGEXP_ANCHOR_ALT
for ( i = 0; i < (int) aa.size(); i++ )
- qDebug( " Anchor alternation 0x%.8x: 0x%.8x 0x%.9x", i, aa[i].a,
- aa[i].b );
+ odebug << QString().sprintf(" Anchor alternation 0x%.8x: 0x%.8x 0x%.9x", i, aa[i].a, aa[i].b ) << oendl;
#endif
}
#endif
void QRegExpEngine::setup( bool caseSensitive )
{
@@ -2193,19 +2199,19 @@ bool QRegExpEngine::CharClass::in( QChar ch ) const
}
#if defined(QT_DEBUG)
void QRegExpEngine::CharClass::dump() const
{
int i;
- qDebug( " %stive character class", n ? "nega" : "posi" );
+ odebug << " " << (n ? "nega" : "posi") << "tive character class" << oendl;
#ifndef QT_NO_REGEXP_CCLASS
if ( c != 0 )
- qDebug( " categories 0x%.8x", c );
+ odebug << QString().sprintf(" categories 0x%.8x", c ) << oendl;
#endif
for ( i = 0; i < (int) r.size(); i++ )
- qDebug( " 0x%.4x through 0x%.4x", r[i].from, r[i].to );
+ odebug << QString().sprintf(" 0x%.4x through 0x%.4x", r[i].from, r[i].to ) << oendl;
}
#endif
#endif
QRegExpEngine::Box::Box( QRegExpEngine *engine )
: eng( engine ), skipanchors( 0 )
@@ -2443,28 +2449,28 @@ void QRegExpEngine::Box::setupHeuristics()
#endif
#if defined(QT_DEBUG)
void QRegExpEngine::Box::dump() const
{
int i;
- qDebug( "Box of at least %d character%s", minl, minl == 1 ? "" : "s" );
- qDebug( " Left states:" );
+ odebug << "Box of at least " << minl << " character" << (minl == 1 ? "" : "s") << oendl;
+ odebug << " Left states:" << oendl;
for ( i = 0; i < (int) ls.size(); i++ ) {
if ( at(lanchors, ls[i]) == 0 )
- qDebug( " %d", ls[i] );
+ odebug << " " << ls[i] << oendl;
else
- qDebug( " %d [anchors 0x%.8x]", ls[i], lanchors[ls[i]] );
+ odebug << " " << ls[i] << QString().sprintf(" [anchors 0x%.8x]", lanchors[ls[i]]) << oendl;
}
- qDebug( " Right states:" );
+ odebug << " Right states:" << oendl;
for ( i = 0; i < (int) rs.size(); i++ ) {
if ( at(ranchors, ls[i]) == 0 )
- qDebug( " %d", rs[i] );
+ odebug << " " << rs[i] << oendl;
else
- qDebug( " %d [anchors 0x%.8x]", rs[i], ranchors[rs[i]] );
+ odebug << " " << rs[i] << QString().sprintf(" [anchors 0x%.8x]", ranchors[rs[i]]) << oendl;
}
- qDebug( " Skip anchors: 0x%.8x", skipanchors );
+ odebug << QString().sprintf(" Skip anchors: 0x%.8x", skipanchors) << oendl;
}
#endif
void QRegExpEngine::Box::addAnchorsToEngine( const Box& to ) const
{
for ( int i = 0; i < (int) to.ls.size(); i++ ) {