summaryrefslogtreecommitdiffstats
path: root/lib/kotext/KoRichText.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kotext/KoRichText.cpp')
-rw-r--r--lib/kotext/KoRichText.cpp204
1 files changed, 105 insertions, 99 deletions
diff --git a/lib/kotext/KoRichText.cpp b/lib/kotext/KoRichText.cpp
index f8500ec9..dc6c6922 100644
--- a/lib/kotext/KoRichText.cpp
+++ b/lib/kotext/KoRichText.cpp
@@ -1,31 +1,31 @@
/****************************************************************************
-** Implementation of the internal Qt classes dealing with rich text
+** Implementation of the internal TQt classes dealing with rich text
**
** Created : 990101
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
-** This file is part of the kernel module of the Qt GUI Toolkit.
+** This file is part of the kernel module of the TQt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
+** LICENSE.TQPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
+** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition
+** licenses may use this file in accordance with the TQt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
+** information about TQt Commercial License Agreements.
+** See http://www.trolltech.com/qpl/ for TQPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
@@ -37,8 +37,8 @@
#include "KoTextFormat.h"
#include "KoTextParag.h"
-#include <qpaintdevicemetrics.h>
-#include "qdrawutil.h" // for KoTextHorizontalLine
+#include <tqpaintdevicemetrics.h>
+#include "tqdrawutil.h" // for KoTextHorizontalLine
#include <stdlib.h>
#include "KoParagCounter.h"
@@ -47,7 +47,7 @@
#include <kdeversion.h>
#include <kglobal.h>
#include <klocale.h>
-#include <private/qtextengine_p.h>
+#include <tqtextengine_p.h>
//#define DEBUG_COLLECTION
//#define DEBUG_TABLE_RENDERING
@@ -59,7 +59,7 @@
void KoTextDocCommandHistory::addCommand( KoTextDocCommand *cmd )
{
if ( current < (int)history.count() - 1 ) {
- QPtrList<KoTextDocCommand> commands;
+ TQPtrList<KoTextDocCommand> commands;
commands.setAutoDelete( FALSE );
for( int i = 0; i <= current; ++i ) {
@@ -119,7 +119,7 @@ bool KoTextDocCommandHistory::isRedoAvailable()
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-KoTextDocDeleteCommand::KoTextDocDeleteCommand( KoTextDocument *d, int i, int idx, const QMemArray<KoTextStringChar> &str )
+KoTextDocDeleteCommand::KoTextDocDeleteCommand( KoTextDocument *d, int i, int idx, const TQMemArray<KoTextStringChar> &str )
: KoTextDocCommand( d ), id( i ), index( idx ), parag( 0 ), text( str )
{
for ( int j = 0; j < (int)text.size(); ++j ) {
@@ -128,7 +128,7 @@ KoTextDocDeleteCommand::KoTextDocDeleteCommand( KoTextDocument *d, int i, int id
}
}
-/*KoTextDocDeleteCommand::KoTextDocDeleteCommand( KoTextParag *p, int idx, const QMemArray<KoTextStringChar> &str )
+/*KoTextDocDeleteCommand::KoTextDocDeleteCommand( KoTextParag *p, int idx, const TQMemArray<KoTextStringChar> &str )
: KoTextDocCommand( 0 ), id( -1 ), index( idx ), parag( p ), text( str )
{
for ( int i = 0; i < (int)text.size(); ++i ) {
@@ -186,7 +186,7 @@ KoTextCursor *KoTextDocDeleteCommand::unexecute( KoTextCursor *c )
cursor.setParag( s );
cursor.setIndex( index );
- QString str = KoTextString::toString( text );
+ TQString str = KoTextString::toString( text );
cursor.insert( str, TRUE, &text );
cursor.setParag( s );
cursor.setIndex( index );
@@ -210,7 +210,7 @@ KoTextCursor *KoTextDocDeleteCommand::unexecute( KoTextCursor *c )
}
KoTextDocFormatCommand::KoTextDocFormatCommand( KoTextDocument *d, int sid, int sidx, int eid, int eidx,
- const QMemArray<KoTextStringChar> &old, const KoTextFormat *f, int fl )
+ const TQMemArray<KoTextStringChar> &old, const KoTextFormat *f, int fl )
: KoTextDocCommand( d ), startId( sid ), startIndex( sidx ), endId( eid ), endIndex( eidx ), oldFormats( old ), flags( fl )
{
format = d->formatCollection()->format( f );
@@ -247,7 +247,7 @@ KoTextCursor *KoTextDocFormatCommand::execute( KoTextCursor *c )
doc->setSelectionEnd( KoTextDocument::Temp, &end );
doc->setFormat( KoTextDocument::Temp, format, flags );
doc->removeSelection( KoTextDocument::Temp );
- if ( endIndex == ep->length() ) // ### Not in QRT - report sent. Description at http://bugs.kde.org/db/34/34556.html
+ if ( endIndex == ep->length() ) // ### Not in TQRT - report sent. Description at http://bugs.kde.org/db/34/34556.html
end.gotoLeft();
*c = end;
return c;
@@ -262,7 +262,7 @@ KoTextCursor *KoTextDocFormatCommand::unexecute( KoTextCursor *c )
int idx = startIndex;
int fIndex = 0;
- if( !oldFormats.isEmpty()) // ## not in QRT. Not sure how it can happen.
+ if( !oldFormats.isEmpty()) // ## not in TQRT. Not sure how it can happen.
{
for ( ;; ) {
if ( oldFormats.at( fIndex ).c == '\n' ) {
@@ -299,7 +299,7 @@ KoTextCursor *KoTextDocFormatCommand::unexecute( KoTextCursor *c )
return c;
}
-KoTextAlignmentCommand::KoTextAlignmentCommand( KoTextDocument *d, int fParag, int lParag, int na, const QMemArray<int> &oa )
+KoTextAlignmentCommand::KoTextAlignmentCommand( KoTextDocument *d, int fParag, int lParag, int na, const TQMemArray<int> &oa )
: KoTextDocCommand( d ), firstParag( fParag ), lastParag( lParag ), newAlign( na ), oldAligns( oa )
{
}
@@ -310,7 +310,7 @@ KoTextCursor *KoTextAlignmentCommand::execute( KoTextCursor *c )
if ( !p )
return c;
while ( p ) {
- p->setAlignment( newAlign );
+ p->tqsetAlignment( newAlign );
if ( p->paragId() == lastParag )
break;
p = p->next();
@@ -326,7 +326,7 @@ KoTextCursor *KoTextAlignmentCommand::unexecute( KoTextCursor *c )
int i = 0;
while ( p ) {
if ( i < (int)oldAligns.size() )
- p->setAlignment( oldAligns.at( i ) );
+ p->tqsetAlignment( oldAligns.at( i ) );
if ( p->paragId() == lastParag )
break;
p = p->next();
@@ -373,18 +373,18 @@ bool KoTextCursor::operator==( const KoTextCursor &c ) const
return doc == c.doc && string == c.string && idx == c.idx;
}
-void KoTextCursor::insert( const QString &str, bool checkNewLine, QMemArray<KoTextStringChar> *formatting )
+void KoTextCursor::insert( const TQString &str, bool checkNewLine, TQMemArray<KoTextStringChar> *formatting )
{
- string->invalidate( idx );
+ string->tqinvalidate( idx );
tmpIndex = -1;
bool justInsert = TRUE;
- QString s( str );
-#if defined(Q_WS_WIN)
+ TQString s( str );
+#if defined(TQ_WS_WIN)
if ( checkNewLine )
- s = s.replace( QRegExp( "\\r" ), "" );
+ s = s.tqreplace( TQRegExp( "\\r" ), "" );
#endif
if ( checkNewLine )
- justInsert = s.find( '\n' ) == -1;
+ justInsert = s.tqfind( '\n' ) == -1;
if ( justInsert ) {
string->insert( idx, s );
if ( formatting ) {
@@ -397,8 +397,8 @@ void KoTextCursor::insert( const QString &str, bool checkNewLine, QMemArray<KoTe
}
idx += s.length();
} else {
- QStringList lst = QStringList::split( '\n', s, TRUE );
- QStringList::Iterator it = lst.begin();
+ TQStringList lst = TQStringList::split( '\n', s, TRUE );
+ TQStringList::Iterator it = lst.begin();
//int y = string->rect().y() + string->rect().height();
int lastIndex = 0;
KoTextFormat *lastFormat = 0;
@@ -415,12 +415,12 @@ void KoTextCursor::insert( const QString &str, bool checkNewLine, QMemArray<KoTe
}
}
lastFormat = 0;
- QString s = *it;
+ TQString s = *it;
++it;
if ( !s.isEmpty() )
string->insert( idx, s );
else
- string->invalidate( 0 );
+ string->tqinvalidate( 0 );
if ( formatting ) {
int len = s.length();
@@ -448,7 +448,7 @@ void KoTextCursor::insert( const QString &str, bool checkNewLine, QMemArray<KoTe
while ( p ) {
p->setParagId( p->prev()->paragId() + 1 );
//p->move( dy );
- p->invalidate( 0 );
+ p->tqinvalidate( 0 );
p = p->next();
}
}
@@ -482,17 +482,17 @@ void KoTextCursor::gotoPreviousLetter()
}
}
-bool KoTextCursor::place( const QPoint &p, KoTextParag *s, bool link, int *customItemIndex )
+bool KoTextCursor::place( const TQPoint &p, KoTextParag *s, bool link, int *customItemIndex )
{
if ( customItemIndex )
*customItemIndex = -1;
- QPoint pos( p );
- QRect r;
+ TQPoint pos( p );
+ TQRect r;
if ( pos.y() < s->rect().y() )
pos.setY( s->rect().y() );
while ( s ) {
r = s->rect();
- r.setWidth( doc ? doc->width() : QWIDGETSIZE_MAX );
+ r.setWidth( doc ? doc->width() : TQWIDGETSIZE_MAX );
if ( !s->next() || ( pos.y() >= r.y() && pos.y() < s->next()->rect().y() ) )
break;
s = s->next();
@@ -545,8 +545,8 @@ bool KoTextCursor::place( const QPoint &p, KoTextParag *s, bool link, int *custo
cpos += cw;
int d = cpos - pos.x();
bool dm = d < 0 ? !chr->rightToLeft : chr->rightToLeft;
- if ( (QABS( d ) < dist || (dist == d && dm == TRUE )) && string->string()->validCursorPosition( i ) ) {
- dist = QABS( d );
+ if ( (TQABS( d ) < dist || (dist == d && dm == TRUE )) && string->string()->validCursorPosition( i ) ) {
+ dist = TQABS( d );
if ( !link || pos.x() >= x + chr->x ) {
curpos = i;
}
@@ -589,7 +589,7 @@ void KoTextCursor::gotoUp()
if ( !c )
return;
- tmpIndex = QMAX( tmpIndex, idx - indexOfLineStart );
+ tmpIndex = TQMAX( tmpIndex, idx - indexOfLineStart );
if ( indexOfLineStart == 0 ) {
if ( !string->prev() ) {
return;
@@ -625,7 +625,7 @@ void KoTextCursor::gotoDown()
if ( !c )
return;
- tmpIndex = QMAX( tmpIndex, idx - indexOfLineStart );
+ tmpIndex = TQMAX( tmpIndex, idx - indexOfLineStart );
if ( line == string->lines() - 1 ) {
if ( !string->next() ) {
return;
@@ -887,7 +887,7 @@ void KoTextCursor::splitAndInsertEmptyParag( bool ind, bool updateIds )
string->format();
}
} else {
- QString str = string->string()->toString().mid( idx, 0xFFFFFF );
+ TQString str = string->string()->toString().mid( idx, 0xFFFFFF );
KoTextParag *n = string->next();
KoTextParag *s = doc->createParag( doc, string, n, updateIds );
s->copyParagData( string );
@@ -933,13 +933,13 @@ bool KoTextCursor::removePreviousChar()
// shouldn't be needed, just to make sure.
fixCursorPosition();
string->format( -1, TRUE );
- //else if ( string->document() && string->document()->parent() )
+ //else if ( string->document() && string->document()->tqparent() )
// string->document()->nextDoubleBuffered = TRUE;
return FALSE;
} else if ( string->prev() ) {
string = string->prev();
string->join( string->next() );
- string->invalidateCounters();
+ string->tqinvalidateCounters();
return TRUE;
}
return FALSE;
@@ -952,7 +952,7 @@ bool KoTextCursor::remove()
int next = string->string()->nextCursorPosition( idx );
string->remove( idx, next-idx );
string->format( -1, TRUE );
- //else if ( doc && doc->parent() )
+ //else if ( doc && doc->tqparent() )
// doc->nextDoubleBuffered = TRUE;
return FALSE;
} else if ( string->next() ) {
@@ -963,9 +963,9 @@ bool KoTextCursor::remove()
KoTextParag *p = string->next();
delete string;
string = p;
- string->invalidate( 0 );
+ string->tqinvalidate( 0 );
//// kotext
- string->invalidateCounters();
+ string->tqinvalidateCounters();
////
KoTextParag *s = string;
while ( s ) {
@@ -990,7 +990,7 @@ void KoTextCursor::killLine()
return;
string->remove( idx, string->length() - idx - 1 );
string->format( -1, TRUE );
- //else if ( doc && doc->parent() )
+ //else if ( doc && doc->tqparent() )
//doc->nextDoubleBuffered = TRUE;
}
@@ -1044,7 +1044,7 @@ void KoTextCursor::fixCursorPosition()
int lineIdx;
KoTextStringChar *start = string->lineStartOfChar( idx, &lineIdx, 0 );
int x = string->string()->at( idx ).x;
- int diff = QABS(start->x - x);
+ int diff = TQABS(start->x - x);
int best = lineIdx;
KoTextStringChar *c = start;
@@ -1055,7 +1055,7 @@ void KoTextCursor::fixCursorPosition()
int xp = c->x;
if ( c->rightToLeft )
xp += c->pixelwidth; //string->string()->width( lineIdx + (c-start) );
- int ndiff = QABS(xp - x);
+ int ndiff = TQABS(xp - x);
if ( ndiff < diff && string->string()->validCursorPosition(lineIdx + (c-start)) ) {
diff = ndiff;
best = lineIdx + (c-start);
@@ -1073,7 +1073,7 @@ KoTextString::KoTextString()
bNeedsSpellCheck = true;
bidi = FALSE;
rightToLeft = FALSE;
- dir = QChar::DirON;
+ dir = TQChar::DirON;
}
KoTextString::KoTextString( const KoTextString &s )
@@ -1092,7 +1092,7 @@ KoTextString::KoTextString( const KoTextString &s )
}
}
-void KoTextString::insert( int index, const QString &s, KoTextFormat *f )
+void KoTextString::insert( int index, const TQString &s, KoTextFormat *f )
{
int os = data.size();
data.resize( data.size() + s.length() );
@@ -1151,8 +1151,8 @@ void KoTextString::insert( int index, KoTextStringChar *c )
void KoTextString::truncate( int index )
{
- index = QMAX( index, 0 );
- index = QMIN( index, (int)data.size() - 1 );
+ index = TQMAX( index, 0 );
+ index = TQMIN( index, (int)data.size() - 1 );
if ( index < (int)data.size() ) {
for ( int i = index + 1; i < (int)data.size(); ++i ) {
KoTextStringChar &ch = data[ i ];
@@ -1188,7 +1188,7 @@ void KoTextString::remove( int index, int len )
}
memmove( data.data() + index, data.data() + index + len,
sizeof( KoTextStringChar ) * ( data.size() - index - len ) );
- data.resize( data.size() - len, QGArray::SpeedOptim );
+ data.resize( data.size() - len, TQGArray::SpeedOptim );
bidiDirty = TRUE;
bNeedsSpellCheck = true;
}
@@ -1236,19 +1236,24 @@ void KoTextString::checkBidi() const
int length = data.size();
if ( !length ) {
that->bidi = FALSE;
- that->rightToLeft = dir == QChar::DirR;
+ that->rightToLeft = dir == TQChar::DirR;
return;
}
const KoTextStringChar *start = data.data();
const KoTextStringChar *end = start + length;
- // determines the properties we need for layouting
- QTextEngine textEngine( toString(), 0 );
- textEngine.direction = (QChar::Direction) dir;
- textEngine.itemize(QTextEngine::SingleLine);
- const QCharAttributes *ca = textEngine.attributes() + length-1;
+ // determines the properties we need for tqlayouting
+#ifdef USE_QT4
+ #warning "KoTextString::checkBidi() for Qt4 partially implemented"
+ printf("[WARNING] KoTextString::checkBidi() partially implemented\n\r");
+ fflush(stdout);
+#else
+ TQTextEngine textEngine( toString(), 0 );
+ textEngine.direction = (TQChar::Direction) dir;
+ textEngine.itemize(TQTextEngine::SingleLine);
+ const TQCharAttributes *ca = textEngine.attributes() + length-1;
KoTextStringChar *ch = (KoTextStringChar *)end - 1;
- QScriptItem *item = &textEngine.items[textEngine.items.size()-1];
+ TQScriptItem *item = &textEngine.items[textEngine.items.size()-1];
unsigned char bidiLevel = item->analysis.bidiLevel;
if ( bidiLevel )
that->bidi = TRUE;
@@ -1273,21 +1278,22 @@ void KoTextString::checkBidi() const
--pos;
}
- if ( dir == QChar::DirR ) {
+ if ( dir == TQChar::DirR ) {
that->bidi = TRUE;
that->rightToLeft = TRUE;
- } else if ( dir == QChar::DirL ) {
+ } else if ( dir == TQChar::DirL ) {
that->rightToLeft = FALSE;
} else {
- that->rightToLeft = (textEngine.direction == QChar::DirR);
+ that->rightToLeft = (textEngine.direction == TQChar::DirR);
}
+#endif // USE_QT4
}
-QMemArray<KoTextStringChar> KoTextString::subString( int start, int len ) const
+TQMemArray<KoTextStringChar> KoTextString::subString( int start, int len ) const
{
if ( len == 0xFFFFFF )
len = data.size();
- QMemArray<KoTextStringChar> a;
+ TQMemArray<KoTextStringChar> a;
a.resize( len );
for ( int i = 0; i < len; ++i ) {
KoTextStringChar *c = &data[ i + start ];
@@ -1307,11 +1313,11 @@ QMemArray<KoTextStringChar> KoTextString::subString( int start, int len ) const
return a;
}
-QString KoTextString::mid( int start, int len ) const
+TQString KoTextString::mid( int start, int len ) const
{
if ( len == 0xFFFFFF )
len = data.size();
- QString res;
+ TQString res;
res.setLength( len );
for ( int i = 0; i < len; ++i ) {
KoTextStringChar *c = &data[ i + start ];
@@ -1320,13 +1326,13 @@ QString KoTextString::mid( int start, int len ) const
return res;
}
-QString KoTextString::toString( const QMemArray<KoTextStringChar> &data )
+TQString KoTextString::toString( const TQMemArray<KoTextStringChar> &data )
{
- QString s;
+ TQString s;
int l = data.size();
s.setUnicode( 0, l );
KoTextStringChar *c = data.data();
- QChar *uc = (QChar *)s.unicode();
+ TQChar *uc = (TQChar *)s.tqunicode();
while ( l-- ) {
*uc = c->c;
uc++;
@@ -1336,13 +1342,13 @@ QString KoTextString::toString( const QMemArray<KoTextStringChar> &data )
return s;
}
-QString KoTextString::toReverseString() const
+TQString KoTextString::toReverseString() const
{
- QString s;
+ TQString s;
int l = length();
s.setUnicode(0, l);
KoTextStringChar *c = data.data() + (l-1);
- QChar *uc = (QChar *)s.unicode();
+ TQChar *uc = (TQChar *)s.tqunicode();
while ( l-- ) {
*uc = c->c;
uc++;
@@ -1352,16 +1358,16 @@ QString KoTextString::toReverseString() const
return s;
}
-QString KoTextString::stringToSpellCheck()
+TQString KoTextString::stringToSpellCheck()
{
if ( !bNeedsSpellCheck )
- return QString::null;
+ return TQString();
bNeedsSpellCheck = false;
if ( length() <= 1 )
- return QString::null;
+ return TQString();
- QString str = toString();
+ TQString str = toString();
str.truncate( str.length() - 1 ); // remove trailing space
return str;
}
@@ -1495,11 +1501,11 @@ KoTextParagLineStart *KoTextFormatterBase::bidiReorderLine( KoTextParag * /*para
//kdDebug(32500) << "doing BiDi reordering from " << start << " to " << last << "!" << endl;
KoBidiControl *control = new KoBidiControl( line->context(), line->status );
- QString str;
+ TQString str;
str.setUnicode( 0, last - start + 1 );
// fill string with logically ordered chars.
KoTextStringChar *ch = startChar;
- QChar *qch = (QChar *)str.unicode();
+ TQChar *qch = (TQChar *)str.tqunicode();
while ( ch <= lastChar ) {
*qch = ch->c;
qch++;
@@ -1507,25 +1513,25 @@ KoTextParagLineStart *KoTextFormatterBase::bidiReorderLine( KoTextParag * /*para
}
int x = startChar->x;
- QPtrList<KoTextRun> *runs;
+ TQPtrList<KoTextRun> *runs;
runs = KoComplexText::bidiReorderLine(control, str, 0, last - start + 1,
- (text->isRightToLeft() ? QChar::DirR : QChar::DirL) );
+ (text->isRightToLeft() ? TQChar::DirR : TQChar::DirL) );
// now construct the reordered string out of the runs...
int numSpaces = 0;
- // set the correct alignment. This is a bit messy....
- if( align == Qt::AlignAuto ) {
+ // set the correct tqalignment. This is a bit messy....
+ if( align == TQt::AlignAuto ) {
// align according to directionality of the paragraph...
if ( text->isRightToLeft() )
- align = Qt::AlignRight;
+ align = TQt::AlignRight;
}
- if ( align & Qt::AlignHCenter )
+ if ( align & TQt::AlignHCenter )
x += space/2;
- else if ( align & Qt::AlignRight )
+ else if ( align & TQt::AlignRight )
x += space;
- else if ( align & Qt::AlignJustify ) {
+ else if ( align & TQt::AlignJustify ) {
for ( int j = start; j < last; ++j ) {
if( isBreakable( text, j ) ) {
numSpaces++;
@@ -1556,7 +1562,7 @@ KoTextParagLineStart *KoTextFormatterBase::bidiReorderLine( KoTextParag * /*para
c->rightToLeft = TRUE;
c->startOfRun = FALSE;
int ww = 0;
- if ( c->c.unicode() >= 32 || c->c == '\t' || c->c == '\n' || c->isCustom() ) {
+ if ( c->c.tqunicode() >= 32 || c->c == '\t' || c->c == '\n' || c->isCustom() ) {
ww = c->width;
} else {
ww = c->format()->width( ' ' );
@@ -1583,7 +1589,7 @@ KoTextParagLineStart *KoTextFormatterBase::bidiReorderLine( KoTextParag * /*para
c->rightToLeft = FALSE;
c->startOfRun = FALSE;
int ww = 0;
- if ( c->c.unicode() >= 32 || c->c == '\t' || c->isCustom() ) {
+ if ( c->c.tqunicode() >= 32 || c->c == '\t' || c->isCustom() ) {
ww = c->width;
} else {
ww = c->format()->width( ' ' );
@@ -1607,7 +1613,7 @@ KoTextParagLineStart *KoTextFormatterBase::bidiReorderLine( KoTextParag * /*para
bool KoTextFormatterBase::isStretchable( KoTextString *string, int pos ) const
{
- if ( string->at( pos ).c == QChar(160) ) //non-breaking space
+ if ( string->at( pos ).c == TQChar(160) ) //non-breaking space
return true;
KoTextStringChar& chr = string->at( pos );
return chr.whiteSpace;
@@ -1628,8 +1634,8 @@ void KoTextParag::insertLineStart( int index, KoTextParagLineStart *ls )
// However this shouldn't happen, KoTextFormatter prevents it, otherwise
// we could loop forever (e.g. if one char is wider than the page...)
#ifndef NDEBUG
- QMap<int, KoTextParagLineStart*>::Iterator it;
- if ( ( it = lineStarts.find( index ) ) == lineStarts.end() ) {
+ TQMap<int, KoTextParagLineStart*>::Iterator it;
+ if ( ( it = lineStarts.tqfind( index ) ) == lineStarts.end() ) {
lineStarts.insert( index, ls );
} else {
kdWarning(32500) << "insertLineStart: there's already a line for char index=" << index << endl;
@@ -1649,8 +1655,8 @@ void KoTextParag::insertLineStart( int index, KoTextParagLineStart *ls )
int KoTextFormatterBase::formatVertically( KoTextDocument* doc, KoTextParag* parag )
{
int oldHeight = parag->rect().height();
- QMap<int, KoTextParagLineStart*>& lineStarts = parag->lineStartList();
- QMap<int, KoTextParagLineStart*>::Iterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>& lineStarts = parag->lineStartList();
+ TQMap<int, KoTextParagLineStart*>::Iterator it = lineStarts.begin();
int h = doc->addMargins() ? parag->topMargin() : 0;
for ( ; it != lineStarts.end() ; ++it ) {
KoTextParagLineStart * ls = it.data();
@@ -1673,7 +1679,7 @@ int KoTextFormatterBase::formatVertically( KoTextDocument* doc, KoTextParag* par
}
int m = parag->bottomMargin();
if ( parag->next() && doc && !doc->addMargins() )
- m = QMAX( m, parag->next()->topMargin() );
+ m = TQMAX( m, parag->next()->topMargin() );
//if ( parag->next() && parag->next()->isLineBreak() )
// m = 0;
h += m;
@@ -1684,7 +1690,7 @@ int KoTextFormatterBase::formatVertically( KoTextDocument* doc, KoTextParag* par
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
KoTextCustomItem::KoTextCustomItem( KoTextDocument *p )
- : width(-1), height(0), parent(p), xpos(0), ypos(-1), parag(0)
+ : width(-1), height(0), tqparent(p), xpos(0), ypos(-1), parag(0)
{
m_deleted = false; // added for kotext
}
@@ -1736,10 +1742,10 @@ void KoTextFlow::unregisterFloatingItem( KoTextCustomItem* item )
void KoTextFlow::registerFloatingItem( KoTextCustomItem* item )
{
if ( item->placement() == KoTextCustomItem::PlaceRight ) {
- if ( !rightItems.contains( item ) )
+ if ( !rightItems.tqcontains( item ) )
rightItems.append( item );
} else if ( item->placement() == KoTextCustomItem::PlaceLeft &&
- !leftItems.contains( item ) ) {
+ !leftItems.tqcontains( item ) ) {
leftItems.append( item );
}
}
@@ -1749,7 +1755,7 @@ int KoTextFlow::availableHeight() const
return -1; // no limit
}
-void KoTextFlow::drawFloatingItems( QPainter* p, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected )
+void KoTextFlow::drawFloatingItems( TQPainter* p, int cx, int cy, int cw, int ch, const TQColorGroup& cg, bool selected )
{
KoTextCustomItem *item;
for ( item = leftItems.first(); item; item = leftItems.next() ) {