summaryrefslogtreecommitdiffstats
path: root/lib/kotext/KoTextView.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kotext/KoTextView.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kotext/KoTextView.cpp')
-rw-r--r--lib/kotext/KoTextView.cpp240
1 files changed, 120 insertions, 120 deletions
diff --git a/lib/kotext/KoTextView.cpp b/lib/kotext/KoTextView.cpp
index c5edcf61..68df4992 100644
--- a/lib/kotext/KoTextView.cpp
+++ b/lib/kotext/KoTextView.cpp
@@ -39,9 +39,9 @@
#include <kbookmark.h>
#include <kurldrag.h>
-#include <qapplication.h>
-#include <qtimer.h>
-#include <qclipboard.h>
+#include <tqapplication.h>
+#include <tqtimer.h>
+#include <tqclipboard.h>
class KoTextView::KoTextViewPrivate
{
@@ -68,27 +68,27 @@ KoTextView::KoTextView( KoTextObject *textobj )
m_bReadWrite = true;
m_textobj = textobj;
dcop=0;
- connect( m_textobj, SIGNAL( hideCursor() ), this, SLOT( hideCursor() ) );
- connect( m_textobj, SIGNAL( showCursor() ), this, SLOT( showCursor() ) );
- connect( m_textobj, SIGNAL( setCursor( KoTextCursor * ) ), this, SLOT( setCursor( KoTextCursor * ) ) );
- connect( m_textobj, SIGNAL( updateUI(bool, bool) ), this, SLOT( updateUI(bool, bool) ) );
- connect( m_textobj, SIGNAL( showCurrentFormat() ), this, SLOT( showCurrentFormat() ) );
- connect( m_textobj, SIGNAL( ensureCursorVisible() ), this, SLOT( ensureCursorVisible() ) );
+ connect( m_textobj, TQT_SIGNAL( hideCursor() ), this, TQT_SLOT( hideCursor() ) );
+ connect( m_textobj, TQT_SIGNAL( showCursor() ), this, TQT_SLOT( showCursor() ) );
+ connect( m_textobj, TQT_SIGNAL( setCursor( KoTextCursor * ) ), this, TQT_SLOT( setCursor( KoTextCursor * ) ) );
+ connect( m_textobj, TQT_SIGNAL( updateUI(bool, bool) ), this, TQT_SLOT( updateUI(bool, bool) ) );
+ connect( m_textobj, TQT_SIGNAL( showCurrentFormat() ), this, TQT_SLOT( showCurrentFormat() ) );
+ connect( m_textobj, TQT_SIGNAL( ensureCursorVisible() ), this, TQT_SLOT( ensureCursorVisible() ) );
m_cursor = new KoTextCursor( m_textobj->textDocument() );
m_cursorVisible = false;
showCursor();
- blinkTimer = new QTimer( this );
- connect( blinkTimer, SIGNAL( timeout() ),
- this, SLOT( blinkCursor() ) );
- if ( QApplication::cursorFlashTime() > 0 )
- blinkTimer->start( QApplication::cursorFlashTime() / 2 );
+ blinkTimer = new TQTimer( this );
+ connect( blinkTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( blinkCursor() ) );
+ if ( TQApplication::cursorFlashTime() > 0 )
+ blinkTimer->start( TQApplication::cursorFlashTime() / 2 );
- dragStartTimer = new QTimer( this );
- connect( dragStartTimer, SIGNAL( timeout() ),
- this, SLOT( startDrag() ) );
+ dragStartTimer = new TQTimer( this );
+ connect( dragStartTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( startDrag() ) );
m_textobj->formatMore( 2 );
@@ -160,8 +160,8 @@ void KoTextView::deleteWordLeft()
textObject()->removeSelectedText( m_cursor, KoTextDocument::Standard, i18n("Remove Word") );
}
-// Compare with QTextEdit::keyPressEvent
-void KoTextView::handleKeyPressEvent( QKeyEvent * e, QWidget *widget, const QPoint &pos)
+// Compare with TQTextEdit::keyPressEvent
+void KoTextView::handleKeyPressEvent( TQKeyEvent * e, TQWidget *widget, const TQPoint &pos)
{
textObject()->typingStarted();
@@ -275,24 +275,24 @@ void KoTextView::handleKeyPressEvent( QKeyEvent * e, QWidget *widget, const QPoi
emit cut();
break;
case Key_Direction_L: {
- if ( m_cursor->parag() && m_cursor->parag()->direction() != QChar::DirL )
+ if ( m_cursor->parag() && m_cursor->parag()->direction() != TQChar::DirL )
{
- KCommand* cmd = textObject()->setParagDirectionCommand( m_cursor, QChar::DirL );
+ KCommand* cmd = textObject()->setParagDirectionCommand( m_cursor, TQChar::DirL );
textObject()->emitNewCommand( cmd );
}
break;
}
case Key_Direction_R: {
- if ( m_cursor->parag() && m_cursor->parag()->direction() != QChar::DirR )
+ if ( m_cursor->parag() && m_cursor->parag()->direction() != TQChar::DirR )
{
- KCommand* cmd = textObject()->setParagDirectionCommand( m_cursor, QChar::DirR );
+ KCommand* cmd = textObject()->setParagDirectionCommand( m_cursor, TQChar::DirR );
textObject()->emitNewCommand( cmd );
}
break;
}
default: {
- //kdDebug(32500) << "KoTextView::keyPressEvent ascii=" << e->ascii() << " text=" << e->text()[0].unicode() << " state=" << e->state() << endl;
- if (e->key() == Qt::Key_Tab)
+ //kdDebug(32500) << "KoTextView::keyPressEvent ascii=" << e->ascii() << " text=" << e->text()[0].tqunicode() << " state=" << e->state() << endl;
+ if (e->key() == TQt::Key_Tab)
{
if (doToolTipCompletion(m_cursor, m_cursor->parag(), m_cursor->index() - 1, e->key()) )
break;
@@ -303,7 +303,7 @@ void KoTextView::handleKeyPressEvent( QKeyEvent * e, QWidget *widget, const QPoi
}
}
- if ( e->key() == Qt::Key_Space )
+ if ( e->key() == TQt::Key_Space )
{
if (doToolTipCompletion(m_cursor, m_cursor->parag(), m_cursor->index() - 1, e->key()) )
break;
@@ -312,7 +312,7 @@ void KoTextView::handleKeyPressEvent( QKeyEvent * e, QWidget *widget, const QPoi
( !e->ascii() || e->ascii() >= 32 ) ||
( e->text() == "\t" && !( e->state() & ControlButton ) ) ) {
clearUndoRedoInfo = FALSE;
- QString text = e->text();
+ TQString text = e->text();
if ( d->m_backSpeller ) {
d->m_backSpeller->setIntraWordEditing( m_cursor->parag(), m_cursor->index() );
@@ -328,10 +328,10 @@ void KoTextView::handleKeyPressEvent( QKeyEvent * e, QWidget *widget, const QPoi
}
if ( !text.isEmpty() )
{
- // Bidi support: need to reverse mirrored chars (e.g. parenthesis)
+ // Bidi support: need to reverse mirrored chars (e.g. tqparenthesis)
KoTextParag *p = m_cursor->parag();
if ( p && p->string() && p->string()->isRightToLeft() ) {
- QChar *c = (QChar *)text.unicode();
+ TQChar *c = (TQChar *)text.tqunicode();
int l = text.length();
while( l-- ) {
if ( c->mirrored() )
@@ -409,7 +409,7 @@ void KoTextView::setOverwriteMode( bool overwriteMode )
m_overwriteMode = overwriteMode;
}
-void KoTextView::insertText( const QString &text )
+void KoTextView::insertText( const TQString &text )
{
int insertFlags = KoTextObject::DefaultInsertFlags;
if ( m_overwriteMode )
@@ -422,11 +422,11 @@ void KoTextView::newParagraph()
textObject()->insert( m_cursor, m_currentFormat, "\n", i18n("Insert Text"), KoTextDocument::Standard, KoTextObject::CheckNewLine );
}
-void KoTextView::handleKeyReleaseEvent( QKeyEvent * e )
+void KoTextView::handleKeyReleaseEvent( TQKeyEvent * e )
{
if ( e->key() == Key_Alt && d->currentUnicodeNumber() >= 32 )
{
- QString text = QChar( d->currentUnicodeNumber() );
+ TQString text = TQChar( d->currentUnicodeNumber() );
d->clearCurrentUnicodeNumber();
insertText( text );
doAutoFormat( m_cursor, m_cursor->parag(),
@@ -434,12 +434,12 @@ void KoTextView::handleKeyReleaseEvent( QKeyEvent * e )
}
}
-void KoTextView::handleImStartEvent( QIMEvent * )
+void KoTextView::handleImStartEvent( TQIMEvent * )
{
// nothing to do
}
-void KoTextView::handleImComposeEvent( QIMEvent * e )
+void KoTextView::handleImComposeEvent( TQIMEvent * e )
{
// remove old preedit
if ( textDocument()->hasSelection( KoTextDocument::Standard ) )
@@ -471,7 +471,7 @@ void KoTextView::handleImComposeEvent( QIMEvent * e )
textObject()->selectionChangedNotify();
}
-void KoTextView::handleImEndEvent( QIMEvent * e )
+void KoTextView::handleImEndEvent( TQIMEvent * e )
{
// remove old preedit
if ( textDocument()->hasSelection( KoTextDocument::Standard ) )
@@ -605,13 +605,13 @@ KoTextCursor KoTextView::selectWordUnderCursor( const KoTextCursor& cursor, int
bool beginFound = false;
for ( int i = c1.index(); i< c2.index(); i++)
{
- const QChar ch = s->at(i).c;
+ const TQChar ch = s->at(i).c;
// This list comes from KoTextCursor::gotoPreviousWord.
- // Can't use QChar::isPunct since "'" and "-" are not word separators
+ // Can't use TQChar::isPunct since "'" and "-" are not word separators
const bool isWordDelimiter = ch.isSpace()
- || ch.category() == QChar::Punctuation_Open // e.g. '('
- || ch.category() == QChar::Punctuation_Close // e.g. ')'
- || ch.category() == QChar::Punctuation_Other // see http://www.fileformat.info/info/unicode/category/Po/list.htm
+ || ch.category() == TQChar::Punctuation_Open // e.g. '('
+ || ch.category() == TQChar::Punctuation_Close // e.g. ')'
+ || ch.category() == TQChar::Punctuation_Other // see http://www.fileformat.info/info/tqunicode/category/Po/list.htm
;
if( !beginFound && !isWordDelimiter )
@@ -643,14 +643,14 @@ KoTextCursor KoTextView::selectParagUnderCursor( const KoTextCursor& cursor, int
{
textObject()->selectionChangedNotify();
// Copy the selection.
- QApplication::clipboard()->setSelectionMode( true );
+ TQApplication::tqclipboard()->setSelectionMode( true );
emit copy();
- QApplication::clipboard()->setSelectionMode( false );
+ TQApplication::tqclipboard()->setSelectionMode( false );
}
return c2;
}
-void KoTextView::extendParagraphSelection( const QPoint& iPoint )
+void KoTextView::extendParagraphSelection( const TQPoint& iPoint )
{
hideCursor();
KoTextCursor oldCursor = *m_cursor;
@@ -675,18 +675,18 @@ void KoTextView::extendParagraphSelection( const QPoint& iPoint )
showCursor();
}
-QString KoTextView::wordUnderCursor( const KoTextCursor& cursor )
+TQString KoTextView::wordUnderCursor( const KoTextCursor& cursor )
{
selectWordUnderCursor( cursor, KoTextDocument::Temp );
- QString text = textObject()->selectedText( KoTextDocument::Temp );
+ TQString text = textObject()->selectedText( KoTextDocument::Temp );
bool hasCustomItems = textObject()->selectionHasCustomItems( KoTextDocument::Temp );
textDocument()->removeSelection( KoTextDocument::Temp );
if( !hasCustomItems )
return text;
- return QString::null;
+ return TQString();
}
-bool KoTextView::handleMousePressEvent( QMouseEvent *e, const QPoint &iPoint, bool canStartDrag, bool insertDirectCursor )
+bool KoTextView::handleMousePressEvent( TQMouseEvent *e, const TQPoint &iPoint, bool canStartDrag, bool insertDirectCursor )
{
bool addParag = false;
mightStartDrag = FALSE;
@@ -702,7 +702,7 @@ bool KoTextView::handleMousePressEvent( QMouseEvent *e, const QPoint &iPoint, bo
addParag = placeCursor( iPoint, insertDirectCursor&& isReadWrite() );
ensureCursorVisible();
- if ( e->button() != LeftButton )
+ if ( e->button() != Qt::LeftButton )
{
showCursor();
return addParag;
@@ -718,7 +718,7 @@ bool KoTextView::handleMousePressEvent( QMouseEvent *e, const QPoint &iPoint, bo
if ( canStartDrag && textdoc->inSelection( KoTextDocument::Standard, iPoint ) ) {
mightStartDrag = TRUE;
m_textobj->emitShowCursor();
- dragStartTimer->start( QApplication::startDragTime(), TRUE );
+ dragStartTimer->start( TQApplication::startDragTime(), TRUE );
dragStartPos = e->pos();
return addParag;
}
@@ -749,7 +749,7 @@ bool KoTextView::handleMousePressEvent( QMouseEvent *e, const QPoint &iPoint, bo
return addParag;
}
-void KoTextView::handleMouseMoveEvent( QMouseEvent*, const QPoint& iPoint )
+void KoTextView::handleMouseMoveEvent( TQMouseEvent*, const TQPoint& iPoint )
{
hideCursor();
KoTextCursor oldCursor = *m_cursor;
@@ -762,9 +762,9 @@ void KoTextView::handleMouseMoveEvent( QMouseEvent*, const QPoint& iPoint )
KoTextCursor cr = *m_cursor;
cr.gotoWordRight();
- int diff = QABS( oldCursor.parag()->at( oldCursor.index() )->x - iPoint.x() );
- int ldiff = QABS( cl.parag()->at( cl.index() )->x - iPoint.x() );
- int rdiff = QABS( cr.parag()->at( cr.index() )->x - iPoint.x() );
+ int diff = TQABS( oldCursor.parag()->at( oldCursor.index() )->x - iPoint.x() );
+ int ldiff = TQABS( cl.parag()->at( cl.index() )->x - iPoint.x() );
+ int rdiff = TQABS( cr.parag()->at( cr.index() )->x - iPoint.x() );
if ( m_cursor->parag()->lineStartOfChar( m_cursor->index() ) !=
oldCursor.parag()->lineStartOfChar( oldCursor.index() ) )
@@ -808,16 +808,16 @@ void KoTextView::handleMouseReleaseEvent()
textObject()->selectionChangedNotify();
// Copy the selection.
- QApplication::clipboard()->setSelectionMode( true );
+ TQApplication::tqclipboard()->setSelectionMode( true );
emit copy();
- QApplication::clipboard()->setSelectionMode( false );
+ TQApplication::tqclipboard()->setSelectionMode( false );
}
inDoubleClick = FALSE;
m_textobj->emitShowCursor();
}
-void KoTextView::handleMouseDoubleClickEvent( QMouseEvent*ev, const QPoint& i )
+void KoTextView::handleMouseDoubleClickEvent( TQMouseEvent*ev, const TQPoint& i )
{
//after a triple click it's not a double click but a simple click
//but as triple click didn't exist it's necessary to do it.
@@ -831,13 +831,13 @@ void KoTextView::handleMouseDoubleClickEvent( QMouseEvent*ev, const QPoint& i )
*m_cursor = selectWordUnderCursor( *m_cursor );
textObject()->selectionChangedNotify();
// Copy the selection.
- QApplication::clipboard()->setSelectionMode( true );
+ TQApplication::tqclipboard()->setSelectionMode( true );
emit copy();
- QApplication::clipboard()->setSelectionMode( false );
+ TQApplication::tqclipboard()->setSelectionMode( false );
possibleTripleClick=true;
- QTimer::singleShot(QApplication::doubleClickInterval(),this,SLOT(tripleClickTimeout()));
+ TQTimer::singleShot(TQApplication::doubleClickInterval(),this,TQT_SLOT(tripleClickTimeout()));
}
void KoTextView::tripleClickTimeout()
@@ -845,9 +845,9 @@ void KoTextView::tripleClickTimeout()
possibleTripleClick=false;
}
-void KoTextView::handleMouseTripleClickEvent( QMouseEvent*ev, const QPoint& /* Currently unused */ )
+void KoTextView::handleMouseTripleClickEvent( TQMouseEvent*ev, const TQPoint& /* Currently unused */ )
{
- if ( ev->button() != LeftButton)
+ if ( ev->button() != Qt::LeftButton)
{
showCursor();
return;
@@ -855,7 +855,7 @@ void KoTextView::handleMouseTripleClickEvent( QMouseEvent*ev, const QPoint& /* C
afterTripleClick= true;
inDoubleClick = FALSE;
*m_cursor = selectParagUnderCursor( *m_cursor );
- QTimer::singleShot(QApplication::doubleClickInterval(),this,SLOT(afterTripleClickTimeout()));
+ TQTimer::singleShot(TQApplication::doubleClickInterval(),this,TQT_SLOT(afterTripleClickTimeout()));
}
void KoTextView::afterTripleClickTimeout()
@@ -863,18 +863,18 @@ void KoTextView::afterTripleClickTimeout()
afterTripleClick=false;
}
-bool KoTextView::maybeStartDrag( QMouseEvent* e )
+bool KoTextView::maybeStartDrag( TQMouseEvent* e )
{
if ( mightStartDrag ) {
dragStartTimer->stop();
- if ( ( e->pos() - dragStartPos ).manhattanLength() > QApplication::startDragDistance() )
+ if ( ( e->pos() - dragStartPos ).manhattanLength() > TQApplication::startDragDistance() )
startDrag();
return true;
}
return false;
}
-bool KoTextView::insertParagraph(const QPoint &pos)
+bool KoTextView::insertParagraph(const TQPoint &pos)
{
KoTextParag *last = textDocument()->lastParag();
KoTextFormat *f = 0;
@@ -884,7 +884,7 @@ bool KoTextView::insertParagraph(const QPoint &pos)
f = last->at( last->length()-1 )->format();
int height =f->height();
int nbParag = (diff / height);
- QFontMetrics fm = f->refFontMetrics();
+ TQFontMetrics fm = f->refFontMetrics();
for (int i = 0; i < nbParag ;i++)
{
KoTextParag *s=textDocument()->createParag( textDocument(), last );
@@ -900,13 +900,13 @@ bool KoTextView::insertParagraph(const QPoint &pos)
if ( pos.x() + f->width(' ') >= textDocument()->width())
{
//FIXME me bidi.
- //change parag alignment => right alignment
- last->setAlignment( Qt::AlignRight );
+ //change parag tqalignment => right tqalignment
+ last->tqsetAlignment( TQt::AlignRight );
}
else
{
int nbSpace = pos.x()/f->width(' ');
- QString tmp;
+ TQString tmp;
for (int i = 0; i< nbSpace; i++)
{
tmp+=' ';
@@ -918,7 +918,7 @@ bool KoTextView::insertParagraph(const QPoint &pos)
}
-bool KoTextView::placeCursor( const QPoint &pos, bool insertDirectCursor )
+bool KoTextView::placeCursor( const TQPoint &pos, bool insertDirectCursor )
{
bool addParag = false;
if ( insertDirectCursor && (pos.y()>textDocument()->height()) )
@@ -955,8 +955,8 @@ void KoTextView::drawCursor( bool visible )
void KoTextView::focusInEvent()
{
- if ( QApplication::cursorFlashTime() > 0 )
- blinkTimer->start( QApplication::cursorFlashTime() / 2 );
+ if ( TQApplication::cursorFlashTime() > 0 )
+ blinkTimer->start( TQApplication::cursorFlashTime() / 2 );
showCursor();
}
@@ -1056,7 +1056,7 @@ KCommand * KoTextView::setJoinBordersCommand( bool join )
{
return textObject()->setJoinBordersCommand( m_cursor, join );
}
-KCommand * KoTextView::setMarginCommand( QStyleSheetItem::Margin m, double margin )
+KCommand * KoTextView::setMarginCommand( TQStyleSheetItem::Margin m, double margin )
{
return textObject()->setMarginCommand( m_cursor, m, margin );
}
@@ -1064,7 +1064,7 @@ KCommand * KoTextView::setTabListCommand( const KoTabulatorList & tabList )
{
return textObject()->setTabListCommand( m_cursor, tabList );
}
-KCommand * KoTextView::setBackgroundColorCommand( const QColor & color )
+KCommand * KoTextView::setBackgroundColorCommand( const TQColor & color )
{
return textObject()->setBackgroundColorCommand( m_cursor, color );
}
@@ -1087,15 +1087,15 @@ KoLinkVariable * KoTextView::linkVariable()
return dynamic_cast<KoLinkVariable *>(variable());
}
-QPtrList<KAction> KoTextView::dataToolActionList(KInstance * instance, const QString& word, bool & _singleWord )
+TQPtrList<KAction> KoTextView::dataToolActionList(KInstance * instance, const TQString& word, bool & _singleWord )
{
m_singleWord = false;
- m_wordUnderCursor = QString::null;
- QString text;
+ m_wordUnderCursor = TQString();
+ TQString text;
if ( textObject()->hasSelection() )
{
text = textObject()->selectedText();
- if ( text.find(' ') == -1 && text.find('\t') == -1 && text.find(KoTextObject::customItemChar()) == -1 )
+ if ( text.tqfind(' ') == -1 && text.tqfind('\t') == -1 && text.tqfind(KoTextObject::customItemChar()) == -1 )
{
m_singleWord = true;
}
@@ -1103,8 +1103,8 @@ QPtrList<KAction> KoTextView::dataToolActionList(KInstance * instance, const QSt
{
m_singleWord = false;
//laurent : don't try to search thesaurus when we have a customItemChar.
- if( text.find(KoTextObject::customItemChar())!=-1)
- text = QString::null;
+ if( text.tqfind(KoTextObject::customItemChar())!=-1)
+ text = TQString();
}
}
else // No selection -> use word under cursor
@@ -1118,25 +1118,25 @@ QPtrList<KAction> KoTextView::dataToolActionList(KInstance * instance, const QSt
}
if ( text.isEmpty() || textObject()->protectContent()) // Nothing to apply a tool to
- return QPtrList<KAction>();
+ return TQPtrList<KAction>();
// Any tool that works on plain text is relevant
- QValueList<KDataToolInfo> tools;
- tools +=KDataToolInfo::query( "QString", "text/plain", instance );
+ TQValueList<KDataToolInfo> tools;
+ tools +=KDataToolInfo::query( TQSTRING_OBJECT_NAME_STRING, "text/plain", instance );
// Add tools that work on a single word if that is the case
if ( m_singleWord )
{
_singleWord = true;
- tools += KDataToolInfo::query( "QString", "application/x-singleword", instance );
+ tools += KDataToolInfo::query( TQSTRING_OBJECT_NAME_STRING, "application/x-singleword", instance );
}
// Maybe one day we'll have tools that use libkotext (or qt3's qrt), to act on formatted text
tools += KDataToolInfo::query( "KoTextString", "application/x-qrichtext", instance );
- return KDataToolAction::dataToolActionList( tools, this, SLOT( slotToolActivated( const KDataToolInfo &, const QString & ) ) );
+ return KDataToolAction::dataToolActionList( tools, this, TQT_SLOT( slotToolActivated( const KDataToolInfo &, const TQString & ) ) );
}
-QString KoTextView::currentWordOrSelection() const
+TQString KoTextView::currentWordOrSelection() const
{
if ( textObject()->hasSelection() )
return textObject()->selectedText();
@@ -1144,7 +1144,7 @@ QString KoTextView::currentWordOrSelection() const
return m_wordUnderCursor;
}
-void KoTextView::slotToolActivated( const KDataToolInfo & info, const QString & command )
+void KoTextView::slotToolActivated( const KDataToolInfo & info, const TQString & command )
{
KDataTool* tool = info.createTool( );
if ( !tool )
@@ -1156,28 +1156,28 @@ void KoTextView::slotToolActivated( const KDataToolInfo & info, const QString &
kdDebug(32500) << "KWTextFrameSetEdit::slotToolActivated command=" << command
<< " dataType=" << info.dataType() << endl;
- QString text;
+ TQString text;
if ( textObject()->hasSelection() )
text = textObject()->selectedText();
else
text = m_wordUnderCursor;
// Preferred type is richtext
- QString mimetype = "application/x-qrichtext";
- QString datatype = "KoTextString";
+ TQString mimetype = "application/x-qrichtext";
+ TQString datatype = "KoTextString";
// If unsupported, try text/plain
- if ( !info.mimeTypes().contains( mimetype ) )
+ if ( !info.mimeTypes().tqcontains( mimetype ) )
{
mimetype = "text/plain";
- datatype = "QString";
+ datatype = TQSTRING_OBJECT_NAME_STRING;
}
// If unsupported (and if we have a single word indeed), try application/x-singleword
- if ( !info.mimeTypes().contains( mimetype ) && m_singleWord )
+ if ( !info.mimeTypes().tqcontains( mimetype ) && m_singleWord )
mimetype = "application/x-singleword";
kdDebug(32500) << "Running tool with datatype=" << datatype << " mimetype=" << mimetype << endl;
- QString origText = text;
+ TQString origText = text;
if ( tool->run( command, &text, datatype, mimetype) )
{
kdDebug(32500) << "Tool ran. Text is now " << text << endl;
@@ -1207,7 +1207,7 @@ bool KoTextView::openLink( KoLinkVariable* variable )
}
else
{
- KMessageBox::sorry( 0, i18n("%1 is not a valid link.").arg( variable->url() ) );
+ KMessageBox::sorry( 0, i18n("%1 is not a valid link.").tqarg( variable->url() ) );
return false;
}
}
@@ -1215,29 +1215,29 @@ bool KoTextView::openLink( KoLinkVariable* variable )
void KoTextView::insertSoftHyphen()
{
- textObject()->insert( cursor(), currentFormat(), QChar(0xad) /* see QRichText */,
+ textObject()->insert( cursor(), currentFormat(), TQChar(0xad) /* see TQRichText */,
i18n("Insert Soft Hyphen") );
}
void KoTextView::insertLineBreak()
{
- textObject()->insert( cursor(), currentFormat(), QChar('\n'),
+ textObject()->insert( cursor(), currentFormat(), TQChar('\n'),
i18n("Insert Line Break") );
}
void KoTextView::insertNonbreakingSpace()
{
- textObject()->insert( cursor(), currentFormat(), QChar(0xa0) /* see QRichText */,
+ textObject()->insert( cursor(), currentFormat(), TQChar(0xa0) /* see TQRichText */,
i18n("Insert Non-Breaking Space") );
}
void KoTextView::insertNonbreakingHyphen()
{
- textObject()->insert( cursor(), currentFormat(), QChar(0x2013),
+ textObject()->insert( cursor(), currentFormat(), TQChar(0x2013),
i18n("Insert Non-Breaking Hyphen") );
}
-void KoTextView::insertSpecialChar(QChar _c, const QString& font)
+void KoTextView::insertSpecialChar(TQChar _c, const TQString& font)
{
KoTextFormat * newFormat = new KoTextFormat(*currentFormat());
newFormat->setFamily( font );
@@ -1250,7 +1250,7 @@ void KoTextView::insertSpecialChar(QChar _c, const QString& font)
KMacroCommand* macroCmd = new KMacroCommand( i18n("Insert Special Char") );
macroCmd->addCommand( cmd );
macroCmd->addCommand( textObject()->replaceSelectionCommand(
- cursor(), _c, QString::null) );
+ cursor(), _c, TQString()) );
textObject()->emitNewCommand( macroCmd );
}
else
@@ -1288,7 +1288,7 @@ void KoTextView::increaseNumberingLevel( const KoStyleCollection* styleCollectio
level = counter->depth() + 1;
if ( m_cursor->parag()->style()->isOutline() )
{
- QValueVector<KoParagStyle *> outlineStyles = styleCollection->outlineStyles();
+ TQValueVector<KoParagStyle *> outlineStyles = styleCollection->outlineStyles();
while ( level < 10 && !style ) {
style = outlineStyles[ level ];
++level;
@@ -1332,7 +1332,7 @@ void KoTextView::decreaseNumberingLevel( const KoStyleCollection* styleCollectio
{
if ( level == -1 ) // nothing higher than Heading1
return;
- QValueVector<KoParagStyle *> outlineStyles = styleCollection->outlineStyles();
+ TQValueVector<KoParagStyle *> outlineStyles = styleCollection->outlineStyles();
while ( level >= 0 && !style ) {
style = outlineStyles[ level ];
--level;
@@ -1362,7 +1362,7 @@ void KoTextView::decreaseNumberingLevel( const KoStyleCollection* styleCollectio
KCommand *KoTextView::setChangeCaseOfTextCommand(KoChangeCaseDia::TypeOfCase _type)
{
- QString text;
+ TQString text;
if ( textObject()->hasSelection() )
text = textObject()->selectedText();
if(!text.isEmpty())
@@ -1429,7 +1429,7 @@ KCommand *KoTextView::prepareDropMove( KoTextCursor dropCursor )
int dropIndex = dropCursor.index();
dropCursor.setParag( startSel.parag() );
// If dropCursor - endSel < 0, selection ends after, we're dropping into selection (no-op)
- dropCursor.setIndex( dropIndex - QMIN( endSel.index(), dropIndex ) + startSel.index() );
+ dropCursor.setIndex( dropIndex - TQMIN( endSel.index(), dropIndex ) + startSel.index() );
}
kdDebug(32500) << "dropCursor: parag=" << dropCursor.parag()->paragId() << " index=" << dropCursor.index() << endl;
}
@@ -1450,10 +1450,10 @@ void KoTextView::copyTextOfComment()
{
KURL::List lst;
lst.append( var->note() );
- QApplication::clipboard()->setSelectionMode(true);
- QApplication::clipboard()->setData( new KURLDrag(lst, 0, 0) );
- QApplication::clipboard()->setSelectionMode(false);
- QApplication::clipboard()->setData( new KURLDrag(lst, 0, 0) );
+ TQApplication::tqclipboard()->setSelectionMode(true);
+ TQApplication::tqclipboard()->setData( new KURLDrag(lst, 0, 0) );
+ TQApplication::tqclipboard()->setSelectionMode(false);
+ TQApplication::tqclipboard()->setData( new KURLDrag(lst, 0, 0) );
}
}
@@ -1470,19 +1470,19 @@ void KoTextView::removeComment()
}
}
-KoParagStyle * KoTextView::createStyleFromSelection(const QString & name)
+KoParagStyle * KoTextView::createStyleFromSelection(const TQString & name)
{
KoTextCursor cursor = *m_cursor;
if ( textDocument()->hasSelection( KoTextDocument::Standard ) )
cursor = textDocument()->selectionStartCursor( KoTextDocument::Standard );
KoParagStyle * style = new KoParagStyle (name);
- KoParagLayout layout(cursor.parag()->paragLayout());
- layout.style = style;
+ KoParagLayout tqlayout(cursor.parag()->paragLayout());
+ tqlayout.style = style;
style->setFollowingStyle( style );
style->format() = *(cursor.parag()->at(cursor.index())->format());
- style->paragLayout() = layout;
- // Select this new style - hmm only the parag layout, we don't want to erase any text-formatting
+ style->paragLayout() = tqlayout;
+ // Select this new style - hmm only the parag tqlayout, we don't want to erase any text-formatting
cursor.parag()->setParagLayout( style->paragLayout() );
return style;
}
@@ -1498,9 +1498,9 @@ void KoTextView::updateStyleFromSelection( KoParagStyle* style )
style->format() = *(cursor.parag()->at(cursor.index())->format());
}
-void KoTextView::addBookmarks(const QString &url)
+void KoTextView::addBookmarks(const TQString &url)
{
- QString filename = locateLocal( "data", QString::fromLatin1("konqueror/bookmarks.xml") );
+ TQString filename = locateLocal( "data", TQString::tqfromLatin1("konqueror/bookmarks.xml") );
KBookmarkManager *bookManager = KBookmarkManager::managerForFile( filename,false );
KBookmarkGroup group = bookManager->root();
group.addBookmark( bookManager, url, KURL( url));
@@ -1515,10 +1515,10 @@ void KoTextView::copyLink()
{
KURL::List lst;
lst.append( var->url() );
- QApplication::clipboard()->setSelectionMode(true);
- QApplication::clipboard()->setData( new KURLDrag(lst, 0, 0) );
- QApplication::clipboard()->setSelectionMode(false);
- QApplication::clipboard()->setData( new KURLDrag(lst, 0, 0) );
+ TQApplication::tqclipboard()->setSelectionMode(true);
+ TQApplication::tqclipboard()->setData( new KURLDrag(lst, 0, 0) );
+ TQApplication::tqclipboard()->setSelectionMode(false);
+ TQApplication::tqclipboard()->setData( new KURLDrag(lst, 0, 0) );
}
}