summaryrefslogtreecommitdiffstats
path: root/lib/kotext/KoTextParag.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/KoTextParag.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/KoTextParag.cpp')
-rw-r--r--lib/kotext/KoTextParag.cpp680
1 files changed, 340 insertions, 340 deletions
diff --git a/lib/kotext/KoTextParag.cpp b/lib/kotext/KoTextParag.cpp
index d28bc1101..8f9485968 100644
--- a/lib/kotext/KoTextParag.cpp
+++ b/lib/kotext/KoTextParag.cpp
@@ -120,7 +120,7 @@ KoTextParag::~KoTextParag()
}
delete [] tArray;
//delete eData;
- QMap<int, KoTextParagLineStart*>::Iterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::Iterator it = lineStarts.begin();
for ( ; it != lineStarts.end(); ++it )
delete *it;
if ( mSelections ) delete mSelections;
@@ -154,14 +154,14 @@ void KoTextParag::setPrev( KoTextParag *s )
doc->setFirstParag( this );
}
-void KoTextParag::invalidate( int /*chr, ignored*/ )
+void KoTextParag::tqinvalidate( int /*chr, ignored*/ )
{
m_invalid = true;
#if 0
if ( invalid < 0 )
invalid = chr;
else
- invalid = QMIN( invalid, chr );
+ invalid = TQMIN( invalid, chr );
#endif
}
@@ -178,15 +178,15 @@ void KoTextParag::setLineChanged( short int line )
m_lineChanged = line;
}
else
- m_lineChanged = QMIN( m_lineChanged, line ); // also works if line=-1
+ m_lineChanged = TQMIN( m_lineChanged, line ); // also works if line=-1
changed = true;
//kdDebug(32500) << "KoTextParag::setLineChanged line=" << line << " -> m_lineChanged=" << m_lineChanged << endl;
}
-void KoTextParag::insert( int index, const QString &s )
+void KoTextParag::insert( int index, const TQString &s )
{
str->insert( index, s, formatCollection()->defaultFormat() );
- invalidate( index );
+ tqinvalidate( index );
//needPreProcess = TRUE;
}
@@ -209,7 +209,7 @@ void KoTextParag::remove( int index, int len )
}
}
str->remove( index, len );
- invalidate( 0 );
+ tqinvalidate( 0 );
//needPreProcess = TRUE;
}
@@ -239,7 +239,7 @@ void KoTextParag::join( KoTextParag *s )
KoTextCustomItem * item = s->str->at( i ).customItem();
str->at( i + start ).setCustomItem( item );
s->str->at( i ).loseCustomItem();
- doc->unregisterCustomItem( item, s ); // ### missing in QRT
+ doc->unregisterCustomItem( item, s ); // ### missing in TQRT
doc->registerCustomItem( item, this );
}
}
@@ -252,9 +252,9 @@ void KoTextParag::join( KoTextParag *s )
extraData()->join( s->extraData() );
}*/
delete s;
- invalidate( 0 );
+ tqinvalidate( 0 );
//// kotext
- invalidateCounters();
+ tqinvalidateCounters();
////
r.setHeight( oh );
//needPreProcess = TRUE;
@@ -285,7 +285,7 @@ void KoTextParag::move( int &dy )
}
}
//if ( p )
- // p->lastInFrame = TRUE; // Qt does this, but the loop at the end of format() calls move a lot!
+ // p->lastInFrame = TRUE; // TQt does this, but the loop at the end of format() calls move a lot!
movedDown = FALSE;
@@ -310,7 +310,7 @@ void KoTextParag::format( int start, bool doMove )
//kdDebug(32500) << "KoTextParag::format " << this << " id:" << paragId() << endl;
- r.moveTopLeft( QPoint( documentX(), p ? p->r.y() + p->r.height() : documentY() ) );
+ r.moveTopLeft( TQPoint( documentX(), p ? p->r.y() + p->r.height() : documentY() ) );
//if ( p )
// p->lastInFrame = FALSE;
@@ -329,16 +329,16 @@ void KoTextParag::format( int start, bool doMove )
i->move( i->x(), r.y() );
}
}
- QMap<int, KoTextParagLineStart*> oldLineStarts = lineStarts;
+ TQMap<int, KoTextParagLineStart*> oldLineStarts = lineStarts;
lineStarts.clear();
int y;
bool formatterWorked = formatter()->format( doc, this, start, oldLineStarts, y, m_wused );
// It can't happen that width < minimumWidth -- hopefully.
- //r.setWidth( QMAX( r.width(), formatter()->minimumWidth() ) );
+ //r.setWidth( TQMAX( r.width(), formatter()->minimumWidth() ) );
//m_minw = formatter()->minimumWidth();
- QMap<int, KoTextParagLineStart*>::Iterator it = oldLineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::Iterator it = oldLineStarts.begin();
for ( ; it != oldLineStarts.end(); ++it )
delete *it;
@@ -364,7 +364,7 @@ void KoTextParag::format( int start, bool doMove )
it = lineStarts.begin();
int usedw = 0; int lineid = 0;
for ( ; it != lineStarts.end(); ++it, ++lineid ) {
- usedw = QMAX( usedw, (*it)->w );
+ usedw = TQMAX( usedw, (*it)->w );
}
if ( r.width() <= 0 ) {
// if the user specifies an invalid rect, this means that the
@@ -372,7 +372,7 @@ void KoTextParag::format( int start, bool doMove )
// needs
r.setWidth( usedw );
} else {
- r.setWidth( QMIN( usedw, r.width() ) );
+ r.setWidth( TQMIN( usedw, r.width() ) );
}
}
}
@@ -403,14 +403,14 @@ void KoTextParag::format( int start, bool doMove )
bool makeInvalid = false; //p && p->lastInFrame;
//kdDebug(32500) << "might move of dy=" << dy << ". previous's lastInFrame (=makeInvalid): " << makeInvalid << endl;
while ( s && dy ) {
- if ( s->movedDown ) { // (not in QRT) : moved down -> invalidate and stop moving down
- s->invalidate( 0 ); // (there is no point in moving down a parag that has a frame break...)
+ if ( s->movedDown ) { // (not in TQRT) : moved down -> tqinvalidate and stop moving down
+ s->tqinvalidate( 0 ); // (there is no point in moving down a parag that has a frame break...)
break;
}
if ( !s->isFullWidth() )
makeInvalid = TRUE;
if ( makeInvalid )
- s->invalidate( 0 );
+ s->tqinvalidate( 0 );
s->move( dy );
//if ( s->lastInFrame )
// makeInvalid = TRUE;
@@ -428,7 +428,7 @@ void KoTextParag::format( int start, bool doMove )
int line = -1;
int lineY = 0; // the one called "cy" in other algos
int baseLine = 0;
- QMap<int, KoTextParagLineStart*>::Iterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::Iterator it = lineStarts.begin();
for ( int i = 0 ; i < len; ++i ) {
KoTextStringChar *chr = &str->at( i );
if ( chr->lineStart ) {
@@ -469,7 +469,7 @@ int KoTextParag::lineHeightOfChar( int i, int *bl, int *y ) const
if ( !isValid() )
( (KoTextParag*)this )->format();
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.end();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.end();
--it;
for ( ;; ) {
if ( i >= it.key() ) {
@@ -494,7 +494,7 @@ KoTextStringChar *KoTextParag::lineStartOfChar( int i, int *index, int *line ) c
( (KoTextParag*)this )->format();
int l = (int)lineStarts.count() - 1;
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.end();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.end();
--it;
for ( ;; ) {
if ( i >= it.key() ) {
@@ -510,7 +510,7 @@ KoTextStringChar *KoTextParag::lineStartOfChar( int i, int *index, int *line ) c
--l;
}
- kdWarning(32500) << "KoTextParag::lineStartOfChar: couldn't find " << i << endl;
+ kdWarning(32500) << "KoTextParag::lineStartOfChar: couldn't tqfind " << i << endl;
return 0;
}
@@ -528,7 +528,7 @@ KoTextStringChar *KoTextParag::lineStartOfLine( int line, int *index ) const
( (KoTextParag*)this )->format();
if ( line >= 0 && line < (int)lineStarts.count() ) {
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
while ( line-- > 0 )
++it;
int i = it.key();
@@ -537,7 +537,7 @@ KoTextStringChar *KoTextParag::lineStartOfLine( int line, int *index ) const
return &str->at( i );
}
- kdWarning(32500) << "KoTextParag::lineStartOfLine: couldn't find " << line << endl;
+ kdWarning(32500) << "KoTextParag::lineStartOfLine: couldn't tqfind " << line << endl;
return 0;
}
@@ -550,14 +550,14 @@ int KoTextParag::leftGap() const
int x = str->at(0).x; /* set x to x of first char */
if ( str->isBidi() ) {
for ( int i = 1; i < str->length(); ++i )
- x = QMIN(x, str->at(i).x);
+ x = TQMIN(x, str->at(i).x);
return x;
}
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
while (line < (int)lineStarts.count()) {
int i = it.key(); /* char index */
- x = QMIN(x, str->at(i).x);
+ x = TQMIN(x, str->at(i).x);
++it;
++line;
}
@@ -600,7 +600,7 @@ void KoTextParag::setFormat( int index, int len, const KoTextFormat *_f, bool us
_f->shadowDistanceX() != of->shadowDistanceX() ||
_f->shadowDistanceY() != of->shadowDistanceY()
) ) {
- invalidate( 0 );
+ tqinvalidate( 0 );
}
if ( flags == -1 || flags == KoTextFormat::Format || !fc ) {
#ifdef DEBUG_COLLECTION
@@ -621,18 +621,18 @@ void KoTextParag::setFormat( int index, int len, const KoTextFormat *_f, bool us
}
}
-void KoTextParag::drawCursorDefault( QPainter &painter, KoTextCursor *cursor, int curx, int cury, int curh, const QColorGroup &cg )
+void KoTextParag::drawCursorDefault( TQPainter &painter, KoTextCursor *cursor, int curx, int cury, int curh, const TQColorGroup &cg )
{
- painter.fillRect( QRect( curx, cury, 1, curh ), cg.color( QColorGroup::Text ) );
+ painter.fillRect( TQRect( curx, cury, 1, curh ), cg.color( TQColorGroup::Text ) );
painter.save();
if ( str->isBidi() ) {
const int d = 4;
if ( at( cursor->index() )->rightToLeft ) {
- painter.setPen( Qt::black );
+ painter.setPen( TQt::black );
painter.drawLine( curx, cury, curx - d / 2, cury + d / 2 );
painter.drawLine( curx, cury + d, curx - d / 2, cury + d / 2 );
} else {
- painter.setPen( Qt::black );
+ painter.setPen( TQt::black );
painter.drawLine( curx, cury, curx + d / 2, cury + d / 2 );
painter.drawLine( curx, cury + d, curx + d / 2, cury + d / 2 );
}
@@ -686,26 +686,26 @@ void KoTextParag::hide()
visible = FALSE;
}
-void KoTextParag::setDirection( QChar::Direction d )
+void KoTextParag::setDirection( TQChar::Direction d )
{
if ( str && str->direction() != d ) {
str->setDirection( d );
- invalidate( 0 );
+ tqinvalidate( 0 );
//// kotext
m_layout.direction = d;
- invalidateCounters(); // #47178
+ tqinvalidateCounters(); // #47178
////
}
}
-QChar::Direction KoTextParag::direction() const
+TQChar::Direction KoTextParag::direction() const
{
- return (str ? str->direction() : QChar::DirON );
+ return (str ? str->direction() : TQChar::DirON );
}
void KoTextParag::setSelection( int id, int start, int end )
{
- QMap<int, KoTextParagSelection>::ConstIterator it = selections().find( id );
+ TQMap<int, KoTextParagSelection>::ConstIterator it = selections().tqfind( id );
if ( it != mSelections->end() ) {
if ( start == ( *it ).start && end == ( *it ).end )
return;
@@ -731,7 +731,7 @@ int KoTextParag::selectionStart( int id ) const
{
if ( !mSelections )
return -1;
- QMap<int, KoTextParagSelection>::ConstIterator it = mSelections->find( id );
+ TQMap<int, KoTextParagSelection>::ConstIterator it = mSelections->tqfind( id );
if ( it == mSelections->end() )
return -1;
return ( *it ).start;
@@ -741,7 +741,7 @@ int KoTextParag::selectionEnd( int id ) const
{
if ( !mSelections )
return -1;
- QMap<int, KoTextParagSelection>::ConstIterator it = mSelections->find( id );
+ TQMap<int, KoTextParagSelection>::ConstIterator it = mSelections->tqfind( id );
if ( it == mSelections->end() )
return -1;
return ( *it ).end;
@@ -751,7 +751,7 @@ bool KoTextParag::hasSelection( int id ) const
{
if ( !mSelections )
return FALSE;
- QMap<int, KoTextParagSelection>::ConstIterator it = mSelections->find( id );
+ TQMap<int, KoTextParagSelection>::ConstIterator it = mSelections->tqfind( id );
if ( it == mSelections->end() )
return FALSE;
return ( *it ).start != ( *it ).end || length() == 1;
@@ -761,7 +761,7 @@ bool KoTextParag::fullSelected( int id ) const
{
if ( !mSelections )
return FALSE;
- QMap<int, KoTextParagSelection>::ConstIterator it = mSelections->find( id );
+ TQMap<int, KoTextParagSelection>::ConstIterator it = mSelections->tqfind( id );
if ( it == mSelections->end() )
return FALSE;
return ( *it ).start == 0 && ( *it ).end == str->length() - 1;
@@ -777,7 +777,7 @@ int KoTextParag::lineY( int l ) const
if ( !isValid() )
( (KoTextParag*)this )->format();
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
while ( l-- > 0 )
++it;
return ( *it )->y;
@@ -793,7 +793,7 @@ int KoTextParag::lineBaseLine( int l ) const
if ( !isValid() )
( (KoTextParag*)this )->format();
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
while ( l-- > 0 )
++it;
return ( *it )->baseLine;
@@ -809,7 +809,7 @@ int KoTextParag::lineHeight( int l ) const
if ( !isValid() )
( (KoTextParag*)this )->format();
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
while ( l-- > 0 )
++it;
return ( *it )->h;
@@ -829,7 +829,7 @@ void KoTextParag::lineInfo( int l, int &y, int &h, int &bl ) const
if ( !isValid() )
( (KoTextParag*)this )->format();
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
while ( l-- > 0 )
++it;
y = ( *it )->y;
@@ -837,7 +837,7 @@ void KoTextParag::lineInfo( int l, int &y, int &h, int &bl ) const
bl = ( *it )->baseLine;
}
-uint KoTextParag::alignment() const
+uint KoTextParag::tqalignment() const
{
return align;
}
@@ -892,29 +892,29 @@ void KoTextParag::setTabStops( int tw )
// tabStopWidth = tw;
}
-QMap<int, KoTextParagSelection> &KoTextParag::selections() const
+TQMap<int, KoTextParagSelection> &KoTextParag::selections() const
{
if ( !mSelections )
- ((KoTextParag *)this)->mSelections = new QMap<int, KoTextParagSelection>;
+ ((KoTextParag *)this)->mSelections = new TQMap<int, KoTextParagSelection>;
return *mSelections;
}
-QPtrList<KoTextCustomItem> &KoTextParag::floatingItems() const
+TQPtrList<KoTextCustomItem> &KoTextParag::floatingItems() const
{
if ( !mFloatingItems )
- ((KoTextParag *)this)->mFloatingItems = new QPtrList<KoTextCustomItem>;
+ ((KoTextParag *)this)->mFloatingItems = new TQPtrList<KoTextCustomItem>;
return *mFloatingItems;
}
void KoTextCursor::setIndex( int i, bool /*restore*/ )
{
-// Note: QRT doesn't allow to position the cursor at string->length
+// Note: TQRT doesn't allow to position the cursor at string->length
// However we need it, when applying a style to a paragraph, so that
// the trailing space gets the style change applied as well.
// Obviously "right of the trailing space" isn't a good place for a real
// cursor, but this needs to be checked somewhere else.
if ( i < 0 || i > string->length() ) {
-#if defined(QT_CHECK_RANGE)
+#if defined(TQT_CHECK_RANGE)
kdWarning(32500) << "KoTextCursor::setIndex: " << i << " out of range" << endl;
//abort();
#endif
@@ -941,78 +941,78 @@ KoParagCounter *KoTextParag::counter()
return m_layout.counter;
}
-void KoTextParag::setMargin( QStyleSheetItem::Margin m, double _i )
+void KoTextParag::setMargin( TQStyleSheetItem::Margin m, double _i )
{
//kdDebug(32500) << "KoTextParag::setMargin " << m << " margin " << _i << endl;
m_layout.margins[m] = _i;
- if ( m == QStyleSheetItem::MarginTop && prev() )
- prev()->invalidate(0); // for top margin (post-1.1: remove this, not necessary anymore)
- invalidate(0);
+ if ( m == TQStyleSheetItem::MarginTop && prev() )
+ prev()->tqinvalidate(0); // for top margin (post-1.1: remove this, not necessary anymore)
+ tqinvalidate(0);
}
void KoTextParag::setMargins( const double * margins )
{
for ( int i = 0 ; i < 5 ; ++i )
m_layout.margins[i] = margins[i];
- invalidate(0);
+ tqinvalidate(0);
}
void KoTextParag::setAlign( int align )
{
- Q_ASSERT( align <= Qt::AlignJustify );
- align &= Qt::AlignHorizontal_Mask;
- setAlignment( align );
- m_layout.alignment = align;
+ Q_ASSERT( align <= TQt::AlignJustify );
+ align &= TQt::AlignHorizontal_Mask;
+ tqsetAlignment( align );
+ m_layout.tqalignment = align;
}
int KoTextParag::resolveAlignment() const
{
- if ( (int)m_layout.alignment == Qt::AlignAuto )
- return str->isRightToLeft() ? Qt::AlignRight : Qt::AlignLeft;
- return m_layout.alignment;
+ if ( (int)m_layout.tqalignment == TQt::AlignAuto )
+ return str->isRightToLeft() ? TQt::AlignRight : TQt::AlignLeft;
+ return m_layout.tqalignment;
}
void KoTextParag::setLineSpacing( double _i )
{
m_layout.setLineSpacingValue(_i);
- invalidate(0);
+ tqinvalidate(0);
}
void KoTextParag::setLineSpacingType( KoParagLayout::SpacingType _type )
{
m_layout.lineSpacingType = _type;
- invalidate(0);
+ tqinvalidate(0);
}
void KoTextParag::setTopBorder( const KoBorder & _brd )
{
m_layout.topBorder = _brd;
- invalidate(0);
+ tqinvalidate(0);
}
void KoTextParag::setBottomBorder( const KoBorder & _brd )
{
m_layout.bottomBorder = _brd;
- invalidate(0);
+ tqinvalidate(0);
}
void KoTextParag::setJoinBorder( bool join )
{
m_layout.joinBorder = join;
- invalidate(0);
+ tqinvalidate(0);
}
-void KoTextParag::setBackgroundColor ( const QColor& color )
+void KoTextParag::setBackgroundColor ( const TQColor& color )
{
m_layout.backgroundColor = color;
- invalidate(0);
+ tqinvalidate(0);
}
void KoTextParag::setNoCounter()
{
delete m_layout.counter;
m_layout.counter = 0L;
- invalidateCounters();
+ tqinvalidateCounters();
}
void KoTextParag::setCounter( const KoParagCounter * pCounter )
@@ -1021,14 +1021,14 @@ void KoTextParag::setCounter( const KoParagCounter * pCounter )
const bool isFootNote = m_layout.counter &&
m_layout.counter->numbering() == KoParagCounter::NUM_FOOTNOTE;
if ( isFootNote ) {
- const QString footNotePrefix = m_layout.counter->prefix(); // this is where the number is
+ const TQString footNotePrefix = m_layout.counter->prefix(); // this is where the number is
delete m_layout.counter;
m_layout.counter = pCounter ? new KoParagCounter( *pCounter ) : new KoParagCounter();
m_layout.counter->setNumbering( KoParagCounter::NUM_FOOTNOTE );
m_layout.counter->setStyle( KoParagCounter::STYLE_NONE ); // no number after the 'prefix'
m_layout.counter->setPrefix( footNotePrefix );
- m_layout.counter->setSuffix( QString::null );
- invalidateCounters();
+ m_layout.counter->setSuffix( TQString() );
+ tqinvalidateCounters();
} else {
if ( pCounter )
setCounter( *pCounter );
@@ -1052,25 +1052,25 @@ void KoTextParag::setCounter( const KoParagCounter & counter )
m_layout.counter = new KoParagCounter( counter );
// Invalidate the counters
- invalidateCounters();
+ tqinvalidateCounters();
}
}
-void KoTextParag::invalidateCounters()
+void KoTextParag::tqinvalidateCounters()
{
// Invalidate this paragraph and all the following ones
// (Numbering may have changed)
- invalidate( 0 );
+ tqinvalidate( 0 );
if ( m_layout.counter )
- m_layout.counter->invalidate();
+ m_layout.counter->tqinvalidate();
KoTextParag *s = next();
// #### Possible optimization: since any invalidation propagates down,
- // it's enough to stop at the first paragraph with an already-invalidated counter, isn't it?
- // This is only true if nobody else calls counter->invalidate...
+ // it's enough to stop at the first paragraph with an already-tqinvalidated counter, isn't it?
+ // This is only true if nobody else calls counter->tqinvalidate...
while ( s ) {
if ( s->m_layout.counter )
- s->m_layout.counter->invalidate();
- s->invalidate( 0 );
+ s->m_layout.counter->tqinvalidate();
+ s->tqinvalidate( 0 );
s = s->next();
}
}
@@ -1085,7 +1085,7 @@ int KoTextParag::counterWidth() const
// Draw the complete label (i.e. heading/list numbers/bullets) for this paragraph.
// This is called by KoTextParag::paint.
-void KoTextParag::drawLabel( QPainter* p, int xLU, int yLU, int /*wLU*/, int /*hLU*/, int baseLU, const QColorGroup& /*cg*/ )
+void KoTextParag::drawLabel( TQPainter* p, int xLU, int yLU, int /*wLU*/, int /*hLU*/, int baseLU, const TQColorGroup& /*cg*/ )
{
if ( !m_layout.counter ) // shouldn't happen
return;
@@ -1107,46 +1107,46 @@ void KoTextParag::drawLabel( QPainter* p, int xLU, int yLU, int /*wLU*/, int /*h
KoTextFormat* format = &counterFormat;
p->save();
- QColor textColor( format->color() );
+ TQColor textColor( format->color() );
if ( !textColor.isValid() ) // Resolve the color at this point
textColor = KoTextFormat::defaultTextColor( p );
- p->setPen( QPen( textColor ) );
+ p->setPen( TQPen( textColor ) );
KoTextZoomHandler * zh = textDocument()->paintingZoomHandler();
assert( zh );
- //bool forPrint = ( p->device()->devType() == QInternal::Printer );
+ //bool forPrint = ( p->device()->devType() == TQInternal::Printer );
bool rtl = str->isRightToLeft(); // when true, we put suffix+counter+prefix at the RIGHT of the paragraph.
- int xLeft = zh->layoutUnitToPixelX( xLU - (rtl ? 0 : counterWidthLU) );
- int y = zh->layoutUnitToPixelY( yLU );
- //int h = zh->layoutUnitToPixelY( yLU, hLU );
- int base = zh->layoutUnitToPixelY( yLU, baseLU );
- int counterWidth = zh->layoutUnitToPixelX( xLU, counterWidthLU );
- int height = zh->layoutUnitToPixelY( yLU, format->height() );
-
- QFont font( format->screenFont( zh ) );
+ int xLeft = zh->tqlayoutUnitToPixelX( xLU - (rtl ? 0 : counterWidthLU) );
+ int y = zh->tqlayoutUnitToPixelY( yLU );
+ //int h = zh->tqlayoutUnitToPixelY( yLU, hLU );
+ int base = zh->tqlayoutUnitToPixelY( yLU, baseLU );
+ int counterWidth = zh->tqlayoutUnitToPixelX( xLU, counterWidthLU );
+ int height = zh->tqlayoutUnitToPixelY( yLU, format->height() );
+
+ TQFont font( format->screenFont( zh ) );
// Footnote numbers are in superscript (in WP and Word, not in OO)
if ( m_layout.counter->numbering() == KoParagCounter::NUM_FOOTNOTE )
{
int pointSize = ( ( font.pointSize() * 2 ) / 3 );
font.setPointSize( pointSize );
- y -= ( height - QFontMetrics(font).height() );
+ y -= ( height - TQFontMetrics(font).height() );
}
p->setFont( font );
// Now draw any bullet that is required over the space left for it.
if ( m_layout.counter->isBullet() )
{
- int xBullet = xLeft + zh->layoutUnitToPixelX( m_layout.counter->bulletX() );
+ int xBullet = xLeft + zh->tqlayoutUnitToPixelX( m_layout.counter->bulletX() );
//kdDebug(32500) << "KoTextParag::drawLabel xLU=" << xLU << " counterWidthLU=" << counterWidthLU << endl;
// The width and height of the bullet is the width of one space
- int width = zh->layoutUnitToPixelX( xLeft, format->width( ' ' ) );
+ int width = zh->tqlayoutUnitToPixelX( xLeft, format->width( ' ' ) );
//kdDebug(32500) << "Pix: xLeft=" << xLeft << " counterWidth=" << counterWidth
// << " xBullet=" << xBullet << " width=" << width << endl;
- QString prefix = m_layout.counter->prefix();
+ TQString prefix = m_layout.counter->prefix();
if ( !prefix.isEmpty() )
{
if ( rtl )
@@ -1163,18 +1163,18 @@ void KoTextParag::drawLabel( QPainter* p, int xLU, int yLU, int /*wLU*/, int /*h
p->drawText( xLeft, posY, prefix );
}
- QRect er( xBullet + (rtl ? width : 0), y + height / 2 - width / 2, width, width );
+ TQRect er( xBullet + (rtl ? width : 0), y + height / 2 - width / 2, width, width );
// Draw the bullet.
int posY = 0;
switch ( m_layout.counter->style() )
{
case KoParagCounter::STYLE_DISCBULLET:
- p->setBrush( QBrush(textColor) );
+ p->setBrush( TQBrush(textColor) );
p->drawEllipse( er );
- p->setBrush( Qt::NoBrush );
+ p->setBrush( TQt::NoBrush );
break;
case KoParagCounter::STYLE_SQUAREBULLET:
- p->fillRect( er, QBrush(textColor) );
+ p->fillRect( er, TQBrush(textColor) );
break;
case KoParagCounter::STYLE_BOXBULLET:
p->drawRect( er );
@@ -1188,7 +1188,7 @@ void KoTextParag::drawLabel( QPainter* p, int xLU, int yLU, int /*wLU*/, int /*h
// font with the given family. This conserves the right size etc.
if ( !m_layout.counter->customBulletFont().isEmpty() )
{
- QFont bulletFont( p->font() );
+ TQFont bulletFont( p->font() );
bulletFont.setFamily( m_layout.counter->customBulletFont() );
p->setFont( bulletFont );
}
@@ -1201,14 +1201,14 @@ void KoTextParag::drawLabel( QPainter* p, int xLU, int yLU, int /*wLU*/, int /*h
if ( sy < 0)
posY -= sy;
- p->drawText( xBullet, posY, m_layout.counter->customBulletCharacter() );
+ p->drawText( xBullet, posY, TQString(m_layout.counter->customBulletCharacter()) );
break;
}
default:
break;
}
- QString suffix = m_layout.counter->suffix();
+ TQString suffix = m_layout.counter->suffix();
if ( !suffix.isEmpty() )
{
if ( !rtl )
@@ -1228,8 +1228,8 @@ void KoTextParag::drawLabel( QPainter* p, int xLU, int yLU, int /*wLU*/, int /*h
}
else
{
- QString counterText = m_layout.counter->text( this );
- // There are no bullets...any parent bullets have already been suppressed.
+ TQString counterText = m_layout.counter->text( this );
+ // There are no bullets...any tqparent bullets have already been suppressed.
// Just draw the text! Note: one space is always appended.
if ( !counterText.isEmpty() )
{
@@ -1254,14 +1254,14 @@ int KoTextParag::breakableTopMargin() const
{
KoTextZoomHandler * zh = textDocument()->formattingZoomHandler();
return zh->ptToLayoutUnitPixY(
- m_layout.margins[ QStyleSheetItem::MarginTop ] );
+ m_layout.margins[ TQStyleSheetItem::MarginTop ] );
}
int KoTextParag::topMargin() const
{
KoTextZoomHandler * zh = textDocument()->formattingZoomHandler();
return zh->ptToLayoutUnitPixY(
- m_layout.margins[ QStyleSheetItem::MarginTop ]
+ m_layout.margins[ TQStyleSheetItem::MarginTop ]
+ ( ( prev() && prev()->joinBorder() && prev()->bottomBorder() == m_layout.bottomBorder &&
prev()->topBorder() == m_layout.topBorder && prev()->leftBorder() == m_layout.leftBorder &&
prev()->rightBorder() == m_layout.rightBorder) ? 0 : m_layout.topBorder.width() ) );
@@ -1271,7 +1271,7 @@ int KoTextParag::bottomMargin() const
{
KoTextZoomHandler * zh = textDocument()->formattingZoomHandler();
return zh->ptToLayoutUnitPixY(
- m_layout.margins[ QStyleSheetItem::MarginBottom ]
+ m_layout.margins[ TQStyleSheetItem::MarginBottom ]
+ ( ( joinBorder() && next() && next()->bottomBorder() == m_layout.bottomBorder &&
next()->topBorder() == m_layout.topBorder && next()->leftBorder() == m_layout.leftBorder &&
next()->rightBorder() == m_layout.rightBorder) ? 0 : m_layout.bottomBorder.width() ) );
@@ -1281,7 +1281,7 @@ int KoTextParag::leftMargin() const
{
KoTextZoomHandler * zh = textDocument()->formattingZoomHandler();
return zh->ptToLayoutUnitPixX(
- m_layout.margins[ QStyleSheetItem::MarginLeft ]
+ m_layout.margins[ TQStyleSheetItem::MarginLeft ]
+ m_layout.leftBorder.width() );
}
@@ -1290,20 +1290,20 @@ int KoTextParag::rightMargin() const
KoTextZoomHandler * zh = textDocument()->formattingZoomHandler();
int cw=0;
if( m_layout.counter && str->isRightToLeft() &&
- (( m_layout.counter->alignment() == Qt::AlignRight ) || ( m_layout.counter->alignment() == Qt::AlignAuto )))
+ (( m_layout.counter->tqalignment() == TQt::AlignRight ) || ( m_layout.counter->tqalignment() == TQt::AlignAuto )))
cw = counterWidth();
return zh->ptToLayoutUnitPixX(
- m_layout.margins[ QStyleSheetItem::MarginRight ]
+ m_layout.margins[ TQStyleSheetItem::MarginRight ]
+ m_layout.rightBorder.width() )
- + cw; /* in layout units already */
+ + cw; /* in tqlayout units already */
}
int KoTextParag::firstLineMargin() const
{
KoTextZoomHandler * zh = textDocument()->formattingZoomHandler();
return zh->ptToLayoutUnitPixY(
- m_layout.margins[ QStyleSheetItem::MarginFirstLine ] );
+ m_layout.margins[ TQStyleSheetItem::MarginFirstLine ] );
}
int KoTextParag::lineSpacing( int line ) const
@@ -1317,7 +1317,7 @@ int KoTextParag::lineSpacing( int line ) const
kdError() << "KoTextParag::lineSpacing assert(line<lines) failed: line=" << line << " lines=" << lineStarts.count() << endl;
return 0;
}
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
while ( line-- > 0 )
++it;
return (*it)->lineSpacing;
@@ -1329,7 +1329,7 @@ int KoTextParag::calculateLineSpacing( int line, int startChar, int lastChar ) c
{
KoTextZoomHandler * zh = textDocument()->formattingZoomHandler();
// TODO add shadow in KoTextFormatter!
- int shadow = 0; //QABS( zh->ptToLayoutUnitPixY( shadowDistanceY() ) );
+ int shadow = 0; //TQABS( zh->ptToLayoutUnitPixY( shadowDistanceY() ) );
if ( m_layout.lineSpacingType == KoParagLayout::LS_SINGLE )
return shadow;
else if ( m_layout.lineSpacingType == KoParagLayout::LS_CUSTOM )
@@ -1340,7 +1340,7 @@ int KoTextParag::calculateLineSpacing( int line, int startChar, int lastChar ) c
kdError() << "KoTextParag::lineSpacing assert(line<lines) failed: line=" << line << " lines=" << lineStarts.count() << endl;
return 0+shadow;
}
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
while ( line-- > 0 )
++it;
@@ -1350,7 +1350,7 @@ int KoTextParag::calculateLineSpacing( int line, int startChar, int lastChar ) c
case KoParagLayout::LS_MULTIPLE:
{
double n = m_layout.lineSpacingValue() - 1.0; // yes, can be negative
- return shadow + qRound( n * heightForLineSpacing( startChar, lastChar ) );
+ return shadow + tqRound( n * heightForLineSpacing( startChar, lastChar ) );
}
case KoParagLayout::LS_ONEANDHALF:
{
@@ -1366,7 +1366,7 @@ int KoTextParag::calculateLineSpacing( int line, int startChar, int lastChar ) c
{
int atLeast = zh->ptToLayoutUnitPixY( m_layout.lineSpacingValue() );
const int lineHeight = ( *it )->h;
- int h = QMAX( lineHeight, atLeast );
+ int h = TQMAX( lineHeight, atLeast );
// height is now the required total height
return shadow + h - lineHeight;
}
@@ -1385,16 +1385,16 @@ int KoTextParag::calculateLineSpacing( int line, int startChar, int lastChar ) c
return 0+shadow;
}
-QRect KoTextParag::pixelRect( KoTextZoomHandler *zh ) const
+TQRect KoTextParag::pixelRect( KoTextZoomHandler *zh ) const
{
- QRect rct( zh->layoutUnitToPixel( rect() ) );
+ TQRect rct( zh->tqlayoutUnitToPixel( rect() ) );
//kdDebug(32500) << " pixelRect for parag " << paragId()
// << ": rect=" << rect() << " pixelRect=" << rct << endl;
// After division we almost always end up with the top overwriting the bottom of the parag above
if ( prev() )
{
- QRect prevRect( zh->layoutUnitToPixel( prev()->rect() ) );
+ TQRect prevRect( zh->tqlayoutUnitToPixel( prev()->rect() ) );
if ( rct.top() < prevRect.bottom() + 1 )
{
//kdDebug(32500) << " pixelRect: rct.top() adjusted to " << prevRect.bottom() + 1 << " (was " << rct.top() << ")" << endl;
@@ -1406,27 +1406,27 @@ QRect KoTextParag::pixelRect( KoTextZoomHandler *zh ) const
// Paint this paragraph. This is called by KoTextDocument::drawParagWYSIWYG
// (KoTextDocument::drawWithoutDoubleBuffer when printing)
-void KoTextParag::paint( QPainter &painter, const QColorGroup &cg, KoTextCursor *cursor, bool drawSelections,
+void KoTextParag::paint( TQPainter &painter, const TQColorGroup &cg, KoTextCursor *cursor, bool drawSelections,
int clipx, int clipy, int clipw, int cliph )
{
#ifdef DEBUG_PAINT
kdDebug(32500) << "KoTextParag::paint ===== id=" << paragId() << " clipx=" << clipx << " clipy=" << clipy << " clipw=" << clipw << " cliph=" << cliph << endl;
- kdDebug(32500) << " clipw in pix (approx) : " << textDocument()->paintingZoomHandler()->layoutUnitToPixelX( clipw ) << " cliph in pix (approx) : " << textDocument()->paintingZoomHandler()->layoutUnitToPixelX( cliph ) << endl;
+ kdDebug(32500) << " clipw in pix (approx) : " << textDocument()->paintingZoomHandler()->tqlayoutUnitToPixelX( clipw ) << " cliph in pix (approx) : " << textDocument()->paintingZoomHandler()->tqlayoutUnitToPixelX( cliph ) << endl;
#endif
KoTextZoomHandler * zh = textDocument()->paintingZoomHandler();
assert(zh);
- QRect paraRect = pixelRect( zh );
+ TQRect paraRect = pixelRect( zh );
// Find left margin size, first line offset and right margin in pixels
- int leftMarginPix = zh->layoutUnitToPixelX( leftMargin() );
- int firstLineOffset = zh->layoutUnitToPixelX( firstLineMargin() );
+ int leftMarginPix = zh->tqlayoutUnitToPixelX( leftMargin() );
+ int firstLineOffset = zh->tqlayoutUnitToPixelX( firstLineMargin() );
// The furthest left and right x-coords of the paragraph,
// including the bullet/counter, but not the borders.
- int leftExtent = QMIN ( leftMarginPix, leftMarginPix + firstLineOffset );
- int rightExtent = paraRect.width() - zh->layoutUnitToPixelX( rightMargin() );
+ int leftExtent = TQMIN ( leftMarginPix, leftMarginPix + firstLineOffset );
+ int rightExtent = paraRect.width() - zh->tqlayoutUnitToPixelX( rightMargin() );
// Draw the paragraph background color
if ( backgroundColor().isValid() )
@@ -1440,7 +1440,7 @@ void KoTextParag::paint( QPainter &painter, const QColorGroup &cg, KoTextCursor
backgroundColor() );
}
- // Let's call drawLabel ourselves, rather than having to deal with QStyleSheetItem to get paintLines to call it!
+ // Let's call drawLabel ourselves, rather than having to deal with TQStyleSheetItem to get paintLines to call it!
if ( m_layout.counter && m_layout.counter->numbering() != KoParagCounter::NUM_NONE && m_lineChanged <= 0 )
{
int cy, h, baseLine;
@@ -1467,10 +1467,10 @@ void KoTextParag::paint( QPainter &painter, const QColorGroup &cg, KoTextCursor
// drawBorders paints outside the give rect, so for the
// x-coords, it just needs to know the left and right extent
// of the paragraph.
- QRect r;
+ TQRect r;
r.setLeft( leftExtent );
r.setRight( rightExtent );
- r.setTop( zh->layoutUnitToPixelY(lineY( 0 )) );
+ r.setTop( zh->tqlayoutUnitToPixelY(lineY( 0 )) );
int lastLine = lines() - 1;
// We need to start from the pixelRect, to make sure the bottom border is entirely painted.
@@ -1479,21 +1479,21 @@ void KoTextParag::paint( QPainter &painter, const QColorGroup &cg, KoTextCursor
// If we don't have a bottom border, we need go as low as possible ( to touch the next parag's border ).
// If we have a bottom border, then we rather exclude the linespacing. Looks nicer. OO does that too.
if ( m_layout.bottomBorder.width() > 0 && drawBottomBorder)
- paragBottom -= zh->layoutUnitToPixelY( lineSpacing( lastLine ) );
+ paragBottom -= zh->tqlayoutUnitToPixelY( lineSpacing( lastLine ) );
paragBottom -= KoBorder::zoomWidthY( m_layout.bottomBorder.width(), zh, 0 );
//kdDebug(32500) << "Parag border: paragBottom=" << paragBottom
// << " bottom border width = " << KoBorder::zoomWidthY( m_layout.bottomBorder.width(), zh, 0 ) << endl;
r.setBottom( paragBottom );
- //kdDebug(32500) << "KoTextParag::paint documentWidth=" << documentWidth() << " LU (" << zh->layoutUnitToPixelX(documentWidth()) << " pixels) bordersRect=" << r << endl;
+ //kdDebug(32500) << "KoTextParag::paint documentWidth=" << documentWidth() << " LU (" << zh->tqlayoutUnitToPixelX(documentWidth()) << " pixels) bordersRect=" << r << endl;
KoBorder::drawBorders( painter, zh, r,
m_layout.leftBorder, m_layout.rightBorder, m_layout.topBorder, m_layout.bottomBorder,
- 0, QPen(), drawTopBorder, drawBottomBorder );
+ 0, TQPen(), drawTopBorder, drawBottomBorder );
}
}
-void KoTextParag::paintLines( QPainter &painter, const QColorGroup &cg, KoTextCursor *cursor, bool drawSelections,
+void KoTextParag::paintLines( TQPainter &painter, const TQColorGroup &cg, KoTextCursor *cursor, bool drawSelections,
int clipx, int clipy, int clipw, int cliph )
{
if ( !visible )
@@ -1508,12 +1508,12 @@ void KoTextParag::paintLines( QPainter &painter, const QColorGroup &cg, KoTextCu
int curx = -1, cury = 0, curh = 0, curline = 0;
int xstart, xend = 0;
- QString qstr = str->toString();
- qstr.replace( QChar(0x00a0U), ' ' ); // Not all fonts have non-breakable-space glyph
+ TQString qstr = str->toString();
+ qstr.tqreplace( TQChar(0x00a0U), ' ' ); // Not all fonts have non-breakable-space glyph
const int nSels = doc ? doc->numSelections() : 1;
- QMemArray<int> selectionStarts( nSels );
- QMemArray<int> selectionEnds( nSels );
+ TQMemArray<int> selectionStarts( nSels );
+ TQMemArray<int> selectionEnds( nSels );
if ( drawSelections ) {
bool hasASelection = FALSE;
for ( int i = 0; i < nSels; ++i ) {
@@ -1572,7 +1572,7 @@ void KoTextParag::paintLines( QPainter &painter, const QColorGroup &cg, KoTextCu
// we flush at end of line
bool flush = ( i == nextLine - 1 );
- // Optimization note: QRT uses "flush |=", which doesn't have shortcut optimization
+ // Optimization note: TQRT uses "flush |=", which doesn't have shortcut optimization
// we flush on format changes
flush = flush || ( nextchr->format() != chr->format() );
@@ -1597,14 +1597,14 @@ void KoTextParag::paintLines( QPainter &painter, const QColorGroup &cg, KoTextCu
// we flush before and after tabs
flush = flush || ( chr->c == '\t' || nextchr->c == '\t' );
// we flush on soft hypens
- flush = flush || ( chr->c.unicode() == 0xad );
+ flush = flush || ( chr->c.tqunicode() == 0xad );
// we flush on custom items
flush = flush || chr->isCustom();
// we flush before custom items
flush = flush || nextchr->isCustom();
// when painting justified we flush on spaces
- if ((alignment() & Qt::AlignJustify) == Qt::AlignJustify )
- //flush = flush || QTextFormatter::isBreakable( str, i );
+ if ((tqalignment() & TQt::AlignJustify) == TQt::AlignJustify )
+ //flush = flush || TQTextFormatter::isBreakable( str, i );
flush = flush || chr->whiteSpace;
// when underlining or striking "word by word" we flush before/after spaces
if (!flush && chr->format()->wordByWord() && chr->format()->isStrikedOrUnderlined())
@@ -1613,7 +1613,7 @@ void KoTextParag::paintLines( QPainter &painter, const QColorGroup &cg, KoTextCu
flush = flush || ( i - paintStart >= 256 );
// we flush when the selection state changes
if ( drawSelections ) {
- // check if selection state changed - TODO update from QRT
+ // check if selection state changed - TODO update from TQRT
bool selectionChange = FALSE;
if ( drawSelections ) {
for ( int j = 0; j < nSels; ++j ) {
@@ -1679,10 +1679,10 @@ void KoTextParag::paintLines( QPainter &painter, const QColorGroup &cg, KoTextCu
// Called by KoTextParag::paintLines
// Draw a set of characters with the same formattings.
// Reimplemented here to convert coordinates first, and call @ref drawFormattingChars.
-void KoTextParag::drawParagString( QPainter &painter, const QString &str, int start, int len, int startX,
+void KoTextParag::drawParagString( TQPainter &painter, const TQString &str, int start, int len, int startX,
int lastY, int baseLine, int bw, int h, bool drawSelections,
- KoTextFormat *format, const QMemArray<int> &selectionStarts,
- const QMemArray<int> &selectionEnds, const QColorGroup &cg, bool rightToLeft, int line )
+ KoTextFormat *format, const TQMemArray<int> &selectionStarts,
+ const TQMemArray<int> &selectionEnds, const TQColorGroup &cg, bool rightToLeft, int line )
{
KoTextZoomHandler * zh = textDocument()->paintingZoomHandler();
assert(zh);
@@ -1696,19 +1696,19 @@ void KoTextParag::drawParagString( QPainter &painter, const QString &str, int st
// Calculate offset (e.g. due to shadow on left or top)
// Important: don't use the 2-args methods here, offsets are not heights
// (0 should be 0, not 1) (#63256)
- int shadowOffsetX_pix = zh->layoutUnitToPixelX( format->offsetX() );
- int shadowOffsetY_pix = zh->layoutUnitToPixelY( format->offsetY() );
+ int shadowOffsetX_pix = zh->tqlayoutUnitToPixelX( format->offsetX() );
+ int shadowOffsetY_pix = zh->tqlayoutUnitToPixelY( format->offsetY() );
// Calculate startX in pixels
- int startX_pix = zh->layoutUnitToPixelX( startX ) /* + at( rightToLeft ? start+len-1 : start )->pixelxadj */;
+ int startX_pix = zh->tqlayoutUnitToPixelX( startX ) /* + at( rightToLeft ? start+len-1 : start )->pixelxadj */;
#ifdef DEBUG_PAINT
kdDebug(32500) << "KoTextParag::drawParagString startX in pixels : " << startX_pix /*<< " adjustment:" << at( rightToLeft ? start+len-1 : start )->pixelxadj*/ << " bw=" << bw << endl;
#endif
- int bw_pix = zh->layoutUnitToPixelX( startX, bw );
- int lastY_pix = zh->layoutUnitToPixelY( lastY );
- int baseLine_pix = zh->layoutUnitToPixelY( lastY, baseLine ); // 2 args=>+1. Is that correct?
- int h_pix = zh->layoutUnitToPixelY( lastY, h );
+ int bw_pix = zh->tqlayoutUnitToPixelX( startX, bw );
+ int lastY_pix = zh->tqlayoutUnitToPixelY( lastY );
+ int baseLine_pix = zh->tqlayoutUnitToPixelY( lastY, baseLine ); // 2 args=>+1. Is that correct?
+ int h_pix = zh->tqlayoutUnitToPixelY( lastY, h );
#ifdef DEBUG_PAINT
kdDebug(32500) << "KoTextParag::drawParagString h(LU)=" << h << " lastY(LU)=" << lastY
<< " h(PIX)=" << h_pix << " lastY(PIX)=" << lastY_pix
@@ -1740,13 +1740,13 @@ void KoTextParag::drawParagString( QPainter &painter, const QString &str, int st
inSelection = true;
switch (j) {
case KoTextDocument::Standard:
- painter.fillRect( startX_pix, lastY_pix, bw_pix, h_pix, cg.color( QColorGroup::Highlight ) );
+ painter.fillRect( startX_pix, lastY_pix, bw_pix, h_pix, cg.color( TQColorGroup::Highlight ) );
break;
case KoTextDocument::InputMethodPreedit:
// no highlight
break;
default:
- painter.fillRect( startX_pix, lastY_pix, bw_pix, h_pix, doc ? doc->selectionColor( j ) : cg.color( QColorGroup::Highlight ) );
+ painter.fillRect( startX_pix, lastY_pix, bw_pix, h_pix, doc ? doc->selectionColor( j ) : cg.color( TQColorGroup::Highlight ) );
break;
}
}
@@ -1762,17 +1762,17 @@ void KoTextParag::drawParagString( QPainter &painter, const QString &str, int st
&& start >= selectionStarts[ KoTextDocument::InputMethodPreedit ]
&& start < selectionEnds[ KoTextDocument::InputMethodPreedit ] )
{
- QColor textColor( format->color() );
- painter.setPen( QPen( textColor ) );
+ TQColor textColor( format->color() );
+ painter.setPen( TQPen( textColor ) );
- QPoint p1( startX_pix, lastY_pix + h_pix - 1 );
- QPoint p2( startX_pix + bw_pix, lastY_pix + h_pix - 1 );
+ TQPoint p1( startX_pix, lastY_pix + h_pix - 1 );
+ TQPoint p2( startX_pix + bw_pix, lastY_pix + h_pix - 1 );
painter.drawLine( p1, p2 );
}
if ( draw_len > 0 )
{
- int draw_startX_pix = zh->layoutUnitToPixelX( draw_startX ) /* + at( rightToLeft ? start+draw_len-1 : start )->pixelxadj*/;
+ int draw_startX_pix = zh->tqlayoutUnitToPixelX( draw_startX ) /* + at( rightToLeft ? start+draw_len-1 : start )->pixelxadj*/;
draw_startX_pix += shadowOffsetX_pix;
lastY_pix += shadowOffsetY_pix;
@@ -1800,7 +1800,7 @@ void KoTextParag::drawParagString( QPainter &painter, const QString &str, int st
selectionEnds, cg, rightToLeft, line, zh, false );
}
- bool forPrint = ( painter.device()->devType() == QInternal::Printer );
+ bool forPrint = ( painter.device()->devType() == TQInternal::Printer );
if ( textDocument()->drawFormattingChars() && !forPrint )
{
drawFormattingChars( painter, start, len,
@@ -1816,10 +1816,10 @@ void KoTextParag::drawParagString( QPainter &painter, const QString &str, int st
// (we have to copy it here, so that color & font changes don't require changing
// a local copy of the text format)
// And we have to keep it separate from drawParagString to avoid s/startX/startX_pix/ etc.
-void KoTextParag::drawParagStringInternal( QPainter &painter, const QString &s, int start, int len, int startX,
+void KoTextParag::drawParagStringInternal( TQPainter &painter, const TQString &s, int start, int len, int startX,
int lastY, int baseLine, int bw, int h, bool drawSelections,
- KoTextFormat *format, const QMemArray<int> &selectionStarts,
- const QMemArray<int> &selectionEnds, const QColorGroup &cg, bool rightToLeft, int line, KoTextZoomHandler* zh, bool drawingShadow )
+ KoTextFormat *format, const TQMemArray<int> &selectionStarts,
+ const TQMemArray<int> &selectionEnds, const TQColorGroup &cg, bool rightToLeft, int line, KoTextZoomHandler* zh, bool drawingShadow )
{
#ifdef DEBUG_PAINT
kdDebug(32500) << "KoTextParag::drawParagStringInternal start=" << start << " len=" << len << " : '" << s.mid(start,len) << "'" << endl;
@@ -1829,27 +1829,27 @@ void KoTextParag::drawParagStringInternal( QPainter &painter, const QString &s,
if ( drawingShadow && format->shadowDistanceX() == 0 && format->shadowDistanceY() == 0 )
return;
// 1) Sort out the color
- QColor textColor( drawingShadow ? format->shadowColor() : format->color() );
+ TQColor textColor( drawingShadow ? format->shadowColor() : format->color() );
if ( !textColor.isValid() ) // Resolve the color at this point
textColor = KoTextFormat::defaultTextColor( &painter );
// 2) Sort out the font
- QFont font( format->screenFont( zh ) );
+ TQFont font( format->screenFont( zh ) );
if ( format->attributeFont() == KoTextFormat::ATT_SMALL_CAPS && s[start].upper() != s[start] )
font = format->smallCapsFont( zh, true );
#if 0
- QFontInfo fi( font );
+ TQFontInfo fi( font );
kdDebug(32500) << "KoTextParag::drawParagStringInternal requested font " << font.pointSizeFloat() << " using font " << fi.pointSize() << "pt (format font: " << format->font().pointSizeFloat() << "pt)" << endl;
- QFontMetrics fm( font );
+ TQFontMetrics fm( font );
kdDebug(32500) << "Real font: " << fi.family() << ". Font height in pixels: " << fm.height() << endl;
#endif
// 3) Paint
- QString str( s );
- if ( str[ (int)str.length() - 1 ].unicode() == 0xad )
+ TQString str( s );
+ if ( str[ (int)str.length() - 1 ].tqunicode() == 0xad )
str.remove( str.length() - 1, 1 );
- painter.setPen( QPen( textColor ) );
+ painter.setPen( TQPen( textColor ) );
painter.setFont( font );
KoTextDocument* doc = document();
@@ -1859,16 +1859,16 @@ void KoTextParag::drawParagStringInternal( QPainter &painter, const QString &s,
for ( int j = 0; j < nSels; ++j ) {
if ( start >= selectionStarts[ j ] && start < selectionEnds[ j ] ) {
if ( !doc || doc->invertSelectionText( j ) )
- textColor = cg.color( QColorGroup::HighlightedText );
- painter.setPen( QPen( textColor ) );
+ textColor = cg.color( TQColorGroup::HighlightedText );
+ painter.setPen( TQPen( textColor ) );
break;
}
}
}
- QPainter::TextDirection dir = rightToLeft ? QPainter::RTL : QPainter::LTR;
+ TQPainter::TextDirection dir = rightToLeft ? TQPainter::RTL : TQPainter::LTR;
- if ( dir != QPainter::RTL && start + len == length() ) // don't draw the last character (trailing space)
+ if ( dir != TQPainter::RTL && start + len == length() ) // don't draw the last character (trailing space)
{
len--;
if ( len <= 0 )
@@ -1877,7 +1877,7 @@ void KoTextParag::drawParagStringInternal( QPainter &painter, const QString &s,
}
KoTextParag::drawFontEffects( &painter, format, zh, font, textColor, startX, baseLine, bw, lastY, h, str[start] );
- if ( str[ start ] != '\t' && str[ start ].unicode() != 0xad ) {
+ if ( str[ start ] != '\t' && str[ start ].tqunicode() != 0xad ) {
str = format->displayedString( str ); // #### This converts the whole string, instead of from start to start+len!
if ( format->vAlign() == KoTextFormat::AlignNormal ) {
int posY = lastY + baseLine;
@@ -1889,14 +1889,14 @@ void KoTextParag::drawParagStringInternal( QPainter &painter, const QString &s,
painter.drawText( startX, posY, str, start, len, dir );
#ifdef BIDI_DEBUG
painter.save();
- painter.setPen ( Qt::red );
+ painter.setPen ( TQt::red );
painter.drawLine( startX, lastY, startX, lastY + baseLine );
painter.drawLine( startX, lastY + baseLine/2, startX + 10, lastY + baseLine/2 );
int w = 0;
int i = 0;
while( i < len )
w += painter.fontMetrics().charWidth( str, start + i++ );
- painter.setPen ( Qt::blue );
+ painter.setPen ( TQt::blue );
painter.drawLine( startX + w - 1, lastY, startX + w - 1, lastY + baseLine );
painter.drawLine( startX + w - 1, lastY + baseLine/2, startX + w - 1 - 10, lastY + baseLine/2 );
painter.restore();
@@ -1927,30 +1927,30 @@ void KoTextParag::drawParagStringInternal( QPainter &painter, const QString &s,
painter.drawText( startX, posY, str, start, len, dir );
}
}
- if ( str[ start ] == '\t' && m_tabCache.contains( start ) ) {
+ if ( str[ start ] == '\t' && m_tabCache.tqcontains( start ) ) {
painter.save();
KoTextZoomHandler * zh = textDocument()->paintingZoomHandler();
const KoTabulator& tab = m_layout.tabList()[ m_tabCache[ start ] ];
int lineWidth = zh->zoomItY( tab.ptWidth );
switch ( tab.filling ) {
case TF_DOTS:
- painter.setPen( QPen( textColor, lineWidth, Qt::DotLine ) );
+ painter.setPen( TQPen( textColor, lineWidth, TQt::DotLine ) );
painter.drawLine( startX, lastY + baseLine, startX + bw, lastY + baseLine );
break;
case TF_LINE:
- painter.setPen( QPen( textColor, lineWidth, Qt::SolidLine ) );
+ painter.setPen( TQPen( textColor, lineWidth, TQt::SolidLine ) );
painter.drawLine( startX, lastY + baseLine, startX + bw, lastY + baseLine );
break;
case TF_DASH:
- painter.setPen( QPen( textColor, lineWidth, Qt::DashLine ) );
+ painter.setPen( TQPen( textColor, lineWidth, TQt::DashLine ) );
painter.drawLine( startX, lastY + baseLine, startX + bw, lastY + baseLine );
break;
case TF_DASH_DOT:
- painter.setPen( QPen( textColor, lineWidth, Qt::DashDotLine ) );
+ painter.setPen( TQPen( textColor, lineWidth, TQt::DashDotLine ) );
painter.drawLine( startX, lastY + baseLine, startX + bw, lastY + baseLine );
break;
case TF_DASH_DOT_DOT:
- painter.setPen( QPen( textColor, lineWidth, Qt::DashDotDotLine ) );
+ painter.setPen( TQPen( textColor, lineWidth, TQt::DashDotDotLine ) );
painter.drawLine( startX, lastY + baseLine, startX + bw, lastY + baseLine );
break;
@@ -1965,25 +1965,25 @@ void KoTextParag::drawParagStringInternal( QPainter &painter, const QString &s,
#ifdef DEBUG_PAINT
//kdDebug(32500) << "we are drawing the end of line " << line << ". Auto-hyphenated: " << lineHyphenated( line ) << endl;
#endif
- bool drawHyphen = at( start+len-1 )->c.unicode() == 0xad;
+ bool drawHyphen = at( start+len-1 )->c.tqunicode() == 0xad;
drawHyphen = drawHyphen || lineHyphenated( line );
if ( drawHyphen ) {
#ifdef DEBUG_PAINT
kdDebug(32500) << "drawing hyphen at x=" << startX+bw << endl;
#endif
- painter.drawText( startX + bw, lastY + baseLine, "-" ); // \xad gives squares with some fonts (!?)
+ painter.drawText( startX + bw, lastY + baseLine, TQString("-") ); // \xad gives squares with some fonts (!?)
}
}
// Paint a zigzag line for "wrong" background spellchecking checked words:
if(
- painter.device()->devType() != QInternal::Printer &&
+ painter.device()->devType() != TQInternal::Printer &&
format->isMisspelled() &&
!drawingShadow &&
textDocument()->drawingMissingSpellLine() )
{
painter.save();
- painter.setPen( QPen( Qt::red, 1 ) );
+ painter.setPen( TQPen( TQt::red, 1 ) );
// Draw 3 pixel lines with increasing offset and distance 4:
for( int zigzag_line = 0; zigzag_line < 3; ++zigzag_line )
@@ -2018,21 +2018,21 @@ bool KoTextParag::lineHyphenated( int l ) const
if ( !isValid() )
const_cast<KoTextParag*>(this)->format();
- QMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
+ TQMap<int, KoTextParagLineStart*>::ConstIterator it = lineStarts.begin();
while ( l-- > 0 )
++it;
return ( *it )->hyphenated;
}
/** Draw the cursor mark. Reimplemented from KoTextParag to convert coordinates first. */
-void KoTextParag::drawCursor( QPainter &painter, KoTextCursor *cursor, int curx, int cury, int curh, const QColorGroup &cg )
+void KoTextParag::drawCursor( TQPainter &painter, KoTextCursor *cursor, int curx, int cury, int curh, const TQColorGroup &cg )
{
KoTextZoomHandler * zh = textDocument()->paintingZoomHandler();
- int x = zh->layoutUnitToPixelX( curx ) /*+ cursor->parag()->at( cursor->index() )->pixelxadj*/;
- //kdDebug(32500) << " drawCursor: LU: [cur]x=" << curx << ", cury=" << cury << " -> PIX: x=" << x << ", y=" << zh->layoutUnitToPixelY( cury ) << endl;
+ int x = zh->tqlayoutUnitToPixelX( curx ) /*+ cursor->parag()->at( cursor->index() )->pixelxadj*/;
+ //kdDebug(32500) << " drawCursor: LU: [cur]x=" << curx << ", cury=" << cury << " -> PIX: x=" << x << ", y=" << zh->tqlayoutUnitToPixelY( cury ) << endl;
KoTextParag::drawCursorDefault( painter, cursor, x,
- zh->layoutUnitToPixelY( cury ),
- zh->layoutUnitToPixelY( cury, curh ), cg );
+ zh->tqlayoutUnitToPixelY( cury ),
+ zh->tqlayoutUnitToPixelY( cury, curh ), cg );
}
// Reimplemented from KoTextParag
@@ -2059,7 +2059,7 @@ void KoTextParag::copyParagData( KoTextParag *parag )
//else
// kdWarning() << "Paragraph has no style " << paragId() << endl;
- // No "following style" setting, or same style -> copy layout & format of previous paragraph
+ // No "following style" setting, or same style -> copy tqlayout & format of previous paragraph
if (!styleApplied)
{
setParagLayout( parag->paragLayout() );
@@ -2082,7 +2082,7 @@ void KoTextParag::copyParagData( KoTextParag *parag )
// Note: we don't call the original KoTextParag::copyParagData on purpose.
// We don't want setListStyle to get called - it ruins our stylesheetitems
// And we don't care about copying the stylesheetitems directly,
- // applying the parag layout will create them
+ // applying the parag tqlayout will create them
}
void KoTextParag::setTabList( const KoTabulatorList &tabList )
@@ -2104,7 +2104,7 @@ void KoTextParag::setTabList( const KoTabulatorList &tabList )
{
setTabArray( 0 );
}
- invalidate( 0 );
+ tqinvalidate( 0 );
}
/** "Reimplemented" (compared to nextTabDefault) to implement non-left-aligned tabs */
@@ -2240,43 +2240,43 @@ void KoTextParag::applyStyle( KoParagStyle *style )
setFormat( newFormat );
}
-void KoTextParag::setParagLayout( const KoParagLayout & layout, int flags, int marginIndex )
+void KoTextParag::setParagLayout( const KoParagLayout & tqlayout, int flags, int marginIndex )
{
//kdDebug(32500) << "KoTextParag::setParagLayout flags=" << flags << endl;
if ( flags & KoParagLayout::Alignment )
- setAlign( layout.alignment );
+ setAlign( tqlayout.tqalignment );
if ( flags & KoParagLayout::Margins ) {
if ( marginIndex == -1 )
- setMargins( layout.margins );
+ setMargins( tqlayout.margins );
else
- setMargin( (QStyleSheetItem::Margin)marginIndex, layout.margins[marginIndex] );
+ setMargin( (TQStyleSheetItem::Margin)marginIndex, tqlayout.margins[marginIndex] );
}
if ( flags & KoParagLayout::LineSpacing )
{
- setLineSpacingType( layout.lineSpacingType );
- setLineSpacing( layout.lineSpacingValue() );
+ setLineSpacingType( tqlayout.lineSpacingType );
+ setLineSpacing( tqlayout.lineSpacingValue() );
}
if ( flags & KoParagLayout::Borders )
{
- setLeftBorder( layout.leftBorder );
- setRightBorder( layout.rightBorder );
- setTopBorder( layout.topBorder );
- setBottomBorder( layout.bottomBorder );
- setJoinBorder( layout.joinBorder );
+ setLeftBorder( tqlayout.leftBorder );
+ setRightBorder( tqlayout.rightBorder );
+ setTopBorder( tqlayout.topBorder );
+ setBottomBorder( tqlayout.bottomBorder );
+ setJoinBorder( tqlayout.joinBorder );
}
if ( flags & KoParagLayout::BackgroundColor )
{
- setBackgroundColor( layout.backgroundColor );
+ setBackgroundColor( tqlayout.backgroundColor );
}
if ( flags & KoParagLayout::BulletNumber )
- setCounter( layout.counter );
+ setCounter( tqlayout.counter );
if ( flags & KoParagLayout::Tabulator )
- setTabList( layout.tabList() );
+ setTabList( tqlayout.tabList() );
if ( flags == KoParagLayout::All )
{
- setDirection( static_cast<QChar::Direction>(layout.direction) );
+ setDirection( static_cast<TQChar::Direction>(tqlayout.direction) );
// Don't call applyStyle from here, it would overwrite any paragraph-specific settings
- setStyle( layout.style );
+ setStyle( tqlayout.style );
}
}
@@ -2290,7 +2290,7 @@ void KoTextParag::setCustomItem( int index, KoTextCustomItem * custom, KoTextFor
//addCustomItem();
document()->registerCustomItem( custom, this );
custom->recalc(); // calc value (e.g. for variables) and set initial size
- invalidate( 0 );
+ tqinvalidate( 0 );
setChanged( true );
}
@@ -2321,7 +2321,7 @@ int KoTextParag::findCustomItem( const KoTextCustomItem * custom ) const
#ifndef NDEBUG
void KoTextParag::printRTDebug( int info )
{
- QString specialFlags;
+ TQString specialFlags;
if ( str->needsSpellCheck() )
specialFlags += " needsSpellCheck=true";
if ( wasMovedDown() )
@@ -2349,10 +2349,10 @@ void KoTextParag::printRTDebug( int info )
static const char * const s_align[] = { "Auto", "Left", "Right", "ERROR", "HCenter", "ERR", "ERR", "ERR", "Justify", };
static const char * const s_linespacing[] = { "Single", "1.5", "2", "custom", "atLeast", "Multiple", "Fixed" };
static const char * const s_dir[] = { "DirL", "DirR", "DirEN", "DirES", "DirET", "DirAN", "DirCS", "DirB", "DirS", "DirWS", "DirON", "DirLRE", "DirLRO", "DirAL", "DirRLE", "DirRLO", "DirPDF", "DirNSM", "DirBN" };
- kdDebug(32500) << " align: " << s_align[alignment()] << " resolveAlignment: " << s_align[resolveAlignment()]
+ kdDebug(32500) << " align: " << s_align[tqalignment()] << " resolveAlignment: " << s_align[resolveAlignment()]
<< " isRTL:" << str->isRightToLeft()
<< " dir: " << s_dir[direction()] << endl;
- QRect pixr = pixelRect( textDocument()->paintingZoomHandler() );
+ TQRect pixr = pixelRect( textDocument()->paintingZoomHandler() );
kdDebug(32500) << " rect() : " << DEBUGRECT( rect() )
<< " pixelRect() : " << DEBUGRECT( pixr ) << endl;
kdDebug(32500) << " topMargin()=" << topMargin()
@@ -2364,7 +2364,7 @@ void KoTextParag::printRTDebug( int info )
kdDebug(32500) << " linespacing type=" << s_linespacing[ -kwLineSpacingType() ]
<< " value=" << kwLineSpacing() << endl;
const int pageBreaking = m_layout.pageBreaking;
- QStringList pageBreakingFlags;
+ TQStringList pageBreakingFlags;
if ( pageBreaking & KoParagLayout::KeepLinesTogether )
pageBreakingFlags.append( "KeepLinesTogether" );
if ( pageBreaking & KoParagLayout::HardFrameBreakBefore )
@@ -2381,7 +2381,7 @@ void KoTextParag::printRTDebug( int info )
static const char * const tabtype[] = { "T_LEFT", "T_CENTER", "T_RIGHT", "T_DEC_PNT", "error!!!" };
KoTabulatorList tabList = m_layout.tabList();
if ( tabList.isEmpty() ) {
- if ( str->toString().find( '\t' ) != -1 )
+ if ( str->toString().tqfind( '\t' ) != -1 )
kdDebug(32500) << "Tab width: " << textDocument()->tabStopWidth() << endl;
} else {
KoTabulatorList::Iterator it = tabList.begin();
@@ -2407,11 +2407,11 @@ void KoTextParag::printRTDebug( int info )
for ( int i = 0 ; i < s->length() ; ++i )
{
KoTextStringChar & ch = s->at(i);
- int pixelx = textDocument()->formattingZoomHandler()->layoutUnitToPixelX( ch.x )
+ int pixelx = textDocument()->formattingZoomHandler()->tqlayoutUnitToPixelX( ch.x )
+ ch.pixelxadj;
if ( ch.lineStart )
kdDebug(32500) << "LINESTART" << endl;
- QString attrs = " ";
+ TQString attrs = " ";
if ( ch.whiteSpace )
attrs += "whitespace ";
if ( !ch.charStop )
@@ -2420,8 +2420,8 @@ void KoTextParag::printRTDebug( int info )
attrs += "wordStop ";
attrs.truncate( attrs.length() - 1 );
- kdDebug(32500) << i << ": '" << QString(ch.c).rightJustify(2)
- << "' (" << QString::number( ch.c.unicode() ).rightJustify(3) << ")"
+ kdDebug(32500) << i << ": '" << TQString(ch.c).rightJustify(2)
+ << "' (" << TQString::number( ch.c.tqunicode() ).rightJustify(3) << ")"
<< " x(LU)=" << ch.x
<< " w(LU)=" << ch.width//s->width(i)
<< " x(PIX)=" << pixelx
@@ -2456,14 +2456,14 @@ void KoTextParag::printRTDebug( int info )
}
#endif
-void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoomHandler *zh, QFont font, const QColor & color, int startX, int baseLine, int bw, int lastY, int /*h*/, QChar firstChar )
+void KoTextParag::drawFontEffects( TQPainter * p, KoTextFormat *format, KoTextZoomHandler *zh, TQFont font, const TQColor & color, int startX, int baseLine, int bw, int lastY, int /*h*/, TQChar firstChar )
{
// This is about drawing underlines and strikeouts
// So abort immediately if there's none to draw.
if ( !format->isStrikedOrUnderlined() )
return;
//kdDebug(32500) << "drawFontEffects wordByWord=" << format->wordByWord() <<
- // " firstChar='" << QString(firstChar) << "'" << endl;
+ // " firstChar='" << TQString(firstChar) << "'" << endl;
// paintLines ensures that we're called word by word if wordByWord is true.
if ( format->wordByWord() && firstChar.isSpace() )
return;
@@ -2484,7 +2484,7 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
if ( format->doubleUnderline())
{
- QColor col = format->textUnderlineColor().isValid() ? format->textUnderlineColor(): color ;
+ TQColor col = format->textUnderlineColor().isValid() ? format->textUnderlineColor(): color ;
int dim=static_cast<int>(0.75*dimd);
dim=dim?dim:1; //width of line should be at least 1
p->save();
@@ -2492,22 +2492,22 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
switch( format->underlineStyle())
{
case KoTextFormat::U_SOLID:
- p->setPen( QPen( col, dim, Qt::SolidLine ) );
+ p->setPen( TQPen( col, dim, TQt::SolidLine ) );
break;
case KoTextFormat::U_DASH:
- p->setPen( QPen( col, dim, Qt::DashLine ) );
+ p->setPen( TQPen( col, dim, TQt::DashLine ) );
break;
case KoTextFormat::U_DOT:
- p->setPen( QPen( col, dim, Qt::DotLine ) );
+ p->setPen( TQPen( col, dim, TQt::DotLine ) );
break;
case KoTextFormat::U_DASH_DOT:
- p->setPen( QPen( col, dim, Qt::DashDotLine ) );
+ p->setPen( TQPen( col, dim, TQt::DashDotLine ) );
break;
case KoTextFormat::U_DASH_DOT_DOT:
- p->setPen( QPen( col, dim, Qt::DashDotDotLine ) );
+ p->setPen( TQPen( col, dim, TQt::DashDotDotLine ) );
break;
default:
- p->setPen( QPen( color, dim, Qt::SolidLine ) );
+ p->setPen( TQPen( color, dim, TQt::SolidLine ) );
}
y += static_cast<int>(1.125*dimd); // slightly under the baseline if possible
@@ -2524,7 +2524,7 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
format->underlineType() == KoTextFormat::U_SIMPLE_BOLD)
{
- QColor col = format->textUnderlineColor().isValid() ? format->textUnderlineColor(): color ;
+ TQColor col = format->textUnderlineColor().isValid() ? format->textUnderlineColor(): color ;
p->save();
int dim=(format->underlineType() == KoTextFormat::U_SIMPLE_BOLD)?static_cast<int>(2*dimd):static_cast<int>(dimd);
dim=dim?dim:1; //width of line should be at least 1
@@ -2533,22 +2533,22 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
switch( format->underlineStyle() )
{
case KoTextFormat::U_SOLID:
- p->setPen( QPen( col, dim, Qt::SolidLine ) );
+ p->setPen( TQPen( col, dim, TQt::SolidLine ) );
break;
case KoTextFormat::U_DASH:
- p->setPen( QPen( col, dim, Qt::DashLine ) );
+ p->setPen( TQPen( col, dim, TQt::DashLine ) );
break;
case KoTextFormat::U_DOT:
- p->setPen( QPen( col, dim, Qt::DotLine ) );
+ p->setPen( TQPen( col, dim, TQt::DotLine ) );
break;
case KoTextFormat::U_DASH_DOT:
- p->setPen( QPen( col, dim, Qt::DashDotLine ) );
+ p->setPen( TQPen( col, dim, TQt::DashDotLine ) );
break;
case KoTextFormat::U_DASH_DOT_DOT:
- p->setPen( QPen( col, dim, Qt::DashDotDotLine ) );
+ p->setPen( TQPen( col, dim, TQt::DashDotDotLine ) );
break;
default:
- p->setPen( QPen( col, dim, Qt::SolidLine ) );
+ p->setPen( TQPen( col, dim, TQt::SolidLine ) );
}
p->drawLine( startX, y, startX + bw, y );
@@ -2561,10 +2561,10 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
int dim=static_cast<int>(dimd);
dim=dim?dim:1; //width of line should be at least 1
y += dim;
- QColor col = format->textUnderlineColor().isValid() ? format->textUnderlineColor(): color ;
+ TQColor col = format->textUnderlineColor().isValid() ? format->textUnderlineColor(): color ;
p->save();
int offset = 2 * dim;
- QPen pen(col, dim, Qt::SolidLine);
+ TQPen pen(col, dim, TQt::SolidLine);
pen.setCapStyle(Qt::RoundCap);
p->setPen(pen);
Q_ASSERT(offset);
@@ -2574,7 +2574,7 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
if(2*((startX/offset)/2)==startX/offset)
pos*=-1;
//draw first part of wave
- p->drawArc( (startX/offset)*offset, y, offset, offset, 0, -qRound(pos*anc*16) );
+ p->drawArc( (startX/offset)*offset, y, offset, offset, 0, -tqRound(pos*anc*16) );
//now the main part
int zigzag_x = (startX/offset+1)*offset;
for ( ; zigzag_x + offset <= bw+startX; zigzag_x += offset)
@@ -2584,7 +2584,7 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
}
//and here we finish
anc=acos(1.0-2*(static_cast<double>((startX+bw)%offset)/static_cast<double>(offset)))/3.1415*180;
- p->drawArc( zigzag_x, y, offset, offset, 180*16, -qRound(pos*anc*16) );
+ p->drawArc( zigzag_x, y, offset, offset, 180*16, -tqRound(pos*anc*16) );
p->restore();
font.setUnderline( FALSE );
p->setFont( font );
@@ -2605,22 +2605,22 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
switch( format->strikeOutStyle() )
{
case KoTextFormat::S_SOLID:
- p->setPen( QPen( color, dim, Qt::SolidLine ) );
+ p->setPen( TQPen( color, dim, TQt::SolidLine ) );
break;
case KoTextFormat::S_DASH:
- p->setPen( QPen( color, dim, Qt::DashLine ) );
+ p->setPen( TQPen( color, dim, TQt::DashLine ) );
break;
case KoTextFormat::S_DOT:
- p->setPen( QPen( color, dim, Qt::DotLine ) );
+ p->setPen( TQPen( color, dim, TQt::DotLine ) );
break;
case KoTextFormat::S_DASH_DOT:
- p->setPen( QPen( color, dim, Qt::DashDotLine ) );
+ p->setPen( TQPen( color, dim, TQt::DashDotLine ) );
break;
case KoTextFormat::S_DASH_DOT_DOT:
- p->setPen( QPen( color, dim, Qt::DashDotDotLine ) );
+ p->setPen( TQPen( color, dim, TQt::DashDotDotLine ) );
break;
default:
- p->setPen( QPen( color, dim, Qt::SolidLine ) );
+ p->setPen( TQPen( color, dim, TQt::SolidLine ) );
}
y -= static_cast<int>(5*dimd);
@@ -2637,22 +2637,22 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
switch( format->strikeOutStyle() )
{
case KoTextFormat::S_SOLID:
- p->setPen( QPen( color, dim, Qt::SolidLine ) );
+ p->setPen( TQPen( color, dim, TQt::SolidLine ) );
break;
case KoTextFormat::S_DASH:
- p->setPen( QPen( color, dim, Qt::DashLine ) );
+ p->setPen( TQPen( color, dim, TQt::DashLine ) );
break;
case KoTextFormat::S_DOT:
- p->setPen( QPen( color, dim, Qt::DotLine ) );
+ p->setPen( TQPen( color, dim, TQt::DotLine ) );
break;
case KoTextFormat::S_DASH_DOT:
- p->setPen( QPen( color, dim, Qt::DashDotLine ) );
+ p->setPen( TQPen( color, dim, TQt::DashDotLine ) );
break;
case KoTextFormat::S_DASH_DOT_DOT:
- p->setPen( QPen( color, dim, Qt::DashDotDotLine ) );
+ p->setPen( TQPen( color, dim, TQt::DashDotDotLine ) );
break;
default:
- p->setPen( QPen( color, dim, Qt::SolidLine ) );
+ p->setPen( TQPen( color, dim, TQt::SolidLine ) );
}
y -= static_cast<int>(4*dimd);
@@ -2667,9 +2667,9 @@ void KoTextParag::drawFontEffects( QPainter * p, KoTextFormat *format, KoTextZoo
}
// ### is this method correct for RTL text?
-QString KoTextParag::toString( int from, int length ) const
+TQString KoTextParag::toString( int from, int length ) const
{
- QString str;
+ TQString str;
if ( from == 0 && m_layout.counter && m_layout.counter->numbering() != KoParagCounter::NUM_FOOTNOTE )
str += m_layout.counter->text( this ) + ' ';
if ( length == -1 )
@@ -2691,27 +2691,27 @@ QString KoTextParag::toString( int from, int length ) const
return str;
}
-// we cannot use QString::simplifyWhiteSpace() because it removes
+// we cannot use TQString::simplifyWhiteSpace() because it removes
// leading and trailing whitespace, but such whitespace is significant
// in ODF -- so we use this function to compress sequences of space characters
// into single spaces
-static QString normalizeWhitespace( const QString& in, bool leadingSpace )
+static TQString normalizeWhitespace( const TQString& in, bool leadingSpace )
{
- QString text = in;
+ TQString text = in;
int r, w = 0;
int len = text.length();
for ( r = 0; r < len; ++r )
{
- QCharRef ch = text[r];
+ TQCharRef ch = text[r];
// check for space, tab, line feed, carriage return
if ( ch == ' ' || ch == '\t' ||ch == '\r' || ch == '\n')
{
- // if we were lead by whitespace in some parent or previous sibling element,
+ // if we were lead by whitespace in some tqparent or previous sibling element,
// we completely collapse this space
if ( r != 0 || !leadingSpace )
- text[w++] = QChar( ' ' );
+ text[w++] = TQChar( ' ' );
// find the end of the whitespace run
while ( r < len && text[r].isSpace() )
@@ -2733,23 +2733,23 @@ static QString normalizeWhitespace( const QString& in, bool leadingSpace )
return text;
}
-void KoTextParag::loadOasisSpan( const QDomElement& parent, KoOasisContext& context, uint& pos, bool stripLeadingSpace )
+void KoTextParag::loadOasisSpan( const TQDomElement& tqparent, KoOasisContext& context, uint& pos, bool stripLeadingSpace )
{
bool dummy;
- return loadOasisSpan( parent, context, pos, stripLeadingSpace, &dummy );
+ return loadOasisSpan( tqparent, context, pos, stripLeadingSpace, &dummy );
}
-void KoTextParag::loadOasisSpan( const QDomElement& parent, KoOasisContext& context, uint& pos, bool stripLeadingSpace, bool *hasTrailingSpace )
+void KoTextParag::loadOasisSpan( const TQDomElement& tqparent, KoOasisContext& context, uint& pos, bool stripLeadingSpace, bool *hasTrailingSpace )
{
- // Parse every child node of the parent
+ // Parse every child node of the tqparent
// Can't use forEachElement here since we also care about text nodes
- QDomNode node;
- for ( node = parent.firstChild(); !node.isNull(); node = node.nextSibling() )
+ TQDomNode node;
+ for ( node = tqparent.firstChild(); !node.isNull(); node = node.nextSibling() )
{
- QDomElement ts = node.toElement();
- QString textData;
- const QString localName( ts.localName() );
+ TQDomElement ts = node.toElement();
+ TQString textData;
+ const TQString localName( ts.localName() );
const bool isTextNS = ts.namespaceURI() == KoXmlNS::text;
KoTextCustomItem* customItem = 0;
@@ -2772,7 +2772,7 @@ void KoTextParag::loadOasisSpan( const QDomElement& parent, KoOasisContext& cont
// should only have one space between each of "Foo", "Bar", and "Baz"
// so we need to keep track of whether there was any trailing whitespace
// in sub-spans so that we can propogate the whitespace compression state
- // back up to the parent element
+ // back up to the tqparent element
loadOasisSpan( ts, context, pos, stripLeadingSpace, hasTrailingSpace ); // recurse
stripLeadingSpace = *hasTrailingSpace;
context.styleStack().restore();
@@ -2781,7 +2781,7 @@ void KoTextParag::loadOasisSpan( const QDomElement& parent, KoOasisContext& cont
{
int howmany = 1;
if (ts.hasAttributeNS( KoXmlNS::text, "c"))
- howmany = ts.attributeNS( KoXmlNS::text, "c", QString::null).toInt();
+ howmany = ts.attributeNS( KoXmlNS::text, "c", TQString()).toInt();
textData.fill(32, howmany);
}
@@ -2800,7 +2800,7 @@ void KoTextParag::loadOasisSpan( const QDomElement& parent, KoOasisContext& cont
}
else if ( node.isProcessingInstruction() )
{
- QDomProcessingInstruction pi = node.toProcessingInstruction();
+ TQDomProcessingInstruction pi = node.toProcessingInstruction();
if ( pi.target() == "opendocument" && pi.data().startsWith( "cursor-position" ) )
{
context.setCursorPosition( this, pos );
@@ -2849,7 +2849,7 @@ void KoTextParag::loadOasisSpan( const QDomElement& parent, KoOasisContext& cont
KoParagLayout KoTextParag::loadParagLayout( KoOasisContext& context, KoStyleCollection *styleCollection, bool findStyle )
{
- KoParagLayout layout;
+ KoParagLayout tqlayout;
// Only when loading paragraphs, not when loading styles
if ( findStyle )
@@ -2857,7 +2857,7 @@ KoParagLayout KoTextParag::loadParagLayout( KoOasisContext& context, KoStyleColl
KoParagStyle *style;
// Name of the style. If there is no style, then we do not supply
// any default!
- QString styleName = context.styleStack().userStyleName( "paragraph" );
+ TQString styleName = context.styleStack().userStyleName( "paragraph" );
if ( !styleName.isEmpty() )
{
style = styleCollection->findStyle( styleName );
@@ -2877,17 +2877,17 @@ KoParagLayout KoTextParag::loadParagLayout( KoOasisContext& context, KoStyleColl
style = styleCollection->findStyle( "Standard" );
}
Q_ASSERT(style);
- layout.style = style;
+ tqlayout.style = style;
}
- KoParagLayout::loadOasisParagLayout( layout, context );
+ KoParagLayout::loadOasisParagLayout( tqlayout, context );
- return layout;
+ return tqlayout;
}
-void KoTextParag::loadOasis( const QDomElement& parent, KoOasisContext& context, KoStyleCollection *styleCollection, uint& pos )
+void KoTextParag::loadOasis( const TQDomElement& tqparent, KoOasisContext& context, KoStyleCollection *styleCollection, uint& pos )
{
- // First load layout from style
+ // First load tqlayout from style
KoParagLayout paragLayout = loadParagLayout( context, styleCollection, true );
setParagLayout( paragLayout );
@@ -2898,7 +2898,7 @@ void KoTextParag::loadOasis( const QDomElement& parent, KoOasisContext& context,
// Load text
// OO.o compatibility: ignore leading whitespace in <p> and <h> elements
- loadOasisSpan( parent, context, pos, true );
+ loadOasisSpan( tqparent, context, pos, true );
// Apply default format to trailing space
const int len = str->length();
@@ -2906,7 +2906,7 @@ void KoTextParag::loadOasis( const QDomElement& parent, KoOasisContext& context,
setFormat( len - 1, 1, paragFormat(), TRUE );
setChanged( true );
- invalidate( 0 );
+ tqinvalidate( 0 );
}
void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context,
@@ -2915,25 +2915,25 @@ void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context,
{
KoGenStyles& mainStyles = context.mainStyles();
- // Write paraglayout to styles (with parent == the parag's style)
- QString parentStyleName;
+ // Write paragtqlayout to styles (with tqparent == the parag's style)
+ TQString tqparentStyleName;
if ( m_layout.style )
- parentStyleName = m_layout.style->name();
+ tqparentStyleName = m_layout.style->name();
- KoGenStyle autoStyle( KoGenStyle::STYLE_AUTO, "paragraph", parentStyleName );
+ KoGenStyle autoStyle( KoGenStyle::STYLE_AUTO, "paragraph", tqparentStyleName );
paragFormat()->save( autoStyle, context );
m_layout.saveOasis( autoStyle, context, false );
- // First paragraph is special, it includes page-layout info (for word-processing at least)
+ // First paragraph is special, it includes page-tqlayout info (for word-processing at least)
if ( !prev() ) {
if ( context.variableSettings() )
autoStyle.addProperty( "style:page-number", context.variableSettings()->startingPageNumber() );
- // Well we support only one page layout, so the first parag always points to "Standard".
+ // Well we support only one page tqlayout, so the first parag always points to "Standard".
autoStyle.addAttribute( "style:master-page-name", "Standard" );
}
- QString autoParagStyleName = mainStyles.lookup( autoStyle, "P", KoGenStyles::ForceNumbering );
+ TQString autoParagStyleName = mainStyles.lookup( autoStyle, "P", KoGenStyles::ForceNumbering );
KoParagCounter* paragCounter = m_layout.counter;
// outline (text:h) assumes paragCounter != 0 (because depth is mandatory)
@@ -2949,10 +2949,10 @@ void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context,
KoGenStyle listStyle( KoGenStyle::STYLE_AUTO_LIST /*, no family*/ );
paragCounter->saveOasis( listStyle );
- QString autoListStyleName = mainStyles.lookup( listStyle, "L", KoGenStyles::ForceNumbering );
+ TQString autoListStyleName = mainStyles.lookup( listStyle, "L", KoGenStyles::ForceNumbering );
writer.addAttribute( "text:style-name", autoListStyleName );
- QString textNumber = m_layout.counter->text( this );
+ TQString textNumber = m_layout.counter->text( this );
if ( !textNumber.isEmpty() )
{
// This is to help export filters
@@ -2969,7 +2969,7 @@ void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context,
if ( paragCounter->numbering() == KoParagCounter::NUM_NONE )
writer.addAttribute( "text:is-list-header", "true" );
- QString textNumber = paragCounter->text( this );
+ TQString textNumber = paragCounter->text( this );
if ( !textNumber.isEmpty() )
{
// This is to help export filters
@@ -2985,7 +2985,7 @@ void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context,
writer.addAttribute( "text:style-name", autoParagStyleName );
}
- QString text = str->toString();
+ TQString text = str->toString();
Q_ASSERT( text.right(1)[0] == ' ' );
const int cursorIndex = context.cursorTextParagraph() == this ? context.cursorTextIndex() : -1;
@@ -3001,7 +3001,7 @@ void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context,
curFormat->save( gs, context, paragFormat() ); \
writer.startElement( "text:span" ); \
if ( !gs.isEmpty() ) { \
- const QString autoStyleName = mainStyles.lookup( gs, "T" ); \
+ const TQString autoStyleName = mainStyles.lookup( gs, "T" ); \
writer.addAttribute( "text:style-name", autoStyleName ); \
} \
writer.addTextSpan( text.mid( startPos, next - startPos ), m_tabCache ); \
@@ -3059,7 +3059,7 @@ void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context,
{
lastFormatRaw = newFormat;
// Remove isMisspelled from format, to avoid useless derived styles
- // (which would be indentical to their parent style)
+ // (which would be indentical to their tqparent style)
KoTextFormat tmpFormat( *newFormat );
tmpFormat.setMisspelled( false );
newFormat = formatCollection()->format( &tmpFormat );
@@ -3081,7 +3081,7 @@ void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context,
curFormat->save( gs, context, paragFormat() );
writer.startElement( "text:span" );
if ( !gs.isEmpty() ) {
- const QString autoStyleName = mainStyles.lookup( gs, "T" );
+ const TQString autoStyleName = mainStyles.lookup( gs, "T" );
writer.addAttribute( "text:style-name", autoStyleName );
}
KoTextCustomItem* customItem = ch.customItem();
@@ -3110,13 +3110,13 @@ void KoTextParag::applyListStyle( KoOasisContext& context, int restartNumbering,
m_layout.counter = new KoParagCounter;
m_layout.counter->loadOasis( context, restartNumbering, orderedList, heading, level );
// We emulate space-before with a left paragraph indent (#109223)
- const QDomElement listStyleProperties = context.listStyleStack().currentListStyleProperties();
+ const TQDomElement listStyleProperties = context.listStyleStack().currentListStyleProperties();
if ( listStyleProperties.hasAttributeNS( KoXmlNS::text, "space-before" ) )
{
- double spaceBefore = KoUnit::parseValue( listStyleProperties.attributeNS( KoXmlNS::text, "space-before", QString::null ) );
- m_layout.margins[ QStyleSheetItem::MarginLeft ] += spaceBefore; // added to left-margin, see 15.12 in spec.
+ double spaceBefore = KoUnit::parseValue( listStyleProperties.attributeNS( KoXmlNS::text, "space-before", TQString() ) );
+ m_layout.margins[ TQStyleSheetItem::MarginLeft ] += spaceBefore; // added to left-margin, see 15.12 in spec.
}
- // need to call invalidateCounters() ? Not during the initial loading at least.
+ // need to call tqinvalidateCounters() ? Not during the initial loading at least.
}
int KoTextParag::documentWidth() const
@@ -3145,25 +3145,25 @@ void KoTextParag::fixParagWidth( bool viewFormattingChars )
if ( viewFormattingChars && lineStartList().count() == 1 ) // don't use lines() here, parag not formatted yet
{
KoTextFormat * lastFormat = at( length() - 1 )->format();
- setWidth( QMIN( rect().width() + lastFormat->width('x'), doc->width() ) );
+ setWidth( TQMIN( rect().width() + lastFormat->width('x'), doc->width() ) );
}
// Warning, if adding anything else here, adjust KWTextFrameSet::fixParagWidth
}
// Called by KoTextParag::drawParagString - all params are in pixel coordinates
-void KoTextParag::drawFormattingChars( QPainter &painter, int start, int len,
+void KoTextParag::drawFormattingChars( TQPainter &painter, int start, int len,
int lastY_pix, int baseLine_pix, int h_pix, // in pixels
bool /*drawSelections*/,
- KoTextFormat * /*lastFormat*/, const QMemArray<int> &/*selectionStarts*/,
- const QMemArray<int> &/*selectionEnds*/, const QColorGroup & /*cg*/,
+ KoTextFormat * /*lastFormat*/, const TQMemArray<int> &/*selectionStarts*/,
+ const TQMemArray<int> &/*selectionEnds*/, const TQColorGroup & /*cg*/,
bool rightToLeft, int /*line*/, KoTextZoomHandler* zh,
int whichFormattingChars )
{
if ( !whichFormattingChars )
return;
painter.save();
- //QPen pen( cg.color( QColorGroup::Highlight ) );
- QPen pen( KGlobalSettings::linkColor() ); // #101820
+ //TQPen pen( cg.color( TQColorGroup::Highlight ) );
+ TQPen pen( KGlobalSettings::linkColor() ); // #101820
painter.setPen( pen );
//kdDebug() << "KWTextParag::drawFormattingChars start=" << start << " len=" << len << " length=" << length() << endl;
if ( start + len == length() && ( whichFormattingChars & FormattingEndParag ) )
@@ -3172,14 +3172,14 @@ void KoTextParag::drawFormattingChars( QPainter &painter, int start, int len,
KoTextStringChar &ch = str->at( length() - 1 );
KoTextFormat* format = static_cast<KoTextFormat *>( ch.format() );
int w = format->charWidth( zh, true, &ch, this, 'X' );
- int size = QMIN( w, h_pix * 3 / 4 );
+ int size = TQMIN( w, h_pix * 3 / 4 );
// x,y is the bottom right corner of the
//kdDebug() << "startX=" << startX << " bw=" << bw << " w=" << w << endl;
int x;
if ( rightToLeft )
- x = zh->layoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + ch.pixelwidth - 1;
+ x = zh->tqlayoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + ch.pixelwidth - 1;
else
- x = zh->layoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + w;
+ x = zh->tqlayoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + w;
int y = lastY_pix + baseLine_pix;
//kdDebug() << "KWTextParag::drawFormattingChars drawing CR at " << x << "," << y << endl;
painter.drawLine( (int)(x - size * 0.2), y - size, (int)(x - size * 0.2), y );
@@ -3188,9 +3188,9 @@ void KoTextParag::drawFormattingChars( QPainter &painter, int start, int len,
painter.drawLine( x, y - size, (int)(x - size * 0.5), y - size);
painter.drawArc( x - size, y - size, size, (int)(size / 2), -90*16, -180*16 );
#ifdef DEBUG_FORMATTING
- painter.setPen( Qt::blue );
- painter.drawRect( zh->layoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ - 1, lastY_pix, ch.pixelwidth, baseLine_pix );
- QPen pen( cg.color( QColorGroup::Highlight ) );
+ painter.setPen( TQt::blue );
+ painter.drawRect( zh->tqlayoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ - 1, lastY_pix, ch.pixelwidth, baseLine_pix );
+ TQPen pen( cg.color( TQColorGroup::Highlight ) );
painter.setPen( pen );
#endif
}
@@ -3200,28 +3200,28 @@ void KoTextParag::drawFormattingChars( QPainter &painter, int start, int len,
(whichFormattingChars & FormattingTabs) ||
(whichFormattingChars & FormattingBreak) )
{
- int end = QMIN( start + len, length() - 1 ); // don't look at the trailing space
+ int end = TQMIN( start + len, length() - 1 ); // don't look at the trailing space
for ( int i = start ; i < end ; ++i )
{
KoTextStringChar &ch = str->at(i);
#ifdef DEBUG_FORMATTING
- painter.setPen( (i % 2)? Qt::red: Qt::green );
- painter.drawRect( zh->layoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ - 1, lastY_pix, ch.pixelwidth, baseLine_pix );
- QPen pen( cg.color( QColorGroup::Highlight ) );
+ painter.setPen( (i % 2)? TQt::red: TQt::green );
+ painter.drawRect( zh->tqlayoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ - 1, lastY_pix, ch.pixelwidth, baseLine_pix );
+ TQPen pen( cg.color( TQColorGroup::Highlight ) );
painter.setPen( pen );
#endif
if ( ch.isCustom() )
continue;
- if ( (ch.c == ' ' || ch.c.unicode() == 0x00a0U)
+ if ( (ch.c == ' ' || ch.c.tqunicode() == 0x00a0U)
&& (whichFormattingChars & FormattingSpace))
{
// Don't use ch.pixelwidth here. We want a square with
// the same size for all spaces, even the justified ones
- int w = zh->layoutUnitToPixelX( ch.format()->width( ' ' ) );
- int height = zh->layoutUnitToPixelY( ch.ascent() );
- int size = QMAX( 2, QMIN( w/2, height/3 ) ); // Enfore that it's a square, and that it's visible
- int x = zh->layoutUnitToPixelX( ch.x ); // + ch.pixelxadj;
- QRect spcRect( x + (ch.pixelwidth - size) / 2, lastY_pix + baseLine_pix - (height - size) / 2, size, size );
+ int w = zh->tqlayoutUnitToPixelX( ch.format()->width( ' ' ) );
+ int height = zh->tqlayoutUnitToPixelY( ch.ascent() );
+ int size = TQMAX( 2, TQMIN( w/2, height/3 ) ); // Enfore that it's a square, and that it's visible
+ int x = zh->tqlayoutUnitToPixelX( ch.x ); // + ch.pixelxadj;
+ TQRect spcRect( x + (ch.pixelwidth - size) / 2, lastY_pix + baseLine_pix - (height - size) / 2, size, size );
if ( ch.c == ' ' )
painter.drawRect( spcRect );
else // nbsp
@@ -3234,15 +3234,15 @@ void KoTextParag::drawFormattingChars( QPainter &painter, int start, int len,
//kdDebug() << "tab x=" << ch.x << " nextch.x=" << nextch.x
// << " nextx=" << nextx << " startX=" << startX << " bw=" << bw << endl;
int availWidth = nextx - ch.x - 1;
- availWidth=zh->layoutUnitToPixelX(availWidth);*/
+ availWidth=zh->tqlayoutUnitToPixelX(availWidth);*/
int availWidth = ch.pixelwidth;
KoTextFormat* format = ch.format();
- int x = zh->layoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + availWidth / 2;
+ int x = zh->tqlayoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + availWidth / 2;
int charWidth = format->screenFontMetrics( zh ).width( 'W' );
- int size = QMIN( availWidth, charWidth ) / 2 ; // actually the half size
- int y = lastY_pix + baseLine_pix - zh->layoutUnitToPixelY( ch.ascent()/2 );
+ int size = TQMIN( availWidth, charWidth ) / 2 ; // actually the half size
+ int y = lastY_pix + baseLine_pix - zh->tqlayoutUnitToPixelY( ch.ascent()/2 );
int arrowsize = zh->zoomItY( 2 );
painter.drawLine( x - size, y, x + size, y );
if ( rightToLeft )
@@ -3261,7 +3261,7 @@ void KoTextParag::drawFormattingChars( QPainter &painter, int start, int len,
// draw line break
KoTextFormat* format = static_cast<KoTextFormat *>( ch.format() );
int w = format->charWidth( zh, true, &ch, this, 'X' );
- int size = QMIN( w, h_pix * 3 / 4 );
+ int size = TQMIN( w, h_pix * 3 / 4 );
int arrowsize = zh->zoomItY( 2 );
// x,y is the bottom right corner of the reversed L
//kdDebug() << "startX=" << startX << " bw=" << bw << " w=" << w << endl;
@@ -3269,7 +3269,7 @@ void KoTextParag::drawFormattingChars( QPainter &painter, int start, int len,
//kdDebug() << "KWTextParag::drawFormattingChars drawing Line Break at " << x << "," << y << endl;
if ( rightToLeft )
{
- int x = zh->layoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + ch.pixelwidth - 1;
+ int x = zh->tqlayoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + ch.pixelwidth - 1;
painter.drawLine( x - size, y - size, x - size, y );
painter.drawLine( x - size, y, (int)(x - size * 0.3), y );
// Now the arrow
@@ -3278,7 +3278,7 @@ void KoTextParag::drawFormattingChars( QPainter &painter, int start, int len,
}
else
{
- int x = zh->layoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + w - 1;
+ int x = zh->tqlayoutUnitToPixelX( ch.x ) /*+ ch.pixelxadj*/ + w - 1;
painter.drawLine( x, y - size, x, y );
painter.drawLine( x, y, (int)(x - size * 0.7), y );
// Now the arrow
@@ -3294,12 +3294,12 @@ void KoTextParag::drawFormattingChars( QPainter &painter, int start, int len,
int KoTextParag::heightForLineSpacing( int startChar, int lastChar ) const
{
int h = 0;
- int end = QMIN( lastChar, length() - 1 ); // don't look at the trailing space
+ int end = TQMIN( lastChar, length() - 1 ); // don't look at the trailing space
for( int i = startChar; i <= end; ++i )
{
const KoTextStringChar &chr = str->at( i );
if ( !chr.isCustom() )
- h = QMAX( h, chr.format()->height() );
+ h = TQMAX( h, chr.format()->height() );
}
return h;
}