summaryrefslogtreecommitdiffstats
path: root/lib/kotext/KoComplexText.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kotext/KoComplexText.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kotext/KoComplexText.cpp')
-rw-r--r--lib/kotext/KoComplexText.cpp716
1 files changed, 358 insertions, 358 deletions
diff --git a/lib/kotext/KoComplexText.cpp b/lib/kotext/KoComplexText.cpp
index b955b332..41c10239 100644
--- a/lib/kotext/KoComplexText.cpp
+++ b/lib/kotext/KoComplexText.cpp
@@ -7,27 +7,27 @@
**
** Copyright (C) 2001 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
@@ -36,11 +36,11 @@
**********************************************************************/
-#ifndef QT_NO_COMPLEXTEXT
+#ifndef TQT_NO_COMPLEXTEXT
#include "KoRichText.h"
-//#include "qfontdata_p.h"
-#include "qfontmetrics.h"
-#include "qrect.h"
+//#include "tqfontdata_p.h"
+#include "tqfontmetrics.h"
+#include "tqrect.h"
#include <stdlib.h>
@@ -48,32 +48,32 @@
/* a small helper class used internally to resolve Bidi embedding levels.
Each line of text caches the embedding level at the start of the line for faster
- relayouting
+ retqlayouting
*/
-KoBidiContext::KoBidiContext( uchar l, QChar::Direction e, KoBidiContext *p, bool o )
+KoBidiContext::KoBidiContext( uchar l, TQChar::Direction e, KoBidiContext *p, bool o )
: level(l) , override(o), dir(e)
{
if ( p )
p->ref();
- parent = p;
+ tqparent = p;
count = 0;
}
KoBidiContext::~KoBidiContext()
{
- if( parent && parent->deref() )
- delete parent;
+ if( tqparent && tqparent->deref() )
+ delete tqparent;
}
-static QChar *shapeBuffer = 0;
-static int shapeBufSize = 0;
+static TQChar *tqshapeBuffer = 0;
+static int tqshapeBufSize = 0;
/*
Arabic shaping obeys a number of rules according to the joining classes (see Unicode book, section on
arabic).
- Each unicode char has a joining class (right, dual (left&right), center (joincausing) or transparent).
- transparent joining is not encoded in QChar::joining(), but applies to all combining marks and format marks.
+ Each tqunicode char has a joining class (right, dual (left&right), center (joincausing) or transparent).
+ transparent joining is not encoded in TQChar::joining(), but applies to all combining marks and format marks.
Right join-causing: dual + center
Left join-causing: dual + right + center
@@ -103,31 +103,31 @@ static int shapeBufSize = 0;
*/
/*
- Two small helper functions for arabic shaping. They get the next shape causing character on either
+ Two small helper functions for arabic shaping. They get the next tqshape causing character on either
side of the char in question. Implements rule R1.
leftChar() returns true if the char to the left is a left join-causing char
rightChar() returns true if the char to the right is a right join-causing char
*/
-static inline const QChar *prevChar( const QString &str, int pos )
+static inline const TQChar *prevChar( const TQString &str, int pos )
{
//kdDebug() << "leftChar: pos=" << pos << endl;
pos--;
- const QChar *ch = str.unicode() + pos;
+ const TQChar *ch = str.tqunicode() + pos;
while( pos > -1 ) {
if( !ch->isMark() )
return ch;
pos--;
ch--;
}
- return &QChar::replacement;
+ return &TQChar::tqreplacement;
}
-static inline const QChar *nextChar( const QString &str, int pos)
+static inline const TQChar *nextChar( const TQString &str, int pos)
{
pos++;
int len = str.length();
- const QChar *ch = str.unicode() + pos;
+ const TQChar *ch = str.tqunicode() + pos;
while( pos < len ) {
//kdDebug() << "rightChar: " << pos << " isLetter=" << ch.isLetter() << ", joining=" << ch.joining() << endl;
if( !ch->isMark() )
@@ -136,37 +136,37 @@ static inline const QChar *nextChar( const QString &str, int pos)
pos++;
ch++;
}
- return &QChar::replacement;
+ return &TQChar::tqreplacement;
}
-static inline bool prevVisualCharJoins( const QString &str, int pos)
+static inline bool prevVisualCharJoins( const TQString &str, int pos)
{
- return ( prevChar( str, pos )->joining() != QChar::OtherJoining );
+ return ( prevChar( str, pos )->joining() != TQChar::OtherJoining );
}
-static inline bool nextVisualCharJoins( const QString &str, int pos)
+static inline bool nextVisualCharJoins( const TQString &str, int pos)
{
- QChar::Joining join = nextChar( str, pos )->joining();
- return ( join == QChar::Dual || join == QChar::Center );
+ TQChar::Joining join = nextChar( str, pos )->joining();
+ return ( join == TQChar::Dual || join == TQChar::Center );
}
-KoComplexText::Shape KoComplexText::glyphVariant( const QString &str, int pos)
+KoComplexText::Shape KoComplexText::glyphVariant( const TQString &str, int pos)
{
// ignores L1 - L3, done in the codec
- QChar::Joining joining = str[pos].joining();
- //kdDebug() << "checking " << str[pos].unicode() << ", joining=" << joining << endl;
+ TQChar::Joining joining = str[pos].joining();
+ //kdDebug() << "checking " << str[pos].tqunicode() << ", joining=" << joining << endl;
switch ( joining ) {
- case QChar::OtherJoining:
- case QChar::Center:
- // these don't change shape
+ case TQChar::OtherJoining:
+ case TQChar::Center:
+ // these don't change tqshape
return XIsolated;
- case QChar::Right:
+ case TQChar::Right:
// only rule R2 applies
if( nextVisualCharJoins( str, pos ) )
return XFinal;
return XIsolated;
- case QChar::Dual:
+ case TQChar::Dual:
bool right = nextVisualCharJoins( str, pos );
bool left = prevVisualCharJoins( str, pos );
//kdDebug() << "dual: right=" << right << ", left=" << left << endl;
@@ -184,34 +184,34 @@ KoComplexText::Shape KoComplexText::glyphVariant( const QString &str, int pos)
/* and the same thing for logical ordering :)
*/
-static inline bool prevLogicalCharJoins( const QString &str, int pos)
+static inline bool prevLogicalCharJoins( const TQString &str, int pos)
{
- return ( nextChar( str, pos )->joining() != QChar::OtherJoining );
+ return ( nextChar( str, pos )->joining() != TQChar::OtherJoining );
}
-static inline bool nextLogicalCharJoins( const QString &str, int pos)
+static inline bool nextLogicalCharJoins( const TQString &str, int pos)
{
- QChar::Joining join = prevChar( str, pos )->joining();
- return ( join == QChar::Dual || join == QChar::Center );
+ TQChar::Joining join = prevChar( str, pos )->joining();
+ return ( join == TQChar::Dual || join == TQChar::Center );
}
-KoComplexText::Shape KoComplexText::glyphVariantLogical( const QString &str, int pos)
+KoComplexText::Shape KoComplexText::glyphVariantLogical( const TQString &str, int pos)
{
// ignores L1 - L3, ligatures are job of the codec
- QChar::Joining joining = str[pos].joining();
- //kdDebug() << "checking " << str[pos].unicode() << ", joining=" << joining << endl;
+ TQChar::Joining joining = str[pos].joining();
+ //kdDebug() << "checking " << str[pos].tqunicode() << ", joining=" << joining << endl;
switch ( joining ) {
- case QChar::OtherJoining:
- case QChar::Center:
- // these don't change shape
+ case TQChar::OtherJoining:
+ case TQChar::Center:
+ // these don't change tqshape
return XIsolated;
- case QChar::Right:
+ case TQChar::Right:
// only rule R2 applies
if( nextLogicalCharJoins( str, pos ) )
return XFinal;
return XIsolated;
- case QChar::Dual:
+ case TQChar::Dual:
bool right = nextLogicalCharJoins( str, pos );
bool left = prevLogicalCharJoins( str, pos );
//kdDebug() << "dual: right=" << right << ", left=" << left << endl;
@@ -229,11 +229,11 @@ KoComplexText::Shape KoComplexText::glyphVariantLogical( const QString &str, int
// -------------------------------------------------------------
-// The unicode to unicode shaping codec.
+// The tqunicode to tqunicode shaping codec.
// does only presentation forms B at the moment, but that should be enough for
// simple display
static const ushort arabicUnicodeMapping[256][2] = {
- // base of shaped forms, and number-1 of them ( 0 for non shaping,
+ // base of tqshaped forms, and number-1 of them ( 0 for non shaping,
// 1 for right binding and 3 for dual binding
{ 0x0600, 0 }, // 0x600
{ 0x0601, 0 }, // 0x601
@@ -355,7 +355,7 @@ static const ushort arabicUnicodeMapping[256][2] = {
{ 0x066e, 0 }, // 0x66e
{ 0x066f, 0 }, // 0x66f
- // ### some glyphs do not have shaped mappings in the presentation forms A.
+ // ### some glyphs do not have tqshaped mappings in the presentation forms A.
// these have the shaping set to 0 for the moment. Will have to find out better mappings for them.
{ 0x0670, 0 }, // 0x670
{ 0xfb50, 1 }, // 0x671 R Alef Wasla
@@ -512,7 +512,7 @@ static const ushort arabicUnicodeMapping[256][2] = {
};
-// this is a bit tricky. Alef always binds to the right, so the second parameter descibing the shape
+// this is a bit tricky. Alef always binds to the right, so the second parameter descibing the tqshape
// of the lam can be either initial of medial. So initial maps to the isolated form of the ligature,
// medial to the final form
static const ushort arabicUnicodeLamAlefMapping[6][4] = {
@@ -524,14 +524,14 @@ static const ushort arabicUnicodeLamAlefMapping[6][4] = {
{ 0xfffd, 0xfffd, 0xfefb, 0xfefc } // 0x627 R Alef
};
-static inline int getShape( const QChar * /* base */, uchar cell, int shape,
- const QFontMetrics * /* fm */ )
+static inline int getShape( const TQChar * /* base */, uchar cell, int tqshape,
+ const TQFontMetrics * /* fm */ )
{
- uint ch = arabicUnicodeMapping[cell][0] + shape;
+ uint ch = arabicUnicodeMapping[cell][0] + tqshape;
/*
- // we revert to the unshaped glyph in case the shaped version doesn't exist
+ // we revert to the untqshaped glyph in case the tqshaped version doesn't exist
if ( fm && !fm->inFont( ch ) ) {
- switch( shape ) {
+ switch( tqshape ) {
case KoComplexText::XIsolated:
break; // try base form
case KoComplexText::XFinal:
@@ -551,47 +551,47 @@ static inline int getShape( const QChar * /* base */, uchar cell, int shape,
return ch;
}
-QString KoComplexText::shapedString(const QString& uc, int from, int len, QPainter::TextDirection dir, const QFontMetrics *fm )
+TQString KoComplexText::tqshapedString(const TQString& uc, int from, int len, TQPainter::TextDirection dir, const TQFontMetrics *fm )
{
if( len < 0 )
len = uc.length() - from;
if( len == 0 ) {
- return QString::null;
+ return TQString();
}
// we have to ignore NSMs at the beginning and add at the end.
int num = uc.length() - from - len;
- const QChar *ch = uc.unicode() + from + len;
+ const TQChar *ch = uc.tqunicode() + from + len;
while ( num > 0 && ch->combiningClass() != 0 ) {
ch++;
num--;
len++;
}
- ch = uc.unicode() + from;
+ ch = uc.tqunicode() + from;
while ( len > 0 && ch->combiningClass() != 0 ) {
ch++;
len--;
from++;
}
- if ( len == 0 ) return QString::null;
-
- if( !shapeBuffer || len > shapeBufSize ) {
- if( shapeBuffer ) free( (void *) shapeBuffer );
- shapeBuffer = (QChar *) malloc( len*sizeof( QChar ) );
-// delete [] shapeBuffer;
-// shapeBuffer = new QChar[ len + 1];
- shapeBufSize = len;
+ if ( len == 0 ) return TQString();
+
+ if( !tqshapeBuffer || len > tqshapeBufSize ) {
+ if( tqshapeBuffer ) free( (void *) tqshapeBuffer );
+ tqshapeBuffer = (TQChar *) malloc( len*sizeof( TQChar ) );
+// delete [] tqshapeBuffer;
+// tqshapeBuffer = new TQChar[ len + 1];
+ tqshapeBufSize = len;
}
int lenOut = 0;
- QChar *data = shapeBuffer;
- if ( dir == QPainter::RTL )
+ TQChar *data = tqshapeBuffer;
+ if ( dir == TQPainter::RTL )
ch += len - 1;
for ( int i = 0; i < len; i++ ) {
uchar r = ch->row();
uchar c = ch->cell();
if ( r != 0x06 ) {
- if ( dir == QPainter::RTL && ch->mirrored() )
+ if ( dir == TQPainter::RTL && ch->mirrored() )
*data = ch->mirroredChar();
else
*data = *ch;
@@ -599,15 +599,15 @@ QString KoComplexText::shapedString(const QString& uc, int from, int len, QPaint
lenOut++;
} else {
int pos = i + from;
- if ( dir == QPainter::RTL )
+ if ( dir == TQPainter::RTL )
pos = from + len - 1 - i;
- int shape = glyphVariantLogical( uc, pos );
- //kdDebug() << "mapping U+" << ch->unicode() << " to shape " << shape << " glyph=0x" << arabicUnicodeMapping[ch->cell()][shape] << endl;
+ int tqshape = glyphVariantLogical( uc, pos );
+ //kdDebug() << "mapping U+" << ch->tqunicode() << " to tqshape " << tqshape << " glyph=0x" << arabicUnicodeMapping[ch->cell()][tqshape] << endl;
// take care of lam-alef ligatures (lam right of alef)
ushort map;
switch ( c ) {
case 0x44: { // lam
- const QChar *pch = nextChar( uc, pos );
+ const TQChar *pch = nextChar( uc, pos );
if ( pch->row() == 0x06 ) {
switch ( pch->cell() ) {
case 0x22:
@@ -615,7 +615,7 @@ QString KoComplexText::shapedString(const QString& uc, int from, int len, QPaint
case 0x25:
case 0x27:
//kdDebug() << " lam of lam-alef ligature" << endl;
- map = arabicUnicodeLamAlefMapping[pch->cell() - 0x22][shape];
+ map = arabicUnicodeLamAlefMapping[pch->cell() - 0x22][tqshape];
goto next;
default:
break;
@@ -627,7 +627,7 @@ QString KoComplexText::shapedString(const QString& uc, int from, int len, QPaint
case 0x23: // alef with hamza above
case 0x25: // alef with hamza below
case 0x27: // alef
- if ( prevChar( uc, pos )->unicode() == 0x0644 ) {
+ if ( prevChar( uc, pos )->tqunicode() == 0x0644 ) {
// have a lam alef ligature
//kdDebug() << " alef of lam-alef ligature" << endl;
goto skip;
@@ -635,40 +635,40 @@ QString KoComplexText::shapedString(const QString& uc, int from, int len, QPaint
default:
break;
}
- map = getShape( ch, c, shape, fm );
+ map = getShape( ch, c, tqshape, fm );
next:
*data = map;
data++;
lenOut++;
}
skip:
- if ( dir == QPainter::RTL )
+ if ( dir == TQPainter::RTL )
ch--;
else
ch++;
}
- if ( dir == QPainter::Auto && !uc.simpleText() ) {
- return bidiReorderString( QConstString( shapeBuffer, lenOut ).string() );
+ if ( dir == TQPainter::Auto && !uc.simpleText() ) {
+ return bidiReorderString( TQConstString( tqshapeBuffer, lenOut ).string() );
}
- if ( dir == QPainter::RTL ) {
+ if ( dir == TQPainter::RTL ) {
// reverses the non spacing marks to be again after the base char
- QChar *s = shapeBuffer;
+ TQChar *s = tqshapeBuffer;
int i = 0;
while ( i < lenOut ) {
if ( s->combiningClass() != 0 ) {
// non spacing marks
int clen = 1;
- QChar *ch = s;
+ TQChar *ch = s;
do {
ch++;
clen++;
} while ( ch->combiningClass() != 0 );
int j = 0;
- QChar *cp = s;
+ TQChar *cp = s;
while ( j < clen/2 ) {
- QChar tmp = *cp;
+ TQChar tmp = *cp;
*cp = *ch;
*ch = tmp;
cp++;
@@ -684,28 +684,28 @@ QString KoComplexText::shapedString(const QString& uc, int from, int len, QPaint
}
}
- return QConstString( shapeBuffer, lenOut ).string();
+ return TQConstString( tqshapeBuffer, lenOut ).string();
}
-QChar KoComplexText::shapedCharacter( const QString &str, int pos, const QFontMetrics *fm )
+TQChar KoComplexText::tqshapedCharacter( const TQString &str, int pos, const TQFontMetrics *fm )
{
- const QChar *ch = str.unicode() + pos;
+ const TQChar *ch = str.tqunicode() + pos;
if ( ch->row() != 0x06 )
return *ch;
else {
- int shape = glyphVariantLogical( str, pos );
- //kdDebug() << "mapping U+" << ch->unicode() << " to shape " << shape << " glyph=0x" << arabicUnicodeMapping[ch->cell()][shape] << endl;
+ int tqshape = glyphVariantLogical( str, pos );
+ //kdDebug() << "mapping U+" << ch->tqunicode() << " to tqshape " << tqshape << " glyph=0x" << arabicUnicodeMapping[ch->cell()][tqshape] << endl;
// lam aleph ligatures
switch ( ch->cell() ) {
case 0x44: { // lam
- const QChar *nch = nextChar( str, pos );
+ const TQChar *nch = nextChar( str, pos );
if ( nch->row() == 0x06 ) {
switch ( nch->cell() ) {
case 0x22:
case 0x23:
case 0x25:
case 0x27:
- return QChar(arabicUnicodeLamAlefMapping[nch->cell() - 0x22][shape]);
+ return TQChar(arabicUnicodeLamAlefMapping[nch->cell() - 0x22][tqshape]);
default:
break;
}
@@ -716,20 +716,20 @@ QChar KoComplexText::shapedCharacter( const QString &str, int pos, const QFontMe
case 0x23: // alef with hamza above
case 0x25: // alef with hamza below
case 0x27: // alef
- if ( prevChar( str, pos )->unicode() == 0x0644 )
+ if ( prevChar( str, pos )->tqunicode() == 0x0644 )
// have a lam alef ligature
- return QChar(0);
+ return TQChar(0);
default:
break;
}
- return QChar( getShape( ch, ch->cell(), shape, fm ) );
+ return TQChar( getShape( ch, ch->cell(), tqshape, fm ) );
}
}
-// Avoid using QFontPrivate, to which we don't have access. We don't use positionMarks() anyway
+// Avoid using TQFontPrivate, to which we don't have access. We don't use positionMarks() anyway
#if 0
-QPointArray KoComplexText::positionMarks( QFontPrivate *f, const QString &str,
- int pos, QRect *boundingRect )
+TQPointArray KoComplexText::positionMarks( TQFontPrivate *f, const TQString &str,
+ int pos, TQRect *boundingRect )
{
int len = str.length();
int nmarks = 0;
@@ -737,23 +737,23 @@ QPointArray KoComplexText::positionMarks( QFontPrivate *f, const QString &str,
nmarks++;
if ( !nmarks )
- return QPointArray();
+ return TQPointArray();
- QChar baseChar = KoComplexText::shapedCharacter( str, pos );
- QRect baseRect = f->boundingRect( baseChar );
+ TQChar baseChar = KoComplexText::tqshapedCharacter( str, pos );
+ TQRect baseRect = f->boundingRect( baseChar );
int baseOffset = f->textWidth( str, pos, 1 );
//kdDebug() << "base char: bounding rect at " << baseRect.x() << "/" << baseRect.y() << " (" << baseRect.width() << "/" << baseRect.height() << ")" << endl;
int offset = f->actual.pixelSize / 10 + 1;
//kdDebug() << "offset = " << offset << endl;
- QPointArray pa( nmarks );
+ TQPointArray pa( nmarks );
int i;
unsigned char lastCmb = 0;
- QRect attachmentRect;
+ TQRect attachmentRect;
if ( boundingRect )
*boundingRect = baseRect;
for( i = 0; i < nmarks; i++ ) {
- QChar mark = str[pos+i+1];
+ TQChar mark = str[pos+i+1];
unsigned char cmb = mark.combiningClass();
if ( cmb < 200 ) {
// fixed position classes. We approximate by mapping to one of the others.
@@ -766,19 +766,19 @@ QPointArray KoComplexText::positionMarks( QFontPrivate *f, const QString &str,
if ( (cmb >= 10 && cmb <= 18) ||
cmb == 20 || cmb == 22 ||
cmb == 29 || cmb == 32 )
- cmb = QChar::Combining_Below;
+ cmb = TQChar::Combining_Below;
// above
else if ( cmb == 23 || cmb == 27 || cmb == 28 ||
cmb == 30 || cmb == 31 || (cmb >= 33 && cmb <= 36 ) )
- cmb = QChar::Combining_Above;
+ cmb = TQChar::Combining_Above;
//below-right
else if ( cmb == 103 )
- cmb = QChar::Combining_BelowRight;
+ cmb = TQChar::Combining_BelowRight;
// above-right
else if ( cmb == 24 || cmb == 107 )
- cmb = QChar::Combining_AboveRight;
+ cmb = TQChar::Combining_AboveRight;
else if ( cmb == 25 )
- cmb = QChar::Combining_AboveLeft;
+ cmb = TQChar::Combining_AboveLeft;
// fixed:
// 19 21
@@ -790,61 +790,61 @@ QPointArray KoComplexText::positionMarks( QFontPrivate *f, const QString &str,
attachmentRect = baseRect;
}
- QPoint p;
- QRect markRect = f->boundingRect( mark );
+ TQPoint p;
+ TQRect markRect = f->boundingRect( mark );
switch( cmb ) {
- case QChar::Combining_DoubleBelow:
+ case TQChar::Combining_DoubleBelow:
// ### wrong in rtl context!
- case QChar::Combining_BelowLeft:
- p += QPoint( 0, offset );
- case QChar::Combining_BelowLeftAttached:
+ case TQChar::Combining_BelowLeft:
+ p += TQPoint( 0, offset );
+ case TQChar::Combining_BelowLeftAttached:
p += attachmentRect.bottomLeft() - markRect.topLeft();
break;
- case QChar::Combining_Below:
- p += QPoint( 0, offset );
- case QChar::Combining_BelowAttached:
+ case TQChar::Combining_Below:
+ p += TQPoint( 0, offset );
+ case TQChar::Combining_BelowAttached:
p += attachmentRect.bottomLeft() - markRect.topLeft();
- p += QPoint( (attachmentRect.width() - markRect.width())/2 , 0 );
+ p += TQPoint( (attachmentRect.width() - markRect.width())/2 , 0 );
break;
- case QChar::Combining_BelowRight:
- p += QPoint( 0, offset );
- case QChar::Combining_BelowRightAttached:
+ case TQChar::Combining_BelowRight:
+ p += TQPoint( 0, offset );
+ case TQChar::Combining_BelowRightAttached:
p += attachmentRect.bottomRight() - markRect.topRight();
break;
- case QChar::Combining_Left:
- p += QPoint( -offset, 0 );
- case QChar::Combining_LeftAttached:
+ case TQChar::Combining_Left:
+ p += TQPoint( -offset, 0 );
+ case TQChar::Combining_LeftAttached:
break;
- case QChar::Combining_Right:
- p += QPoint( offset, 0 );
- case QChar::Combining_RightAttached:
+ case TQChar::Combining_Right:
+ p += TQPoint( offset, 0 );
+ case TQChar::Combining_RightAttached:
break;
- case QChar::Combining_DoubleAbove:
+ case TQChar::Combining_DoubleAbove:
// ### wrong in RTL context!
- case QChar::Combining_AboveLeft:
- p += QPoint( 0, -offset );
- case QChar::Combining_AboveLeftAttached:
+ case TQChar::Combining_AboveLeft:
+ p += TQPoint( 0, -offset );
+ case TQChar::Combining_AboveLeftAttached:
p += attachmentRect.topLeft() - markRect.bottomLeft();
break;
- case QChar::Combining_Above:
- p += QPoint( 0, -offset );
- case QChar::Combining_AboveAttached:
+ case TQChar::Combining_Above:
+ p += TQPoint( 0, -offset );
+ case TQChar::Combining_AboveAttached:
p += attachmentRect.topLeft() - markRect.bottomLeft();
- p += QPoint( (attachmentRect.width() - markRect.width())/2 , 0 );
+ p += TQPoint( (attachmentRect.width() - markRect.width())/2 , 0 );
break;
- case QChar::Combining_AboveRight:
- p += QPoint( 0, -offset );
- case QChar::Combining_AboveRightAttached:
+ case TQChar::Combining_AboveRight:
+ p += TQPoint( 0, -offset );
+ case TQChar::Combining_AboveRightAttached:
p += attachmentRect.topRight() - markRect.bottomRight();
break;
- case QChar::Combining_IotaSubscript:
+ case TQChar::Combining_IotaSubscript:
default:
break;
}
- //kdDebug() << "char=" << mark.unicode() << " combiningClass = " << cmb << " offset=" << p.x() << "/" << p.y() << endl;
+ //kdDebug() << "char=" << mark.tqunicode() << " combiningClass = " << cmb << " offset=" << p.x() << "/" << p.y() << endl;
markRect.moveBy( p.x(), p.y() );
- p += QPoint( -baseOffset, 0 );
+ p += TQPoint( -baseOffset, 0 );
attachmentRect |= markRect;
if ( boundingRect )
*boundingRect |= markRect;
@@ -860,23 +860,23 @@ QPointArray KoComplexText::positionMarks( QFontPrivate *f, const QString &str,
#include <iostream>
#endif
-static QChar::Direction basicDirection(const QString &str, int start = 0)
+static TQChar::Direction basicDirection(const TQString &str, int start = 0)
{
int len = str.length();
int pos = start > len ? len -1 : start;
- const QChar *uc = str.unicode() + pos;
+ const TQChar *uc = str.tqunicode() + pos;
while( pos < len ) {
switch( uc->direction() )
{
- case QChar::DirL:
- case QChar::DirLRO:
- case QChar::DirLRE:
- return QChar::DirL;
- case QChar::DirR:
- case QChar::DirAL:
- case QChar::DirRLO:
- case QChar::DirRLE:
- return QChar::DirR;
+ case TQChar::DirL:
+ case TQChar::DirLRO:
+ case TQChar::DirLRE:
+ return TQChar::DirL;
+ case TQChar::DirR:
+ case TQChar::DirAL:
+ case TQChar::DirRLO:
+ case TQChar::DirRLE:
+ return TQChar::DirR;
default:
break;
}
@@ -885,18 +885,18 @@ static QChar::Direction basicDirection(const QString &str, int start = 0)
}
if ( start != 0 )
return basicDirection( str );
- return QChar::DirL;
+ return TQChar::DirL;
}
// transforms one line of the paragraph to visual order
// the caller is responisble to delete the returned list of KoTextRuns.
-QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, const QString &text, int start, int len,
- QChar::Direction basicDir )
+TQPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, const TQString &text, int start, int len,
+ TQChar::Direction basicDir )
{
int last = start + len - 1;
//printf("doing BiDi reordering from %d to %d!\n", start, last);
- QPtrList<KoTextRun> *runs = new QPtrList<KoTextRun>;
+ TQPtrList<KoTextRun> *runs = new TQPtrList<KoTextRun>;
runs->setAutoDelete(TRUE);
KoBidiContext *context = control->context;
@@ -904,31 +904,31 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
// first line
//if( start != 0 )
// kdDebug() << "bidiReorderLine::internal error" << endl;
- if( basicDir == QChar::DirR || (basicDir == QChar::DirON && text.isRightToLeft() ) ) {
- context = new KoBidiContext( 1, QChar::DirR );
- control->status.last = QChar::DirR;
+ if( basicDir == TQChar::DirR || (basicDir == TQChar::DirON && text.isRightToLeft() ) ) {
+ context = new KoBidiContext( 1, TQChar::DirR );
+ control->status.last = TQChar::DirR;
} else {
- context = new KoBidiContext( 0, QChar::DirL );
- control->status.last = QChar::DirL;
+ context = new KoBidiContext( 0, TQChar::DirL );
+ control->status.last = TQChar::DirL;
}
}
- KoBidiStatus status = control->status;
- QChar::Direction dir = QChar::DirON;
+ KoBiditqStatus status = control->status;
+ TQChar::Direction dir = TQChar::DirON;
int sor = start;
int eor = start;
int current = start;
while(current <= last) {
- QChar::Direction dirCurrent;
+ TQChar::Direction dirCurrent;
if(current == (int)text.length()) {
KoBidiContext *c = context;
- while ( c->parent )
- c = c->parent;
+ while ( c->tqparent )
+ c = c->tqparent;
dirCurrent = c->dir;
} else if ( current == last ) {
- dirCurrent = ( basicDir != QChar::DirON ? basicDir : basicDirection( text, current ) );
+ dirCurrent = ( basicDir != TQChar::DirON ? basicDir : basicDirection( text, current ) );
} else
dirCurrent = text.at(current).direction();
@@ -940,7 +940,7 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
switch(dirCurrent) {
// embedding and overrides (X1-X9 in the BiDi specs)
- case QChar::DirRLE:
+ case TQChar::DirRLE:
{
uchar level = context->level;
if(level%2) // we have an odd level
@@ -949,14 +949,14 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
level++;
if(level < 61) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- context = new KoBidiContext(level, QChar::DirR, context);
- status.last = QChar::DirR;
- status.lastStrong = QChar::DirR;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ context = new KoBidiContext(level, TQChar::DirR, context);
+ status.last = TQChar::DirR;
+ status.lastStrong = TQChar::DirR;
}
break;
}
- case QChar::DirLRE:
+ case TQChar::DirLRE:
{
uchar level = context->level;
if(level%2) // we have an odd level
@@ -965,14 +965,14 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
level += 2;
if(level < 61) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- context = new KoBidiContext(level, QChar::DirL, context);
- status.last = QChar::DirL;
- status.lastStrong = QChar::DirL;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ context = new KoBidiContext(level, TQChar::DirL, context);
+ status.last = TQChar::DirL;
+ status.lastStrong = TQChar::DirL;
}
break;
}
- case QChar::DirRLO:
+ case TQChar::DirRLO:
{
uchar level = context->level;
if(level%2) // we have an odd level
@@ -981,15 +981,15 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
level++;
if(level < 61) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- context = new KoBidiContext(level, QChar::DirR, context, TRUE);
- dir = QChar::DirR;
- status.last = QChar::DirR;
- status.lastStrong = QChar::DirR;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ context = new KoBidiContext(level, TQChar::DirR, context, TRUE);
+ dir = TQChar::DirR;
+ status.last = TQChar::DirR;
+ status.lastStrong = TQChar::DirR;
}
break;
}
- case QChar::DirLRO:
+ case TQChar::DirLRO:
{
uchar level = context->level;
if(level%2) // we have an odd level
@@ -998,122 +998,122 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
level += 2;
if(level < 61) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- context = new KoBidiContext(level, QChar::DirL, context, TRUE);
- dir = QChar::DirL;
- status.last = QChar::DirL;
- status.lastStrong = QChar::DirL;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ context = new KoBidiContext(level, TQChar::DirL, context, TRUE);
+ dir = TQChar::DirL;
+ status.last = TQChar::DirL;
+ status.lastStrong = TQChar::DirL;
}
break;
}
- case QChar::DirPDF:
+ case TQChar::DirPDF:
{
- KoBidiContext *c = context->parent;
+ KoBidiContext *c = context->tqparent;
if(c) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
status.last = context->dir;
if( context->deref() ) delete context;
context = c;
if(context->override)
dir = context->dir;
else
- dir = QChar::DirON;
+ dir = TQChar::DirON;
status.lastStrong = context->dir;
}
break;
}
// strong types
- case QChar::DirL:
- if(dir == QChar::DirON)
- dir = QChar::DirL;
+ case TQChar::DirL:
+ if(dir == TQChar::DirON)
+ dir = TQChar::DirL;
switch(status.last)
{
- case QChar::DirL:
- eor = current; status.eor = QChar::DirL; break;
- case QChar::DirR:
- case QChar::DirAL:
- case QChar::DirEN:
- case QChar::DirAN:
+ case TQChar::DirL:
+ eor = current; status.eor = TQChar::DirL; break;
+ case TQChar::DirR:
+ case TQChar::DirAL:
+ case TQChar::DirEN:
+ case TQChar::DirAN:
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
break;
- case QChar::DirES:
- case QChar::DirET:
- case QChar::DirCS:
- case QChar::DirBN:
- case QChar::DirB:
- case QChar::DirS:
- case QChar::DirWS:
- case QChar::DirON:
- if(dir != QChar::DirL) {
+ case TQChar::DirES:
+ case TQChar::DirET:
+ case TQChar::DirCS:
+ case TQChar::DirBN:
+ case TQChar::DirB:
+ case TQChar::DirS:
+ case TQChar::DirWS:
+ case TQChar::DirON:
+ if(dir != TQChar::DirL) {
//last stuff takes embedding dir
- if( context->dir == QChar::DirR ) {
- if(status.eor != QChar::DirR) {
+ if( context->dir == TQChar::DirR ) {
+ if(status.eor != TQChar::DirR) {
// AN or EN
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- dir = QChar::DirR;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ dir = TQChar::DirR;
}
else
eor = current - 1;
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
} else {
- if(status.eor != QChar::DirL) {
+ if(status.eor != TQChar::DirL) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- dir = QChar::DirL;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ dir = TQChar::DirL;
} else {
- eor = current; status.eor = QChar::DirL; break;
+ eor = current; status.eor = TQChar::DirL; break;
}
}
} else {
- eor = current; status.eor = QChar::DirL;
+ eor = current; status.eor = TQChar::DirL;
}
default:
break;
}
- status.lastStrong = QChar::DirL;
+ status.lastStrong = TQChar::DirL;
break;
- case QChar::DirAL:
- case QChar::DirR:
- if(dir == QChar::DirON) dir = QChar::DirR;
+ case TQChar::DirAL:
+ case TQChar::DirR:
+ if(dir == TQChar::DirON) dir = TQChar::DirR;
switch(status.last)
{
- case QChar::DirR:
- case QChar::DirAL:
- eor = current; status.eor = QChar::DirR; break;
- case QChar::DirL:
- case QChar::DirEN:
- case QChar::DirAN:
+ case TQChar::DirR:
+ case TQChar::DirAL:
+ eor = current; status.eor = TQChar::DirR; break;
+ case TQChar::DirL:
+ case TQChar::DirEN:
+ case TQChar::DirAN:
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
break;
- case QChar::DirES:
- case QChar::DirET:
- case QChar::DirCS:
- case QChar::DirBN:
- case QChar::DirB:
- case QChar::DirS:
- case QChar::DirWS:
- case QChar::DirON:
- if( status.eor != QChar::DirR && status.eor != QChar::DirAL ) {
+ case TQChar::DirES:
+ case TQChar::DirET:
+ case TQChar::DirCS:
+ case TQChar::DirBN:
+ case TQChar::DirB:
+ case TQChar::DirS:
+ case TQChar::DirWS:
+ case TQChar::DirON:
+ if( status.eor != TQChar::DirR && status.eor != TQChar::DirAL ) {
//last stuff takes embedding dir
- if(context->dir == QChar::DirR || status.lastStrong == QChar::DirR) {
+ if(context->dir == TQChar::DirR || status.lastStrong == TQChar::DirR) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- dir = QChar::DirR;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ dir = TQChar::DirR;
eor = current;
} else {
eor = current - 1;
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- dir = QChar::DirR;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ dir = TQChar::DirR;
}
} else {
- eor = current; status.eor = QChar::DirR;
+ eor = current; status.eor = TQChar::DirR;
}
default:
break;
@@ -1123,68 +1123,68 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
// weak types:
- case QChar::DirNSM:
+ case TQChar::DirNSM:
// ### if @sor, set dir to dirSor
break;
- case QChar::DirEN:
- if(status.lastStrong != QChar::DirAL) {
+ case TQChar::DirEN:
+ if(status.lastStrong != TQChar::DirAL) {
// if last strong was AL change EN to AL
- if(dir == QChar::DirON) {
- if(status.lastStrong == QChar::DirL)
- dir = QChar::DirL;
+ if(dir == TQChar::DirON) {
+ if(status.lastStrong == TQChar::DirL)
+ dir = TQChar::DirL;
else
- dir = QChar::DirAN;
+ dir = TQChar::DirAN;
}
switch(status.last)
{
- case QChar::DirET:
- if ( status.lastStrong == QChar::DirR || status.lastStrong == QChar::DirAL ) {
+ case TQChar::DirET:
+ if ( status.lastStrong == TQChar::DirR || status.lastStrong == TQChar::DirAL ) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; status.eor = QChar::DirON;
- dir = QChar::DirAN;
+ ++eor; sor = eor; status.eor = TQChar::DirON;
+ dir = TQChar::DirAN;
}
// fall through
- case QChar::DirEN:
- case QChar::DirL:
+ case TQChar::DirEN:
+ case TQChar::DirL:
eor = current;
status.eor = dirCurrent;
break;
- case QChar::DirR:
- case QChar::DirAL:
- case QChar::DirAN:
+ case TQChar::DirR:
+ case TQChar::DirAL:
+ case TQChar::DirAN:
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; status.eor = QChar::DirEN;
- dir = QChar::DirAN; break;
- case QChar::DirES:
- case QChar::DirCS:
- if(status.eor == QChar::DirEN || dir == QChar::DirAN) {
+ ++eor; sor = eor; status.eor = TQChar::DirEN;
+ dir = TQChar::DirAN; break;
+ case TQChar::DirES:
+ case TQChar::DirCS:
+ if(status.eor == TQChar::DirEN || dir == TQChar::DirAN) {
eor = current; break;
}
- case QChar::DirBN:
- case QChar::DirB:
- case QChar::DirS:
- case QChar::DirWS:
- case QChar::DirON:
- if(status.eor == QChar::DirR) {
+ case TQChar::DirBN:
+ case TQChar::DirB:
+ case TQChar::DirS:
+ case TQChar::DirWS:
+ case TQChar::DirON:
+ if(status.eor == TQChar::DirR) {
// neutrals go to R
eor = current - 1;
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirEN;
- dir = QChar::DirAN;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirEN;
+ dir = TQChar::DirAN;
}
- else if( status.eor == QChar::DirL ||
- (status.eor == QChar::DirEN && status.lastStrong == QChar::DirL)) {
+ else if( status.eor == TQChar::DirL ||
+ (status.eor == TQChar::DirEN && status.lastStrong == TQChar::DirL)) {
eor = current; status.eor = dirCurrent;
} else {
// numbers on both sides, neutrals get right to left direction
- if(dir != QChar::DirL) {
+ if(dir != TQChar::DirL) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
eor = current - 1;
- dir = QChar::DirR;
+ dir = TQChar::DirR;
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- dir = QChar::DirAN;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ dir = TQChar::DirAN;
} else {
eor = current; status.eor = dirCurrent;
}
@@ -1194,50 +1194,50 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
}
break;
}
- case QChar::DirAN:
- dirCurrent = QChar::DirAN;
- if(dir == QChar::DirON) dir = QChar::DirAN;
+ case TQChar::DirAN:
+ dirCurrent = TQChar::DirAN;
+ if(dir == TQChar::DirON) dir = TQChar::DirAN;
switch(status.last)
{
- case QChar::DirL:
- case QChar::DirAN:
- eor = current; status.eor = QChar::DirAN; break;
- case QChar::DirR:
- case QChar::DirAL:
- case QChar::DirEN:
+ case TQChar::DirL:
+ case TQChar::DirAN:
+ eor = current; status.eor = TQChar::DirAN; break;
+ case TQChar::DirR:
+ case TQChar::DirAL:
+ case TQChar::DirEN:
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
break;
- case QChar::DirCS:
- if(status.eor == QChar::DirAN) {
- eor = current; status.eor = QChar::DirR; break;
+ case TQChar::DirCS:
+ if(status.eor == TQChar::DirAN) {
+ eor = current; status.eor = TQChar::DirR; break;
}
- case QChar::DirES:
- case QChar::DirET:
- case QChar::DirBN:
- case QChar::DirB:
- case QChar::DirS:
- case QChar::DirWS:
- case QChar::DirON:
- if(status.eor == QChar::DirR) {
+ case TQChar::DirES:
+ case TQChar::DirET:
+ case TQChar::DirBN:
+ case TQChar::DirB:
+ case TQChar::DirS:
+ case TQChar::DirWS:
+ case TQChar::DirON:
+ if(status.eor == TQChar::DirR) {
// neutrals go to R
eor = current - 1;
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- dir = QChar::DirAN;
- } else if( status.eor == QChar::DirL ||
- (status.eor == QChar::DirEN && status.lastStrong == QChar::DirL)) {
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ dir = TQChar::DirAN;
+ } else if( status.eor == TQChar::DirL ||
+ (status.eor == TQChar::DirEN && status.lastStrong == TQChar::DirL)) {
eor = current; status.eor = dirCurrent;
} else {
// numbers on both sides, neutrals get right to left direction
- if(dir != QChar::DirL) {
+ if(dir != TQChar::DirL) {
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
eor = current - 1;
- dir = QChar::DirR;
+ dir = TQChar::DirR;
runs->append( new KoTextRun(sor, eor, context, dir) );
- ++eor; sor = eor; dir = QChar::DirON; status.eor = QChar::DirON;
- dir = QChar::DirAN;
+ ++eor; sor = eor; dir = TQChar::DirON; status.eor = TQChar::DirON;
+ dir = TQChar::DirAN;
} else {
eor = current; status.eor = dirCurrent;
}
@@ -1246,29 +1246,29 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
break;
}
break;
- case QChar::DirES:
- case QChar::DirCS:
+ case TQChar::DirES:
+ case TQChar::DirCS:
break;
- case QChar::DirET:
- if(status.last == QChar::DirEN) {
- dirCurrent = QChar::DirEN;
+ case TQChar::DirET:
+ if(status.last == TQChar::DirEN) {
+ dirCurrent = TQChar::DirEN;
eor = current; status.eor = dirCurrent;
break;
}
break;
// boundary neutrals should be ignored
- case QChar::DirBN:
+ case TQChar::DirBN:
break;
// neutrals
- case QChar::DirB:
+ case TQChar::DirB:
// ### what do we do with newline and paragraph separators that come to here?
break;
- case QChar::DirS:
+ case TQChar::DirS:
// ### implement rule L1
break;
- case QChar::DirWS:
- case QChar::DirON:
+ case TQChar::DirWS:
+ case TQChar::DirON:
break;
default:
break;
@@ -1281,27 +1281,27 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
// set status.last as needed.
switch(dirCurrent)
{
- case QChar::DirET:
- case QChar::DirES:
- case QChar::DirCS:
- case QChar::DirS:
- case QChar::DirWS:
- case QChar::DirON:
+ case TQChar::DirET:
+ case TQChar::DirES:
+ case TQChar::DirCS:
+ case TQChar::DirS:
+ case TQChar::DirWS:
+ case TQChar::DirON:
switch(status.last)
{
- case QChar::DirL:
- case QChar::DirR:
- case QChar::DirAL:
- case QChar::DirEN:
- case QChar::DirAN:
+ case TQChar::DirL:
+ case TQChar::DirR:
+ case TQChar::DirAL:
+ case TQChar::DirEN:
+ case TQChar::DirAN:
status.last = dirCurrent;
break;
default:
- status.last = QChar::DirON;
+ status.last = TQChar::DirON;
}
break;
- case QChar::DirNSM:
- case QChar::DirBN:
+ case TQChar::DirNSM:
+ case TQChar::DirBN:
// ignore these
break;
default:
@@ -1344,7 +1344,7 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
#ifdef BIDI_DEBUG
cout << "reorderLine: lineLow = " << (uint)levelLow << ", lineHigh = " << (uint)levelHigh << endl;
cout << "logical order is:" << endl;
- QPtrListIterator<KoTextRun> it2(*runs);
+ TQPtrListIterator<KoTextRun> it2(*runs);
KoTextRun *r2;
for ( ; (r2 = it2.current()); ++it2 )
cout << " " << r2 << " start=" << r2->start << " stop=" << r2->stop << " level=" << (uint)r2->level << endl;
@@ -1381,7 +1381,7 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
#ifdef BIDI_DEBUG
cout << "visual order is:" << endl;
- QPtrListIterator<KoTextRun> it3(*runs);
+ TQPtrListIterator<KoTextRun> it3(*runs);
KoTextRun *r3;
for ( ; (r3 = it3.current()); ++it3 )
{
@@ -1396,7 +1396,7 @@ QPtrList<KoTextRun> *KoComplexText::bidiReorderLine( KoBidiControl *control, con
}
-QString KoComplexText::bidiReorderString( const QString &str, QChar::Direction /*basicDir*/ )
+TQString KoComplexText::bidiReorderString( const TQString &str, TQChar::Direction /*basicDir*/ )
{
// ### fix basic direction
@@ -1404,10 +1404,10 @@ QString KoComplexText::bidiReorderString( const QString &str, QChar::Direction /
int lineStart = 0;
int lineEnd = 0;
int len = str.length();
- QString visual;
+ TQString visual;
visual.setUnicode( 0, len );
- QChar *vch = (QChar *)visual.unicode();
- const QChar *ch = str.unicode();
+ TQChar *vch = (TQChar *)visual.tqunicode();
+ const TQChar *ch = str.tqunicode();
while( lineStart < len ) {
lineEnd = lineStart;
while( *ch != '\n' && lineEnd < len ) {
@@ -1415,7 +1415,7 @@ QString KoComplexText::bidiReorderString( const QString &str, QChar::Direction /
lineEnd++;
}
lineEnd++;
- QPtrList<KoTextRun> *runs = bidiReorderLine( &control, str, lineStart, lineEnd - lineStart );
+ TQPtrList<KoTextRun> *runs = bidiReorderLine( &control, str, lineStart, lineEnd - lineStart );
// reorder the content of the line, and output to visual
KoTextRun *r = runs->first();
@@ -1451,21 +1451,21 @@ QString KoComplexText::bidiReorderString( const QString &str, QChar::Direction /
return visual;
}
-KoTextRun::KoTextRun(int _start, int _stop, KoBidiContext *context, QChar::Direction dir) {
+KoTextRun::KoTextRun(int _start, int _stop, KoBidiContext *context, TQChar::Direction dir) {
start = _start;
stop = _stop;
- if(dir == QChar::DirON) dir = context->dir;
+ if(dir == TQChar::DirON) dir = context->dir;
level = context->level;
// add level of run (cases I1 & I2)
if( level % 2 ) {
- if(dir == QChar::DirL || dir == QChar::DirAN)
+ if(dir == TQChar::DirL || dir == TQChar::DirAN)
level++;
} else {
- if( dir == QChar::DirR )
+ if( dir == TQChar::DirR )
level++;
- else if( dir == QChar::DirAN )
+ else if( dir == TQChar::DirAN )
level += 2;
}
#ifdef BIDI_DEBUG
@@ -1473,4 +1473,4 @@ KoTextRun::KoTextRun(int _start, int _stop, KoBidiContext *context, QChar::Direc
#endif
}
-#endif //QT_NO_COMPLEXTEXT
+#endif //TQT_NO_COMPLEXTEXT