summaryrefslogtreecommitdiffstats
path: root/src/widgets/tqtextedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/tqtextedit.cpp')
-rw-r--r--src/widgets/tqtextedit.cpp592
1 files changed, 295 insertions, 297 deletions
diff --git a/src/widgets/tqtextedit.cpp b/src/widgets/tqtextedit.cpp
index 7ea000f21..75da02e01 100644
--- a/src/widgets/tqtextedit.cpp
+++ b/src/widgets/tqtextedit.cpp
@@ -97,13 +97,13 @@ class TQTextEditPrivate
{
public:
TQTextEditPrivate()
- :preeditStart(-1),preeditLength(-1),ensureCursorVisibleInShowEvent(FALSE),
- tabChangesFocus(FALSE),
+ :preeditStart(-1),preeditLength(-1),ensureCursorVisibleInShowEvent(false),
+ tabChangesFocus(false),
#ifndef TQT_NO_CLIPBOARD
clipboard_mode( TQClipboard::Clipboard ),
#endif
#ifdef QT_TEXTEDIT_OPTIMIZATION
- od(0), optimMode(FALSE),
+ od(0), optimMode(false),
maxLogLines(-1),
logOffset(0),
#endif
@@ -181,9 +181,9 @@ bool TQRichTextDrag::decode( TQMimeSource *e, TQString &str, const TQCString &mi
if ( qstrcmp( "application/x-qrichtext", mime ) != 0 )
continue;
str = TQString::fromUtf8( e->encodedData( mime ) );
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
// do a regular text decode
@@ -194,7 +194,7 @@ bool TQRichTextDrag::decode( TQMimeSource *e, TQString &str, const TQCString &mi
bool TQRichTextDrag::canDecode( TQMimeSource* e )
{
if ( e->provides( "application/x-qrichtext" ) )
- return TRUE;
+ return true;
return TQTextDrag::canDecode( e );
}
@@ -209,7 +209,7 @@ const char* TQRichTextDrag::format( int i ) const
#endif
-static bool block_set_alignment = FALSE;
+static bool block_set_alignment = false;
/*!
\class TQTextEdit tqtextedit.h
@@ -241,7 +241,7 @@ static bool block_set_alignment = FALSE;
correctly display files that have margins set and that
include images). This mode is mostly useful for editing small
amounts of rich text. <sup>1.</sup>
- \row \i Text Viewer \i setReadOnly(TRUE)
+ \row \i Text Viewer \i setReadOnly(true)
\i Set text with setText() or append() (which has no undo
history so is faster and uses less memory); text() returns
plain or rich text depending on the textFormat(). This mode
@@ -350,7 +350,7 @@ static bool block_set_alignment = FALSE;
if ( file.open( IO_WriteOnly ) ) {
TQTextStream stream( &file );
stream << textEdit->text();
- textEdit->setModified( FALSE );
+ textEdit->setModified( false );
}
\endcode
@@ -460,7 +460,7 @@ static bool block_set_alignment = FALSE;
TQStyleSheetItem * item = new TQStyleSheetItem( log->styleSheet(), "mytag" );
item->setColor( "red" );
item->setFontWeight( TQFont::Bold );
- item->setFontUnderline( TRUE );
+ item->setFontUnderline( true );
log->append( "This is a <mytag>custom tag</mytag>!" );
\endcode
Note that only the color, bold, underline and italic attributes of
@@ -510,7 +510,7 @@ static bool block_set_alignment = FALSE;
If the text changes, the textChanged() signal is emitted, and if
the user inserts a new line by pressing Return or Enter,
returnPressed() is emitted. The isModified() function will return
- TRUE if the text has been modified.
+ true if the text has been modified.
TQTextEdit provides command-based undo and redo. To set the depth
of the command history use setUndoDepth() which defaults to 100
@@ -643,11 +643,11 @@ static bool block_set_alignment = FALSE;
text edit.
When text is selected this signal will be emitted with \a yes set
- to TRUE. If no text has been selected or if the selected text is
- de-selected this signal is emitted with \a yes set to FALSE.
+ to true. If no text has been selected or if the selected text is
+ de-selected this signal is emitted with \a yes set to false.
- If \a yes is TRUE then copy() can be used to copy the selection to
- the clipboard. If \a yes is FALSE then copy() does nothing.
+ If \a yes is true then copy() can be used to copy the selection to
+ the clipboard. If \a yes is false then copy() does nothing.
\sa selectionChanged()
*/
@@ -737,9 +737,9 @@ static bool block_set_alignment = FALSE;
\property TQTextEdit::overwriteMode
\brief the text edit's overwrite mode
- If FALSE (the default) characters entered by the user are inserted
+ If false (the default) characters entered by the user are inserted
with any characters to the right being moved out of the way. If
- TRUE, the editor is in overwrite mode, i.e. characters entered by
+ true, the editor is in overwrite mode, i.e. characters entered by
the user overwrite any characters to the right of the cursor
position.
*/
@@ -769,7 +769,7 @@ static bool block_set_alignment = FALSE;
\fn void TQTextEdit::undoAvailable( bool yes )
This signal is emitted when the availability of undo changes. If
- \a yes is TRUE, then undo() will work until undoAvailable( FALSE )
+ \a yes is true, then undo() will work until undoAvailable( false )
is next emitted.
\sa undo() undoDepth()
@@ -779,7 +779,7 @@ static bool block_set_alignment = FALSE;
\fn void TQTextEdit::modificationChanged( bool m )
This signal is emitted when the modification status of the
- document has changed. If \a m is TRUE, the document was modified,
+ document has changed. If \a m is true, the document was modified,
otherwise the modification state has been reset to unmodified.
\sa modified
@@ -789,7 +789,7 @@ static bool block_set_alignment = FALSE;
\fn void TQTextEdit::redoAvailable( bool yes )
This signal is emitted when the availability of redo changes. If
- \a yes is TRUE, then redo() will work until redoAvailable( FALSE )
+ \a yes is true, then redo() will work until redoAvailable( false )
is next emitted.
\sa redo() undoDepth()
@@ -951,24 +951,24 @@ void TQTextEdit::init()
{
d = new TQTextEditPrivate;
doc->formatCollection()->setPaintDevice( this );
- undoEnabled = TRUE;
- readOnly = TRUE;
- setReadOnly( FALSE );
+ undoEnabled = true;
+ readOnly = true;
+ setReadOnly( false );
setFrameStyle( LineEditPanel | Sunken );
connect( doc, TQ_SIGNAL( minimumWidthChanged(int) ),
this, TQ_SLOT( documentWidthChanged(int) ) );
- mousePressed = FALSE;
- inDoubleClick = FALSE;
- modified = FALSE;
+ mousePressed = false;
+ inDoubleClick = false;
+ modified = false;
onLink = TQString::null;
d->onName = TQString::null;
- overWrite = FALSE;
+ overWrite = false;
wrapMode = WidgetWidth;
wrapWidth = -1;
wPolicy = AtWhiteSpace;
- mightStartDrag = FALSE;
- inDnD = FALSE;
+ mightStartDrag = false;
+ inDnD = false;
doc->setFormatter( new TQTextFormatterBreakWords );
doc->formatCollection()->defaultFormat()->setFont( TQScrollView::font() );
doc->formatCollection()->defaultFormat()->setColor( colorGroup().color( TQColorGroup::Text ) );
@@ -977,12 +977,12 @@ void TQTextEdit::init()
setBackgroundMode( PaletteBase );
viewport()->setBackgroundMode( PaletteBase );
- viewport()->setAcceptDrops( TRUE );
+ viewport()->setAcceptDrops( true );
resizeContents( 0, doc->lastParagraph() ?
( doc->lastParagraph()->paragId() + 1 ) * doc->formatCollection()->defaultFormat()->height() : 0 );
- setKeyCompression( TRUE );
- viewport()->setMouseTracking( TRUE );
+ setKeyCompression( true );
+ viewport()->setMouseTracking( true );
#ifndef TQT_NO_CURSOR
viewport()->setCursor( isReadOnly() ? arrowCursor : ibeamCursor );
#endif
@@ -1002,7 +1002,7 @@ void TQTextEdit::init()
connect( changeIntervalTimer, TQ_SIGNAL( timeout() ),
this, TQ_SLOT( doChangeInterval() ) );
- cursorVisible = TRUE;
+ cursorVisible = true;
blinkTimer = new TQTimer( this );
connect( blinkTimer, TQ_SIGNAL( timeout() ),
this, TQ_SLOT( blinkCursor() ) );
@@ -1017,11 +1017,11 @@ void TQTextEdit::init()
formatMore();
- blinkCursorVisible = FALSE;
+ blinkCursorVisible = false;
viewport()->setFocusProxy( this );
viewport()->setFocusPolicy( WheelFocus );
- setInputMethodEnabled( TRUE );
+ setInputMethodEnabled( true );
viewport()->installEventFilter( this );
connect( this, TQ_SIGNAL(horizontalSliderReleased()), this, TQ_SLOT(sliderReleased()) );
connect( this, TQ_SIGNAL(verticalSliderReleased()), this, TQ_SLOT(sliderReleased()) );
@@ -1039,7 +1039,7 @@ void TQTextEdit::paintDocument( bool drawAll, TQPainter *p, int cx, int cy, int
bool drawCur = hasFocus() || viewport()->hasFocus();
if (( hasSelectedText() && !style().styleHint( TQStyle::SH_BlinkCursorWhenTextSelected ) ) ||
isReadOnly() || !cursorVisible || doc->hasSelection( TQTextDocument::IMSelectionText ))
- drawCur = FALSE;
+ drawCur = false;
TQColorGroup g = colorGroup();
const TQColorGroup::ColorRole backRole = TQPalette::backgroundRoleFromMode(backgroundMode());
if ( doc->paper() )
@@ -1078,7 +1078,7 @@ void TQTextEdit::drawContents( TQPainter *p, int cx, int cy, int cw, int ch )
return;
}
#endif
- paintDocument( TRUE, p, cx, cy, cw, ch );
+ paintDocument( true, p, cx, cy, cw, ch );
int v;
p->setPen( foregroundColor() );
if ( document()->isPageBreakEnabled() && ( v = document()->flow()->pageSize() ) > 0 ) {
@@ -1209,7 +1209,7 @@ bool TQTextEdit::event( TQEvent *e )
#endif
d->ensureCursorVisibleInShowEvent ) {
ensureCursorVisible();
- d->ensureCursorVisibleInShowEvent = FALSE;
+ d->ensureCursorVisibleInShowEvent = false;
}
if ( !d->scrollToAnchor.isEmpty() ) {
scrollToAnchor( d->scrollToAnchor );
@@ -1228,25 +1228,25 @@ void TQTextEdit::keyPressEvent( TQKeyEvent *e )
{
changeIntervalTimer->stop();
interval = 10;
- bool unknownKey = FALSE;
+ bool unknownKey = false;
if ( isReadOnly() ) {
if ( !handleReadOnlyKeyEvent( e ) )
TQScrollView::keyPressEvent( e );
- changeIntervalTimer->start( 100, TRUE );
+ changeIntervalTimer->start( 100, true );
return;
}
- bool selChanged = FALSE;
+ bool selChanged = false;
for ( int i = 1; i < doc->numSelections(); ++i ) // start with 1 as we don't want to remove the Standard-Selection
selChanged = doc->removeSelection( i ) || selChanged;
if ( selChanged ) {
- cursor->paragraph()->document()->nextDoubleBuffered = TRUE;
+ cursor->paragraph()->document()->nextDoubleBuffered = true;
repaintChanged();
}
- bool clearUndoRedoInfo = TRUE;
+ bool clearUndoRedoInfo = true;
switch ( e->key() ) {
@@ -1281,16 +1281,16 @@ void TQTextEdit::keyPressEvent( TQKeyEvent *e )
moveCursor( MovePgDown, e->state() & ShiftButton );
break;
case Key_Return: case Key_Enter:
- if ( doc->hasSelection( TQTextDocument::Standard, FALSE ) )
+ if ( doc->hasSelection( TQTextDocument::Standard, false ) )
removeSelectedText();
if ( textFormat() == TQt::RichText && ( e->state() & ControlButton ) ) {
// Ctrl-Enter inserts a line break in rich text mode
- insert( TQString( TQChar( 0x2028) ), TRUE, FALSE );
+ insert( TQString( TQChar( 0x2028) ), true, false );
} else {
#ifndef TQT_NO_CURSOR
viewport()->setCursor( isReadOnly() ? arrowCursor : ibeamCursor );
#endif
- clearUndoRedoInfo = FALSE;
+ clearUndoRedoInfo = false;
doKeyboardAction( ActionReturn );
emit returnPressed();
}
@@ -1302,13 +1302,13 @@ void TQTextEdit::keyPressEvent( TQKeyEvent *e )
break;
} else
#endif
- if ( doc->hasSelection( TQTextDocument::Standard, TRUE ) ) {
+ if ( doc->hasSelection( TQTextDocument::Standard, true ) ) {
removeSelectedText();
break;
}
doKeyboardAction( e->state() & ControlButton ? ActionWordDelete
: ActionDelete );
- clearUndoRedoInfo = FALSE;
+ clearUndoRedoInfo = false;
break;
case Key_Insert:
@@ -1335,14 +1335,14 @@ void TQTextEdit::keyPressEvent( TQKeyEvent *e )
}
} else
#endif
- if ( doc->hasSelection( TQTextDocument::Standard, TRUE ) ) {
+ if ( doc->hasSelection( TQTextDocument::Standard, true ) ) {
removeSelectedText();
break;
}
doKeyboardAction( e->state() & ControlButton ? ActionWordBackspace
: ActionBackspace );
- clearUndoRedoInfo = FALSE;
+ clearUndoRedoInfo = false;
break;
case Key_F16: // Copy key on Sun keyboards
copy();
@@ -1402,7 +1402,7 @@ void TQTextEdit::keyPressEvent( TQKeyEvent *e )
!( e->state() & MetaButton ) ) ||
( ( (e->state()&ControlButton) | AltButton ) == (ControlButton|AltButton) ) ) &&
( !e->ascii() || e->ascii() >= 32 || e->text() == "\t" ) ) {
- clearUndoRedoInfo = FALSE;
+ clearUndoRedoInfo = false;
if ( e->key() == Key_Tab ) {
if ( d->tabChangesFocus ) {
e->ignore();
@@ -1417,9 +1417,9 @@ void TQTextEdit::keyPressEvent( TQKeyEvent *e )
undoRedoInfo.styleInformation = TQTextStyleCommand::readStyleInformation( doc, undoRedoInfo.id, undoRedoInfo.eid );
cursor->paragraph()->setListDepth( cursor->paragraph()->listDepth() +1 );
clearUndoRedo();
- drawCursor( FALSE );
+ drawCursor( false );
repaintChanged();
- drawCursor( TRUE );
+ drawCursor( true );
break;
}
} else if ( e->key() == Key_BackTab ) {
@@ -1440,14 +1440,14 @@ void TQTextEdit::keyPressEvent( TQKeyEvent *e )
undoRedoInfo.styleInformation = TQTextStyleCommand::readStyleInformation( doc, undoRedoInfo.id, undoRedoInfo.eid );
setParagType( TQStyleSheetItem::DisplayListItem, TQStyleSheetItem::ListDisc );
clearUndoRedo();
- drawCursor( FALSE );
+ drawCursor( false );
repaintChanged();
- drawCursor( TRUE );
+ drawCursor( true );
break;
}
if (overWrite && !cursor->atParagEnd() && !doc->hasSelection(TQTextDocument::Standard)) {
doKeyboardAction(ActionDelete);
- clearUndoRedoInfo = FALSE;
+ clearUndoRedoInfo = false;
}
TQString t = e->text();
#ifdef TQ_WS_X11
@@ -1468,7 +1468,7 @@ void TQTextEdit::keyPressEvent( TQKeyEvent *e )
}
}
#endif
- insert( t, TRUE, FALSE );
+ insert( t, true, false );
break;
} else if ( e->state() & ControlButton ) {
switch ( e->key() ) {
@@ -1489,7 +1489,7 @@ void TQTextEdit::keyPressEvent( TQKeyEvent *e )
#if defined(TQ_WS_X11)
moveCursor( MoveLineStart, e->state() & ShiftButton );
#else
- selectAll( TRUE );
+ selectAll( true );
#endif
break;
case Key_B:
@@ -1504,7 +1504,7 @@ void TQTextEdit::keyPressEvent( TQKeyEvent *e )
break;
}
doKeyboardAction( ActionDelete );
- clearUndoRedoInfo = FALSE;
+ clearUndoRedoInfo = false;
break;
case Key_H:
if ( doc->hasSelection( TQTextDocument::Standard ) ) {
@@ -1516,7 +1516,7 @@ void TQTextEdit::keyPressEvent( TQKeyEvent *e )
break;
doKeyboardAction( ActionBackspace );
- clearUndoRedoInfo = FALSE;
+ clearUndoRedoInfo = false;
break;
case Key_E:
moveCursor( MoveLineEnd, e->state() & ShiftButton );
@@ -1548,11 +1548,11 @@ void TQTextEdit::keyPressEvent( TQKeyEvent *e )
break;
#endif
default:
- unknownKey = FALSE;
+ unknownKey = false;
break;
}
} else {
- unknownKey = TRUE;
+ unknownKey = true;
}
}
}
@@ -1561,7 +1561,7 @@ void TQTextEdit::keyPressEvent( TQKeyEvent *e )
emit cursorPositionChanged( cursor->paragraph()->paragId(), cursor->index() );
if ( clearUndoRedoInfo )
clearUndoRedo();
- changeIntervalTimer->start( 100, TRUE );
+ changeIntervalTimer->start( 100, true );
if ( unknownKey )
e->ignore();
}
@@ -1576,7 +1576,7 @@ bool TQTextEdit::sendMouseEventToInputContext( TQMouseEvent *e )
#ifndef TQT_NO_IM
if ( d->composeMode() ) {
TQTextCursor c( doc );
- if ( c.place( e->pos(), doc->firstParagraph(), FALSE, FALSE, FALSE ) ) {
+ if ( c.place( e->pos(), doc->firstParagraph(), false, false, false ) ) {
int mousePos = c.index() - d->preeditStart;
if ( cursor->globalY() == c.globalY() &&
mousePos >= 0 && mousePos < d->preeditLength ) {
@@ -1588,10 +1588,10 @@ bool TQTextEdit::sendMouseEventToInputContext( TQMouseEvent *e )
TQWidget::sendMouseEventToInputContext( -1, e->type(),
e->button(), e->state() );
}
- return TRUE;
+ return true;
}
#endif
- return FALSE;
+ return false;
}
@@ -1689,7 +1689,7 @@ void TQTextEdit::imEndEvent( TQIMEvent *e )
if ( d->preeditStart >= 0 ) {
cursor->setIndex( d->preeditStart );
//TODO: TQt 4 we should use the new virtual insert function
- insert( e->text(), FALSE );
+ insert( e->text(), false );
}
d->preeditStart = d->preeditLength = -1;
@@ -1697,7 +1697,7 @@ void TQTextEdit::imEndEvent( TQIMEvent *e )
}
-static bool tqtextedit_ignore_readonly = FALSE;
+static bool tqtextedit_ignore_readonly = false;
/*!
Executes keyboard action \a action. This is normally called by a
@@ -1713,8 +1713,8 @@ void TQTextEdit::doKeyboardAction( KeyboardAction action )
return;
lastFormatted = cursor->paragraph();
- drawCursor( FALSE );
- bool doUpdateCurrentFormat = TRUE;
+ drawCursor( false );
+ bool doUpdateCurrentFormat = true;
switch ( action ) {
case ActionWordDelete:
@@ -1729,7 +1729,7 @@ void TQTextEdit::doKeyboardAction( KeyboardAction action )
}
int idx = cursor->index();
do {
- undoRedoInfo.d->text.insert( undoRedoInfo.d->text.length(), cursor->paragraph()->at( idx++ ), TRUE );
+ undoRedoInfo.d->text.insert( undoRedoInfo.d->text.length(), cursor->paragraph()->at( idx++ ), true );
} while ( !cursor->paragraph()->string()->validCursorPosition( idx ) );
}
cursor->remove();
@@ -1760,9 +1760,9 @@ void TQTextEdit::doKeyboardAction( KeyboardAction action )
}
int ldepth = cursor->paragraph()->listDepth();
if ( cursor->paragraph()->isListItem() && ldepth == 1 ) {
- cursor->paragraph()->setListItem( FALSE );
+ cursor->paragraph()->setListItem( false );
} else if ( TQMAX( ldepth, 1 ) == 1 ) {
- cursor->paragraph()->setListItem( FALSE );
+ cursor->paragraph()->setListItem( false );
cursor->paragraph()->setListDepth( 0 );
} else {
cursor->paragraph()->setListDepth( ldepth - 1 );
@@ -1770,7 +1770,7 @@ void TQTextEdit::doKeyboardAction( KeyboardAction action )
clearUndoRedo();
lastFormatted = cursor->paragraph();
repaintChanged();
- drawCursor( TRUE );
+ drawCursor( true );
return;
}
@@ -1787,13 +1787,13 @@ void TQTextEdit::doKeyboardAction( KeyboardAction action )
if (para->at(cur_idx - 1)->c.isLowSurrogate() && cur_idx > 1 &&
para->at(cur_idx - 2)->c.isHighSurrogate())
{
- undoRedoInfo.d->text.insert( 0, para->at(cur_idx - 1), TRUE );
- undoRedoInfo.d->text.insert( 0, para->at(cur_idx - 2), TRUE );
+ undoRedoInfo.d->text.insert( 0, para->at(cur_idx - 1), true );
+ undoRedoInfo.d->text.insert( 0, para->at(cur_idx - 2), true );
undoRedoInfo.index = cursor->index() - 2;
}
else
{
- undoRedoInfo.d->text.insert( 0, para->at(cur_idx - 1), TRUE );
+ undoRedoInfo.d->text.insert( 0, para->at(cur_idx - 1), true );
undoRedoInfo.index = cursor->index() - 1;
}
}
@@ -1828,7 +1828,7 @@ void TQTextEdit::doKeyboardAction( KeyboardAction action )
lastFormatted = cursor->paragraph()->prev();
lastFormatted->invalidate( 0 );
}
- doUpdateCurrentFormat = FALSE;
+ doUpdateCurrentFormat = false;
break;
case ActionKill:
clearUndoRedo();
@@ -1845,7 +1845,7 @@ void TQTextEdit::doKeyboardAction( KeyboardAction action )
formatMore();
repaintChanged();
ensureCursorVisible();
- drawCursor( TRUE );
+ drawCursor( true );
updateMicroFocusHint();
if ( doUpdateCurrentFormat )
updateCurrentFormat();
@@ -1863,7 +1863,7 @@ void TQTextEdit::readFormats( TQTextCursor &c1, TQTextCursor &c2, TQTextString &
int lastIndex = text.length();
if ( c1.paragraph() == c2.paragraph() ) {
for ( int i = c1.index(); i < c2.index(); ++i )
- text.insert( lastIndex + i - c1.index(), c1.paragraph()->at( i ), TRUE );
+ text.insert( lastIndex + i - c1.index(), c1.paragraph()->at( i ), true );
#ifndef TQT_NO_DATASTREAM
if ( fillStyles ) {
styleStream << (int) 1;
@@ -1873,7 +1873,7 @@ void TQTextEdit::readFormats( TQTextCursor &c1, TQTextCursor &c2, TQTextString &
} else {
int i;
for ( i = c1.index(); i < c1.paragraph()->length()-1; ++i )
- text.insert( lastIndex++, c1.paragraph()->at( i ), TRUE );
+ text.insert( lastIndex++, c1.paragraph()->at( i ), true );
int num = 2; // start and end, being different
text += "\n"; lastIndex++;
@@ -1883,7 +1883,7 @@ void TQTextEdit::readFormats( TQTextCursor &c1, TQTextCursor &c2, TQTextString &
}
for ( i = 0; i < c2.index(); ++i )
- text.insert( i + lastIndex, c2.paragraph()->at( i ), TRUE );
+ text.insert( i + lastIndex, c2.paragraph()->at( i ), true );
#ifndef TQT_NO_DATASTREAM
if ( fillStyles ) {
styleStream << num;
@@ -1934,14 +1934,14 @@ void TQTextEdit::removeSelectedText( int selNum )
doc->removeSelection( i );
}
- drawCursor( FALSE );
+ drawCursor( false );
if ( undoEnabled ) {
checkUndoRedoInfo( UndoRedoInfo::RemoveSelected );
if ( !undoRedoInfo.valid() ) {
doc->selectionStart( selNum, undoRedoInfo.id, undoRedoInfo.index );
undoRedoInfo.d->text = TQString::null;
}
- readFormats( c1, c2, undoRedoInfo.d->text, TRUE );
+ readFormats( c1, c2, undoRedoInfo.d->text, true );
}
doc->removeSelectedText( selNum, cursor );
@@ -1950,15 +1950,15 @@ void TQTextEdit::removeSelectedText( int selNum )
ensureCursorVisible();
lastFormatted = cursor->paragraph();
formatMore();
- repaintContents( FALSE );
+ repaintContents( false );
ensureCursorVisible();
- drawCursor( TRUE );
+ drawCursor( true );
clearUndoRedo();
#if defined(TQ_WS_WIN)
// there seems to be a problem with repainting or erasing the area
// of the scrollview which is not the contents on windows
if ( contentsHeight() < visibleHeight() )
- viewport()->repaint( 0, contentsHeight(), visibleWidth(), visibleHeight() - contentsHeight(), TRUE );
+ viewport()->repaint( 0, contentsHeight(), visibleWidth(), visibleHeight() - contentsHeight(), true );
#endif
#ifndef TQT_NO_CURSOR
viewport()->setCursor( isReadOnly() ? arrowCursor : ibeamCursor );
@@ -1967,8 +1967,8 @@ void TQTextEdit::removeSelectedText( int selNum )
} else {
delete cursor;
cursor = new TQTextCursor( doc );
- drawCursor( TRUE );
- repaintContents( TRUE );
+ drawCursor( true );
+ repaintContents( true );
}
setModified();
emit textChanged();
@@ -1993,7 +1993,7 @@ void TQTextEdit::moveCursor( CursorAction action, bool select )
TQTextCursor c1 = *cursor;
TQTextCursor c2;
#endif
- drawCursor( FALSE );
+ drawCursor( false );
if ( select ) {
if ( !doc->hasSelection( TQTextDocument::Standard ) )
doc->setSelectionStart( TQTextDocument::Standard, *cursor );
@@ -2007,10 +2007,10 @@ void TQTextEdit::moveCursor( CursorAction action, bool select )
moveCursor( MoveHome );
#endif
if ( doc->setSelectionEnd( TQTextDocument::Standard, *cursor ) ) {
- cursor->paragraph()->document()->nextDoubleBuffered = TRUE;
+ cursor->paragraph()->document()->nextDoubleBuffered = true;
repaintChanged();
} else {
- drawCursor( TRUE );
+ drawCursor( true );
}
ensureCursorVisible();
emit selectionChanged();
@@ -2042,12 +2042,12 @@ void TQTextEdit::moveCursor( CursorAction action, bool select )
#endif
if ( !redraw ) {
ensureCursorVisible();
- drawCursor( TRUE );
+ drawCursor( true );
} else {
- cursor->paragraph()->document()->nextDoubleBuffered = TRUE;
+ cursor->paragraph()->document()->nextDoubleBuffered = true;
repaintChanged();
ensureCursorVisible();
- drawCursor( TRUE );
+ drawCursor( true );
#ifndef TQT_NO_CURSOR
viewport()->setCursor( isReadOnly() ? arrowCursor : ibeamCursor );
#endif
@@ -2058,7 +2058,7 @@ void TQTextEdit::moveCursor( CursorAction action, bool select )
}
}
- drawCursor( TRUE );
+ drawCursor( true );
updateCurrentFormat();
updateMicroFocusHint();
}
@@ -2151,7 +2151,7 @@ void TQTextEdit::ensureCursorVisible()
{
// Not visible or the user is draging the window, so don't position to caret yet
if ( !isUpdatesEnabled() || !isVisible() || isHorizontalSliderPressed() || isVerticalSliderPressed() ) {
- d->ensureCursorVisibleInShowEvent = TRUE;
+ d->ensureCursorVisibleInShowEvent = true;
return;
}
sync();
@@ -2171,7 +2171,7 @@ void TQTextEdit::ensureCursorVisible()
void TQTextEdit::sliderReleased()
{
if ( d->ensureCursorVisibleInShowEvent && isVisible() ) {
- d->ensureCursorVisibleInShowEvent = FALSE;
+ d->ensureCursorVisibleInShowEvent = false;
ensureCursorVisible();
}
}
@@ -2186,7 +2186,7 @@ void TQTextEdit::drawCursor( bool visible )
!cursor->paragraph() ||
!cursor->paragraph()->isValid() ||
( !style().styleHint( TQStyle::SH_BlinkCursorWhenTextSelected ) &&
- ( d->optimMode ? optimHasSelection() : doc->hasSelection( TQTextDocument::Standard, TRUE ))) ||
+ ( d->optimMode ? optimHasSelection() : doc->hasSelection( TQTextDocument::Standard, true ))) ||
( visible && !hasFocus() && !viewport()->hasFocus() && !inDnD ) ||
doc->hasSelection( TQTextDocument::IMSelectionText ) ||
isReadOnly() )
@@ -2196,12 +2196,12 @@ void TQTextEdit::drawCursor( bool visible )
// selection phase of input method, so ordinary cursor should be
// invisible if IM selection text exists.
if ( doc->hasSelection( TQTextDocument::IMSelectionText ) ) {
- visible = FALSE;
+ visible = false;
}
TQPainter p( viewport() );
TQRect r( cursor->topParagraph()->rect() );
- cursor->paragraph()->setChanged( TRUE );
+ cursor->paragraph()->setChanged( true );
p.translate( -contentsX() + cursor->totalOffsetX(), -contentsY() + cursor->totalOffsetY() );
TQPixmap *pix = 0;
TQColorGroup cg( colorGroup() );
@@ -2211,7 +2211,7 @@ void TQTextEdit::drawCursor( bool visible )
else if ( doc->paper() )
cg.setBrush( backRole, *doc->paper() );
p.setBrushOrigin( -contentsX(), -contentsY() );
- cursor->paragraph()->document()->nextDoubleBuffered = TRUE;
+ cursor->paragraph()->document()->nextDoubleBuffered = true;
if ( !cursor->nestedDepth() ) {
int h = cursor->paragraph()->lineHeightOfChar( cursor->index() );
int dist = 5;
@@ -2287,7 +2287,7 @@ void TQTextEdit::contentsMousePressEvent( TQMouseEvent *e )
doc->setSelectionEnd( TQTextDocument::Standard, c2 );
*cursor = c2;
repaintChanged();
- mousePressed = TRUE;
+ mousePressed = true;
return;
}
@@ -2295,19 +2295,19 @@ void TQTextEdit::contentsMousePressEvent( TQMouseEvent *e )
TQTextCursor oldCursor = *cursor;
TQTextCursor c = *cursor;
mousePos = e->pos();
- mightStartDrag = FALSE;
+ mightStartDrag = false;
pressedLink = TQString::null;
d->pressedName = TQString::null;
if ( e->button() == LeftButton ) {
- mousePressed = TRUE;
- drawCursor( FALSE );
+ mousePressed = true;
+ drawCursor( false );
placeCursor( e->pos() );
ensureCursorVisible();
if ( isReadOnly() && linksEnabled() ) {
TQTextCursor c = *cursor;
- placeCursor( e->pos(), &c, TRUE );
+ placeCursor( e->pos(), &c, true );
if ( c.paragraph() && c.paragraph()->at( c.index() ) &&
c.paragraph()->at( c.index() )->isAnchor() ) {
pressedLink = c.paragraph()->at( c.index() )->anchorHref();
@@ -2317,15 +2317,15 @@ void TQTextEdit::contentsMousePressEvent( TQMouseEvent *e )
#ifndef TQT_NO_DRAGANDDROP
if ( doc->inSelection( TQTextDocument::Standard, e->pos() ) ) {
- mightStartDrag = TRUE;
- drawCursor( TRUE );
- dragStartTimer->start( TQApplication::startDragTime(), TRUE );
+ mightStartDrag = true;
+ drawCursor( true );
+ dragStartTimer->start( TQApplication::startDragTime(), true );
dragStartPos = e->pos();
return;
}
#endif
- bool redraw = FALSE;
+ bool redraw = false;
if ( doc->hasSelection( TQTextDocument::Standard ) ) {
if ( !( e->state() & ShiftButton ) ) {
redraw = doc->removeSelection( TQTextDocument::Standard );
@@ -2346,7 +2346,7 @@ void TQTextEdit::contentsMousePressEvent( TQMouseEvent *e )
redraw = doc->removeSelection( i ) || redraw;
if ( !redraw ) {
- drawCursor( TRUE );
+ drawCursor( true );
} else {
repaintChanged();
#ifndef TQT_NO_CURSOR
@@ -2356,7 +2356,7 @@ void TQTextEdit::contentsMousePressEvent( TQMouseEvent *e )
} else if ( e->button() == MidButton ) {
bool redraw = doc->removeSelection( TQTextDocument::Standard );
if ( !redraw ) {
- drawCursor( TRUE );
+ drawCursor( true );
} else {
repaintChanged();
#ifndef TQT_NO_CURSOR
@@ -2460,24 +2460,24 @@ void TQTextEdit::contentsMouseReleaseEvent( TQMouseEvent * e )
if ( dragStartTimer->isActive() )
dragStartTimer->stop();
if ( mightStartDrag ) {
- selectAll( FALSE );
- mousePressed = FALSE;
+ selectAll( false );
+ mousePressed = false;
}
#endif
bool mouseWasPressed = mousePressed;
if ( mousePressed ) {
- mousePressed = FALSE;
+ mousePressed = false;
copyToClipboard();
}
#ifndef TQT_NO_CLIPBOARD
else if ( e->button() == MidButton && !isReadOnly() ) {
// only do middle-click pasting on systems that have selections (ie. X11)
if (TQApplication::clipboard()->supportsSelection()) {
- drawCursor( FALSE );
+ drawCursor( false );
placeCursor( e->pos() );
ensureCursorVisible();
doc->setSelectionStart( TQTextDocument::Standard, oldCursor );
- bool redraw = FALSE;
+ bool redraw = false;
if ( doc->hasSelection( TQTextDocument::Standard ) ) {
redraw = doc->removeSelection( TQTextDocument::Standard );
doc->setSelectionStart( TQTextDocument::Standard, *cursor );
@@ -2488,7 +2488,7 @@ void TQTextEdit::contentsMouseReleaseEvent( TQMouseEvent * e )
for ( int i = 1; i < doc->numSelections(); ++i )
redraw = doc->removeSelection( i ) || redraw;
if ( !redraw ) {
- drawCursor( TRUE );
+ drawCursor( true );
} else {
repaintChanged();
#ifndef TQT_NO_CURSOR
@@ -2505,15 +2505,15 @@ void TQTextEdit::contentsMouseReleaseEvent( TQMouseEvent * e )
emit cursorPositionChanged( cursor->paragraph()->paragId(), cursor->index() );
if ( oldCursor != *cursor )
updateCurrentFormat();
- inDoubleClick = FALSE;
+ inDoubleClick = false;
#ifndef TQT_NO_NETWORKPROTOCOL
if ( ( (!onLink.isEmpty() && onLink == pressedLink)
|| (!d->onName.isEmpty() && d->onName == d->pressedName))
&& linksEnabled() && mouseWasPressed ) {
if (!onLink.isEmpty()) {
- TQUrl u( doc->context(), onLink, TRUE );
- emitLinkClicked( u.toString( FALSE, FALSE ) );
+ TQUrl u( doc->context(), onLink, true );
+ emitLinkClicked( u.toString( false, false ) );
}
if (::tqt_cast<TQTextBrowser*>(this)) { // change for 4.0
TQConnectionList *clist = receivers(
@@ -2532,8 +2532,8 @@ void TQTextEdit::contentsMouseReleaseEvent( TQMouseEvent * e )
updateCursor( e->pos() );
}
#endif
- drawCursor( TRUE );
- if ( !doc->hasSelection( TQTextDocument::Standard, TRUE ) )
+ drawCursor( true );
+ if ( !doc->hasSelection( TQTextDocument::Standard, true ) )
doc->removeSelection( TQTextDocument::Standard );
emit copyAvailable( doc->hasSelection( TQTextDocument::Standard ) );
@@ -2572,7 +2572,7 @@ void TQTextEdit::contentsMouseDoubleClickEvent( TQMouseEvent * e )
endIdx = ++i;
}
optimSetSelection( para, startIdx, para, endIdx );
- repaintContents( FALSE );
+ repaintContents( false );
}
} else
#endif
@@ -2616,11 +2616,11 @@ void TQTextEdit::contentsMouseDoubleClickEvent( TQMouseEvent * e )
repaintChanged();
- d->trippleClickTimer->start( tqApp->doubleClickInterval(), TRUE );
+ d->trippleClickTimer->start( tqApp->doubleClickInterval(), true );
d->trippleClickPoint = e->globalPos();
}
- inDoubleClick = TRUE;
- mousePressed = TRUE;
+ inDoubleClick = true;
+ mousePressed = true;
emit doubleClicked( para, index );
}
@@ -2637,7 +2637,7 @@ void TQTextEdit::contentsDragEnterEvent( TQDragEnterEvent *e )
return;
}
e->acceptAction();
- inDnD = TRUE;
+ inDnD = true;
}
/*!
@@ -2650,9 +2650,9 @@ void TQTextEdit::contentsDragMoveEvent( TQDragMoveEvent *e )
e->ignore();
return;
}
- drawCursor( FALSE );
+ drawCursor( false );
placeCursor( e->pos(), cursor );
- drawCursor( TRUE );
+ drawCursor( true );
e->acceptAction();
}
@@ -2662,8 +2662,8 @@ void TQTextEdit::contentsDragMoveEvent( TQDragMoveEvent *e )
void TQTextEdit::contentsDragLeaveEvent( TQDragLeaveEvent * )
{
- drawCursor( FALSE );
- inDnD = FALSE;
+ drawCursor( false );
+ inDnD = false;
}
/*!
@@ -2674,9 +2674,9 @@ void TQTextEdit::contentsDropEvent( TQDropEvent *e )
{
if ( isReadOnly() )
return;
- inDnD = FALSE;
+ inDnD = false;
e->acceptAction();
- bool intern = FALSE;
+ bool intern = false;
if ( TQRichTextDrag::canDecode( e ) ) {
bool hasSel = doc->hasSelection( TQTextDocument::Standard );
bool internalDrag = e->source() == this || e->source() == viewport();
@@ -2715,7 +2715,7 @@ void TQTextEdit::contentsDropEvent( TQDropEvent *e )
if ( internalDrag && e->action() == TQDropEvent::Move ) {
removeSelectedText();
- intern = TRUE;
+ intern = true;
doc->removeSelection( TQTextDocument::Standard );
} else {
doc->removeSelection( TQTextDocument::Standard );
@@ -2723,10 +2723,10 @@ void TQTextEdit::contentsDropEvent( TQDropEvent *e )
viewport()->setCursor( isReadOnly() ? arrowCursor : ibeamCursor );
#endif
}
- drawCursor( FALSE );
+ drawCursor( false );
cursor->setParagraph( insertCursor.paragraph() );
cursor->setIndex( insertCursor.index() );
- drawCursor( TRUE );
+ drawCursor( true );
if ( !cursor->nestedDepth() ) {
TQString subType = "plain";
if ( textFormat() != PlainText ) {
@@ -2762,7 +2762,7 @@ void TQTextEdit::contentsContextMenuEvent( TQContextMenuEvent *e )
#endif
clearUndoRedo();
- mousePressed = FALSE;
+ mousePressed = false;
#ifndef TQT_NO_POPUPMENU
TQGuardedPtr<TQTextEdit> that = this;
@@ -2825,11 +2825,11 @@ void TQTextEdit::handleMouseMove( const TQPoint& pos )
return;
if ( (!scrollTimer->isActive() && pos.y() < contentsY()) || pos.y() > contentsY() + visibleHeight() )
- scrollTimer->start( 100, FALSE );
+ scrollTimer->start( 100, false );
else if ( scrollTimer->isActive() && pos.y() >= contentsY() && pos.y() <= contentsY() + visibleHeight() )
scrollTimer->stop();
- drawCursor( FALSE );
+ drawCursor( false );
TQTextCursor oldCursor = *cursor;
placeCursor( pos );
@@ -2859,16 +2859,16 @@ void TQTextEdit::handleMouseMove( const TQPoint& pos )
}
ensureCursorVisible();
- bool redraw = FALSE;
+ bool redraw = false;
if ( doc->hasSelection( TQTextDocument::Standard ) ) {
redraw = doc->setSelectionEnd( TQTextDocument::Standard, *cursor ) || redraw;
}
if ( !redraw ) {
- drawCursor( TRUE );
+ drawCursor( true );
} else {
repaintChanged();
- drawCursor( TRUE );
+ drawCursor( true );
}
if ( currentFormat && currentFormat->key() != cursor->paragraph()->at( cursor->index() )->format()->key() ) {
@@ -2885,9 +2885,9 @@ void TQTextEdit::handleMouseMove( const TQPoint& pos )
if ( currentAlignment != cursor->paragraph()->alignment() ) {
currentAlignment = cursor->paragraph()->alignment();
- block_set_alignment = TRUE;
+ block_set_alignment = true;
emit currentAlignmentChanged( currentAlignment );
- block_set_alignment = FALSE;
+ block_set_alignment = false;
}
}
@@ -2934,7 +2934,7 @@ void TQTextEdit::updateMicroFocusHint()
if ( !readOnly ) {
TQFont f = c.paragraph()->at( c.index() )->format()->font();
setMicroFocusHint( c.x() - contentsX() + frameWidth(),
- c.y() + cursor->paragraph()->rect().y() - contentsY() + frameWidth(), 0, h, TRUE, &f );
+ c.y() + cursor->paragraph()->rect().y() - contentsY() + frameWidth(), 0, h, true, &f );
}
}
}
@@ -2950,7 +2950,7 @@ void TQTextEdit::formatMore()
int lastTop = -1;
int lastBottom = -1;
int to = 20;
- bool firstVisible = FALSE;
+ bool firstVisible = false;
TQRect cr( contentsX(), contentsY(), visibleWidth(), visibleHeight() );
for ( int i = 0; lastFormatted &&
( i < to || ( firstVisible && lastTop < contentsY()+height() ) );
@@ -2974,7 +2974,7 @@ void TQTextEdit::formatMore()
}
if ( lastFormatted )
- formatTimer->start( interval, TRUE );
+ formatTimer->start( interval, true );
else
interval = TQMAX( 0, interval );
}
@@ -2995,7 +2995,7 @@ void TQTextEdit::doResize()
interval = 0;
formatMore();
}
- repaintContents( FALSE );
+ repaintContents( false );
}
/*! \internal */
@@ -3019,11 +3019,11 @@ bool TQTextEdit::eventFilter( TQObject *o, TQEvent *e )
if ( e->type() == TQEvent::FocusIn ) {
if ( TQApplication::cursorFlashTime() > 0 )
blinkTimer->start( TQApplication::cursorFlashTime() / 2 );
- drawCursor( TRUE );
+ drawCursor( true );
updateMicroFocusHint();
} else if ( e->type() == TQEvent::FocusOut ) {
blinkTimer->stop();
- drawCursor( FALSE );
+ drawCursor( false );
}
}
@@ -3095,7 +3095,7 @@ void TQTextEdit::insert( const TQString &text, uint insertionFlags )
bool imComposition = insertionFlags & AsIMCompositionText;
bool imSelection = insertionFlags & WithIMSelection;
TQString txt( text );
- drawCursor( FALSE );
+ drawCursor( false );
if ( !isReadOnly() && doc->hasSelection( TQTextDocument::Standard ) && removeSelected )
removeSelectedText();
TQTextCursor c2 = *cursor;
@@ -3146,7 +3146,7 @@ void TQTextEdit::insert( const TQString &text, uint insertionFlags )
c2.paragraph()->at( c2.index() )->format()->addRef();
undoRedoInfo.d->text.
setFormat( oldLen + i,
- c2.paragraph()->at( c2.index() )->format(), TRUE );
+ c2.paragraph()->at( c2.index() )->format(), true );
}
c2.gotoNextLetter();
}
@@ -3189,7 +3189,7 @@ void TQTextEdit::insertAt( const TQString &text, int para, int index )
TQTextCursor tmp = *cursor;
cursor->setParagraph( p );
cursor->setIndex( index );
- insert( text, FALSE, TRUE, FALSE );
+ insert( text, false, true, false );
*cursor = tmp;
removeSelection( TQTextDocument::Standard );
}
@@ -3219,23 +3219,23 @@ void TQTextEdit::insertParagraph( const TQString &text, int para )
p = doc->lastParagraph();
TQTextCursor old = *cursor;
- drawCursor( FALSE );
+ drawCursor( false );
cursor->setParagraph( p );
cursor->setIndex( 0 );
clearUndoRedo();
- tqtextedit_ignore_readonly = TRUE;
+ tqtextedit_ignore_readonly = true;
if ( append && cursor->paragraph()->length() > 1 ) {
cursor->setIndex( cursor->paragraph()->length() - 1 );
doKeyboardAction( ActionReturn );
}
- insert( text, FALSE, TRUE, TRUE );
+ insert( text, false, true, true );
doKeyboardAction( ActionReturn );
- tqtextedit_ignore_readonly = FALSE;
+ tqtextedit_ignore_readonly = false;
- drawCursor( FALSE );
+ drawCursor( false );
*cursor = old;
- drawCursor( TRUE );
+ drawCursor( true );
repaintChanged();
}
@@ -3304,16 +3304,16 @@ void TQTextEdit::undo()
#endif
clearUndoRedo();
- drawCursor( FALSE );
+ drawCursor( false );
TQTextCursor *c = doc->undo( cursor );
if ( !c ) {
- drawCursor( TRUE );
+ drawCursor( true );
return;
}
lastFormatted = 0;
repaintChanged();
ensureCursorVisible();
- drawCursor( TRUE );
+ drawCursor( true );
updateMicroFocusHint();
setModified();
// ### If we get back to a completely blank textedit, it
@@ -3324,8 +3324,8 @@ void TQTextEdit::undo()
if ( !cursor->isValid() ) {
delete cursor;
cursor = new TQTextCursor( doc );
- drawCursor( TRUE );
- repaintContents( TRUE );
+ drawCursor( true );
+ repaintContents( true );
}
emit undoAvailable( isUndoAvailable() );
emit redoAvailable( isRedoAvailable() );
@@ -3355,17 +3355,17 @@ void TQTextEdit::redo()
#endif
clearUndoRedo();
- drawCursor( FALSE );
+ drawCursor( false );
TQTextCursor *c = doc->redo( cursor );
if ( !c ) {
- drawCursor( TRUE );
+ drawCursor( true );
return;
}
lastFormatted = 0;
ensureCursorVisible();
repaintChanged();
ensureCursorVisible();
- drawCursor( TRUE );
+ drawCursor( true );
updateMicroFocusHint();
setModified();
emit undoAvailable( isUndoAvailable() );
@@ -3429,7 +3429,7 @@ void TQTextEdit::repaintChanged()
}
#endif
p.translate( -contentsX(), -contentsY() );
- paintDocument( FALSE, &p, contentsX(), contentsY(), visibleWidth(), visibleHeight() );
+ paintDocument( false, &p, contentsX(), contentsY(), visibleWidth(), visibleHeight() );
}
#ifndef TQT_NO_MIME
@@ -3442,7 +3442,7 @@ TQTextDrag *TQTextEdit::dragObject( TQWidget *parent ) const
return new TQTextDrag( doc->selectedText( TQTextDocument::Standard ), parent );
TQRichTextDrag *drag = new TQRichTextDrag( parent );
drag->setPlainText( doc->selectedText( TQTextDocument::Standard ) );
- drag->setRichText( doc->selectedText( TQTextDocument::Standard, TRUE ) );
+ drag->setRichText( doc->selectedText( TQTextDocument::Standard, true ) );
return drag;
}
#endif
@@ -3509,28 +3509,28 @@ void TQTextEdit::indent()
if ( isReadOnly() )
return;
- drawCursor( FALSE );
+ drawCursor( false );
if ( !doc->hasSelection( TQTextDocument::Standard ) )
cursor->indent();
else
doc->indentSelection( TQTextDocument::Standard );
repaintChanged();
- drawCursor( TRUE );
+ drawCursor( true );
setModified();
emit textChanged();
}
/*!
- Reimplemented to allow tabbing through links. If \a n is TRUE the
- tab moves the focus to the next child; if \a n is FALSE the tab
- moves the focus to the previous child. Returns TRUE if the focus
- was moved; otherwise returns FALSE.
+ Reimplemented to allow tabbing through links. If \a n is true the
+ tab moves the focus to the next child; if \a n is false the tab
+ moves the focus to the previous child. Returns true if the focus
+ was moved; otherwise returns false.
*/
bool TQTextEdit::focusNextPrevChild( bool n )
{
if ( !isReadOnly() || !linksEnabled() )
- return FALSE;
+ return false;
bool b = doc->focusNextPrevChild( n );
repaintChanged();
if ( b ) {
@@ -3577,7 +3577,7 @@ bool TQTextEdit::focusNextPrevChild( bool n )
void TQTextEdit::setFormat( TQTextFormat *f, int flags )
{
if ( doc->hasSelection( TQTextDocument::Standard ) ) {
- drawCursor( FALSE );
+ drawCursor( false );
TQTextCursor c1 = doc->selectionStartCursor( TQTextDocument::Standard );
c1.restoreState();
TQTextCursor c2 = doc->selectionEndCursor( TQTextDocument::Standard );
@@ -3597,7 +3597,7 @@ void TQTextEdit::setFormat( TQTextFormat *f, int flags )
doc->setFormat( TQTextDocument::Standard, f, flags );
repaintChanged();
formatMore();
- drawCursor( TRUE );
+ drawCursor( true );
setModified();
emit textChanged();
}
@@ -3614,7 +3614,7 @@ void TQTextEdit::setFormat( TQTextFormat *f, int flags )
emit currentVerticalAlignmentChanged( (VerticalAlignment)currentFormat->vAlign() );
if ( cursor->index() == cursor->paragraph()->length() - 1 ) {
currentFormat->addRef();
- cursor->paragraph()->string()->setFormat( cursor->index(), currentFormat, TRUE );
+ cursor->paragraph()->string()->setFormat( cursor->index(), currentFormat, true );
if ( cursor->paragraph()->length() == 1 ) {
cursor->paragraph()->invalidate( 0 );
cursor->paragraph()->format();
@@ -3656,7 +3656,7 @@ void TQTextEdit::setParagType( TQStyleSheetItem::DisplayMode dm,
if ( isReadOnly() )
return;
- drawCursor( FALSE );
+ drawCursor( false );
TQTextParagraph *start = cursor->paragraph();
TQTextParagraph *end = start;
if ( doc->hasSelection( TQTextDocument::Standard ) ) {
@@ -3675,11 +3675,11 @@ void TQTextEdit::setParagType( TQStyleSheetItem::DisplayMode dm,
while ( start != end->next() ) {
start->setListStyle( listStyle );
if ( dm == TQStyleSheetItem::DisplayListItem ) {
- start->setListItem( TRUE );
+ start->setListItem( true );
if( start->listDepth() == 0 )
start->setListDepth( 1 );
} else if ( start->isListItem() ) {
- start->setListItem( FALSE );
+ start->setListItem( false );
start->setListDepth( TQMAX( start->listDepth()-1, 0 ) );
}
start = start->next();
@@ -3688,7 +3688,7 @@ void TQTextEdit::setParagType( TQStyleSheetItem::DisplayMode dm,
clearUndoRedo();
repaintChanged();
formatMore();
- drawCursor( TRUE );
+ drawCursor( true );
setModified();
emit textChanged();
}
@@ -3705,7 +3705,7 @@ void TQTextEdit::setAlignment( int a )
if ( isReadOnly() || block_set_alignment )
return;
- drawCursor( FALSE );
+ drawCursor( false );
TQTextParagraph *start = cursor->paragraph();
TQTextParagraph *end = start;
if ( doc->hasSelection( TQTextDocument::Standard ) ) {
@@ -3729,7 +3729,7 @@ void TQTextEdit::setAlignment( int a )
clearUndoRedo();
repaintChanged();
formatMore();
- drawCursor( TRUE );
+ drawCursor( true );
if ( currentAlignment != a ) {
currentAlignment = a;
emit currentAlignmentChanged( currentAlignment );
@@ -3759,14 +3759,14 @@ void TQTextEdit::updateCurrentFormat()
if ( currentAlignment != cursor->paragraph()->alignment() ) {
currentAlignment = cursor->paragraph()->alignment();
- block_set_alignment = TRUE;
+ block_set_alignment = true;
emit currentAlignmentChanged( currentAlignment );
- block_set_alignment = FALSE;
+ block_set_alignment = false;
}
}
/*!
- If \a b is TRUE sets the current format to italic; otherwise sets
+ If \a b is true sets the current format to italic; otherwise sets
the current format to non-italic.
\sa italic()
@@ -3781,7 +3781,7 @@ void TQTextEdit::setItalic( bool b )
}
/*!
- If \a b is TRUE sets the current format to bold; otherwise sets
+ If \a b is true sets the current format to bold; otherwise sets
the current format to non-bold.
\sa bold()
@@ -3796,7 +3796,7 @@ void TQTextEdit::setBold( bool b )
}
/*!
- If \a b is TRUE sets the current format to underline; otherwise
+ If \a b is true sets the current format to underline; otherwise
sets the current format to non-underline.
\sa underline()
@@ -3953,8 +3953,8 @@ void TQTextEdit::setText( const TQString &text, const TQString &context )
this->context() == context && this->text() == text )
return;
- emit undoAvailable( FALSE );
- emit redoAvailable( FALSE );
+ emit undoAvailable( false );
+ emit redoAvailable( false );
undoRedoInfo.clear();
doc->commands()->clear();
@@ -3979,7 +3979,7 @@ void TQTextEdit::setText( const TQString &text, const TQString &context )
updateContents();
if ( isModified() )
- setModified( FALSE );
+ setModified( false );
emit textChanged();
if ( cursor->index() != oldCursorPos || cursor->paragraph()->paragId() != oldCursorPar ) {
emit cursorPositionChanged( cursor );
@@ -4018,32 +4018,32 @@ void TQTextEdit::setText( const TQString &text, const TQString &context )
In a read-only text edit the user can only navigate through the
text and select text; modifying the text is not possible.
- This property's default is FALSE.
+ This property's default is false.
*/
/*!
- Finds the next occurrence of the string, \a expr. Returns TRUE if
- \a expr was found; otherwise returns FALSE.
+ Finds the next occurrence of the string, \a expr. Returns true if
+ \a expr was found; otherwise returns false.
If \a para and \a index are both 0 the search begins from the
current cursor position. If \a para and \a index are both not 0,
the search begins from the \a *index character position in the
\a *para paragraph.
- If \a cs is TRUE the search is case sensitive, otherwise it is
- case insensitive. If \a wo is TRUE the search looks for whole word
+ If \a cs is true the search is case sensitive, otherwise it is
+ case insensitive. If \a wo is true the search looks for whole word
matches only; otherwise it searches for any matching text. If \a
- forward is TRUE (the default) the search works forward from the
+ forward is true (the default) the search works forward from the
starting position to the end of the text, otherwise it works
backwards to the beginning of the text.
- If \a expr is found the function returns TRUE. If \a index and \a
+ If \a expr is found the function returns true. If \a index and \a
para are not 0, the number of the paragraph in which the first
character of the match was found is put into \a *para, and the
index position of that character within the paragraph is put into
\a *index.
- If \a expr is not found the function returns FALSE. If \a index
+ If \a expr is not found the function returns false. If \a index
and \a para are not 0 and \a expr is not found, \a *index
and \a *para are undefined.
@@ -4062,7 +4062,7 @@ bool TQTextEdit::find( const TQString &expr, bool cs, bool wo, bool forward,
if ( d->optimMode )
return optimFind( expr, cs, wo, forward, para, index );
#endif
- drawCursor( FALSE );
+ drawCursor( false );
#ifndef TQT_NO_CURSOR
viewport()->setCursor( isReadOnly() ? arrowCursor : ibeamCursor );
#endif
@@ -4092,7 +4092,7 @@ bool TQTextEdit::find( const TQString &expr, bool cs, bool wo, bool forward,
repaintChanged();
ensureCursorVisible();
}
- drawCursor( TRUE );
+ drawCursor( true );
if (found) {
emit cursorPositionChanged( cursor );
emit cursorPositionChanged( cursor->paragraph()->paragId(), cursor->index() );
@@ -4126,11 +4126,11 @@ void TQTextEdit::setCursorPosition( int para, int index )
if ( index > p->length() - 1 )
index = p->length() - 1;
- drawCursor( FALSE );
+ drawCursor( false );
cursor->setParagraph( p );
cursor->setIndex( index );
ensureCursorVisible();
- drawCursor( TRUE );
+ drawCursor( true );
updateCurrentFormat();
emit cursorPositionChanged( cursor );
emit cursorPositionChanged( cursor->paragraph()->paragId(), cursor->index() );
@@ -4175,7 +4175,7 @@ void TQTextEdit::setSelection( int paraFrom, int indexFrom,
#ifdef QT_TEXTEDIT_OPTIMIZATION
if (d->optimMode) {
optimSetSelection(paraFrom, indexFrom, paraTo, indexTo);
- repaintContents(FALSE);
+ repaintContents(false);
return;
}
#endif
@@ -4198,7 +4198,7 @@ void TQTextEdit::setSelection( int paraFrom, int indexFrom,
if ( indexTo > p2->length() - 1 )
indexTo = p2->length() - 1;
- drawCursor( FALSE );
+ drawCursor( false );
TQTextCursor c = *cursor;
TQTextCursor oldCursor = *cursor;
c.setParagraph( p1 );
@@ -4211,7 +4211,7 @@ void TQTextEdit::setSelection( int paraFrom, int indexFrom,
ensureCursorVisible();
if ( selNum != TQTextDocument::Standard )
*cursor = oldCursor;
- drawCursor( TRUE );
+ drawCursor( true );
}
/*!
@@ -4426,11 +4426,11 @@ bool TQTextEdit::isModified() const
void TQTextEdit::setModified()
{
if ( !isModified() )
- setModified( TRUE );
+ setModified( true );
}
/*!
- Returns TRUE if the current format is italic; otherwise returns FALSE.
+ Returns true if the current format is italic; otherwise returns false.
\sa setItalic()
*/
@@ -4441,7 +4441,7 @@ bool TQTextEdit::italic() const
}
/*!
- Returns TRUE if the current format is bold; otherwise returns FALSE.
+ Returns true if the current format is bold; otherwise returns false.
\sa setBold()
*/
@@ -4452,8 +4452,8 @@ bool TQTextEdit::bold() const
}
/*!
- Returns TRUE if the current format is underlined; otherwise returns
- FALSE.
+ Returns true if the current format is underlined; otherwise returns
+ false.
\sa setUnderline()
*/
@@ -4537,8 +4537,8 @@ int TQTextEdit::alignment() const
void TQTextEdit::startDrag()
{
#ifndef TQT_NO_DRAGANDDROP
- mousePressed = FALSE;
- inDoubleClick = FALSE;
+ mousePressed = false;
+ inDoubleClick = false;
TQDragObject *drag = dragObject( viewport() );
if ( !drag )
return;
@@ -4552,8 +4552,8 @@ void TQTextEdit::startDrag()
}
/*!
- If \a select is TRUE (the default), all the text is selected as
- selection 0. If \a select is FALSE any selected text is
+ If \a select is true (the default), all the text is selected as
+ selection 0. If \a select is false any selected text is
unselected, i.e. the default selection (selection 0) is cleared.
\sa selectedText
@@ -4718,8 +4718,8 @@ TQBrush TQTextEdit::paper() const
\property TQTextEdit::linkUnderline
\brief whether hypertext links will be underlined
- If TRUE (the default) hypertext links will be displayed
- underlined. If FALSE links will not be displayed underlined.
+ If true (the default) hypertext links will be displayed
+ underlined. If false links will not be displayed underlined.
*/
void TQTextEdit::setLinkUnderline( bool b )
@@ -4806,7 +4806,7 @@ void TQTextEdit::append( const TQString &text )
f = PlainText;
}
- drawCursor( FALSE );
+ drawCursor( false );
TQTextCursor oldc( *cursor );
ensureFormatted( doc->lastParagraph() );
bool atBottom = contentsY() >= contentsHeight() - visibleHeight();
@@ -4816,7 +4816,7 @@ void TQTextEdit::append( const TQString &text )
TQTextCursor oldCursor2 = *cursor;
if ( f == TQt::PlainText ) {
- cursor->insert( text, TRUE );
+ cursor->insert( text, true );
if ( doc->useFormatCollection() && !doc->preProcessor() &&
currentFormat != cursor->paragraph()->at( cursor->index() )->format() ) {
doc->setSelectionStart( TQTextDocument::Temp, oldCursor2 );
@@ -4825,7 +4825,7 @@ void TQTextEdit::append( const TQString &text )
doc->removeSelection( TQTextDocument::Temp );
}
} else {
- cursor->paragraph()->setListItem( FALSE );
+ cursor->paragraph()->setListItem( false );
cursor->paragraph()->setListDepth( 0 );
if ( cursor->paragraph()->prev() )
cursor->paragraph()->prev()->invalidate(0); // vertical margins might have to change
@@ -4837,7 +4837,7 @@ void TQTextEdit::append( const TQString &text )
scrollToBottom();
*cursor = oldc;
if ( !isReadOnly() )
- cursorVisible = TRUE;
+ cursorVisible = true;
setModified();
emit textChanged();
}
@@ -4915,8 +4915,8 @@ bool TQTextEdit::handleReadOnlyKeyEvent( TQKeyEvent *e )
if (!doc->focusIndicator.href.isEmpty()
|| !doc->focusIndicator.name.isEmpty()) {
if (!doc->focusIndicator.href.isEmpty()) {
- TQUrl u( doc->context(), doc->focusIndicator.href, TRUE );
- emitLinkClicked( u.toString( FALSE, FALSE ) );
+ TQUrl u( doc->context(), doc->focusIndicator.href, true );
+ emitLinkClicked( u.toString( false, false ) );
}
if (!doc->focusIndicator.name.isEmpty()) {
if (::tqt_cast<TQTextBrowser*>(this)) { // change for 4.0
@@ -4955,9 +4955,9 @@ bool TQTextEdit::handleReadOnlyKeyEvent( TQKeyEvent *e )
}
}
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/*!
@@ -5189,7 +5189,7 @@ void TQTextEdit::pasteSubType( const TQCString& subtype, TQMimeSource *m )
if ( txt[ i ] != '\n' && oldC.paragraph()->at( oldC.index() )->format() ) {
oldC.paragraph()->at( oldC.index() )->format()->addRef();
undoRedoInfo.d->text.
- setFormat( oldLen + i, oldC.paragraph()->at( oldC.index() )->format(), TRUE );
+ setFormat( oldLen + i, oldC.paragraph()->at( oldC.index() )->format(), true );
}
oldC.gotoNextLetter();
}
@@ -5219,7 +5219,7 @@ void TQTextEdit::pasteSubType( const TQCString& subtype, TQMimeSource *m )
uc[ i ] = ' ';
}
if ( !t.isEmpty() )
- insert( t, FALSE, TRUE );
+ insert( t, false, true );
}
#endif //TQT_NO_MIME
}
@@ -5234,7 +5234,7 @@ void TQTextEdit::pasteSubType( const TQCString& subtype, TQMimeSource *m )
void TQTextEdit::pasteSpecial( const TQPoint& pt )
{
TQCString st = pickSpecial( TQApplication::clipboard()->data( d->clipboard_mode ),
- TRUE, pt );
+ true, pt );
if ( !st.isEmpty() )
pasteSubType( st );
}
@@ -5330,7 +5330,7 @@ void TQTextEdit::setWordWrap( WordWrap mode )
wrapMode = mode;
switch ( mode ) {
case NoWrap:
- document()->formatter()->setWrapEnabled( FALSE );
+ document()->formatter()->setWrapEnabled( false );
document()->formatter()->setWrapAtColumn( -1 );
doc->setWidth( visibleWidth() );
doc->setMinimumWidth( -1 );
@@ -5341,12 +5341,12 @@ void TQTextEdit::setWordWrap( WordWrap mode )
formatMore();
break;
case WidgetWidth:
- document()->formatter()->setWrapEnabled( TRUE );
+ document()->formatter()->setWrapEnabled( true );
document()->formatter()->setWrapAtColumn( -1 );
doResize();
break;
case FixedPixelWidth:
- document()->formatter()->setWrapEnabled( TRUE );
+ document()->formatter()->setWrapEnabled( true );
document()->formatter()->setWrapAtColumn( -1 );
if ( wrapWidth < 0 )
wrapWidth = 200;
@@ -5355,7 +5355,7 @@ void TQTextEdit::setWordWrap( WordWrap mode )
case FixedColumnWidth:
if ( wrapWidth < 0 )
wrapWidth = 80;
- document()->formatter()->setWrapEnabled( TRUE );
+ document()->formatter()->setWrapEnabled( true );
document()->formatter()->setWrapAtColumn( wrapWidth );
setWrapColumnOrWidth( wrapWidth );
break;
@@ -5487,7 +5487,7 @@ void TQTextEdit::clear()
setContentsPos( 0, 0 );
if ( cursor->isValid() )
cursor->restoreState();
- doc->clear( TRUE );
+ doc->clear( true );
delete cursor;
cursor = new TQTextCursor( doc );
lastFormatted = 0;
@@ -5576,23 +5576,23 @@ void TQTextEdit::clearUndoRedo()
color to the character's color and \a verticalAlignment to the
character's vertical alignment.
- Returns FALSE if \a para or \a index is out of range otherwise
- returns TRUE.
+ Returns false if \a para or \a index is out of range otherwise
+ returns true.
*/
bool TQTextEdit::getFormat( int para, int index, TQFont *font, TQColor *color, VerticalAlignment *verticalAlignment )
{
if ( !font || !color )
- return FALSE;
+ return false;
TQTextParagraph *p = doc->paragAt( para );
if ( !p )
- return FALSE;
+ return false;
if ( index < 0 || index >= p->length() )
- return FALSE;
+ return false;
*font = p->at( index )->format()->font();
*color = p->at( index )->format()->color();
*verticalAlignment = (VerticalAlignment)p->at( index )->format()->vAlign();
- return TRUE;
+ return true;
}
/*! \internal
@@ -5609,7 +5609,7 @@ bool TQTextEdit::getFormat( int para, int index, TQFont *font, TQColor *color, V
listDepth to the depth of the list (if the display mode is
TQStyleSheetItem::DisplayListItem).
- Returns FALSE if \a para is out of range otherwise returns TRUE.
+ Returns false if \a para is out of range otherwise returns true.
*/
bool TQTextEdit::getParagraphFormat( int para, TQFont *font, TQColor *color,
@@ -5619,10 +5619,10 @@ bool TQTextEdit::getParagraphFormat( int para, TQFont *font, TQColor *color,
int *listDepth )
{
if ( !font || !color || !alignment || !displayMode || !listStyle )
- return FALSE;
+ return false;
TQTextParagraph *p = doc->paragAt( para );
if ( !p )
- return FALSE;
+ return false;
*font = p->at(0)->format()->font();
*color = p->at(0)->format()->color();
*verticalAlignment = (VerticalAlignment)p->at(0)->format()->vAlign();
@@ -5630,7 +5630,7 @@ bool TQTextEdit::getParagraphFormat( int para, TQFont *font, TQColor *color,
*displayMode = p->isListItem() ? TQStyleSheetItem::DisplayListItem : TQStyleSheetItem::DisplayBlock;
*listStyle = p->listStyle();
*listDepth = p->listDepth();
- return TRUE;
+ return true;
}
@@ -5682,11 +5682,11 @@ TQPopupMenu *TQTextEdit::createPopupMenu( const TQPoint& pos )
popup->setItemEnabled( d->id[ IdUndo ], !isReadOnly() && doc->commands()->isUndoAvailable() );
popup->setItemEnabled( d->id[ IdRedo ], !isReadOnly() && doc->commands()->isRedoAvailable() );
#ifndef TQT_NO_CLIPBOARD
- popup->setItemEnabled( d->id[ IdCut ], !isReadOnly() && doc->hasSelection( TQTextDocument::Standard, TRUE ) );
+ popup->setItemEnabled( d->id[ IdCut ], !isReadOnly() && doc->hasSelection( TQTextDocument::Standard, true ) );
#ifdef QT_TEXTEDIT_OPTIMIZATION
- popup->setItemEnabled( d->id[ IdCopy ], d->optimMode ? optimHasSelection() : doc->hasSelection( TQTextDocument::Standard, TRUE ) );
+ popup->setItemEnabled( d->id[ IdCopy ], d->optimMode ? optimHasSelection() : doc->hasSelection( TQTextDocument::Standard, true ) );
#else
- popup->setItemEnabled( d->id[ IdCopy ], doc->hasSelection( TQTextDocument::Standard, TRUE ) );
+ popup->setItemEnabled( d->id[ IdCopy ], doc->hasSelection( TQTextDocument::Standard, true ) );
#endif
popup->setItemEnabled( d->id[ IdPaste ], !isReadOnly() && !TQApplication::clipboard()->text( d->clipboard_mode ).isEmpty() );
#endif
@@ -6043,7 +6043,7 @@ TQColor TQTextEdit::paragraphBackgroundColor( int para ) const
When changing this property, the undo/redo history is cleared.
- The default is TRUE.
+ The default is true.
*/
void TQTextEdit::setUndoRedoEnabled( bool b )
@@ -6060,7 +6060,7 @@ bool TQTextEdit::isUndoRedoEnabled() const
}
/*!
- Returns TRUE if undo is available; otherwise returns FALSE.
+ Returns true if undo is available; otherwise returns false.
*/
bool TQTextEdit::isUndoAvailable() const
@@ -6069,7 +6069,7 @@ bool TQTextEdit::isUndoAvailable() const
}
/*!
- Returns TRUE if redo is available; otherwise returns FALSE.
+ Returns true if redo is available; otherwise returns false.
*/
bool TQTextEdit::isRedoAvailable() const
@@ -6091,13 +6091,13 @@ void TQTextEdit::updateCursor( const TQPoint & pos )
{
if ( isReadOnly() && linksEnabled() ) {
TQTextCursor c = *cursor;
- placeCursor( pos, &c, TRUE );
+ placeCursor( pos, &c, true );
#ifndef TQT_NO_NETWORKPROTOCOL
- bool insideParagRect = TRUE;
+ bool insideParagRect = true;
if (c.paragraph() == doc->lastParagraph()
&& c.paragraph()->rect().y() + c.paragraph()->rect().height() < pos.y())
- insideParagRect = FALSE;
+ insideParagRect = false;
if (insideParagRect && c.paragraph() && c.paragraph()->at( c.index() ) &&
c.paragraph()->at( c.index() )->isAnchor()) {
if (!c.paragraph()->at( c.index() )->anchorHref().isEmpty()
@@ -6116,8 +6116,8 @@ void TQTextEdit::updateCursor( const TQPoint & pos )
#ifndef TQT_NO_CURSOR
viewport()->setCursor( onLink.isEmpty() ? arrowCursor : pointingHandCursor );
#endif
- TQUrl u( doc->context(), onLink, TRUE );
- emitHighlighted( u.toString( FALSE, FALSE ) );
+ TQUrl u( doc->context(), onLink, true );
+ emitHighlighted( u.toString( false, false ) );
}
} else {
#ifndef TQT_NO_CURSOR
@@ -6139,7 +6139,7 @@ void TQTextEdit::updateCursor( const TQPoint & pos )
*/
void TQTextEdit::placeCursor( const TQPoint &pos, TQTextCursor *c )
{
- placeCursor( pos, c, FALSE );
+ placeCursor( pos, c, false );
}
/*! \internal */
@@ -6149,7 +6149,7 @@ void TQTextEdit::clipboardChanged()
// don't listen to selection changes
disconnect( TQApplication::clipboard(), TQ_SIGNAL(selectionChanged()), this, 0);
#endif
- selectAll(FALSE);
+ selectAll(false);
}
/*! \property TQTextEdit::tabChangesFocus
@@ -6157,7 +6157,7 @@ void TQTextEdit::clipboardChanged()
In some occasions text edits should not allow the user to input
tabulators or change indentation using the TAB key, as this breaks
- the focus chain. The default is FALSE.
+ the focus chain. The default is false.
*/
@@ -6188,10 +6188,10 @@ bool TQTextEdit::checkOptimMode()
{
bool oldMode = d->optimMode;
if ( textFormat() == LogText ) {
- setReadOnly( TRUE );
- d->optimMode = TRUE;
+ setReadOnly( true );
+ d->optimMode = true;
} else {
- d->optimMode = FALSE;
+ d->optimMode = false;
}
// when changing mode - try to keep selections and text
@@ -6203,7 +6203,7 @@ bool TQTextEdit::checkOptimMode()
disconnect( scrollTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( autoScrollTimerDone() ) );
disconnect( formatTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( formatMore() ) );
optimSetText( doc->originalText() );
- doc->clear(TRUE);
+ doc->clear(true);
delete cursor;
cursor = new TQTextCursor( doc );
} else {
@@ -6266,7 +6266,7 @@ void TQTextEdit::optimSetText( const TQString &str )
d->od->clearTags();
TQFontMetrics fm( TQScrollView::font() );
if ( !(str.isEmpty() || str.isNull() || d->maxLogLines == 0) ) {
- TQStringList strl = TQStringList::split( '\n', str, TRUE );
+ TQStringList strl = TQStringList::split( '\n', str, true );
int lWidth = 0;
for ( TQStringList::Iterator it = strl.begin(); it != strl.end(); ++it ) {
optimParseTags( &*it );
@@ -6291,7 +6291,7 @@ TQTextEditOptimPrivate::Tag * TQTextEdit::optimAppendTag( int index, const TQStr
if ( d->od->tags == 0 )
d->od->tags = t;
- t->bold = t->italic = t->underline = FALSE;
+ t->bold = t->italic = t->underline = false;
t->line = d->od->numLines;
t->index = index;
t->tag = tag;
@@ -6320,7 +6320,7 @@ TQTextEditOptimPrivate::Tag *TQTextEdit::optimInsertTag(int line, int index, con
if (d->od->tags == 0)
d->od->tags = t;
- t->bold = t->italic = t->underline = FALSE;
+ t->bold = t->italic = t->underline = false;
t->line = line;
t->index = index;
t->tag = tag;
@@ -6440,7 +6440,7 @@ void TQTextEdit::optimParseTags( TQString * line, int lineNo, int indexOffset )
endIndex = i;
if ( !tagStr.isEmpty() ) {
TQTextEditOptimPrivate::Tag * tag, * cur, * tmp;
- bool format = TRUE;
+ bool format = true;
if ( tagStr == "b" )
bold++;
@@ -6455,7 +6455,7 @@ void TQTextEdit::optimParseTags( TQString * line, int lineNo, int indexOffset )
else if ( tagStr == "/u" )
underline--;
else
- format = FALSE;
+ format = false;
if ( lineNo > -1 )
tag = optimInsertTag( lineNo, startIndex + indexOffset, tagStr );
else
@@ -6571,13 +6571,13 @@ bool TQTextEdit::optimHasBoldMetrics(int line)
t = *it;
while (t && t->line == line) {
if (t->bold)
- return TRUE;
+ return true;
t = t->next;
}
} else if ((t = optimPreviousLeftTag(line)) && t->bold) {
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/*! \internal
@@ -6590,7 +6590,7 @@ void TQTextEdit::optimAppend( const TQString &str )
if ( str.isEmpty() || str.isNull() || d->maxLogLines == 0 )
return;
- TQStringList strl = TQStringList::split( '\n', str, TRUE );
+ TQStringList strl = TQStringList::split( '\n', str, true );
TQStringList::Iterator it = strl.begin();
TQFontMetrics fm(TQScrollView::font());
@@ -6601,7 +6601,7 @@ void TQTextEdit::optimAppend( const TQString &str )
optimCheckLimit( *it );
if (optimHasBoldMetrics(d->od->numLines-1)) {
TQFont fnt = TQScrollView::font();
- fnt.setBold(TRUE);
+ fnt.setBold(true);
fm = TQFontMetrics(fnt);
}
lWidth = qStrWidth(*it, tabStopWidth(), fm) + 4;
@@ -6691,7 +6691,7 @@ void TQTextEdit::optimInsert(const TQString& text, int line, int index)
if (index > (int) d->od->lines[line].length())
index = d->od->lines[line].length();
- TQStringList strl = TQStringList::split('\n', text, TRUE);
+ TQStringList strl = TQStringList::split('\n', text, true);
int numNewLines = (int)strl.count() - 1;
TQTextEditOptimPrivate::Tag *tag = 0;
TQMap<int,TQTextEditOptimPrivate::Tag *>::ConstIterator ii;
@@ -6790,7 +6790,7 @@ void TQTextEdit::optimInsert(const TQString& text, int line, int index)
for (x = line; x < line + numNewLines; x++) {
if (optimHasBoldMetrics(x)) {
TQFont fnt = TQScrollView::font();
- fnt.setBold(TRUE);
+ fnt.setBold(true);
fm = TQFontMetrics(fnt);
}
lWidth = fm.width(d->od->lines[x]) + 4;
@@ -6923,7 +6923,7 @@ void TQTextEdit::optimDrawContents( TQPainter * p, int clipx, int clipy,
td->setDefaultFormat( TQScrollView::font(), TQColor() );
td->setPlainText( str );
td->setFormatter( new TQTextFormatterBreakWords ); // deleted by TQTextDoc
- td->formatter()->setWrapEnabled( FALSE );
+ td->formatter()->setWrapEnabled( false );
td->setTabStops(doc->tabStopWidth());
// get the current text color from the current format
@@ -7069,7 +7069,7 @@ void TQTextEdit::optimMousePressEvent( TQMouseEvent * e )
return;
TQFontMetrics fm( TQScrollView::font() );
- mousePressed = TRUE;
+ mousePressed = true;
mousePos = e->pos();
d->od->selStart.line = e->y() / fm.lineSpacing();
if ( d->od->selStart.line > d->od->numLines-1 ) {
@@ -7082,7 +7082,7 @@ void TQTextEdit::optimMousePressEvent( TQMouseEvent * e )
d->od->selEnd.line = d->od->selStart.line;
d->od->selEnd.index = d->od->selStart.index;
oldMousePos = e->pos();
- repaintContents( FALSE );
+ repaintContents( false );
}
/*! \internal */
@@ -7110,14 +7110,14 @@ void TQTextEdit::optimMouseReleaseEvent( TQMouseEvent * e )
tqSwap( &d->od->selStart.index, &d->od->selEnd.index );
}
oldMousePos = e->pos();
- repaintContents( FALSE );
+ repaintContents( false );
}
if ( mousePressed ) {
- mousePressed = FALSE;
+ mousePressed = false;
copyToClipboard();
}
- inDoubleClick = FALSE;
+ inDoubleClick = false;
emit copyAvailable( optimHasSelection() );
emit selectionChanged();
}
@@ -7138,7 +7138,7 @@ void TQTextEdit::optimDoAutoScroll()
TQFontMetrics fm( TQScrollView::font() );
TQPoint pos( mapFromGlobal( TQCursor::pos() ) );
- bool doScroll = FALSE;
+ bool doScroll = false;
int xx = contentsX() + pos.x();
int yy = contentsY() + pos.y();
@@ -7161,7 +7161,7 @@ void TQTextEdit::optimDoAutoScroll()
d->od->selEnd.line = my / fm.lineSpacing();
mousePos.setX( xx );
mousePos.setY( my );
- doScroll = TRUE;
+ doScroll = true;
} else {
d->od->selEnd.line = mousePos.y() / fm.lineSpacing();
}
@@ -7183,7 +7183,7 @@ void TQTextEdit::optimDoAutoScroll()
// - redraw the whole thing otherwise calculate the rect that
// needs drawing.
if ( d->od->numLines * fm.lineSpacing() < viewport()->height() ) {
- repaintContents( contentsX(), contentsY(), width(), height(), FALSE );
+ repaintContents( contentsX(), contentsY(), width(), height(), false );
} else {
int h = TQABS(mousePos.y() - oldMousePos.y()) + fm.lineSpacing() * 2;
int y;
@@ -7196,11 +7196,11 @@ void TQTextEdit::optimDoAutoScroll()
}
if ( y < 0 )
y = 0;
- repaintContents( contentsX(), y, width(), h, FALSE );
+ repaintContents( contentsX(), y, width(), h, false );
}
if ( (!scrollTimer->isActive() && pos.y() < 0) || pos.y() > height() )
- scrollTimer->start( 100, FALSE );
+ scrollTimer->start( 100, false );
else if ( scrollTimer->isActive() && pos.y() >= 0 && pos.y() <= height() )
scrollTimer->stop();
}
@@ -7242,7 +7242,7 @@ void TQTextEdit::optimSelectAll()
d->od->selEnd.line = d->od->numLines - 1;
d->od->selEnd.index = d->od->lines[ LOGOFFSET(d->od->selEnd.line) ].length();
- repaintContents( FALSE );
+ repaintContents( false );
emit copyAvailable( optimHasSelection() );
emit selectionChanged();
}
@@ -7252,7 +7252,7 @@ void TQTextEdit::optimRemoveSelection()
{
d->od->selStart.line = d->od->selEnd.line = -1;
d->od->selStart.index = d->od->selEnd.index = -1;
- repaintContents( FALSE );
+ repaintContents( false );
}
/*! \internal */
@@ -7268,10 +7268,8 @@ void TQTextEdit::optimSetSelection( int startLine, int startIdx,
/*! \internal */
bool TQTextEdit::optimHasSelection() const
{
- if ( d->od->selStart.line != d->od->selEnd.line ||
- d->od->selStart.index != d->od->selEnd.index )
- return TRUE;
- return FALSE;
+ return d->od->selStart.line != d->od->selEnd.line ||
+ d->od->selStart.index != d->od->selEnd.index;
}
/*! \internal */
@@ -7306,18 +7304,18 @@ TQString TQTextEdit::optimSelectedText() const
bool TQTextEdit::optimFind( const TQString & expr, bool cs, bool /*wo*/,
bool fw, int * para, int * index )
{
- bool found = FALSE;
+ bool found = false;
int parag = para ? *para : d->od->search.line,
idx = index ? *index : d->od->search.index, i;
if ( d->od->len == 0 )
- return FALSE;
+ return false;
for ( i = parag; fw ? i < d->od->numLines : i >= 0; fw ? i++ : i-- ) {
idx = fw ? d->od->lines[ LOGOFFSET(i) ].find( expr, idx, cs ) :
d->od->lines[ LOGOFFSET(i) ].findRev( expr, idx, cs );
if ( idx != -1 ) {
- found = TRUE;
+ found = true;
break;
} else if ( fw )
idx = 0;