summaryrefslogtreecommitdiffstats
path: root/src/kernel/tqrichtext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/tqrichtext.cpp')
-rw-r--r--src/kernel/tqrichtext.cpp622
1 files changed, 311 insertions, 311 deletions
diff --git a/src/kernel/tqrichtext.cpp b/src/kernel/tqrichtext.cpp
index 98fbc8f53..eddb23761 100644
--- a/src/kernel/tqrichtext.cpp
+++ b/src/kernel/tqrichtext.cpp
@@ -83,7 +83,7 @@ const int border_tolerance = 2;
static inline bool is_printer( TQPainter *p )
{
if ( !p || !p->device() )
- return FALSE;
+ return false;
return p->device()->devType() == TQInternal::Printer;
}
@@ -111,7 +111,7 @@ static inline int scale( int value, TQPainter *painter )
inline bool isBreakable( TQTextString *string, int pos )
{
if (string->at(pos).nobreak)
- return FALSE;
+ return false;
return (pos < string->length()-1 && string->at(pos+1).softBreak);
}
@@ -121,7 +121,7 @@ void TQTextCommandHistory::addCommand( TQTextCommand *cmd )
{
if ( current < (int)history.count() - 1 ) {
TQPtrList<TQTextCommand> commands;
- commands.setAutoDelete( FALSE );
+ commands.setAutoDelete( false );
for( int i = 0; i <= current; ++i ) {
commands.insert( i, history.at( 0 ) );
@@ -131,7 +131,7 @@ void TQTextCommandHistory::addCommand( TQTextCommand *cmd )
commands.append( cmd );
history.clear();
history = commands;
- history.setAutoDelete( TRUE );
+ history.setAutoDelete( true );
} else {
history.append( cmd );
}
@@ -254,7 +254,7 @@ TQTextCursor *TQTextDeleteCommand::unexecute( TQTextCursor *c )
cursor.setParagraph( s );
cursor.setIndex( index );
TQString str = TQTextString::toString( text );
- cursor.insert( str, TRUE, &text );
+ cursor.insert( str, true, &text );
if ( c )
*c = cursor;
cursor.setParagraph( s );
@@ -275,7 +275,7 @@ TQTextCursor *TQTextDeleteCommand::unexecute( TQTextCursor *c )
s = cursor.paragraph();
while ( s ) {
s->format();
- s->setChanged( TRUE );
+ s->setChanged( true );
if ( s == c->paragraph() )
break;
s = s->next();
@@ -429,7 +429,7 @@ TQTextCursor *TQTextStyleCommand::unexecute( TQTextCursor *c )
TQTextCursor::TQTextCursor( TQTextDocument *d )
: idx( 0 ), tmpX( -1 ), ox( 0 ), oy( 0 ),
- valid( TRUE )
+ valid( true )
{
para = d ? d->firstParagraph() : 0;
}
@@ -522,7 +522,7 @@ void TQTextCursor::invalidateNested()
void TQTextCursor::insert( const TQString &str, bool checkNewLine, TQMemArray<TQTextStringChar> *formatting )
{
tmpX = -1;
- bool justInsert = TRUE;
+ bool justInsert = true;
TQString s( str );
#if defined(TQ_WS_WIN)
if ( checkNewLine ) {
@@ -539,7 +539,7 @@ void TQTextCursor::insert( const TQString &str, bool checkNewLine, TQMemArray<TQ
for ( int i = 0; i < (int)s.length(); ++i ) {
if ( formatting->at( i ).format() ) {
formatting->at( i ).format()->addRef();
- para->string()->setFormat( idx + i, formatting->at( i ).format(), TRUE );
+ para->string()->setFormat( idx + i, formatting->at( i ).format(), true );
}
}
}
@@ -562,7 +562,7 @@ void TQTextCursor::insert( const TQString &str, bool checkNewLine, TQMemArray<TQ
for ( int i = 0; i < len; ++i ) {
if ( formatting->at( i + lastIndex ).format() ) {
formatting->at( i + lastIndex ).format()->addRef();
- para->string()->setFormat( i + idx, formatting->at( i + lastIndex ).format(), TRUE );
+ para->string()->setFormat( i + idx, formatting->at( i + lastIndex ).format(), true );
}
}
lastIndex += len;
@@ -570,15 +570,15 @@ void TQTextCursor::insert( const TQString &str, bool checkNewLine, TQMemArray<TQ
start = end; // next start is at the end of this line
idx += len; // increase the index of the cursor to the end of the inserted text
if ( s[end] == '\n' ) { // if at the end was a line break, break the line
- splitAndInsertEmptyParagraph( FALSE, TRUE );
+ splitAndInsertEmptyParagraph( false, true );
para->setEndState( -1 );
- para->prev()->format( -1, FALSE );
+ para->prev()->format( -1, false );
lastIndex++;
}
} while ( end < (int)s.length() );
- para->format( -1, FALSE );
+ para->format( -1, false );
int dy = para->rect().y() + para->rect().height() - y;
TQTextParagraph *p = para;
p->setParagId( p->prev() ? p->prev()->paragId() + 1 : 0 );
@@ -593,11 +593,11 @@ void TQTextCursor::insert( const TQString &str, bool checkNewLine, TQMemArray<TQ
}
int h = para->rect().height();
- para->format( -1, TRUE );
+ para->format( -1, true );
if ( h != para->rect().height() )
invalidateNested();
else if ( para->document() && para->document()->parent() )
- para->document()->nextDoubleBuffered = TRUE;
+ para->document()->nextDoubleBuffered = true;
fixCursorPosition();
}
@@ -688,7 +688,7 @@ bool TQTextCursor::place( const TQPoint &p, TQTextParagraph *s, bool link, bool
str = s;
if ( pos.y() >= r.y() && pos.y() <= r.y() + r.height() )
break;
- if ( loosePlacing == TRUE && !s->next() ) {
+ if ( loosePlacing && !s->next() ) {
#ifdef TQ_WS_MACX
pos.setX( s->rect().x() + s->rect().width() );
#endif
@@ -698,7 +698,7 @@ bool TQTextCursor::place( const TQPoint &p, TQTextParagraph *s, bool link, bool
}
if ( !s || !str )
- return FALSE;
+ return false;
s = str;
@@ -715,7 +715,7 @@ bool TQTextCursor::place( const TQPoint &p, TQTextParagraph *s, bool link, bool
cy = s->lineY( i );
ch = s->lineHeight( i );
if ( !chr )
- return FALSE;
+ return false;
if ( pos.y() <= y + cy + ch )
break;
}
@@ -731,7 +731,7 @@ bool TQTextCursor::place( const TQPoint &p, TQTextParagraph *s, bool link, bool
int cw;
int curpos = -1;
int dist = 10000000;
- bool inCustom = FALSE;
+ bool inCustom = false;
while ( i < nextLine ) {
chr = s->at(i);
int cpos = x + chr->x;
@@ -740,7 +740,7 @@ bool TQTextCursor::place( const TQPoint &p, TQTextParagraph *s, bool link, bool
if ( chr->isCustom() && chr->customItem()->isNested() ) {
if ( pos.x() >= cpos && pos.x() <= cpos + cw &&
pos.y() >= y + cy && pos.y() <= y + cy + chr->height() ) {
- inCustom = TRUE;
+ inCustom = true;
curpos = i;
break;
}
@@ -751,20 +751,20 @@ bool TQTextCursor::place( const TQPoint &p, TQTextParagraph *s, bool link, bool
cpos += cw;
int d = cpos - pos.x();
bool dm = d < 0 ? !chr->rightToLeft : chr->rightToLeft;
- if ( ( matchBetweenCharacters == TRUE && (TQABS( d ) < dist || (dist == d && dm == TRUE )) && para->string()->validCursorPosition( i ) ) ||
- ( matchBetweenCharacters == FALSE && ( d == 0 || dm == TRUE ) ) ) {
+ if ( ( matchBetweenCharacters && (TQABS( d ) < dist || (dist == d && dm)) && para->string()->validCursorPosition( i ) ) ||
+ ( !matchBetweenCharacters && ( d == 0 || dm ) ) ) {
dist = TQABS( d );
- if ( !link || ( pos.x() >= x + chr->x && ( loosePlacing == TRUE || pos.x() < cpos ) ) )
+ if ( !link || ( pos.x() >= x + chr->x && ( loosePlacing || pos.x() < cpos ) ) )
curpos = i;
}
}
i++;
}
if ( curpos == -1 ) {
- if ( loosePlacing == TRUE )
+ if ( loosePlacing )
curpos = s->length()-1;
else
- return FALSE;
+ return false;
}
setIndex( curpos );
@@ -773,26 +773,26 @@ bool TQTextCursor::place( const TQPoint &p, TQTextParagraph *s, bool link, bool
TQTextDocument *oldDoc = para->document();
gotoIntoNested( pos );
if ( oldDoc == para->document() )
- return TRUE;
+ return true;
TQPoint p( pos.x() - offsetX(), pos.y() - offsetY() );
if ( !place( p, document()->firstParagraph(), link ) )
pop();
}
#endif
- return TRUE;
+ return true;
}
bool TQTextCursor::processNesting( Operation op )
{
if ( !para->document() )
- return FALSE;
+ return false;
TQTextDocument* doc = para->document();
push();
ox = para->at( idx )->x;
int bl, y;
para->lineHeightOfChar( idx, &bl, &y );
oy = y + para->rect().y();
- bool ok = FALSE;
+ bool ok = false;
#ifndef TQT_NO_TEXTCUSTOMITEM
switch ( op ) {
@@ -800,7 +800,7 @@ bool TQTextCursor::processNesting( Operation op )
ok = para->at( idx )->customItem()->enter( this, doc, para, idx, ox, oy );
break;
case EnterEnd:
- ok = para->at( idx )->customItem()->enter( this, doc, para, idx, ox, oy, TRUE );
+ ok = para->at( idx )->customItem()->enter( this, doc, para, idx, ox, oy, true );
break;
case Next:
ok = para->at( idx )->customItem()->next( this, doc, para, idx, ox, oy );
@@ -1092,7 +1092,7 @@ void TQTextCursor::gotoPreviousWord( bool onlySpace )
gotoPreviousLetter();
tmpX = -1;
TQTextString *s = para->string();
- bool allowSame = FALSE;
+ bool allowSame = false;
if ( idx == ((int)s->length()-1) )
return;
for ( int i = idx; i >= 0; --i ) {
@@ -1103,7 +1103,7 @@ void TQTextCursor::gotoPreviousWord( bool onlySpace )
return;
}
if ( !allowSame && !is_seperator( s->at( i ).c, onlySpace ) )
- allowSame = TRUE;
+ allowSame = true;
}
idx = 0;
}
@@ -1112,7 +1112,7 @@ void TQTextCursor::gotoNextWord( bool onlySpace )
{
tmpX = -1;
TQTextString *s = para->string();
- bool allowSame = FALSE;
+ bool allowSame = false;
for ( int i = idx; i < (int)s->length(); ++i ) {
if ( !is_seperator( s->at( i ).c, onlySpace ) ) {
if ( !allowSame )
@@ -1121,7 +1121,7 @@ void TQTextCursor::gotoNextWord( bool onlySpace )
return;
}
if ( !allowSame && is_seperator( s->at( i ).c, onlySpace ) )
- allowSame = TRUE;
+ allowSame = true;
}
@@ -1170,7 +1170,7 @@ void TQTextCursor::splitAndInsertEmptyParagraph( bool ind, bool updateIds )
TQTextParagraph *n = para->next();
TQTextParagraph *s = para->document()->createParagraph( para->document(), para, n, updateIds );
if ( f )
- s->setFormat( 0, 1, f, TRUE );
+ s->setFormat( 0, 1, f, true );
s->copyParagData( para );
if ( ind ) {
int oi, ni;
@@ -1185,7 +1185,7 @@ void TQTextCursor::splitAndInsertEmptyParagraph( bool ind, bool updateIds )
TQTextParagraph *p = para->prev();
TQTextParagraph *s = para->document()->createParagraph( para->document(), p, para, updateIds );
if ( f )
- s->setFormat( 0, 1, f, TRUE );
+ s->setFormat( 0, 1, f, true );
s->copyParagData( para );
if ( ind ) {
s->indent();
@@ -1199,10 +1199,10 @@ void TQTextCursor::splitAndInsertEmptyParagraph( bool ind, bool updateIds )
TQTextParagraph *s = para->document()->createParagraph( para->document(), para, n, updateIds );
s->copyParagData( para );
s->remove( 0, 1 );
- s->append( str, TRUE );
+ s->append( str, true );
for ( uint i = 0; i < str.length(); ++i ) {
TQTextStringChar* tsc = para->at( idx + i );
- s->setFormat( i, 1, tsc->format(), TRUE );
+ s->setFormat( i, 1, tsc->format(), true );
#ifndef TQT_NO_TEXTCUSTOMITEM
if ( tsc->isCustom() ) {
TQTextCustomItem * item = tsc->customItem();
@@ -1236,18 +1236,18 @@ bool TQTextCursor::remove()
int next = para->string()->nextCursorPosition( idx );
para->remove( idx, next-idx );
int h = para->rect().height();
- para->format( -1, TRUE );
+ para->format( -1, true );
if ( h != para->rect().height() )
invalidateNested();
else if ( para->document() && para->document()->parent() )
- para->document()->nextDoubleBuffered = TRUE;
- return FALSE;
+ para->document()->nextDoubleBuffered = true;
+ return false;
} else if ( para->next() ) {
para->join( para->next() );
invalidateNested();
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/* needed to implement backspace the correct way */
@@ -1268,19 +1268,19 @@ bool TQTextCursor::removePreviousChar()
int h = para->rect().height();
// shouldn't be needed, just to make sure.
fixCursorPosition();
- para->format( -1, TRUE );
+ para->format( -1, true );
if ( h != para->rect().height() )
invalidateNested();
else if ( para->document() && para->document()->parent() )
- para->document()->nextDoubleBuffered = TRUE;
- return FALSE;
+ para->document()->nextDoubleBuffered = true;
+ return false;
} else if ( para->prev() ) {
para = para->prev();
para->join( para->next() );
invalidateNested();
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void TQTextCursor::indent()
@@ -1342,18 +1342,18 @@ TQTextDocument::TQTextDocument( TQTextDocument *p )
void TQTextDocument::init()
{
- oTextValid = TRUE;
- mightHaveCustomItems = FALSE;
+ oTextValid = true;
+ mightHaveCustomItems = false;
if ( par )
par->insertChild( this );
pProcessor = 0;
- useFC = TRUE;
+ useFC = true;
pFormatter = 0;
indenter = 0;
fParag = 0;
txtFormat = TQt::AutoText;
- preferRichText = FALSE;
- pages = FALSE;
+ preferRichText = false;
+ pages = false;
focusIndicator.parag = 0;
minw = 0;
wused = 0;
@@ -1367,15 +1367,15 @@ void TQTextDocument::init()
#endif
contxt = TQString::null;
- underlLinks = par ? par->underlLinks : TRUE;
+ underlLinks = par ? par->underlLinks : true;
backBrush = 0;
buf_pixmap = 0;
- nextDoubleBuffered = FALSE;
+ nextDoubleBuffered = false;
if ( par )
withoutDoubleBuffer = par->withoutDoubleBuffer;
else
- withoutDoubleBuffer = FALSE;
+ withoutDoubleBuffer = false;
lParag = fParag = createParagraph( this, 0, 0 );
@@ -1393,9 +1393,9 @@ void TQTextDocument::init()
selectionColors[ Standard ] = TQApplication::palette().color( TQPalette::Active, TQColorGroup::Highlight );
- selectionText[ Standard ] = TRUE;
- selectionText[ IMSelectionText ] = TRUE;
- selectionText[ IMCompositionText ] = FALSE;
+ selectionText[ Standard ] = true;
+ selectionText[ IMSelectionText ] = true;
+ selectionText[ IMCompositionText ] = false;
commandHistory = new TQTextCommandHistory( 100 );
tStopWidth = formatCollection()->defaultFormat()->width( 'x' ) * 8;
}
@@ -1433,7 +1433,7 @@ void TQTextDocument::clear( bool createEmptyParag )
focusIndicator.parag = 0;
selections.clear();
oText = TQString::null;
- oTextValid = FALSE;
+ oTextValid = false;
}
int TQTextDocument::widthUsed() const
@@ -1485,14 +1485,14 @@ bool TQTextDocument::setMinimumWidth( int needed, int used, TQTextParagraph *p )
wused = TQMAX( wused, used );
wused = TQMAX( wused, minw );
cw = TQMAX( minw, cw );
- return TRUE;
+ return true;
}
void TQTextDocument::setPlainText( const TQString &text )
{
- preferRichText = FALSE;
+ preferRichText = false;
clear();
- oTextValid = TRUE;
+ oTextValid = true;
oText = text;
int lastNl = 0;
@@ -1576,33 +1576,33 @@ struct TQ_EXPORT TQTextDocumentTag {
if ( !textEditMode && curpar && curpar->length()>1 && curpar->at( curpar->length()-2)->c == TQChar_linesep ) \
curpar->remove( curpar->length()-2, 1 ); \
curpar = createParagraph( this, curpar, curpar->next() ); styles.append( vec ); vec = 0;} \
- hasNewPar = TRUE; \
- curpar->rtext = TRUE; \
+ hasNewPar = true; \
+ curpar->rtext = true; \
curpar->align = curtag.alignment; \
curpar->lstyle = curtag.liststyle; \
curpar->litem = ( curtag.style->displayMode() == TQStyleSheetItem::DisplayListItem ); \
curpar->str->setDirection( (TQChar::Direction)curtag.direction ); \
- space = TRUE; \
+ space = true; \
tabExpansionColumn = 0; \
delete vec; vec = new TQPtrVector<TQStyleSheetItem>( (uint)tags.count() + 1); \
int i = 0; \
for ( TQValueStack<TQTextDocumentTag>::Iterator it = tags.begin(); it != tags.end(); ++it ) \
vec->insert( i++, (*it).style ); \
vec->insert( i, curtag.style ); \
- }while(FALSE);
+ }while(false);
void TQTextDocument::setRichText( const TQString &text, const TQString &context, const TQTextFormat *initialFormat )
{
- preferRichText = TRUE;
+ preferRichText = true;
if ( !context.isEmpty() )
setContext( context );
clear();
fParag = lParag = createParagraph( this );
- oTextValid = TRUE;
+ oTextValid = true;
oText = text;
setRichTextInternal( text, 0, initialFormat );
- fParag->rtext = TRUE;
+ fParag->rtext = true;
}
void TQTextDocument::setRichTextInternal( const TQString &text, TQTextCursor* cursor, const TQTextFormat *initialFormat )
@@ -1616,10 +1616,10 @@ void TQTextDocument::setRichTextInternal( const TQString &text, TQTextCursor* cu
if ( bodyText.isValid() )
initag.format.setColor( bodyText );
TQTextDocumentTag curtag = initag;
- bool space = TRUE;
- bool canMergeLi = FALSE;
+ bool space = true;
+ bool canMergeLi = false;
- bool textEditMode = FALSE;
+ bool textEditMode = false;
int tabExpansionColumn = 0;
const TQChar* doc = text.unicode();
@@ -1631,21 +1631,21 @@ void TQTextDocument::setRichTextInternal( const TQString &text, TQTextCursor* cu
TQTextParagraph* stylesPar = curpar;
TQPtrVector<TQStyleSheetItem>* vec = 0;
TQPtrList< TQPtrVector<TQStyleSheetItem> > styles;
- styles.setAutoDelete( TRUE );
+ styles.setAutoDelete( true );
if ( cursor ) {
cursor->splitAndInsertEmptyParagraph();
TQTextCursor tmp = *cursor;
tmp.gotoPreviousLetter();
stylesPar = curpar = tmp.paragraph();
- hasNewPar = TRUE;
- textEditMode = TRUE;
+ hasNewPar = true;
+ textEditMode = true;
} else {
NEWPAR;
}
- // set rtext spacing to FALSE for the initial paragraph.
- curpar->rtext = FALSE;
+ // set rtext spacing to false for the initial paragraph.
+ curpar->rtext = false;
TQString wellKnownTags = "br hr wsp table qt body meta title";
@@ -1654,7 +1654,7 @@ void TQTextDocument::setRichTextInternal( const TQString &text, TQTextCursor* cu
if ( !hasPrefix( doc, length, pos+1, TQChar('/') ) ) {
// open tag
TQMap<TQString, TQString> attr;
- bool emptyTag = FALSE;
+ bool emptyTag = false;
TQString tagname = parseOpenTag(doc, length, pos, attr, emptyTag);
if ( tagname.isEmpty() )
continue; // nothing we could do with this, probably parse error
@@ -1678,7 +1678,7 @@ void TQTextDocument::setRichTextInternal( const TQString &text, TQTextCursor* cu
p, and we do not want new blocks inside non-empty
lis. Plus we want to merge empty lis sometimes. */
if( nstyle->displayMode() == TQStyleSheetItem::DisplayListItem ) {
- canMergeLi = TRUE;
+ canMergeLi = true;
} else if ( nstyle->displayMode() == TQStyleSheetItem::DisplayBlock ) {
while ( curtag.style->name() == "p" ) {
if ( tags.isEmpty() )
@@ -1689,7 +1689,7 @@ void TQTextDocument::setRichTextInternal( const TQString &text, TQTextCursor* cu
if ( curtag.style->displayMode() == TQStyleSheetItem::DisplayListItem ) {
// we are in a li and a new block comes along
if ( nstyle->name() == "ul" || nstyle->name() == "ol" )
- hasNewPar = FALSE; // we want an empty li (like most browsers)
+ hasNewPar = false; // we want an empty li (like most browsers)
if ( !hasNewPar ) {
/* do not add new blocks inside
non-empty lis */
@@ -1703,7 +1703,7 @@ void TQTextDocument::setRichTextInternal( const TQString &text, TQTextCursor* cu
comes along, merge them */
nstyle = curtag.style;
}
- canMergeLi = FALSE;
+ canMergeLi = false;
}
}
}
@@ -1711,25 +1711,25 @@ void TQTextDocument::setRichTextInternal( const TQString &text, TQTextCursor* cu
#ifndef TQT_NO_TEXTCUSTOMITEM
TQTextCustomItem* custom = 0;
#else
- bool custom = FALSE;
+ bool custom = false;
#endif
// some well-known tags, some have a nstyle, some not
if ( wellKnownTags.find( tagname ) != -1 ) {
if ( tagname == "br" ) {
- emptyTag = space = TRUE;
+ emptyTag = space = true;
int index = TQMAX( curpar->length(),1) - 1;
TQTextFormat format = curtag.format.makeTextFormat( nstyle, attr, scaleFontsFactor );
curpar->append( TQChar_linesep );
curpar->setFormat( index, 1, &format );
hasNewPar = false;
} else if ( tagname == "hr" ) {
- emptyTag = space = TRUE;
+ emptyTag = space = true;
#ifndef TQT_NO_TEXTCUSTOMITEM
custom = sheet_->tag( tagname, attr, contxt, *factory_ , emptyTag, this );
#endif
} else if ( tagname == "table" ) {
- emptyTag = space = TRUE;
+ emptyTag = space = true;
#ifndef TQT_NO_TEXTCUSTOMITEM
TQTextFormat format = curtag.format.makeTextFormat( nstyle, attr, scaleFontsFactor );
curpar->setAlignment( curtag.alignment );
@@ -1785,7 +1785,7 @@ void TQTextDocument::setRichTextInternal( const TQString &text, TQTextCursor* cu
// end qt- and body-tag handling
} else if ( tagname == "meta" ) {
if ( attr["name"] == "qrichtext" && attr["content"] == "1" )
- textEditMode = TRUE;
+ textEditMode = true;
} else if ( tagname == "title" ) {
TQString title;
while ( pos < length ) {
@@ -1821,7 +1821,7 @@ void TQTextDocument::setRichTextInternal( const TQString &text, TQTextCursor* cu
anchorName = TQString::null;
}
registerCustomItem( custom, curpar );
- hasNewPar = FALSE;
+ hasNewPar = false;
#endif
} else if ( !emptyTag ) {
/* if we do nesting, push curtag on the stack,
@@ -1932,7 +1932,7 @@ void TQTextDocument::setRichTextInternal( const TQString &text, TQTextCursor* cu
if ( attr.contains( "style" ) ) {
TQString a = attr["style"];
- bool ok = TRUE;
+ bool ok = true;
for ( int s = 0; ok && s < a.contains(';')+1; s++ ) {
TQString style = a.section( ';', s, s );
if ( style.startsWith("margin-top:" ) && style.endsWith("px") )
@@ -1985,7 +1985,7 @@ void TQTextDocument::setRichTextInternal( const TQString &text, TQTextCursor* cu
if ( needNewPar ) {
if ( textEditMode && (tagname == "p" || tagname == "div" ) ) // preserve empty paragraphs
- hasNewPar = FALSE;
+ hasNewPar = false;
NEWPAR;
}
}
@@ -2026,9 +2026,9 @@ void TQTextDocument::setRichTextInternal( const TQString &text, TQTextCursor* cu
*/
if ( curtag.wsm == TQStyleSheetItem::WhiteSpaceNormal && s.length() > 4096 ) do {
if ( doc[l] == '\n' ) {
- hasNewPar = FALSE; // for a new paragraph ...
+ hasNewPar = false; // for a new paragraph ...
NEWPAR;
- hasNewPar = FALSE; // ... and make it non-reusable
+ hasNewPar = false; // ... and make it non-reusable
c = '\n'; // make sure we break below
break;
}
@@ -2049,17 +2049,17 @@ void TQTextDocument::setRichTextInternal( const TQString &text, TQTextCursor* cu
s += c;
}
if ( !s.isEmpty() && curtag.style->displayMode() != TQStyleSheetItem::DisplayNone ) {
- hasNewPar = FALSE;
+ hasNewPar = false;
int index = TQMAX( curpar->length(),1) - 1;
curpar->append( s );
if (curtag.wsm != TQStyleSheetItem::WhiteSpaceNormal) {
TQTextString *str = curpar->string();
for (uint i = index; i < index + s.length(); ++i)
- str->at(i).nobreak = TRUE;
+ str->at(i).nobreak = true;
}
TQTextFormat* f = formatCollection()->format( &curtag.format );
- curpar->setFormat( index, s.length(), f, FALSE ); // do not use collection because we have done that already
+ curpar->setFormat( index, s.length(), f, false ); // do not use collection because we have done that already
f->ref += s.length() -1; // that what friends are for...
if ( !curtag.anchorHref.isEmpty() ) {
for ( int i = 0; i < int(s.length()); i++ )
@@ -2113,7 +2113,7 @@ void TQTextDocument::setRichTextMarginsInternal( TQPtrList< TQPtrVector<TQStyleS
int i, mar;
TQStyleSheetItem* mainStyle = curStyle->size() ? (*curStyle)[curStyle->size()-1] : 0;
if ( mainStyle && mainStyle->displayMode() == TQStyleSheetItem::DisplayListItem )
- stylesPar->setListItem( TRUE );
+ stylesPar->setListItem( true );
int numLists = 0;
for ( i = 0; i < (int)curStyle->size(); ++i ) {
if ( (*curStyle)[ i ]->displayMode() == TQStyleSheetItem::DisplayBlock
@@ -2273,7 +2273,7 @@ TQString TQTextDocument::plainText() const
while ( p ) {
if ( !p->mightHaveCustomItems ) {
const TQTextString *ts = p->string();
- s = ts->toString(); // with FALSE we don't fix spaces (nbsp)
+ s = ts->toString(); // with false we don't fix spaces (nbsp)
} else {
for ( int i = 0; i < p->length() - 1; ++i ) {
#ifndef TQT_NO_TEXTCUSTOMITEM
@@ -2575,7 +2575,7 @@ bool TQTextDocument::setSelectionEnd( int id, const TQTextCursor &cursor )
{
TQMap<int, TQTextDocumentSelection>::Iterator it = selections.find( id );
if ( it == selections.end() )
- return FALSE;
+ return false;
TQTextDocumentSelection &sel = *it;
TQTextCursor start = sel.startCursor;
@@ -2584,15 +2584,15 @@ bool TQTextDocument::setSelectionEnd( int id, const TQTextCursor &cursor )
if ( start == end ) {
removeSelection( id );
setSelectionStart( id, cursor );
- return TRUE;
+ return true;
}
if ( sel.endCursor.paragraph() == end.paragraph() ) {
setSelectionEndHelper( id, sel, start, end );
- return TRUE;
+ return true;
}
- bool inSelection = FALSE;
+ bool inSelection = false;
TQTextCursor c( this );
TQTextCursor tmp = sel.startCursor;
if ( sel.swapped )
@@ -2601,32 +2601,32 @@ bool TQTextDocument::setSelectionEnd( int id, const TQTextCursor &cursor )
TQTextCursor tmp2 = cursor;
tmp2.restoreState();
c.setParagraph( tmp.paragraph()->paragId() < tmp2.paragraph()->paragId() ? tmp.paragraph() : tmp2.paragraph() );
- bool hadStart = FALSE;
- bool hadEnd = FALSE;
- bool hadStartParag = FALSE;
- bool hadEndParag = FALSE;
- bool hadOldStart = FALSE;
- bool hadOldEnd = FALSE;
- bool leftSelection = FALSE;
- sel.swapped = FALSE;
+ bool hadStart = false;
+ bool hadEnd = false;
+ bool hadStartParag = false;
+ bool hadEndParag = false;
+ bool hadOldStart = false;
+ bool hadOldEnd = false;
+ bool leftSelection = false;
+ sel.swapped = false;
for ( ;; ) {
if ( c == start )
- hadStart = TRUE;
+ hadStart = true;
if ( c == end )
- hadEnd = TRUE;
+ hadEnd = true;
if ( c.paragraph() == start.paragraph() )
- hadStartParag = TRUE;
+ hadStartParag = true;
if ( c.paragraph() == end.paragraph() )
- hadEndParag = TRUE;
+ hadEndParag = true;
if ( c == sel.startCursor )
- hadOldStart = TRUE;
+ hadOldStart = true;
if ( c == sel.endCursor )
- hadOldEnd = TRUE;
+ hadOldEnd = true;
if ( !sel.swapped &&
( ( hadEnd && !hadStart ) ||
( hadEnd && hadStart && start.paragraph() == end.paragraph() && start.index() > end.index() ) ) )
- sel.swapped = TRUE;
+ sel.swapped = true;
if ( ( c == end && hadStartParag ) ||
( c == start && hadEndParag ) ) {
@@ -2641,9 +2641,9 @@ bool TQTextDocument::setSelectionEnd( int id, const TQTextCursor &cursor )
if ( inSelection &&
( ( c == end && hadStart ) || ( c == start && hadEnd ) ) )
- leftSelection = TRUE;
+ leftSelection = true;
else if ( !leftSelection && !inSelection && ( hadStart || hadEnd ) )
- inSelection = TRUE;
+ inSelection = true;
bool noSelectionAnymore = hadOldStart && hadOldEnd && leftSelection && !inSelection && !c.paragraph()->hasSelection( id ) && c.atParagEnd();
c.paragraph()->removeSelection( id );
@@ -2664,7 +2664,7 @@ bool TQTextDocument::setSelectionEnd( int id, const TQTextCursor &cursor )
}
if ( leftSelection )
- inSelection = FALSE;
+ inSelection = false;
if ( noSelectionAnymore )
break;
@@ -2694,7 +2694,7 @@ bool TQTextDocument::setSelectionEnd( int id, const TQTextCursor &cursor )
setSelectionEndHelper( id, sel, start, end );
- return TRUE;
+ return true;
}
void TQTextDocument::selectAll( int id )
@@ -2702,7 +2702,7 @@ void TQTextDocument::selectAll( int id )
removeSelection( id );
TQTextDocumentSelection sel;
- sel.swapped = FALSE;
+ sel.swapped = false;
TQTextCursor c( this );
c.setParagraph( fParag );
@@ -2728,7 +2728,7 @@ void TQTextDocument::selectAll( int id )
bool TQTextDocument::removeSelection( int id )
{
if ( !selections.contains( id ) )
- return FALSE;
+ return false;
TQTextDocumentSelection &sel = selections[ id ];
@@ -2748,7 +2748,7 @@ bool TQTextDocument::removeSelection( int id )
p = start.paragraph();
p->removeSelection( id );
selections.remove( id );
- return TRUE;
+ return true;
}
TQString TQTextDocument::selectedText( int id, bool asRichText ) const
@@ -2916,17 +2916,17 @@ void TQTextDocument::setFormat( int id, TQTextFormat *f, int flags )
c1.restoreState();
if ( c1.paragraph() == c2.paragraph() ) {
- c1.paragraph()->setFormat( c1.index(), c2.index() - c1.index(), f, TRUE, flags );
+ c1.paragraph()->setFormat( c1.index(), c2.index() - c1.index(), f, true, flags );
return;
}
- c1.paragraph()->setFormat( c1.index(), c1.paragraph()->length() - c1.index(), f, TRUE, flags );
+ c1.paragraph()->setFormat( c1.index(), c1.paragraph()->length() - c1.index(), f, true, flags );
TQTextParagraph *p = c1.paragraph()->next();
while ( p && p != c2.paragraph() ) {
- p->setFormat( 0, p->length(), f, TRUE, flags );
+ p->setFormat( 0, p->length(), f, true, flags );
p = p->next();
}
- c2.paragraph()->setFormat( 0, c2.index(), f, TRUE, flags );
+ c2.paragraph()->setFormat( 0, c2.index(), f, true, flags );
}
void TQTextDocument::removeSelectedText( int id, TQTextCursor *cursor )
@@ -2960,9 +2960,9 @@ void TQTextDocument::removeSelectedText( int id, TQTextCursor *cursor )
if ( c1.paragraph() == fParag && c1.index() == 0 &&
c2.paragraph() == lParag && c2.index() == lParag->length() - 1 )
- cursor->setValid( FALSE );
+ cursor->setValid( false );
- bool didGoLeft = FALSE;
+ bool didGoLeft = false;
if ( c1.index() == 0 && c1.paragraph() != fParag ) {
cursor->gotoPreviousLetter();
didGoLeft = cursor->isValid();
@@ -3034,7 +3034,7 @@ bool TQTextDocument::find( TQTextCursor& cursor, const TQString &expr, bool cs,
removeSelection( Standard );
TQTextParagraph *p = 0;
if ( expr.isEmpty() )
- return FALSE;
+ return false;
for (;;) {
if ( p != cursor.paragraph() ) {
p = cursor.paragraph();
@@ -3054,7 +3054,7 @@ bool TQTextDocument::find( TQTextCursor& cursor, const TQString &expr, bool cs,
setSelectionEnd( Standard, cursor );
if ( !forward )
cursor.setIndex( res );
- return TRUE;
+ return true;
}
start = res + (forward ? 1 : -1);
}
@@ -3069,7 +3069,7 @@ bool TQTextDocument::find( TQTextCursor& cursor, const TQString &expr, bool cs,
cursor.gotoPreviousLetter();
}
}
- return FALSE;
+ return false;
}
void TQTextDocument::setTextFormat( TQt::TextFormat f )
@@ -3088,14 +3088,14 @@ bool TQTextDocument::inSelection( int selId, const TQPoint &pos ) const
{
TQMap<int, TQTextDocumentSelection>::ConstIterator it = selections.find( selId );
if ( it == selections.end() )
- return FALSE;
+ return false;
TQTextDocumentSelection sel = *it;
TQTextParagraph *startParag = sel.startCursor.paragraph();
TQTextParagraph *endParag = sel.endCursor.paragraph();
if ( sel.startCursor.paragraph() == sel.endCursor.paragraph() &&
sel.startCursor.paragraph()->selectionStart( selId ) == sel.endCursor.paragraph()->selectionEnd( selId ) )
- return FALSE;
+ return false;
if ( sel.endCursor.paragraph()->paragId() < sel.startCursor.paragraph()->paragId() ) {
endParag = sel.startCursor.paragraph();
startParag = sel.endCursor.paragraph();
@@ -3104,14 +3104,14 @@ bool TQTextDocument::inSelection( int selId, const TQPoint &pos ) const
TQTextParagraph *p = startParag;
while ( p ) {
if ( p->rect().contains( pos ) ) {
- bool inSel = FALSE;
+ bool inSel = false;
int selStart = p->selectionStart( selId );
int selEnd = p->selectionEnd( selId );
int y = 0;
int h = 0;
for ( int i = 0; i < p->length(); ++i ) {
if ( i == selStart )
- inSel = TRUE;
+ inSel = true;
if ( i == selEnd )
break;
if ( p->at( i )->lineStart ) {
@@ -3121,7 +3121,7 @@ bool TQTextDocument::inSelection( int selId, const TQPoint &pos ) const
if ( pos.y() - p->rect().y() >= y && pos.y() - p->rect().y() <= y + h ) {
if ( inSel && pos.x() >= p->at( i )->x &&
pos.x() <= p->at( i )->x + p->at( i )->format()->width( p->at( i )->c ) )
- return TRUE;
+ return true;
}
}
}
@@ -3132,7 +3132,7 @@ bool TQTextDocument::inSelection( int selId, const TQPoint &pos ) const
p = p->next();
}
- return FALSE;
+ return false;
}
void TQTextDocument::doLayout( TQPainter *p, int w )
@@ -3199,13 +3199,13 @@ void TQTextDocument::draw( TQPainter *p, const TQRect &rect, const TQColorGroup
}
p->translate( 0, y );
if ( rect.isValid() )
- parag->paint( *p, cg, 0, FALSE, rect.x(), rect.y(), rect.width(), rect.height() );
+ parag->paint( *p, cg, 0, false, rect.x(), rect.y(), rect.width(), rect.height() );
else
- parag->paint( *p, cg, 0, FALSE );
+ parag->paint( *p, cg, 0, false );
p->translate( 0, -y );
parag = parag->next();
if ( !flow()->isEmpty() )
- flow()->drawFloatingItems( p, rect.x(), rect.y(), rect.width(), rect.height(), cg, FALSE );
+ flow()->drawFloatingItems( p, rect.x(), rect.y(), rect.width(), rect.height(), cg, false );
}
TQTextFormat::setPainter(oldPainter);
}
@@ -3216,7 +3216,7 @@ void TQTextDocument::drawParagraph( TQPainter *p, TQTextParagraph *parag, int cx
{
TQPainter *painter = 0;
if ( resetChanged )
- parag->setChanged( FALSE );
+ parag->setChanged( false );
TQRect ir( parag->rect() );
#ifndef TQT_NO_TEXTCUSTOMITEM
if (!parag->tableCell())
@@ -3252,7 +3252,7 @@ void TQTextDocument::drawParagraph( TQPainter *p, TQTextParagraph *parag, int cx
painter->translate( -( ir.x() - parag->rect().x() ),
-( ir.y() - parag->rect().y() ) );
- parag->paint( *painter, cg, drawCursor ? cursor : 0, TRUE, cx, cy, cw, ch );
+ parag->paint( *painter, cg, drawCursor ? cursor : 0, true, cx, cy, cw, ch );
if ( uDoubleBuffer ) {
delete painter;
@@ -3262,19 +3262,19 @@ void TQTextDocument::drawParagraph( TQPainter *p, TQTextParagraph *parag, int cx
painter->translate( -ir.x(), -ir.y() );
}
- parag->document()->nextDoubleBuffered = FALSE;
+ parag->document()->nextDoubleBuffered = false;
}
TQTextParagraph *TQTextDocument::draw( TQPainter *p, int cx, int cy, int cw, int ch, const TQColorGroup &cg,
bool onlyChanged, bool drawCursor, TQTextCursor *cursor, bool resetChanged )
{
if ( withoutDoubleBuffer || ( par && par->withoutDoubleBuffer ) ) {
- withoutDoubleBuffer = TRUE;
+ withoutDoubleBuffer = true;
TQRect r;
draw( p, r, cg );
return 0;
}
- withoutDoubleBuffer = FALSE;
+ withoutDoubleBuffer = false;
if ( !firstParagraph() )
return 0;
@@ -3328,7 +3328,7 @@ TQTextParagraph *TQTextDocument::draw( TQPainter *p, int cx, int cy, int cw, int
}
if ( !flow()->isEmpty() ) {
TQRect cr( cx, cy, cw, ch );
- flow()->drawFloatingItems( p, cr.x(), cr.y(), cr.width(), cr.height(), cg, FALSE );
+ flow()->drawFloatingItems( p, cr.x(), cr.y(), cr.width(), cr.height(), cg, false );
}
}
@@ -3376,7 +3376,7 @@ void TQTextDocument::registerCustomItem( TQTextCustomItem *i, TQTextParagraph *p
p->registerFloatingItem( i );
}
if (i) i->setParagraph( p );
- p->mightHaveCustomItems = mightHaveCustomItems = TRUE;
+ p->mightHaveCustomItems = mightHaveCustomItems = true;
}
void TQTextDocument::unregisterCustomItem( TQTextCustomItem *i, TQTextParagraph *p )
@@ -3415,7 +3415,7 @@ bool TQTextDocument::focusNextPrevChild( bool next )
focusIndicator.len = 0;
}
} else {
- focusIndicator.parag->setChanged( TRUE );
+ focusIndicator.parag->setChanged( true );
}
focusIndicator.href = TQString::null;
focusIndicator.name = TQString::null;
@@ -3426,7 +3426,7 @@ bool TQTextDocument::focusNextPrevChild( bool next )
while ( p ) {
for ( int i = index; i < p->length(); ++i ) {
if ( p->at( i )->isAnchor() ) {
- p->setChanged( TRUE );
+ p->setChanged( true );
focusIndicator.parag = p;
focusIndicator.start = i;
focusIndicator.len = 0;
@@ -3434,7 +3434,7 @@ bool TQTextDocument::focusNextPrevChild( bool next )
focusIndicator.name = p->at( i )->anchorName();
while ( i < p->length() ) {
if ( !p->at( i )->isAnchor() )
- return TRUE;
+ return true;
focusIndicator.len++;
i++;
}
@@ -3445,19 +3445,19 @@ bool TQTextDocument::focusNextPrevChild( bool next )
TQPtrList<TQTextTableCell> cells = t->tableCells();
// first try to continue
TQTextTableCell *c;
- bool resetCells = TRUE;
+ bool resetCells = true;
for ( c = cells.first(); c; c = cells.next() ) {
if ( c->richText()->hasFocusParagraph() ) {
if ( c->richText()->focusNextPrevChild( next ) ) {
- p->setChanged( TRUE );
+ p->setChanged( true );
focusIndicator.parag = p;
focusIndicator.start = i;
focusIndicator.len = 0;
focusIndicator.href = c->richText()->focusHref();
focusIndicator.name = c->richText()->focusName();
- return TRUE;
+ return true;
} else {
- resetCells = FALSE;
+ resetCells = false;
c = cells.next();
break;
}
@@ -3468,13 +3468,13 @@ bool TQTextDocument::focusNextPrevChild( bool next )
c = cells.first();
for ( ; c; c = cells.next() ) {
if ( c->richText()->focusNextPrevChild( next ) ) {
- p->setChanged( TRUE );
+ p->setChanged( true );
focusIndicator.parag = p;
focusIndicator.start = i;
focusIndicator.len = 0;
focusIndicator.href = c->richText()->focusHref();
focusIndicator.name = c->richText()->focusName();
- return TRUE;
+ return true;
}
}
}
@@ -3492,7 +3492,7 @@ bool TQTextDocument::focusNextPrevChild( bool next )
while ( p ) {
for ( int i = index; i >= 0; --i ) {
if ( p->at( i )->isAnchor() ) {
- p->setChanged( TRUE );
+ p->setChanged( true );
focusIndicator.parag = p;
focusIndicator.start = i;
focusIndicator.len = 0;
@@ -3501,7 +3501,7 @@ bool TQTextDocument::focusNextPrevChild( bool next )
while ( i >= -1 ) {
if ( i < 0 || !p->at( i )->isAnchor() ) {
focusIndicator.start++;
- return TRUE;
+ return true;
}
if ( i < 0 )
break;
@@ -3516,19 +3516,19 @@ bool TQTextDocument::focusNextPrevChild( bool next )
TQPtrList<TQTextTableCell> cells = t->tableCells();
// first try to continue
TQTextTableCell *c;
- bool resetCells = TRUE;
+ bool resetCells = true;
for ( c = cells.last(); c; c = cells.prev() ) {
if ( c->richText()->hasFocusParagraph() ) {
if ( c->richText()->focusNextPrevChild( next ) ) {
- p->setChanged( TRUE );
+ p->setChanged( true );
focusIndicator.parag = p;
focusIndicator.start = i;
focusIndicator.len = 0;
focusIndicator.href = c->richText()->focusHref();
focusIndicator.name = c->richText()->focusName();
- return TRUE;
+ return true;
} else {
- resetCells = FALSE;
+ resetCells = false;
c = cells.prev();
break;
}
@@ -3541,13 +3541,13 @@ bool TQTextDocument::focusNextPrevChild( bool next )
c = cells.last();
for ( ; c; c = cells.prev() ) {
if ( c->richText()->focusNextPrevChild( next ) ) {
- p->setChanged( TRUE );
+ p->setChanged( true );
focusIndicator.parag = p;
focusIndicator.start = i;
focusIndicator.len = 0;
focusIndicator.href = c->richText()->focusHref();
focusIndicator.name = c->richText()->focusName();
- return TRUE;
+ return true;
}
if ( cells.at() == 0 )
break;
@@ -3564,7 +3564,7 @@ bool TQTextDocument::focusNextPrevChild( bool next )
focusIndicator.parag = 0;
- return FALSE;
+ return false;
}
int TQTextDocument::length() const
@@ -3656,15 +3656,15 @@ int TQTextFormat::width( const TQString &str, int pos ) const
TQTextString::TQTextString()
{
- bidiDirty = TRUE;
- bidi = FALSE;
- rightToLeft = FALSE;
+ bidiDirty = true;
+ bidi = false;
+ rightToLeft = false;
dir = TQChar::DirON;
}
TQTextString::TQTextString( const TQTextString &s )
{
- bidiDirty = TRUE;
+ bidiDirty = true;
bidi = s.bidi;
rightToLeft = s.rightToLeft;
dir = s.dir;
@@ -3695,14 +3695,14 @@ void TQTextString::insert( int index, const TQChar *unicode, int len, TQTextForm
ch->x = 0;
ch->lineStart = 0;
ch->d.format = 0;
- ch->nobreak = FALSE;
+ ch->nobreak = false;
ch->type = TQTextStringChar::Regular;
ch->d.format = f;
ch->rightToLeft = 0;
ch->c = unicode[i];
++ch;
}
- bidiDirty = TRUE;
+ bidiDirty = true;
}
TQTextString::~TQTextString()
@@ -3725,11 +3725,11 @@ void TQTextString::insert( int index, TQTextStringChar *c, bool doAddRefFormat
ch.rightToLeft = 0;
ch.d.format = 0;
ch.type = TQTextStringChar::Regular;
- ch.nobreak = FALSE;
+ ch.nobreak = false;
if ( doAddRefFormat && c->format() )
c->format()->addRef();
ch.setFormat( c->format() );
- bidiDirty = TRUE;
+ bidiDirty = true;
}
int TQTextString::appendParagraphs( TQTextParagraph *start, TQTextParagraph *end )
@@ -3755,14 +3755,14 @@ int TQTextString::appendParagraphs( TQTextParagraph *start, TQTextParagraph *end
d[i].lineStart = 0;
d[i].rightToLeft = 0;
d[i].type = TQTextStringChar::Regular;
- d[i].nobreak = FALSE;
+ d[i].nobreak = false;
d[i].d.format = src[i].format();
if (d[i].d.format)
d[i].d.format->addRef();
}
d[i].x = 0;
d[i].lineStart = 0;
- d[i].nobreak = FALSE;
+ d[i].nobreak = false;
d[i].type = TQTextStringChar::Regular;
d[i].d.format = 0;
d[i].rightToLeft = 0;
@@ -3770,7 +3770,7 @@ int TQTextString::appendParagraphs( TQTextParagraph *start, TQTextParagraph *end
d += p->length();
}
- bidiDirty = TRUE;
+ bidiDirty = true;
return paragCount;
}
@@ -3796,7 +3796,7 @@ void TQTextString::truncate( int index )
}
}
data.truncate( index );
- bidiDirty = TRUE;
+ bidiDirty = true;
}
void TQTextString::remove( int index, int len )
@@ -3819,7 +3819,7 @@ void TQTextString::remove( int index, int len )
memmove( data.data() + index, data.data() + index + len,
sizeof( TQTextStringChar ) * ( data.size() - index - len ) );
data.resize( data.size() - len, TQGArray::SpeedOptim );
- bidiDirty = TRUE;
+ bidiDirty = true;
}
void TQTextString::clear()
@@ -3841,7 +3841,7 @@ void TQTextString::clear()
}
}
data.resize( 0 );
- bidiDirty = TRUE;
+ bidiDirty = true;
}
void TQTextString::setFormat( int index, TQTextFormat *f, bool useCollection )
@@ -3855,10 +3855,10 @@ void TQTextString::setFormat( int index, TQTextFormat *f, bool useCollection )
void TQTextString::checkBidi() const
{
TQTextString *that = (TQTextString *)this;
- that->bidiDirty = FALSE;
+ that->bidiDirty = false;
int length = data.size();
if ( !length ) {
- that->bidi = FALSE;
+ that->bidi = false;
that->rightToLeft = dir == TQChar::DirR;
return;
}
@@ -3877,7 +3877,7 @@ void TQTextString::checkBidi() const
TQScriptItem *item = &textEngine.items[textEngine.items.size()-1];
unsigned char bidiLevel = item->analysis.bidiLevel;
if ( bidiLevel )
- that->bidi = TRUE;
+ that->bidi = true;
int pos = length-1;
while ( ch >= start ) {
if ( item->position > pos ) {
@@ -3886,7 +3886,7 @@ void TQTextString::checkBidi() const
Q_ASSERT( item < &textEngine.items[textEngine.items.size()] );
bidiLevel = item->analysis.bidiLevel;
if ( bidiLevel )
- that->bidi = TRUE;
+ that->bidi = true;
}
ch->softBreak = ca->softBreak;
ch->whiteSpace = ca->whiteSpace;
@@ -3900,10 +3900,10 @@ void TQTextString::checkBidi() const
}
if ( dir == TQChar::DirR ) {
- that->bidi = TRUE;
- that->rightToLeft = TRUE;
+ that->bidi = true;
+ that->rightToLeft = true;
} else if ( dir == TQChar::DirL ) {
- that->rightToLeft = FALSE;
+ that->rightToLeft = false;
} else {
that->rightToLeft = (textEngine.direction == TQChar::DirR);
}
@@ -4051,9 +4051,9 @@ int TQTextString::width( int idx ) const
TQTextParagraph::TQTextParagraph( TQTextDocument *d, TQTextParagraph *pr, TQTextParagraph *nx, bool updateIds )
: p( pr ), n( nx ), docOrPseudo( d ),
- changed(FALSE), firstFormat(TRUE), firstPProcess(TRUE), needPreProcess(FALSE), fullWidth(TRUE),
- lastInFrame(FALSE), visible(TRUE), breakable(TRUE), movedDown(FALSE),
- mightHaveCustomItems(FALSE), hasdoc( d != 0 ), litem(FALSE), rtext(FALSE),
+ changed(false), firstFormat(true), firstPProcess(true), needPreProcess(false), fullWidth(true),
+ lastInFrame(false), visible(true), breakable(true), movedDown(false),
+ mightHaveCustomItems(false), hasdoc( d != 0 ), litem(false), rtext(false),
align( 0 ), lstyle( TQStyleSheetItem::ListDisc ), invalid( 0 ), mSelections( 0 ),
#ifndef TQT_NO_TEXTCUSTOMITEM
mFloatingItems( 0 ),
@@ -4184,14 +4184,14 @@ void TQTextParagraph::insert( int index, const TQChar *unicode, int len )
else
str->insert( index, unicode, len, formatCollection()->defaultFormat() );
invalidate( index );
- needPreProcess = TRUE;
+ needPreProcess = true;
}
void TQTextParagraph::truncate( int index )
{
str->truncate( index );
insert( length(), " " );
- needPreProcess = TRUE;
+ needPreProcess = true;
}
void TQTextParagraph::remove( int index, int len )
@@ -4208,7 +4208,7 @@ void TQTextParagraph::remove( int index, int len )
#endif
str->remove( index, len );
invalidate( 0 );
- needPreProcess = TRUE;
+ needPreProcess = true;
}
void TQTextParagraph::join( TQTextParagraph *s )
@@ -4225,12 +4225,12 @@ void TQTextParagraph::join( TQTextParagraph *s )
remove( length() - 1, 1 );
--start;
}
- append( s->str->toString(), TRUE );
+ append( s->str->toString(), true );
for ( int i = 0; i < s->length(); ++i ) {
if ( !hasdoc || document()->useFormatCollection() ) {
s->str->at( i ).format()->addRef();
- str->setFormat( i + start, s->str->at( i ).format(), TRUE );
+ str->setFormat( i + start, s->str->at( i ).format(), true );
}
#ifndef TQT_NO_TEXTCUSTOMITEM
if ( s->str->at( i ).isCustom() ) {
@@ -4258,15 +4258,15 @@ void TQTextParagraph::join( TQTextParagraph *s )
delete s;
invalidate( 0 );
r.setHeight( oh );
- needPreProcess = TRUE;
+ needPreProcess = true;
if ( n ) {
TQTextParagraph *s = n;
s->invalidate( 0 );
while ( s ) {
s->id = s->p->id + 1;
s->state = -1;
- s->needPreProcess = TRUE;
- s->changed = TRUE;
+ s->needPreProcess = true;
+ s->changed = true;
s->invalidateStyleCache();
s = s->n;
}
@@ -4279,7 +4279,7 @@ void TQTextParagraph::move( int &dy )
{
if ( dy == 0 )
return;
- changed = TRUE;
+ changed = true;
r.moveBy( 0, dy );
#ifndef TQT_NO_TEXTCUSTOMITEM
if ( mFloatingItems ) {
@@ -4288,14 +4288,14 @@ void TQTextParagraph::move( int &dy )
}
#endif
if ( p )
- p->lastInFrame = TRUE;
+ p->lastInFrame = true;
// do page breaks if required
if ( hasdoc && document()->isPageBreakEnabled() ) {
int shift;
if ( ( shift = document()->formatter()->formatVertically( document(), this ) ) ) {
if ( p )
- p->setChanged( TRUE );
+ p->setChanged( true );
dy += shift;
}
}
@@ -4310,17 +4310,17 @@ void TQTextParagraph::format( int start, bool doMove )
{
document()->preProcessor()->process( document(), this, invalid <= 0 ? 0 : invalid );
}
- needPreProcess = FALSE;
+ needPreProcess = false;
if ( invalid == -1 )
return;
r.moveTopLeft( TQPoint( documentX(), p ? p->r.y() + p->r.height() : documentY() ) );
if ( p )
- p->lastInFrame = FALSE;
+ p->lastInFrame = false;
- movedDown = FALSE;
- bool formattedAgain = FALSE;
+ movedDown = false;
+ bool formattedAgain = false;
formatAgain:
@@ -4384,7 +4384,7 @@ void TQTextParagraph::format( int start, bool doMove )
if ( hasdoc && document()->isPageBreakEnabled() ) {
int shift = document()->formatter()->formatVertically( document(), this );
if ( shift && !formattedAgain ) {
- formattedAgain = TRUE;
+ formattedAgain = true;
goto formatAgain;
}
}
@@ -4395,20 +4395,20 @@ void TQTextParagraph::format( int start, bool doMove )
bool makeInvalid = p && p->lastInFrame;
while ( s && dy ) {
if ( !s->isFullWidth() )
- makeInvalid = TRUE;
+ makeInvalid = true;
if ( makeInvalid )
s->invalidate( 0 );
s->move( dy );
if ( s->lastInFrame )
- makeInvalid = TRUE;
+ makeInvalid = true;
s = s->n;
}
}
- firstFormat = FALSE;
- changed = TRUE;
+ firstFormat = false;
+ changed = true;
invalid = -1;
- //##### string()->setTextChanged( FALSE );
+ //##### string()->setTextChanged( false );
}
int TQTextParagraph::lineHeightOfChar( int i, int *bl, int *y ) const
@@ -4532,7 +4532,7 @@ void TQTextParagraph::setFormat( int index, int len, TQTextFormat *f, bool useCo
for ( int i = 0; i < len; ++i ) {
of = str->at( i + index ).format();
if ( !changed && ( !of || f->key() != of->key() ) )
- changed = TRUE;
+ changed = true;
if ( invalid == -1 &&
( f->font().family() != of->font().family() ||
f->font().pointSize() != of->font().pointSize() ||
@@ -4603,7 +4603,7 @@ void TQTextParagraph::paint( TQPainter &painter, const TQColorGroup &cg, TQTextC
// we flush at end of document
bool flush = (i == length()-1);
- bool ignoreSoftHyphen = FALSE;
+ bool ignoreSoftHyphen = false;
if ( !flush ) {
// we flush at end of line
flush |= nextchr->lineStart;
@@ -4619,9 +4619,9 @@ void TQTextParagraph::paint( TQPainter &painter, const TQColorGroup &cg, TQTextC
flush |= ( chr->c == '\t' || nextchr->c == '\t' );
// we flush on soft hypens
if (chr->c.unicode() == 0xad) {
- flush = TRUE;
+ flush = true;
if (!nextchr->lineStart)
- ignoreSoftHyphen = TRUE;
+ ignoreSoftHyphen = true;
}
// we flush on custom items
flush |= chr->isCustom();
@@ -4696,7 +4696,7 @@ void TQTextParagraph::paint( TQPainter &painter, const TQColorGroup &cg, TQTextC
chr, cg, chr->rightToLeft );
#ifndef TQT_NO_TEXTCUSTOMITEM
else if ( chr->customItem()->placement() == TQTextCustomItem::PlaceInline ) {
- bool inSelection = FALSE;
+ bool inSelection = false;
if (drawSelections) {
TQMap<int, TQTextParagraphSelection>::ConstIterator it = mSelections->find( TQTextDocument::Standard );
inSelection = (it != mSelections->end() && (*it).start <= i && (*it).end > i);
@@ -4767,7 +4767,7 @@ void TQTextParagraph::drawString( TQPainter &painter, const TQString &str, int s
TQTextStringChar *formatChar, const TQColorGroup& cg,
bool rightToLeft )
{
- bool plainText = hasdoc ? document()->textFormat() == TQt::PlainText : FALSE;
+ bool plainText = hasdoc ? document()->textFormat() == TQt::PlainText : false;
TQTextFormat* format = formatChar->format();
if ( !plainText || ( hasdoc && format->color() != document()->formatCollection()->defaultFormat()->color() ) )
@@ -4781,7 +4781,7 @@ void TQTextParagraph::drawString( TQPainter &painter, const TQString &str, int s
painter.setPen(document()->linkColor.isValid() ? document()->linkColor : cg.link());
if ( document()->underlineLinks() ) {
TQFont fn = format->font();
- fn.setUnderline( TRUE );
+ fn.setUnderline( true );
painter.setFont( fn );
}
}
@@ -4808,7 +4808,7 @@ void TQTextParagraph::drawString( TQPainter &painter, const TQString &str, int s
baseLine += (vAlign == TQTextFormat::AlignSubScript) ? h/6 : -h/2;
}
- bool allSelected = FALSE;
+ bool allSelected = false;
if (drawSelections) {
TQMap<int, TQTextParagraphSelection>::ConstIterator it = mSelections->find( TQTextDocument::Standard );
allSelected = (it != mSelections->end() && (*it).start <= start && (*it).end >= start+len);
@@ -4843,8 +4843,8 @@ void TQTextParagraph::drawString( TQPainter &painter, const TQString &str, int s
selStart = TQMAX(selStart, start);
int real_selEnd = TQMIN(selEnd, start+real_length);
selEnd = TQMIN(selEnd, start+len);
- bool extendRight = FALSE;
- bool extendLeft = FALSE;
+ bool extendRight = false;
+ bool extendLeft = false;
bool selWrap = (real_selEnd == length()-1 && n && n->hasSelection(it.key()));
if (selWrap || this->str->at(real_selEnd).lineStart) {
extendRight = (fullSelectionWidth != 0);
@@ -4852,10 +4852,10 @@ void TQTextParagraph::drawString( TQPainter &painter, const TQString &str, int s
tmpw += painter.fontMetrics().width(' ');
}
if (fullSelectionWidth && (selStart == 0 || this->str->at(selStart).lineStart)) {
- extendLeft = TRUE;
+ extendLeft = true;
}
if (this->str->isRightToLeft() != rightToLeft)
- extendLeft = extendRight = FALSE;
+ extendLeft = extendRight = false;
if (this->str->isRightToLeft()) {
bool tmp = extendLeft;
@@ -5046,7 +5046,7 @@ void TQTextParagraph::setListItem( bool li )
if ( (bool)litem == li )
return;
litem = li;
- changed = TRUE;
+ changed = true;
TQTextParagraph* s = prev() ? prev() : this;
while ( s ) {
s->invalidate( 0 );
@@ -5278,14 +5278,14 @@ void TQTextParagraph::show()
{
if ( visible || !hasdoc )
return;
- visible = TRUE;
+ visible = true;
}
void TQTextParagraph::hide()
{
if ( !visible || !hasdoc )
return;
- visible = FALSE;
+ visible = false;
}
void TQTextParagraph::setDirection( TQChar::Direction d )
@@ -5320,7 +5320,7 @@ TQTextPreProcessor::TQTextPreProcessor()
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
TQTextFormatter::TQTextFormatter()
- : thisminw(0), thiswused(0), wrapEnabled( TRUE ), wrapColumn( -1 ), biw( FALSE )
+ : thisminw(0), thiswused(0), wrapEnabled( true ), wrapColumn( -1 ), biw( false )
{
}
@@ -5506,11 +5506,11 @@ TQTextLineStart *TQTextFormatter::bidiReorderLine( TQTextParagraph * /*parag*/,
if ( text->isRightToLeft() ) {
xorig -= sw;
lastChar->x = xorig;
- ch->rightToLeft = TRUE;
+ ch->rightToLeft = true;
} else {
lastChar->x = x;
x += sw;
- ch->rightToLeft = FALSE;
+ ch->rightToLeft = false;
}
}
@@ -5559,7 +5559,7 @@ int TQTextFormatter::formatVertically( TQTextDocument* doc, TQTextParagraph* par
int delta = c->customItem()->height - h;
ls->h += delta;
if ( delta )
- parag->setMovedDown( TRUE );
+ parag->setMovedDown( true );
} else
#endif
{
@@ -5567,7 +5567,7 @@ int TQTextFormatter::formatVertically( TQTextDocument* doc, TQTextParagraph* par
int shift = doc->flow()->adjustFlow( parag->rect().y() + ls->y, ls->w, ls->h );
ls->y += shift;
if ( shift )
- parag->setMovedDown( TRUE );
+ parag->setMovedDown( true );
}
h = ls->y + ls->h;
}
@@ -5607,7 +5607,7 @@ int TQTextFormatterBreakInWords::format( TQTextDocument *doc,TQTextParagraph *pa
x = doc->flow()->adjustLMargin( y + parag->rect().y(), parag->rect().height(), x, 4 );
int rm = parag->rightMargin();
int w = dw - ( doc ? doc->flow()->adjustRMargin( y + parag->rect().y(), parag->rect().height(), rm, 4 ) : 0 );
- bool fullWidth = TRUE;
+ bool fullWidth = true;
int minw = 0;
int wused = 0;
bool wrapEnabled = isWrapEnabled( parag );
@@ -5723,7 +5723,7 @@ TQTextFormatterBreakWords::TQTextFormatterBreakWords()
int shift = doc->flow()->adjustFlow( yflow, dw, lineStart->h ); \
lineStart->y += shift;\
y += shift;\
- }}while(FALSE)
+ }}while(false)
int TQTextFormatterBreakWords::format( TQTextDocument *doc, TQTextParagraph *parag,
int start, const TQMap<int, TQTextLineStart*> & )
@@ -5747,7 +5747,7 @@ int TQTextFormatterBreakWords::format( TQTextDocument *doc, TQTextParagraph *par
int rm = parag->rightMargin();
int rdiff = doc ? doc->flow()->adjustRMargin( y + parag->rect().y(), parag->rect().height(), rm, 0 ) : 0;
int w = dw - rdiff;
- bool fullWidth = TRUE;
+ bool fullWidth = true;
int marg = left + rdiff;
int minw = 0;
int wused = 0;
@@ -5762,7 +5762,7 @@ int TQTextFormatterBreakWords::format( TQTextDocument *doc, TQTextParagraph *par
insertLineStart( parag, 0, lineStart );
int lastBreak = -1;
int tmpBaseLine = 0, tmph = 0;
- bool lastWasNonInlineCustom = FALSE;
+ bool lastWasNonInlineCustom = false;
int align = parag->alignment();
if ( align == TQt::AlignAuto && doc && doc->alignment() != TQt::AlignAuto )
@@ -6071,7 +6071,7 @@ TQTextFormatCollection::TQTextFormatCollection()
TQApplication::palette().color( TQPalette::Active, TQColorGroup::Text ) );
lastFormat = cres = 0;
cflags = -1;
- cKey.setAutoDelete( TRUE );
+ cKey.setAutoDelete( true );
cachedFormat = 0;
}
@@ -6184,7 +6184,7 @@ TQTextFormat *TQTextFormatCollection::format( const TQFont &f, const TQColor &c
return cachedFormat;
}
- TQString key = TQTextFormat::getKey( f, c, FALSE, TQTextFormat::AlignNormal );
+ TQString key = TQTextFormat::getKey( f, c, false, TQTextFormat::AlignNormal );
cachedFormat = cKey.find( key );
cfont = f;
ccol = c;
@@ -6264,7 +6264,7 @@ void TQTextFormatCollection::updateKeys()
{
if ( cKey.isEmpty() )
return;
- cKey.setAutoDelete( FALSE );
+ cKey.setAutoDelete( false );
TQTextFormat** formats = new TQTextFormat*[ cKey.count() + 1 ];
TQTextFormat **f = formats;
TQDictIterator<TQTextFormat> it( cKey );
@@ -6275,7 +6275,7 @@ void TQTextFormatCollection::updateKeys()
cKey.clear();
for ( f = formats; *f; f++ )
cKey.insert( (*f)->key(), *f );
- cKey.setAutoDelete( TRUE );
+ cKey.setAutoDelete( true );
delete [] formats;
}
@@ -6344,7 +6344,7 @@ void TQTextFormat::setPointSize( int s )
if ( s == fn.pointSize() )
return;
fn.setPointSize( s );
- usePixelSizes = FALSE;
+ usePixelSizes = false;
update();
}
@@ -6387,24 +6387,24 @@ TQString TQTextFormat::makeFormatChangeTags( TQTextFormat* defaultFormat, TQText
if ( font().weight() != defaultFormat->font().weight() )
s += TQString(!!s?";":"") + "font-weight:" + TQString::number( fn.weight() * 8 );
TQString textDecoration;
- bool none = FALSE;
+ bool none = false;
if ( font().underline() != defaultFormat->font().underline() ) {
if (font().underline())
textDecoration = "underline";
else
- none = TRUE;
+ none = true;
}
if ( font().overline() != defaultFormat->font().overline() ) {
if (font().overline())
textDecoration += " overline";
else
- none = TRUE;
+ none = true;
}
if ( font().strikeOut() != defaultFormat->font().strikeOut() ) {
if (font().strikeOut())
textDecoration += " line-through";
else
- none = TRUE;
+ none = true;
}
if (none && textDecoration.isEmpty())
textDecoration = "none";
@@ -6455,7 +6455,7 @@ TQTextFormat TQTextFormat::makeTextFormat( const TQStyleSheetItem *style, const
// the style is not an anchor and defines a color.
// It might be used inside an anchor and it should
// override the link color.
- format.linkColor = FALSE;
+ format.linkColor = false;
}
switch ( style->verticalAlignment() ) {
case TQStyleSheetItem::VAlignBaseline:
@@ -6505,7 +6505,7 @@ TQTextFormat TQTextFormat::makeTextFormat( const TQStyleSheetItem *style, const
TQString s = attr["color"];
if ( !s.isEmpty() ) {
format.col.setNamedColor( s );
- format.linkColor = FALSE;
+ format.linkColor = false;
}
}
if ( attr.contains("face") ) {
@@ -6538,12 +6538,12 @@ TQTextFormat TQTextFormat::makeTextFormat( const TQStyleSheetItem *style, const
} else if ( style.startsWith("font-style:" ) ) {
TQString s = style.mid( 11 ).stripWhiteSpace();
if ( s == "normal" )
- format.fn.setItalic( FALSE );
+ format.fn.setItalic( false );
else if ( s == "italic" || s == "oblique" )
- format.fn.setItalic( TRUE );
+ format.fn.setItalic( true );
} else if ( style.startsWith("font-weight:" ) ) {
TQString s = style.mid( 12 );
- bool ok = TRUE;
+ bool ok = true;
int n = s.toInt( &ok );
if ( ok )
format.fn.setWeight( n/8 );
@@ -6568,7 +6568,7 @@ TQTextFormat TQTextFormat::makeTextFormat( const TQStyleSheetItem *style, const
format.setVAlign( TQTextFormat::AlignNormal );
} else if ( style.startsWith("color:" ) ) {
format.col.setNamedColor( style.mid(6) );
- format.linkColor = FALSE;
+ format.linkColor = false;
}
}
}
@@ -6818,7 +6818,7 @@ void TQTextHorizontalLine::draw( TQPainter* p, int x, int y, int , int , int , i
g.setColor( TQColorGroup::Dark, color );
if ( selected )
p->fillRect( r, g.highlight() );
- qDrawShadeLine( p, r.left() - 1, y + height / 2, r.right() + 1, y + height / 2, g, TRUE, height / 8 );
+ qDrawShadeLine( p, r.left() - 1, y + height / 2, r.right() + 1, y + height / 2, g, true, height / 8 );
}
}
#endif //TQT_NO_TEXTCUSTOMITEM
@@ -6830,19 +6830,19 @@ void TQTextHorizontalLine::draw( TQPainter* p, int x, int y, int , int , int , i
bool TQTextDocument::hasPrefix(const TQChar* doc, int length, int pos, TQChar c)
{
if ( pos + 1 > length )
- return FALSE;
+ return false;
return doc[ pos ].lower() == c.lower();
}
bool TQTextDocument::hasPrefix( const TQChar* doc, int length, int pos, const TQString& s )
{
if ( pos + (int) s.length() > length )
- return FALSE;
+ return false;
for ( int i = 0; i < (int)s.length(); i++ ) {
if ( doc[ pos + i ].lower() != s[ i ].lower() )
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
#ifndef TQT_NO_TEXTCUSTOMITEM
@@ -6851,9 +6851,9 @@ static bool qt_is_cell_in_use( TQPtrList<TQTextTableCell>& cells, int row, int c
for ( TQTextTableCell* c = cells.first(); c; c = cells.next() ) {
if ( row >= c->row() && row < c->row() + c->rowspan()
&& col >= c->column() && col < c->column() + c->colspan() )
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
TQTextCustomItem* TQTextDocument::parseTable( const TQMap<TQString, TQString> &attr, const TQTextFormat &fmt,
@@ -6881,7 +6881,7 @@ TQTextCustomItem* TQTextDocument::parseTable( const TQMap<TQString, TQString> &a
}
} else {
TQMap<TQString, TQString> attr2;
- bool emptyTag = FALSE;
+ bool emptyTag = false;
tagname = parseOpenTag( doc, length, pos, attr2, emptyTag );
if ( tagname == "tr" ) {
rowbgcolor = attr2["bgcolor"];
@@ -7378,7 +7378,7 @@ TQChar TQTextDocument::parseChar(const TQChar* doc, int length, int& pos, TQStyl
TQString TQTextDocument::parseOpenTag(const TQChar* doc, int length, int& pos,
TQMap<TQString, TQString> &attr, bool& emptyTag)
{
- emptyTag = FALSE;
+ emptyTag = false;
pos++;
if ( hasPrefix(doc, length, pos, '!') ) {
if ( hasPrefix( doc, length, pos+1, "--")) {
@@ -7389,9 +7389,9 @@ TQString TQTextDocument::parseOpenTag(const TQChar* doc, int length, int& pos,
pos++;
if ( hasPrefix(doc, length, pos, pref ) ) {
pos += 3;
- eatSpace(doc, length, pos, TRUE);
+ eatSpace(doc, length, pos, true);
}
- emptyTag = TRUE;
+ emptyTag = true;
return TQString::null;
}
else {
@@ -7400,20 +7400,20 @@ TQString TQTextDocument::parseOpenTag(const TQChar* doc, int length, int& pos,
pos++;
if ( hasPrefix(doc, length, pos, '>') ) {
pos++;
- eatSpace(doc, length, pos, TRUE);
+ eatSpace(doc, length, pos, true);
}
return TQString::null;
}
}
TQString tag = parseWord(doc, length, pos );
- eatSpace(doc, length, pos, TRUE);
+ eatSpace(doc, length, pos, true);
static TQString term = TQString::fromLatin1("/>");
static TQString s_TRUE = TQString::fromLatin1("TRUE");
while (doc[pos] != '>' && ! (emptyTag = hasPrefix(doc, length, pos, term) )) {
TQString key = parseWord(doc, length, pos );
- eatSpace(doc, length, pos, TRUE);
+ eatSpace(doc, length, pos, true);
if ( key.isEmpty()) {
// error recovery
while ( pos < length && doc[pos] != '>' )
@@ -7424,12 +7424,12 @@ TQString TQTextDocument::parseOpenTag(const TQChar* doc, int length, int& pos,
if (hasPrefix(doc, length, pos, '=') ){
pos++;
eatSpace(doc, length, pos);
- value = parseWord(doc, length, pos, FALSE);
+ value = parseWord(doc, length, pos, false);
}
else
value = s_TRUE;
attr.insert(key.lower(), value );
- eatSpace(doc, length, pos, TRUE);
+ eatSpace(doc, length, pos, true);
}
if (emptyTag) {
@@ -7447,7 +7447,7 @@ TQString TQTextDocument::parseCloseTag( const TQChar* doc, int length, int& pos
pos++;
pos++;
TQString tag = parseWord(doc, length, pos );
- eatSpace(doc, length, pos, TRUE);
+ eatSpace(doc, length, pos, true);
eat(doc, length, pos, '>');
return tag;
}
@@ -7465,12 +7465,12 @@ TQTextFlow::~TQTextFlow()
void TQTextFlow::clear()
{
#ifndef TQT_NO_TEXTCUSTOMITEM
- leftItems.setAutoDelete( TRUE );
- rightItems.setAutoDelete( TRUE );
+ leftItems.setAutoDelete( true );
+ rightItems.setAutoDelete( true );
leftItems.clear();
rightItems.clear();
- leftItems.setAutoDelete( FALSE );
- rightItems.setAutoDelete( FALSE );
+ leftItems.setAutoDelete( false );
+ rightItems.setAutoDelete( false );
#endif
}
@@ -7587,7 +7587,7 @@ void TQTextCustomItem::pageBreak( int /*y*/ , TQTextFlow* /*flow*/ )
TQTextTable::TQTextTable( TQTextDocument *p, const TQMap<TQString, TQString> & attr )
: TQTextCustomItem( p )
{
- cells.setAutoDelete( FALSE );
+ cells.setAutoDelete( false );
cellspacing = 2;
if ( attr.contains("cellspacing") )
cellspacing = attr["cellspacing"].toInt();
@@ -7657,7 +7657,7 @@ TQString TQTextTable::richText() const
s += ">\n";
int lastRow = -1;
- bool needEnd = FALSE;
+ bool needEnd = false;
TQPtrListIterator<TQTextTableCell> it2( cells );
while ( it2.current() ) {
TQTextTableCell *cell = it2.current();
@@ -7667,7 +7667,7 @@ TQString TQTextTable::richText() const
s += "</tr>\n";
s += "<tr>";
lastRow = cell->row();
- needEnd = TRUE;
+ needEnd = true;
}
s += "<td";
it = cell->attributes.begin();
@@ -7708,18 +7708,18 @@ void TQTextTable::adjustCells( int y , int shift )
{
TQPtrListIterator<TQTextTableCell> it( cells );
TQTextTableCell* cell;
- bool enlarge = FALSE;
+ bool enlarge = false;
while ( ( cell = it.current() ) ) {
++it;
TQRect r = cell->geometry();
if ( y <= r.top() ) {
r.moveBy(0, shift );
cell->setGeometry( r );
- enlarge = TRUE;
+ enlarge = true;
} else if ( y <= r.bottom() ) {
r.rBottom() += shift;
cell->setGeometry( r );
- enlarge = TRUE;
+ enlarge = true;
}
}
if ( enlarge )
@@ -7781,7 +7781,7 @@ void TQTextTable::draw(TQPainter* p, int x, int y, int cx, int cy, int cw, int c
p->fillRect( r.left()-s, r.top()-s, r.width()+2*s, s, cg.button() );
p->fillRect( r.left()-s, r.bottom(), r.width()+2*s, s, cg.button() );
}
- qDrawShadePanel( p, r, cg, TRUE, innerborder );
+ qDrawShadePanel( p, r, cg, true, innerborder );
}
}
}
@@ -7803,7 +7803,7 @@ void TQTextTable::draw(TQPainter* p, int x, int y, int cx, int cy, int cw, int c
p->fillRect( r.left(), r.top(), r.width(), s, cg.button() );
p->fillRect( r.left(), r.bottom()-s, r.width(), s, cg.button() );
}
- qDrawShadePanel( p, r, cg, FALSE, border );
+ qDrawShadePanel( p, r, cg, false, border );
}
}
@@ -7904,24 +7904,24 @@ bool TQTextTable::enterAt( TQTextCursor *c, TQTextDocument *&doc, TQTextParagrap
}
}
if ( i == (int) cells.count() )
- return FALSE; // no cell found
+ return false; // no cell found
if ( currCell.find( c ) == currCell.end() ) {
if ( lastY != -1 )
currCell.insert( c, lastCell );
else
- return FALSE;
+ return false;
}
TQTextTableCell *cell = cells.at( *currCell.find( c ) );
if ( !cell )
- return FALSE;
+ return false;
doc = cell->richText();
parag = doc->firstParagraph();
idx = 0;
ox += cell->geometry().x() + cell->horizontalAlignmentOffset() + outerborder + parent->x();
oy += cell->geometry().y() + cell->verticalAlignmentOffset() + outerborder;
- return TRUE;
+ return true;
}
bool TQTextTable::next( TQTextCursor *c, TQTextDocument *&doc, TQTextParagraph *&parag, int &idx, int &ox, int &oy )
@@ -7938,23 +7938,23 @@ bool TQTextTable::next( TQTextCursor *c, TQTextDocument *&doc, TQTextParagraph *
TQTextCustomItem::next( c, doc, parag, idx, ox, oy );
TQTextTableCell *cell = cells.first();
if ( !cell )
- return FALSE;
+ return false;
doc = cell->richText();
idx = -1;
- return TRUE;
+ return true;
}
if ( currCell.find( c ) == currCell.end() )
- return FALSE;
+ return false;
TQTextTableCell *cell = cells.at( *currCell.find( c ) );
if ( !cell )
- return FALSE;
+ return false;
doc = cell->richText();
parag = doc->firstParagraph();
idx = 0;
ox += cell->geometry().x() + cell->horizontalAlignmentOffset() + outerborder + parent->x();
oy += cell->geometry().y() + cell->verticalAlignmentOffset() + outerborder;
- return TRUE;
+ return true;
}
bool TQTextTable::prev( TQTextCursor *c, TQTextDocument *&doc, TQTextParagraph *&parag, int &idx, int &ox, int &oy )
@@ -7971,45 +7971,45 @@ bool TQTextTable::prev( TQTextCursor *c, TQTextDocument *&doc, TQTextParagraph *
TQTextCustomItem::prev( c, doc, parag, idx, ox, oy );
TQTextTableCell *cell = cells.first();
if ( !cell )
- return FALSE;
+ return false;
doc = cell->richText();
idx = -1;
- return TRUE;
+ return true;
}
if ( currCell.find( c ) == currCell.end() )
- return FALSE;
+ return false;
TQTextTableCell *cell = cells.at( *currCell.find( c ) );
if ( !cell )
- return FALSE;
+ return false;
doc = cell->richText();
parag = doc->lastParagraph();
idx = parag->length() - 1;
ox += cell->geometry().x() + cell->horizontalAlignmentOffset() + outerborder + parent->x();
oy += cell->geometry().y() + cell->verticalAlignmentOffset() + outerborder;
- return TRUE;
+ return true;
}
bool TQTextTable::down( TQTextCursor *c, TQTextDocument *&doc, TQTextParagraph *&parag, int &idx, int &ox, int &oy )
{
if ( currCell.find( c ) == currCell.end() )
- return FALSE;
+ return false;
TQTextTableCell *cell = cells.at( *currCell.find( c ) );
if ( cell->row_ == layout->numRows() - 1 ) {
currCell.insert( c, 0 );
TQTextCustomItem::down( c, doc, parag, idx, ox, oy );
TQTextTableCell *cell = cells.first();
if ( !cell )
- return FALSE;
+ return false;
doc = cell->richText();
idx = -1;
- return TRUE;
+ return true;
}
int oldRow = cell->row_;
int oldCol = cell->col_;
if ( currCell.find( c ) == currCell.end() )
- return FALSE;
+ return false;
int cc = *currCell.find( c );
for ( int i = cc; i < (int)cells.count(); ++i ) {
cell = cells.at( i );
@@ -8020,34 +8020,34 @@ bool TQTextTable::down( TQTextCursor *c, TQTextDocument *&doc, TQTextParagraph *
}
doc = cell->richText();
if ( !cell )
- return FALSE;
+ return false;
parag = doc->firstParagraph();
idx = 0;
ox += cell->geometry().x() + cell->horizontalAlignmentOffset() + outerborder + parent->x();
oy += cell->geometry().y() + cell->verticalAlignmentOffset() + outerborder;
- return TRUE;
+ return true;
}
bool TQTextTable::up( TQTextCursor *c, TQTextDocument *&doc, TQTextParagraph *&parag, int &idx, int &ox, int &oy )
{
if ( currCell.find( c ) == currCell.end() )
- return FALSE;
+ return false;
TQTextTableCell *cell = cells.at( *currCell.find( c ) );
if ( cell->row_ == 0 ) {
currCell.insert( c, 0 );
TQTextCustomItem::up( c, doc, parag, idx, ox, oy );
TQTextTableCell *cell = cells.first();
if ( !cell )
- return FALSE;
+ return false;
doc = cell->richText();
idx = -1;
- return TRUE;
+ return true;
}
int oldRow = cell->row_;
int oldCol = cell->col_;
if ( currCell.find( c ) == currCell.end() )
- return FALSE;
+ return false;
int cc = *currCell.find( c );
for ( int i = cc; i >= 0; --i ) {
cell = cells.at( i );
@@ -8058,12 +8058,12 @@ bool TQTextTable::up( TQTextCursor *c, TQTextDocument *&doc, TQTextParagraph *&p
}
doc = cell->richText();
if ( !cell )
- return FALSE;
+ return false;
parag = doc->lastParagraph();
idx = parag->length() - 1;
ox += cell->geometry().x() + cell->horizontalAlignmentOffset() + outerborder + parent->x();
oy += cell->geometry().y() + cell->verticalAlignmentOffset() + outerborder;
- return TRUE;
+ return true;
}
TQTextTableCell::TQTextTableCell( TQTextTable* table,
@@ -8127,7 +8127,7 @@ TQTextTableCell::TQTextTableCell( TQTextTable* table,
}
- hasFixedWidth = FALSE;
+ hasFixedWidth = false;
if ( attr.contains("width") ) {
bool b;
TQString s( attr["width"] );
@@ -8135,7 +8135,7 @@ TQTextTableCell::TQTextTableCell( TQTextTable* table,
if ( b ) {
maxw = w;
minw = maxw;
- hasFixedWidth = TRUE;
+ hasFixedWidth = true;
} else {
s = s.stripWhiteSpace();
if ( s.length() > 1 && s[ (int)s.length()-1 ] == '%' )
@@ -8187,7 +8187,7 @@ TQSizePolicy::ExpandData TQTextTableCell::expanding() const
bool TQTextTableCell::isEmpty() const
{
- return FALSE;
+ return false;
}
void TQTextTableCell::setGeometry( const TQRect& r )
{
@@ -8205,7 +8205,7 @@ TQRect TQTextTableCell::geometry() const
bool TQTextTableCell::hasHeightForWidth() const
{
- return TRUE;
+ return true;
}
int TQTextTableCell::heightForWidth( int w ) const
@@ -8270,9 +8270,9 @@ void TQTextTableCell::draw( TQPainter* p, int x, int y, int cx, int cy, int cw,
if ( cx >= 0 && cy >= 0 )
richtext->draw( p, cx - ( x + horizontalAlignmentOffset() + geom.x() ),
cy - ( y + geom.y() + verticalAlignmentOffset() ),
- cw, ch, g, FALSE, FALSE, 0 );
+ cw, ch, g, false, false, 0 );
else
- richtext->draw( p, -1, -1, -1, -1, g, FALSE, FALSE, 0 );
+ richtext->draw( p, -1, -1, -1, -1, g, false, false, 0 );
p->restore();
}