summaryrefslogtreecommitdiffstats
path: root/lib/kotext/KoTextFormatter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kotext/KoTextFormatter.cpp')
-rw-r--r--lib/kotext/KoTextFormatter.cpp180
1 files changed, 90 insertions, 90 deletions
diff --git a/lib/kotext/KoTextFormatter.cpp b/lib/kotext/KoTextFormatter.cpp
index 7670dff69..6696f0411 100644
--- a/lib/kotext/KoTextFormatter.cpp
+++ b/lib/kotext/KoTextFormatter.cpp
@@ -30,7 +30,7 @@
//#define DEBUG_FORMATTER
-// Vertical info (height, baseline etc.)
+//Qt::Vertical info (height, baseline etc.)
//#define DEBUG_FORMATTER_VERT
// Line and paragraph width
@@ -66,7 +66,7 @@ struct TemporaryWordData
};
bool KoTextFormatter::format( KoTextDocument *doc, KoTextParag *parag,
- int start, const QMap<int, KoTextParagLineStart*> &,
+ int start, const TQMap<int, KoTextParagLineStart*> &,
int& y, int& widthUsed )
{
KoTextFormatterCore formatter( this, doc, parag, start );
@@ -83,7 +83,7 @@ KoTextFormatterCore::KoTextFormatterCore( KoTextFormatter* _settings,
{
}
-QPair<int, int> KoTextFormatterCore::determineCharWidth()
+TQPair<int, int> KoTextFormatterCore::determineCharWidth()
{
int ww, pixelww;
KoTextZoomHandler *zh = doc->formattingZoomHandler();
@@ -92,9 +92,9 @@ QPair<int, int> KoTextFormatterCore::determineCharWidth()
if ( c->isCustom() ) {
ww = c->customItem()->width;
Q_ASSERT( ww >= 0 );
- ww = QMAX(0, ww);
+ ww = TQMAX(0, ww);
#ifndef REF_IS_LU
- pixelww = zh->layoutUnitToPixelX( ww );
+ pixelww = zh->tqlayoutUnitToPixelX( ww );
#endif
} else {
ww = charFormat->charWidthLU( c, parag, i );
@@ -113,12 +113,12 @@ QPair<int, int> KoTextFormatterCore::determineCharWidth()
kdDebug(32500) << "nextTab for x=" << x << " returned nx=" << nx << " (=> ww=" << ww << ")" << endl;
#endif
#ifndef REF_IS_LU
- pixelww = zh->layoutUnitToPixelX( ww );
+ pixelww = zh->tqlayoutUnitToPixelX( ww );
#endif
}
Q_ASSERT( ww >= 0 );
c->width = ww;
- return qMakePair(ww, pixelww);
+ return tqMakePair(ww, pixelww);
}
@@ -131,8 +131,8 @@ int KoTextFormatterCore::leftMargin( bool firstLine, bool includeFirstLineMargin
left += parag->firstLineMargin();
// Add the width of the paragraph counter - first line of parag only.
if( parag->counter() &&
- ( parag->counter()->alignment() == Qt::AlignLeft ||
- parag->counter()->alignment() == Qt::AlignAuto ) )
+ ( parag->counter()->tqalignment() == TQt::AlignLeft ||
+ parag->counter()->tqalignment() == TQt::AlignAuto ) )
left += parag->counterWidth(); // in LU pixels
}
return left;
@@ -140,7 +140,7 @@ int KoTextFormatterCore::leftMargin( bool firstLine, bool includeFirstLineMargin
int KoTextFormatterCore::rightMargin( bool firstLine ) const
{
- int right = parag->rightMargin(); // 'rm' in QRT
+ int right = parag->rightMargin(); // 'rm' in TQRT
if ( /*doc &&*/ firstLine && parag->string()->isRightToLeft() )
right += parag->firstLineMargin();
return right;
@@ -195,8 +195,8 @@ bool KoTextFormatterCore::format()
// The result might not be 100% accurate when using a tab (it'll use x=0
// but with counters/margins this might be different). This is why
// we call determineCharWidth() again from within the loop.
- QPair<int, int> widths = determineCharWidth();
- int ww = widths.first; // width in layout units
+ TQPair<int, int> widths = determineCharWidth();
+ int ww = widths.first; // width in tqlayout units
#ifndef REF_IS_LU
int pixelww = widths.second; // width in pixels
#endif
@@ -214,7 +214,7 @@ bool KoTextFormatterCore::format()
int maxY = doc ? doc->flow()->availableHeight() : -1;
- availableWidth = dw - initialRMargin; // 'w' in QRT
+ availableWidth = dw - initialRMargin; // 'w' in TQRT
#if defined(DEBUG_FORMATTER) || defined(DEBUG_FORMATTER_WIDTH)
kdDebug(32500) << "KoTextFormatter::format formatting parag " << parag->paragId()
<< " text:" << parag->string()->toString() << "\n"
@@ -235,7 +235,7 @@ bool KoTextFormatterCore::format()
wused = 0;
- QValueList<TemporaryWordData> tempWordData;
+ TQValueList<TemporaryWordData> tempWordData;
#ifdef DEBUG_FORMATTER
kdDebug(32500) << "Initial KoTextParagLineStart at y=" << y << endl;
@@ -251,16 +251,16 @@ bool KoTextFormatterCore::format()
bool lastWasNonInlineCustom = FALSE;
bool abort = false;
- int align = parag->alignment();
- if ( align == Qt::AlignAuto && doc && doc->alignment() != Qt::AlignAuto )
- align = doc->alignment();
+ int align = parag->tqalignment();
+ if ( align == TQt::AlignAuto && doc && doc->tqalignment() != TQt::AlignAuto )
+ align = doc->tqalignment();
int col = 0;
- maxAvailableWidth = qMakePair( 0, 0 );
+ maxAvailableWidth = tqMakePair( 0, 0 );
KoTextZoomHandler *zh = doc->formattingZoomHandler();
- int pixelx = zh->layoutUnitToPixelX( x );
+ int pixelx = zh->tqlayoutUnitToPixelX( x );
int lastPixelx = 0;
KoTextStringChar* lastChr = 0;
@@ -285,7 +285,7 @@ bool KoTextFormatterCore::format()
else
lastWasNonInlineCustom = FALSE;
- QPair<int, int> widths = determineCharWidth();
+ TQPair<int, int> widths = determineCharWidth();
ww = widths.first;
pixelww = widths.second;
@@ -326,7 +326,7 @@ bool KoTextFormatterCore::format()
}
#ifdef DEBUG_FORMATTER
- kdDebug(32500) << "c='" << QString(c->c) << "' i=" << i << "/" << len << " x=" << x << " ww=" << ww << " availableWidth=" << availableWidth << " (test is x+ww>aW) lastBreak=" << lastBreak << " isBreakable=" << settings->isBreakable(string, i) << endl;
+ kdDebug(32500) << "c='" << TQString(c->c) << "' i=" << i << "/" << len << " x=" << x << " ww=" << ww << " availableWidth=" << availableWidth << " (test is x+ww>aW) lastBreak=" << lastBreak << " isBreakable=" << settings->isBreakable(string, i) << endl;
#endif
// Wrapping at end of line - one big if :)
if (
@@ -357,16 +357,16 @@ bool KoTextFormatterCore::format()
kdDebug(32500) << "BREAKING" << endl;
#endif
//if ( wrapAtColumn() != -1 )
- // minw = QMAX( minw, x + ww );
+ // minw = TQMAX( minw, x + ww );
bool hyphenated = false;
// Hyphenation: check if we can break somewhere between lastBreak and i
if ( settings->hyphenator() && !c->isCustom() )
{
- int wordStart = QMAX(0, lastBreak+1);
+ int wordStart = TQMAX(0, lastBreak+1);
// Breaking after i isn't possible, i is too far already
int maxlen = i - wordStart; // we can't accept to break after maxlen
- QString word = string->mid( wordStart, maxlen );
+ TQString word = string->mid( wordStart, maxlen );
int wordEnd = i;
// but we need to compose the entire word, to hyphenate it
while ( wordEnd < len && !settings->isBreakable( string, wordEnd ) ) {
@@ -375,7 +375,7 @@ bool KoTextFormatterCore::format()
}
if ( word.length() > 1 ) // don't call the hyphenator for empty or one-letter words
{
- QString lang = string->at(wordStart).format()->language();
+ TQString lang = string->at(wordStart).format()->language();
char * hyphens = settings->hyphenator()->hyphens( word, lang );
#if defined(DEBUG_HYPHENATION)
kdDebug(32500) << "Hyphenation: word=" << word << " lang=" << lang << " hyphens=" << hyphens << " maxlen=" << maxlen << endl;
@@ -385,7 +385,7 @@ bool KoTextFormatterCore::format()
Q_ASSERT( maxlen <= hylen );
// If this word was already hyphenated (at the previous line),
// don't break it there again. We can only break after firstChar.
- int minPos = QMAX( 0, (firstChar - &string->at(0)) - wordStart );
+ int minPos = TQMAX( 0, (firstChar - &string->at(0)) - wordStart );
// Check hyphenation positions from the end
for ( int hypos = maxlen-1 ; hypos >= minPos ; --hypos )
@@ -424,8 +424,8 @@ bool KoTextFormatterCore::format()
if ( !emptyLine && i > 0 )
{
// (combine lineStart->baseLine/lineStart->h and tmpBaseLine/tmph)
- int belowBaseLine = QMAX( lineStart->h - lineStart->baseLine, tmph - tmpBaseLine );
- lineStart->baseLine = QMAX( lineStart->baseLine, tmpBaseLine );
+ int belowBaseLine = TQMAX( lineStart->h - lineStart->baseLine, tmph - tmpBaseLine );
+ lineStart->baseLine = TQMAX( lineStart->baseLine, tmpBaseLine );
lineStart->h = lineStart->baseLine + belowBaseLine;
lineStart->w = dw;
@@ -445,7 +445,7 @@ bool KoTextFormatterCore::format()
ww, // ## correct?
x, initialRMargin, dw, parag );
- pixelx = zh->layoutUnitToPixelX( x );
+ pixelx = zh->tqlayoutUnitToPixelX( x );
initialHeight = tmph;
initialLMargin = x;
availableWidth = dw - initialRMargin;
@@ -468,7 +468,7 @@ bool KoTextFormatterCore::format()
tmpBaseLine = lineStart->baseLine;
lastBreak = -1;
col = 0;
- //tminw = marg; // not in QRT?
+ //tminw = marg; // not in TQRT?
tmpWused = 0;
}
// recalc everything for 'i', it might still not be ok where it is...
@@ -495,7 +495,7 @@ bool KoTextFormatterCore::format()
}
}
// maxY not known (or "final choice for empty line") -> keep going ('i' remains where it is)
- // (in case of maxY not known, this is the initial QRT behaviour)
+ // (in case of maxY not known, this is the initial TQRT behaviour)
} else {
// If breaking means we're after maxY, then we won't do it.
// Hopefully KWord will create more pages.
@@ -516,11 +516,11 @@ bool KoTextFormatterCore::format()
spaceAfterLine -= c->width;
//else
- if ( c->c.unicode() == 0xad || hyphenated ) // soft hyphen or hyphenation
+ if ( c->c.tqunicode() == 0xad || hyphenated ) // soft hyphen or hyphenation
{
// Recalculate its width, the hyphen will appear finally (important for the parag rect)
- int width = KoTextZoomHandler::ptToLayoutUnitPt( c->format()->refFontMetrics().width( QChar(0xad) ) );
- if ( c->c.unicode() == 0xad )
+ int width = KoTextZoomHandler::ptToLayoutUnitPt( c->format()->refFontMetrics().width( TQChar(0xad) ) );
+ if ( c->c.tqunicode() == 0xad )
c->width = width;
spaceAfterLine -= width;
}
@@ -534,7 +534,7 @@ bool KoTextFormatterCore::format()
c = &string->at( i + 1 ); // The first char in the new line
#ifdef DEBUG_FORMATTER
- kdDebug(32500) << "Next line will start at i+1=" << i+1 << ", char=" << QString(c->c) << endl;
+ kdDebug(32500) << "Next line will start at i+1=" << i+1 << ", char=" << TQString(c->c) << endl;
#endif
tmph = c->height();
@@ -545,7 +545,7 @@ bool KoTextFormatterCore::format()
c->width,
x, initialRMargin, dw, parag );
- pixelx = zh->layoutUnitToPixelX( x );
+ pixelx = zh->tqlayoutUnitToPixelX( x );
initialHeight = tmph;
initialLMargin = x;
availableWidth = dw - initialRMargin;
@@ -575,17 +575,17 @@ bool KoTextFormatterCore::format()
<< " with " << c->ascent() << "/" << c->height() << endl;
#endif
// (combine tmpBaseLine/tmph and this character)
- int belowBaseLine = QMAX( tmph - tmpBaseLine, c->height() - c->ascent() );
- tmpBaseLine = QMAX( tmpBaseLine, c->ascent() );
+ int belowBaseLine = TQMAX( tmph - tmpBaseLine, c->height() - c->ascent() );
+ tmpBaseLine = TQMAX( tmpBaseLine, c->ascent() );
tmph = tmpBaseLine + belowBaseLine;
#ifdef DEBUG_FORMATTER_VERT
kdDebug(32500) << " -> tmpBaseLine/tmph : " << tmpBaseLine << "/" << tmph << endl;
#endif
}
tempWordData.clear();
- //minw = QMAX( minw, tminw );
+ //minw = TQMAX( minw, tminw );
//tminw = marg + ww;
- wused = QMAX( wused, tmpWused );
+ wused = TQMAX( wused, tmpWused );
#ifdef DEBUG_FORMATTER_WIDTH
kdDebug(32500) << " Breakable character (i=" << i << " len=" << len << "): wused=" << wused << endl;
#endif
@@ -594,8 +594,8 @@ bool KoTextFormatterCore::format()
#ifdef DEBUG_FORMATTER_VERT
kdDebug(32500) << "Breakable character: combining " << lineStart->baseLine << "/" << lineStart->h << " with " << tmpBaseLine << "/" << tmph << endl;
#endif
- int belowBaseLine = QMAX( lineStart->h - lineStart->baseLine, tmph - tmpBaseLine );
- lineStart->baseLine = QMAX( lineStart->baseLine, tmpBaseLine );
+ int belowBaseLine = TQMAX( lineStart->h - lineStart->baseLine, tmph - tmpBaseLine );
+ lineStart->baseLine = TQMAX( lineStart->baseLine, tmpBaseLine );
lineStart->h = lineStart->baseLine + belowBaseLine;
lineStart->w = dw;
#ifdef DEBUG_FORMATTER_VERT
@@ -624,7 +624,7 @@ bool KoTextFormatterCore::format()
#endif
i = (firstChar - &string->at(0));
x = newLMargin;
- pixelx = zh->layoutUnitToPixelX( x );
+ pixelx = zh->tqlayoutUnitToPixelX( x );
availableWidth = dw - newRMargin;
initialLMargin = newLMargin;
initialRMargin = newRMargin;
@@ -641,7 +641,7 @@ bool KoTextFormatterCore::format()
kdDebug(32500) << "Restarting with i=" << i << " x=" << x << " y=" << y << " tmph=" << tmph << " initialHeight=" << initialHeight << " initialLMargin=" << initialLMargin << " initialRMargin=" << initialRMargin << " y=" << y << endl;
#endif
// ww and pixelww already calculated and stored, no need to duplicate
- // code like QRT does.
+ // code like TQRT does.
ww = c->width;
#ifndef REF_IS_LU
pixelww = c->pixelwidth;
@@ -662,8 +662,8 @@ bool KoTextFormatterCore::format()
kdDebug(32500) << " Non-breakable character: combining " << tmpBaseLine << "/" << tmph << " with " << c->ascent() << "/" << c->height() << endl;
#endif
// (combine tmpBaseLine/tmph and this character)
- int belowBaseLine = QMAX( tmph - tmpBaseLine, c->height() - c->ascent() );
- tmpBaseLine = QMAX( tmpBaseLine, c->ascent() );
+ int belowBaseLine = TQMAX( tmph - tmpBaseLine, c->height() - c->ascent() );
+ tmpBaseLine = TQMAX( tmpBaseLine, c->ascent() );
tmph = tmpBaseLine + belowBaseLine;
#ifdef DEBUG_FORMATTER_VERT
kdDebug(32500) << " -> tmpBaseLine/tmph : " << tmpBaseLine << "/" << tmph << endl;
@@ -679,10 +679,10 @@ bool KoTextFormatterCore::format()
c->x = x;
// pixelxadj is the adjustement to add to lu2pixel(x), to find pixelx
// (pixelx would be too expensive to store directly since it would require an int)
- c->pixelxadj = pixelx - zh->layoutUnitToPixelX( x );
+ c->pixelxadj = pixelx - zh->tqlayoutUnitToPixelX( x );
//c->pixelwidth = pixelww; // done as pixelx - lastPixelx below
#ifdef DEBUG_FORMATTER
- kdDebug(32500) << "LU: x=" << x << " [equiv. to pix=" << zh->layoutUnitToPixelX( x ) << "] ; PIX: x=" << pixelx << " --> adj=" << c->pixelxadj << endl;
+ kdDebug(32500) << "LU: x=" << x << " [equiv. to pix=" << zh->tqlayoutUnitToPixelX( x ) << "] ; PIX: x=" << pixelx << " --> adj=" << c->pixelxadj << endl;
#endif
x += ww;
@@ -690,13 +690,13 @@ bool KoTextFormatterCore::format()
if ( i > 0 )
lastChr->pixelwidth = pixelx - lastPixelx;
if ( i < len - 1 )
- tmpWused = QMAX( tmpWused, x );
+ tmpWused = TQMAX( tmpWused, x );
else // trailing space
- c->pixelwidth = zh->layoutUnitToPixelX( ww ); // was: pixelww;
+ c->pixelwidth = zh->tqlayoutUnitToPixelX( ww ); // was: pixelww;
lastPixelx = pixelx;
#ifdef REF_IS_LU
- pixelx = zh->layoutUnitToPixelX( x ); // no accumulating rounding errors anymore
+ pixelx = zh->tqlayoutUnitToPixelX( x ); // no accumulating rounding errors anymore
#else
pixelx += pixelww;
#endif
@@ -706,7 +706,7 @@ bool KoTextFormatterCore::format()
}
// ### hack. The last char in the paragraph is always invisible, and somehow sometimes has a wrong format. It changes between
- // layouting and printing. This corrects some layouting errors in BiDi mode due to this.
+ // tqlayouting and printing. This corrects some tqlayouting errors in BiDi mode due to this.
if ( len > 1 /*&& !c->isAnchor()*/ ) {
c->format()->removeRef();
c->setFormat( string->at( len - 2 ).format() );
@@ -722,8 +722,8 @@ bool KoTextFormatterCore::format()
kdDebug(32500) << "Last Line... Combining " << lineStart->baseLine << "/" << lineStart->h << " with " << tmpBaseLine << "/" << tmph << endl;
#endif
// (combine lineStart and tmpBaseLine/tmph)
- int belowBaseLine = QMAX( lineStart->h - lineStart->baseLine, tmph - tmpBaseLine );
- lineStart->baseLine = QMAX( lineStart->baseLine, tmpBaseLine );
+ int belowBaseLine = TQMAX( lineStart->h - lineStart->baseLine, tmph - tmpBaseLine );
+ lineStart->baseLine = TQMAX( lineStart->baseLine, tmpBaseLine );
lineStart->h = lineStart->baseLine + belowBaseLine;
lineStart->w = dw;
#ifdef DEBUG_FORMATTER_WIDTH
@@ -733,15 +733,15 @@ bool KoTextFormatterCore::format()
kdDebug(32500) << " -> lineStart->baseLine/lineStart->h : " << lineStart->baseLine << "/" << lineStart->h << endl;
#endif
// last line in a paragraph is not justified
- if ( align == Qt::AlignJustify )
- align = Qt::AlignAuto;
+ if ( align == TQt::AlignJustify )
+ align = TQt::AlignAuto;
int space = availableWidth - x + c->width; // don't count the trailing space (it breaks e.g. centering)
KoTextParagLineStart *lineStart2 = koFormatLine( zh, parag, string, lineStart, firstChar, c, align, space );
delete lineStart2;
}
- //minw = QMAX( minw, tminw );
- wused = QMAX( wused, tmpWused );
+ //minw = TQMAX( minw, tminw );
+ wused = TQMAX( wused, tmpWused );
#ifdef DEBUG_FORMATTER_WIDTH
kdDebug(32500) << "Done, wused=" << wused << endl;
#endif
@@ -749,7 +749,7 @@ bool KoTextFormatterCore::format()
int m = parag->bottomMargin();
// ##### Does OOo add margins or does it max them?
//if ( parag->next() && doc && !doc->addMargins() )
- // m = QMAX( m, parag->next()->topMargin() );
+ // m = TQMAX( m, parag->next()->topMargin() );
parag->setFullWidth( fullWidth );
//if ( parag->next() && parag->next()->isLineBreak() )
// m = 0;
@@ -760,20 +760,20 @@ bool KoTextFormatterCore::format()
tmpWused += currentRightMargin; // ### this can break with a variable right-margin
//if ( wrapAtColumn() != -1 )
- // minw = QMAX(minw, wused);
+ // minw = TQMAX(minw, wused);
//thisminw = minw;
#ifdef DEBUG_FORMATTER
// Sanity checking
int numberOfLines = 0;
- QString charPosList;
+ TQString charPosList;
for ( int i = 0 ; i < len; ++i ) {
KoTextStringChar *chr = &string->at( i );
if ( i == 0 )
assert( chr->lineStart );
if ( chr->lineStart ) {
++numberOfLines;
- charPosList += QString::number(i) + " ";
+ charPosList += TQString::number(i) + " ";
}
}
kdDebug(32500) << parag->lineStartList().count() << " lines. " << numberOfLines << " chars with lineStart set: " << charPosList << endl;
@@ -787,11 +787,11 @@ void KoTextFormatterCore::moveChar( KoTextStringChar& chr, KoTextZoomHandler *zh
int deltaX, int deltaPixelX )
{
#ifndef REF_IS_LU
- int pixelx = chr.pixelxadj + zh->layoutUnitToPixelX( chr.x );
+ int pixelx = chr.pixelxadj + zh->tqlayoutUnitToPixelX( chr.x );
#endif
chr.x += deltaX;
#ifndef REF_IS_LU
- chr.pixelxadj = pixelx + deltaPixelX - zh->layoutUnitToPixelX( chr.x );
+ chr.pixelxadj = pixelx + deltaPixelX - zh->tqlayoutUnitToPixelX( chr.x );
#endif
}
@@ -810,16 +810,16 @@ KoTextParagLineStart *KoTextFormatterCore::koFormatLine(
if (space < 0)
space = 0;
- // do alignment Auto == Left in this case
- if ( align & Qt::AlignHCenter || align & Qt::AlignRight ) {
- if ( align & Qt::AlignHCenter )
+ // do tqalignment Auto == Left in this case
+ if ( align & TQt::AlignHCenter || align & TQt::AlignRight ) {
+ if ( align & TQt::AlignHCenter )
space /= 2;
- int toAddPix = zh->layoutUnitToPixelX( space );
+ int toAddPix = zh->tqlayoutUnitToPixelX( space );
for ( int j = last; j >= start; --j ) {
KoTextStringChar &chr = string->at( j );
moveChar( chr, zh, space, toAddPix );
}
- } else if ( align & Qt::AlignJustify ) {
+ } else if ( align & TQt::AlignJustify ) {
int numSpaces = 0;
// End at "last-1", the last space ends up with a width of 0
for ( int j = last-1; j >= start; --j ) {
@@ -841,12 +841,12 @@ KoTextParagLineStart *KoTextFormatterCore::koFormatLine(
if( settings->isStretchable( string, k ) && numSpaces ) {
int s = space / numSpaces;
toAdd += s;
- toAddPix = zh->layoutUnitToPixelX( toAdd );
+ toAddPix = zh->tqlayoutUnitToPixelX( toAdd );
space -= s;
numSpaces--;
chr.width += s;
#ifndef REF_IS_LU
- chr.pixelwidth += zh->layoutUnitToPixelX( s ); // ### rounding problem, recalculate
+ chr.pixelwidth += zh->tqlayoutUnitToPixelX( s ); // ### rounding problem, recalculate
#endif
}
}
@@ -889,7 +889,7 @@ KoTextParagLineStart *KoTextFormatterCore::koFormatLine(
line->w = chr.x + chr.width; //string->width( last );
// Add width of hyphen (so that it appears)
if ( line->hyphenated )
- line->w += KoTextZoomHandler::ptToLayoutUnitPt( chr.format()->refFontMetrics().width( QChar(0xad) ) );
+ line->w += KoTextZoomHandler::ptToLayoutUnitPt( chr.format()->refFontMetrics().width( TQChar(0xad) ) );
} else
line->w = 0;
#endif
@@ -912,7 +912,7 @@ KoTextParagLineStart *KoTextFormatterCore::koBidiReorderLine(
KoTextParag * /*parag*/, KoTextString *text, KoTextParagLineStart *line,
KoTextStringChar *startChar, KoTextStringChar *lastChar, int align, int space )
{
- // This comes from Qt (3.3.x) but seems wrong: the last space is where we draw
+ // This comes from TQt (3.3.x) but seems wrong: the last space is where we draw
// the "end of paragraph" sign, so it needs to be correctly positioned too.
#if 0
// ignore white space at the end of the line.
@@ -930,11 +930,11 @@ KoTextParagLineStart *KoTextFormatterCore::koBidiReorderLine(
kdDebug(32500) << "*KoTextFormatter::koBidiReorderLine from " << start << " to " << last << " space=" << space << " startChar->x=" << startChar->x << endl;
#endif
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++;
@@ -942,25 +942,25 @@ KoTextParagLineStart *KoTextFormatterCore::koBidiReorderLine(
}
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 = last - 1; j >= start; --j ) {
//// Start at last tab, if any. BR #40472 specifies that justifying should start after the last tab.
if ( text->at( j ).c == '\t' ) {
@@ -973,7 +973,7 @@ KoTextParagLineStart *KoTextFormatterCore::koBidiReorderLine(
}
}
// TODO #ifndef REF_IS_LU or remove
- int pixelx = zh->layoutUnitToPixelX( x );
+ int pixelx = zh->tqlayoutUnitToPixelX( x );
int toAdd = 0;
int toAddPix = 0;
bool first = TRUE;
@@ -991,11 +991,11 @@ KoTextParagLineStart *KoTextFormatterCore::koBidiReorderLine(
if( numSpaces && !first && settings->isBreakable( text, pos ) ) {
int s = space / numSpaces;
toAdd += s;
- toAddPix = zh->layoutUnitToPixelX( toAdd );
+ toAddPix = zh->tqlayoutUnitToPixelX( toAdd );
space -= s;
numSpaces--;
chr.width += s;
- chr.pixelwidth += zh->layoutUnitToPixelX( s ); // ### rounding problem, recalculate
+ chr.pixelwidth += zh->tqlayoutUnitToPixelX( s ); // ### rounding problem, recalculate
} else if ( first ) {
first = FALSE;
if ( chr.c == ' ' ) // trailing space
@@ -1006,9 +1006,9 @@ KoTextParagLineStart *KoTextFormatterCore::koBidiReorderLine(
}
}
chr.x = x + toAdd;
- chr.pixelxadj = pixelx + toAddPix - zh->layoutUnitToPixelX( chr.x );
+ chr.pixelxadj = pixelx + toAddPix - zh->tqlayoutUnitToPixelX( chr.x );
#ifdef DEBUG_FORMATTER
- kdDebug(32500) << "koBidiReorderLine: pos=" << pos << " x(LU)=" << x << " toAdd(LU)=" << toAdd << " -> chr.x=" << chr.x << " pixelx=" << pixelx << "+" << zh->layoutUnitToPixelX( toAdd ) << ", pixelxadj=" << pixelx+zh->layoutUnitToPixelX( toAdd )-zh->layoutUnitToPixelX( chr.x ) << endl;
+ kdDebug(32500) << "koBidiReorderLine: pos=" << pos << " x(LU)=" << x << " toAdd(LU)=" << toAdd << " -> chr.x=" << chr.x << " pixelx=" << pixelx << "+" << zh->tqlayoutUnitToPixelX( toAdd ) << ", pixelxadj=" << pixelx+zh->tqlayoutUnitToPixelX( toAdd )-zh->tqlayoutUnitToPixelX( chr.x ) << endl;
#endif
chr.rightToLeft = TRUE;
chr.startOfRun = FALSE;
@@ -1028,7 +1028,7 @@ KoTextParagLineStart *KoTextFormatterCore::koBidiReorderLine(
if( numSpaces && !first && settings->isBreakable( text, pos ) ) {
int s = space / numSpaces;
toAdd += s;
- toAddPix = zh->layoutUnitToPixelX( toAdd );
+ toAddPix = zh->tqlayoutUnitToPixelX( toAdd );
space -= s;
numSpaces--;
} else if ( first ) {
@@ -1041,7 +1041,7 @@ KoTextParagLineStart *KoTextFormatterCore::koBidiReorderLine(
}
}
chr.x = x + toAdd;
- chr.pixelxadj = pixelx + toAddPix - zh->layoutUnitToPixelX( chr.x );
+ chr.pixelxadj = pixelx + toAddPix - zh->tqlayoutUnitToPixelX( chr.x );
chr.rightToLeft = FALSE;
chr.startOfRun = FALSE;
int ww = chr.width;