summaryrefslogtreecommitdiffstats
path: root/lib/kotext/KoTextObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kotext/KoTextObject.cpp')
-rw-r--r--lib/kotext/KoTextObject.cpp428
1 files changed, 214 insertions, 214 deletions
diff --git a/lib/kotext/KoTextObject.cpp b/lib/kotext/KoTextObject.cpp
index 3ff03216..c65e3bb6 100644
--- a/lib/kotext/KoTextObject.cpp
+++ b/lib/kotext/KoTextObject.cpp
@@ -35,9 +35,9 @@
#include <kdebug.h>
#include <kapplication.h>
-#include <qtimer.h>
-#include <qregexp.h>
-#include <qprogressdialog.h>
+#include <tqtimer.h>
+#include <tqregexp.h>
+#include <tqprogressdialog.h>
#include <assert.h>
@@ -57,21 +57,21 @@ public:
bool abortFormatting;
};
-KoTextObject::KoTextObject( KoTextZoomHandler *zh, const QFont& defaultFont,
- const QString &defaultLanguage, bool hyphenation,
+KoTextObject::KoTextObject( KoTextZoomHandler *zh, const TQFont& defaultFont,
+ const TQString &defaultLanguage, bool hyphenation,
KoParagStyle* defaultStyle, int tabStopWidth,
- QObject* parent, const char *name )
- : QObject( parent, name ), m_defaultStyle( defaultStyle ), undoRedoInfo( this )
+ TQObject* tqparent, const char *name )
+ : TQObject( tqparent, name ), m_defaultStyle( defaultStyle ), undoRedoInfo( this )
{
- textdoc = new KoTextDocument( zh, new KoTextFormatCollection( defaultFont, QColor(),defaultLanguage, hyphenation ) );
+ textdoc = new KoTextDocument( zh, new KoTextFormatCollection( defaultFont, TQColor(),defaultLanguage, hyphenation ) );
if ( tabStopWidth != -1 )
textdoc->setTabStops( tabStopWidth );
init();
}
KoTextObject::KoTextObject( KoTextDocument* _textdoc, KoParagStyle* defaultStyle,
- QObject* parent, const char *name )
- : QObject( parent, name ), m_defaultStyle( defaultStyle ), undoRedoInfo( this )
+ TQObject* tqparent, const char *name )
+ : TQObject( tqparent, name ), m_defaultStyle( defaultStyle ), undoRedoInfo( this )
{
textdoc = _textdoc;
init();
@@ -87,31 +87,31 @@ void KoTextObject::init()
m_lastFormatted = textdoc->firstParag();
m_highlightSelectionAdded = false;
interval = 0;
- changeIntervalTimer = new QTimer( this );
- connect( changeIntervalTimer, SIGNAL( timeout() ),
- this, SLOT( doChangeInterval() ) );
+ changeIntervalTimer = new TQTimer( this );
+ connect( changeIntervalTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( doChangeInterval() ) );
- formatTimer = new QTimer( this );
- connect( formatTimer, SIGNAL( timeout() ),
- this, SLOT( formatMore() ) );
+ formatTimer = new TQTimer( this );
+ connect( formatTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( formatMore() ) );
// Apply default style to initial paragraph
if ( m_lastFormatted && m_defaultStyle )
m_lastFormatted->applyStyle( m_defaultStyle );
- connect( textdoc, SIGNAL( paragraphDeleted( KoTextParag* ) ),
- this, SIGNAL( paragraphDeleted( KoTextParag* ) ) );
- connect( textdoc, SIGNAL( paragraphDeleted( KoTextParag* ) ),
- this, SLOT( slotParagraphDeleted( KoTextParag* ) ) );
- connect( textdoc, SIGNAL( newCommand( KCommand* ) ),
- this, SIGNAL( newCommand( KCommand* ) ) );
- connect( textdoc, SIGNAL( repaintChanged() ),
- this, SLOT( emitRepaintChanged() ) );
+ connect( textdoc, TQT_SIGNAL( paragraphDeleted( KoTextParag* ) ),
+ this, TQT_SIGNAL( paragraphDeleted( KoTextParag* ) ) );
+ connect( textdoc, TQT_SIGNAL( paragraphDeleted( KoTextParag* ) ),
+ this, TQT_SLOT( slotParagraphDeleted( KoTextParag* ) ) );
+ connect( textdoc, TQT_SIGNAL( newCommand( KCommand* ) ),
+ this, TQT_SIGNAL( newCommand( KCommand* ) ) );
+ connect( textdoc, TQT_SIGNAL( tqrepaintChanged() ),
+ this, TQT_SLOT( emitRepaintChanged() ) );
- connect( this, SIGNAL(paragraphModified( KoTextParag*, int, int , int ) ),
- this, SLOT(slotParagraphModified(KoTextParag *, int, int , int)));
- connect( this, SIGNAL(paragraphCreated( KoTextParag* )),
- this, SLOT(slotParagraphCreated(KoTextParag *)));
+ connect( this, TQT_SIGNAL(paragraphModified( KoTextParag*, int, int , int ) ),
+ this, TQT_SLOT(slotParagraphModified(KoTextParag *, int, int , int)));
+ connect( this, TQT_SIGNAL(paragraphCreated( KoTextParag* )),
+ this, TQT_SLOT(slotParagraphCreated(KoTextParag *)));
}
KoTextObject::~KoTextObject()
@@ -193,7 +193,7 @@ bool KoTextObject::selectionHasCustomItems( KoTextDocument::SelectionId selectio
void KoTextObject::slotAfterUndoRedo()
{
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit updateUI( true );
emit showCursor();
emit ensureCursorVisible();
@@ -231,7 +231,7 @@ void KoTextObject::undo()
emit setCursor( c );
setLastFormattedParag( textdoc->firstParag() );
delete cursor;
- QTimer::singleShot( 0, this, SLOT( slotAfterUndoRedo() ) );
+ TQTimer::singleShot( 0, this, TQT_SLOT( slotAfterUndoRedo() ) );
}
void KoTextObject::redo()
@@ -248,13 +248,13 @@ void KoTextObject::redo()
emit setCursor( c ); // see undo
setLastFormattedParag( textdoc->firstParag() );
delete cursor;
- QTimer::singleShot( 0, this, SLOT( slotAfterUndoRedo() ) );
+ TQTimer::singleShot( 0, this, TQT_SLOT( slotAfterUndoRedo() ) );
}
KoTextObject::UndoRedoInfo::UndoRedoInfo( KoTextObject *to )
: type( Invalid ), textobj(to), cursor( 0 )
{
- text = QString::null;
+ text = TQString();
id = -1;
index = -1;
placeHolderCmd = 0L;
@@ -289,11 +289,11 @@ void KoTextObject::UndoRedoInfo::clear()
if ( itemCmd )
placeHolderCmd->addCommand( itemCmd );
}
- placeHolderCmd->addCommand( new KoTextCommand( textobj, /*cmd, */QString::null ) );
+ placeHolderCmd->addCommand( new KoTextCommand( textobj, /*cmd, */TQString() ) );
}
else
{
- placeHolderCmd->addCommand( new KoTextCommand( textobj, /*cmd, */QString::null ) );
+ placeHolderCmd->addCommand( new KoTextCommand( textobj, /*cmd, */TQString() ) );
}
}
} break;
@@ -303,7 +303,7 @@ void KoTextObject::UndoRedoInfo::clear()
KoTextDocCommand * cmd = textobj->deleteTextCommand( textdoc, id, index, text.rawData(), customItemsMap, oldParagLayouts );
textdoc->addCommand( cmd );
Q_ASSERT( placeHolderCmd );
- placeHolderCmd->addCommand( new KoTextCommand( textobj, /*cmd, */QString::null ) );
+ placeHolderCmd->addCommand( new KoTextCommand( textobj, /*cmd, */TQString() ) );
// Deleting any custom items -> let them add their command
if ( !customItemsMap.isEmpty() )
{
@@ -315,9 +315,9 @@ void KoTextObject::UndoRedoInfo::clear()
}
}
type = Invalid;
- // Before Qt-3.2.0, this called KoTextString::clear(), which called resize(0) on the array, which _detached_. Tricky.
- // Since Qt-3.2.0, resize(0) doesn't detach anymore -> KoTextDocDeleteCommand calls copy() itself.
- text = QString::null;
+ // Before TQt-3.2.0, this called KoTextString::clear(), which called resize(0) on the array, which _detached_. Tricky.
+ // Since TQt-3.2.0, resize(0) doesn't detach anymore -> KoTextDocDeleteCommand calls copy() itself.
+ text = TQString();
id = -1;
index = -1;
oldParagLayouts.clear();
@@ -344,7 +344,7 @@ void KoTextObject::copyCharFormatting( KoTextParag *parag, int position, int ind
}
}
-// Based on QTextView::readFormats - with all code duplication moved to copyCharFormatting
+// Based on TQTextView::readFormats - with all code duplication moved to copyCharFormatting
void KoTextObject::readFormats( KoTextCursor &c1, KoTextCursor &c2, bool copyParagLayouts, bool moveCustomItems )
{
//kdDebug(32500) << "KoTextObject::readFormats moveCustomItems=" << moveCustomItems << endl;
@@ -389,7 +389,7 @@ void KoTextObject::readFormats( KoTextCursor &c1, KoTextCursor &c2, bool copyPar
}
}
-void KoTextObject::newPlaceHolderCommand( const QString & name )
+void KoTextObject::newPlaceHolderCommand( const TQString & name )
{
Q_ASSERT( !undoRedoInfo.placeHolderCmd );
if ( undoRedoInfo.placeHolderCmd ) kdDebug(32500) << kdBacktrace();
@@ -436,7 +436,7 @@ void KoTextObject::doKeyboardAction( KoTextCursor * cursor, KoTextFormat * & /*c
newPlaceHolderCommand( i18n("Delete Text") );
undoRedoInfo.id = parag->paragId();
undoRedoInfo.index = cursor->index();
- undoRedoInfo.text = QString::null;
+ undoRedoInfo.text = TQString();
undoRedoInfo.oldParagLayouts << parag->paragLayout();
}
if ( !cursor->atParagEnd() )
@@ -476,7 +476,7 @@ void KoTextObject::doKeyboardAction( KoTextCursor * cursor, KoTextFormat * & /*c
newPlaceHolderCommand( i18n("Delete Text") );
undoRedoInfo.id = parag->paragId();
undoRedoInfo.index = cursor->index();
- undoRedoInfo.text = QString::null;
+ undoRedoInfo.text = TQString();
undoRedoInfo.oldParagLayouts << parag->paragLayout();
}
undoRedoInfo.text.insert( 0, cursor->parag()->at( cursor->index()-1 ) );
@@ -502,13 +502,13 @@ void KoTextObject::doKeyboardAction( KoTextCursor * cursor, KoTextFormat * & /*c
newPlaceHolderCommand( i18n("Insert Text") );
undoRedoInfo.id = cursor->parag()->paragId();
undoRedoInfo.index = cursor->index();
- undoRedoInfo.text = QString::null;
+ undoRedoInfo.text = TQString();
}
undoRedoInfo.text += "\n";
if ( cursor->parag() )
{
- QString last_line = cursor->parag()->toString();
- last_line.remove(0,last_line.find(' ')+1);
+ TQString last_line = cursor->parag()->toString();
+ last_line.remove(0,last_line.tqfind(' ')+1);
if( last_line.isEmpty() && cursor->parag()->counter() && cursor->parag()->counter()->numbering() == KoParagCounter::NUM_LIST ) //if the previous line the in paragraph is empty
{
@@ -520,7 +520,7 @@ void KoTextObject::doKeyboardAction( KoTextCursor * cursor, KoTextFormat * & /*c
cursor->parag()->setNoCounter();
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit ensureCursorVisible();
emit showCursor();
emit updateUI( doUpdateCurrentFormat );
@@ -560,11 +560,11 @@ void KoTextObject::doKeyboardAction( KoTextCursor * cursor, KoTextFormat * & /*c
newPlaceHolderCommand( i18n("Delete Text") );
undoRedoInfo.id = cursor->parag()->paragId();
undoRedoInfo.index = cursor->index();
- undoRedoInfo.text = QString::null;
+ undoRedoInfo.text = TQString();
undoRedoInfo.oldParagLayouts << parag->paragLayout();
}
if ( cursor->atParagEnd() ) {
- // Get paraglayout from next parag (next can't be 0 here)
+ // Get paragtqlayout from next parag (next can't be 0 here)
KoParagLayout paragLayout = parag->next()->paragLayout();
if ( cursor->remove() )
{
@@ -588,24 +588,24 @@ void KoTextObject::doKeyboardAction( KoTextCursor * cursor, KoTextFormat * & /*c
clearUndoRedoInfo();
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit ensureCursorVisible();
emit showCursor();
emit updateUI( doUpdateCurrentFormat );
}
void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
- const QString &txt, const QString & commandName, KoTextDocument::SelectionId selectionId,
+ const TQString &txt, const TQString & commandName, KoTextDocument::SelectionId selectionId,
int insertFlags, CustomItemsMap customItemsMap )
{
if ( protectContent() )
return;
const bool checkNewLine = insertFlags & CheckNewLine;
const bool removeSelected = ( insertFlags & DoNotRemoveSelected ) == 0;
- const bool repaint = ( insertFlags & DoNotRepaint ) == 0;
+ const bool tqrepaint = ( insertFlags & DoNotRepaint ) == 0;
//kdDebug(32500) << "KoTextObject::insert txt=" << txt << endl;
bool tinyRepaint = !checkNewLine;
- if ( repaint )
+ if ( tqrepaint )
emit hideCursor();
if ( textdoc->hasSelection( selectionId, true ) && removeSelected ) {
kdDebug() << k_funcinfo << "removing selection " << selectionId << endl;
@@ -618,7 +618,7 @@ void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
textdoc->setSelectionStart( KoTextDocument::Temp, cursor );
KoTextCursor oc = *cursor;
kdDebug(32500) << "overwrite: going to insert " << txt.length() << " chars; idx=" << oc.index() << endl;
- oc.setIndex( QMIN( oc.index() + (int)txt.length(), oc.parag()->lastCharPos() + 1 ) );
+ oc.setIndex( TQMIN( oc.index() + (int)txt.length(), oc.parag()->lastCharPos() + 1 ) );
kdDebug(32500) << "overwrite: removing from " << cursor->index() << " to " << oc.index() << endl;
if ( oc.index() > cursor->index() )
{
@@ -635,11 +635,11 @@ void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
clearUndoRedoInfo();
checkUndoRedoInfo( cursor, UndoRedoInfo::Insert );
if ( !undoRedoInfo.valid() ) {
- if ( !commandName.isNull() ) // see replace-selection
+ if ( !commandName.isNull() ) // see tqreplace-selection
newPlaceHolderCommand( commandName );
undoRedoInfo.id = cursor->parag()->paragId();
undoRedoInfo.index = cursor->index();
- undoRedoInfo.text = QString::null;
+ undoRedoInfo.text = TQString();
}
int oldLen = undoRedoInfo.text.length();
KoTextCursor oldCursor = *cursor;
@@ -673,7 +673,7 @@ void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
}
// Speed optimization: if we only type a char, and it doesn't
- // invalidate the next parag, only format the current one
+ // tqinvalidate the next parag, only format the current one
// ### This idea is wrong. E.g. when the last parag grows and must create a new page.
#if 0
KoTextParag *parag = cursor->parag();
@@ -687,9 +687,9 @@ void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
// Doing this here means callers don't have to do it, and cursor can be positionned correctly.
ensureFormatted( cursor->parag() );
- // Speed optimization: if we only type a char, only repaint from current line
+ // Speed optimization: if we only type a char, only tqrepaint from current line
// (In fact the one before. When typing a space, a word could move up to the
- // line before, we need to repaint it too...)
+ // line before, we need to tqrepaint it too...)
if ( !checkNewLine && tinyRepaint && !wasChanged )
{
// insert() called format() which called setChanged().
@@ -703,12 +703,12 @@ void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
parag->setLineChanged( origLine - 1 ); // if origLine=0, it'll pass -1, which is 'all'
}
- if ( repaint ) {
- emit repaintChanged( this );
+ if ( tqrepaint ) {
+ emit tqrepaintChanged( this );
emit ensureCursorVisible();
emit showCursor();
- // we typed the first char of a paragraph in AlignAuto mode -> show correct alignment in UI
- if ( oldCursor.index() == 0 && oldCursor.parag()->alignment() == Qt::AlignAuto )
+ // we typed the first char of a paragraph in AlignAuto mode -> show correct tqalignment in UI
+ if ( oldCursor.index() == 0 && oldCursor.parag()->tqalignment() == TQt::AlignAuto )
emit updateUI( true );
}
@@ -722,11 +722,11 @@ void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
if ( !removeSelected ) {
// ## not sure why we do this. I'd prefer leaving the selection unchanged...
// but then it'd need adjustements in the offsets etc.
- if ( textdoc->removeSelection( selectionId ) && repaint )
- selectionChangedNotify(); // does the repaint
+ if ( textdoc->removeSelection( selectionId ) && tqrepaint )
+ selectionChangedNotify(); // does the tqrepaint
}
if ( !customItemsMap.isEmpty()
- && !commandName.isNull() /* see replace-selection; #139890 */ ) {
+ && !commandName.isNull() /* see tqreplace-selection; #139890 */ ) {
clearUndoRedoInfo();
}
@@ -741,15 +741,15 @@ void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
}
}
-void KoTextObject::pasteText( KoTextCursor * cursor, const QString & text, KoTextFormat * currentFormat, bool removeSelected )
+void KoTextObject::pasteText( KoTextCursor * cursor, const TQString & text, KoTextFormat * currentFormat, bool removeSelected )
{
if ( protectContent() )
return;
kdDebug(32500) << "KoTextObject::pasteText cursor parag=" << cursor->parag()->paragId() << endl;
- QString t = text;
+ TQString t = text;
// Need to convert CRLF to NL
- QRegExp crlf( QString::fromLatin1("\r\n") );
- t.replace( crlf, QChar('\n') );
+ TQRegExp crlf( TQString::tqfromLatin1("\r\n") );
+ t.tqreplace( crlf, TQChar('\n') );
// Convert non-printable chars
for ( int i=0; (uint) i<t.length(); i++ ) {
if ( t[ i ] < ' ' && t[ i ] != '\n' && t[ i ] != '\t' )
@@ -763,7 +763,7 @@ void KoTextObject::pasteText( KoTextCursor * cursor, const QString & text, KoTex
insert( cursor, currentFormat, t, i18n("Paste Text"),
KoTextDocument::Standard, insertFlags );
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
}
}
@@ -793,7 +793,7 @@ KCommand* KoTextObject::setParagLayoutCommand( KoTextCursor * cursor, const KoPa
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit showCursor();
emit updateUI( true );
@@ -803,7 +803,7 @@ KCommand* KoTextObject::setParagLayoutCommand( KoTextCursor * cursor, const KoPa
KoTextDocCommand * cmd = new KoTextParagCommand( textdoc, undoRedoInfo.id, undoRedoInfo.eid,
undoRedoInfo.oldParagLayouts,
paragLayout, paragLayoutFlags,
- (QStyleSheetItem::Margin)marginIndex );
+ (TQStyleSheetItem::Margin)marginIndex );
textdoc->addCommand( cmd );
return new KoTextCommand( this, /*cmd, */"related to KoTextParagCommand" );
}
@@ -872,8 +872,8 @@ KCommand *KoTextObject::applyStyleCommand( KoTextCursor * cursor, const KoParagS
if ( createUndoRedo )
{
- QValueList<KoTextFormat *> lstFormats;
- //QString str;
+ TQValueList<KoTextFormat *> lstFormats;
+ //TQString str;
for ( KoTextParag * parag = firstParag ; parag && parag != lastParag->next() ; parag = parag->next() )
{
//str += parag->string()->toString() + '\n';
@@ -887,7 +887,7 @@ KCommand *KoTextObject::applyStyleCommand( KoTextCursor * cursor, const KoParagS
c2.setIndex( lastParag->string()->length() );
undoRedoInfo.clear();
undoRedoInfo.type = UndoRedoInfo::Invalid; // same trick
- readFormats( c1, c2 ); // gather char-format info but not paraglayouts nor customitems
+ readFormats( c1, c2 ); // gather char-format info but not paragtqlayouts nor customitems
KoTextDocCommand * cmd = new KoTextFormatCommand( textdoc, firstParag->paragId(), 0,
lastParag->paragId(), c2.index(),
@@ -916,7 +916,7 @@ KCommand *KoTextObject::applyStyleCommand( KoTextCursor * cursor, const KoParagS
}
//resize all variables after applying the style
- QPtrListIterator<KoTextCustomItem> cit( textdoc->allCustomItems() );
+ TQPtrListIterator<KoTextCustomItem> cit( textdoc->allCustomItems() );
for ( ; cit.current() ; ++cit )
cit.current()->resize();
@@ -925,7 +925,7 @@ KCommand *KoTextObject::applyStyleCommand( KoTextCursor * cursor, const KoParagS
{
setLastFormattedParag( firstParag );
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit updateUI( true );
emit showCursor();
}
@@ -949,7 +949,7 @@ void KoTextObject::applyStyleChange( KoStyleChangeDefMap changed )
KoTextParag *p = textdoc->firstParag();
while ( p ) {
- KoStyleChangeDefMap::Iterator it = changed.find( p->style() );
+ KoStyleChangeDefMap::Iterator it = changed.tqfind( p->style() );
if ( it != changed.end() )
{
if ( (*it).paragLayoutChanged == -1 || (*it).formatChanged == -1 ) // Style has been deleted
@@ -977,7 +977,7 @@ void KoTextObject::applyStyleChange( KoStyleChangeDefMap changed )
}
setLastFormattedParag( textdoc->firstParag() );
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit updateUI( true );
}
@@ -1054,7 +1054,7 @@ KCommand * KoTextObject::setFormatCommand( KoTextCursor * cursor, KoTextFormat *
undoRedoInfo.clear();
setLastFormattedParag( c1.parag() );
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit showCursor();
}
if ( isNewFormat ) {
@@ -1066,9 +1066,9 @@ KCommand * KoTextObject::setFormatCommand( KoTextCursor * cursor, KoTextFormat *
if ( cursor->parag()->length() == 1 ) {
newFormat->addRef();
cursor->parag()->setFormat( newFormat );
- cursor->parag()->invalidate(0);
+ cursor->parag()->tqinvalidate(0);
cursor->parag()->format();
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
}
}
}
@@ -1125,7 +1125,7 @@ KCommand *KoTextObject::setCounterCommand( KoTextCursor * cursor, const KoParagC
}
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
if ( !undoRedoInfo.newParagLayout.counter )
undoRedoInfo.newParagLayout.counter = new KoParagCounter;
*undoRedoInfo.newParagLayout.counter = counter;
@@ -1146,7 +1146,7 @@ KCommand * KoTextObject::setAlignCommand( KoTextCursor * cursor, int align, KoTe
if ( protectContent() )
return 0L;
if ( !textdoc->hasSelection( selectionId, true ) && cursor &&
- (int)cursor->parag()->alignment() == align )
+ (int)cursor->parag()->tqalignment() == align )
return 0L; // No change needed.
emit hideCursor();
@@ -1164,8 +1164,8 @@ KCommand * KoTextObject::setAlignCommand( KoTextCursor * cursor, int align, KoTe
start->setAlign(align);
}
formatMore( 2 );
- emit repaintChanged( this );
- undoRedoInfo.newParagLayout.alignment = align;
+ emit tqrepaintChanged( this );
+ undoRedoInfo.newParagLayout.tqalignment = align;
KoTextParagCommand *cmd = new KoTextParagCommand(
textdoc, undoRedoInfo.id, undoRedoInfo.eid,
undoRedoInfo.oldParagLayouts, undoRedoInfo.newParagLayout,
@@ -1177,7 +1177,7 @@ KCommand * KoTextObject::setAlignCommand( KoTextCursor * cursor, int align, KoTe
return new KoTextCommand( this, /*cmd, */i18n("Change Alignment") );
}
-KCommand * KoTextObject::setMarginCommand( KoTextCursor * cursor, QStyleSheetItem::Margin m, double margin , KoTextDocument::SelectionId selectionId ) {
+KCommand * KoTextObject::setMarginCommand( KoTextCursor * cursor, TQStyleSheetItem::Margin m, double margin , KoTextDocument::SelectionId selectionId ) {
if ( protectContent() )
return 0L;
@@ -1202,17 +1202,17 @@ KCommand * KoTextObject::setMarginCommand( KoTextCursor * cursor, QStyleSheetIte
start->setMargin(m, margin);
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
undoRedoInfo.newParagLayout.margins[m] = margin;
KoTextParagCommand *cmd = new KoTextParagCommand(
textdoc, undoRedoInfo.id, undoRedoInfo.eid,
undoRedoInfo.oldParagLayouts, undoRedoInfo.newParagLayout,
KoParagLayout::Margins, m );
textdoc->addCommand( cmd );
- QString name;
- if ( m == QStyleSheetItem::MarginFirstLine )
+ TQString name;
+ if ( m == TQStyleSheetItem::MarginFirstLine )
name = i18n("Change First Line Indent");
- else if ( m == QStyleSheetItem::MarginLeft || m == QStyleSheetItem::MarginRight )
+ else if ( m == TQStyleSheetItem::MarginLeft || m == TQStyleSheetItem::MarginRight )
name = i18n("Change Indent");
else
name = i18n("Change Paragraph Spacing");
@@ -1223,7 +1223,7 @@ KCommand * KoTextObject::setMarginCommand( KoTextCursor * cursor, QStyleSheetIte
}
KCommand * KoTextObject::setBackgroundColorCommand( KoTextCursor * cursor,
- const QColor & color,
+ const TQColor & color,
KoTextDocument::SelectionId selectionId ) {
if ( protectContent() )
return 0L;
@@ -1250,7 +1250,7 @@ KCommand * KoTextObject::setBackgroundColorCommand( KoTextCursor * cursor,
start->setBackgroundColor(color);
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
// Update undo/redo info
undoRedoInfo.newParagLayout.backgroundColor = color;
@@ -1298,7 +1298,7 @@ KCommand * KoTextObject::setLineSpacingCommand( KoTextCursor * cursor, double sp
}
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
undoRedoInfo.newParagLayout.setLineSpacingValue( spacing );
undoRedoInfo.newParagLayout.lineSpacingType = _type;
KoTextParagCommand *cmd = new KoTextParagCommand(
@@ -1358,7 +1358,7 @@ KCommand * KoTextObject::setBordersCommand( KoTextCursor * cursor, const KoBorde
end->next()->setChanged( true );
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
undoRedoInfo.newParagLayout.leftBorder=leftBorder;
undoRedoInfo.newParagLayout.rightBorder=rightBorder;
undoRedoInfo.newParagLayout.topBorder=topBorder;
@@ -1367,7 +1367,7 @@ KCommand * KoTextObject::setBordersCommand( KoTextCursor * cursor, const KoBorde
KoTextParagCommand *cmd = new KoTextParagCommand(
textdoc, undoRedoInfo.id, undoRedoInfo.eid,
undoRedoInfo.oldParagLayouts, undoRedoInfo.newParagLayout,
- KoParagLayout::Borders, (QStyleSheetItem::Margin)-1 );
+ KoParagLayout::Borders, (TQStyleSheetItem::Margin)-1 );
textdoc->addCommand( cmd );
undoRedoInfo.clear();
@@ -1414,13 +1414,13 @@ KCommand * KoTextObject::setJoinBordersCommand( KoTextCursor * cursor, bool join
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
undoRedoInfo.newParagLayout.joinBorder=join;
KoTextParagCommand *cmd = new KoTextParagCommand(
textdoc, undoRedoInfo.id, undoRedoInfo.eid,
undoRedoInfo.oldParagLayouts, undoRedoInfo.newParagLayout,
- KoParagLayout::Borders, (QStyleSheetItem::Margin)-1 );
+ KoParagLayout::Borders, (TQStyleSheetItem::Margin)-1 );
textdoc->addCommand( cmd );
undoRedoInfo.clear();
@@ -1456,7 +1456,7 @@ KCommand * KoTextObject::setTabListCommand( KoTextCursor * cursor, const KoTabul
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
undoRedoInfo.newParagLayout.setTabList( tabList );
KoTextParagCommand *cmd = new KoTextParagCommand(
textdoc, undoRedoInfo.id, undoRedoInfo.eid,
@@ -1469,7 +1469,7 @@ KCommand * KoTextObject::setTabListCommand( KoTextCursor * cursor, const KoTabul
return new KoTextCommand( this, /*cmd, */i18n("Change Tabulator") );
}
-KCommand * KoTextObject::setParagDirectionCommand( KoTextCursor * cursor, QChar::Direction d, KoTextDocument::SelectionId selectionId )
+KCommand * KoTextObject::setParagDirectionCommand( KoTextCursor * cursor, TQChar::Direction d, KoTextDocument::SelectionId selectionId )
{
if ( protectContent() )
return 0L;
@@ -1494,7 +1494,7 @@ KCommand * KoTextObject::setParagDirectionCommand( KoTextCursor * cursor, QChar:
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
////// ### TODO
#if 0
undoRedoInfo.newParagLayout.direction = d;
@@ -1514,7 +1514,7 @@ KCommand * KoTextObject::setParagDirectionCommand( KoTextCursor * cursor, QChar:
#endif
}
-void KoTextObject::removeSelectedText( KoTextCursor * cursor, KoTextDocument::SelectionId selectionId, const QString & cmdName, bool createUndoRedo )
+void KoTextObject::removeSelectedText( KoTextCursor * cursor, KoTextDocument::SelectionId selectionId, const TQString & cmdName, bool createUndoRedo )
{
if ( protectContent() )
return ;
@@ -1524,7 +1524,7 @@ void KoTextObject::removeSelectedText( KoTextCursor * cursor, KoTextDocument::Se
checkUndoRedoInfo( cursor, UndoRedoInfo::RemoveSelected );
if ( !undoRedoInfo.valid() ) {
textdoc->selectionStart( selectionId, undoRedoInfo.id, undoRedoInfo.index );
- undoRedoInfo.text = QString::null;
+ undoRedoInfo.text = TQString();
newPlaceHolderCommand( cmdName.isNull() ? i18n("Remove Selected Text") : cmdName );
}
}
@@ -1537,7 +1537,7 @@ void KoTextObject::removeSelectedText( KoTextCursor * cursor, KoTextDocument::Se
setLastFormattedParag( cursor->parag() );
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit ensureCursorVisible();
emit updateUI( true );
emit showCursor();
@@ -1547,7 +1547,7 @@ void KoTextObject::removeSelectedText( KoTextCursor * cursor, KoTextDocument::Se
undoRedoInfo.clear();
}
-KCommand * KoTextObject::removeSelectedTextCommand( KoTextCursor * cursor, KoTextDocument::SelectionId selectionId, bool repaint )
+KCommand * KoTextObject::removeSelectedTextCommand( KoTextCursor * cursor, KoTextDocument::SelectionId selectionId, bool tqrepaint )
{
if ( protectContent() )
return 0L;
@@ -1571,20 +1571,20 @@ KCommand * KoTextObject::removeSelectedTextCommand( KoTextCursor * cursor, KoTex
undoRedoInfo.customItemsMap,
undoRedoInfo.oldParagLayouts );
textdoc->addCommand(cmd);
- macroCmd->addCommand(new KoTextCommand( this, /*cmd, */QString::null ));
+ macroCmd->addCommand(new KoTextCommand( this, /*cmd, */TQString() ));
if(!undoRedoInfo.customItemsMap.isEmpty())
undoRedoInfo.customItemsMap.deleteAll( macroCmd );
undoRedoInfo.type = UndoRedoInfo::Invalid; // we don't want clear() to create a command
undoRedoInfo.clear();
- if ( repaint )
+ if ( tqrepaint )
selectionChangedNotify();
return macroCmd;
}
-KCommand* KoTextObject::replaceSelectionCommand( KoTextCursor * cursor, const QString & replacement,
- const QString & cmdName,
+KCommand* KoTextObject::replaceSelectionCommand( KoTextCursor * cursor, const TQString & replacement,
+ const TQString & cmdName,
KoTextDocument::SelectionId selectionId,
int insertFlags,
CustomItemsMap customItemsMap )
@@ -1592,8 +1592,8 @@ KCommand* KoTextObject::replaceSelectionCommand( KoTextCursor * cursor, const QS
if ( protectContent() )
return 0L;
Q_ASSERT( ( insertFlags & DoNotRemoveSelected ) == 0 ); // nonsensical
- const bool repaint = ( insertFlags & DoNotRepaint ) == 0; // DoNotRepaint is set during search/replace
- if ( repaint )
+ const bool tqrepaint = ( insertFlags & DoNotRepaint ) == 0; // DoNotRepaint is set during search/tqreplace
+ if ( tqrepaint )
emit hideCursor();
// This could be improved to use a macro command only when there's a selection to remove.
KMacroCommand * macroCmd = new KMacroCommand( cmdName );
@@ -1604,20 +1604,20 @@ KCommand* KoTextObject::replaceSelectionCommand( KoTextCursor * cursor, const QS
format->addRef();
// Remove selected text, if any
- KCommand* removeSelCmd = removeSelectedTextCommand( cursor, selectionId, repaint );
+ KCommand* removeSelCmd = removeSelectedTextCommand( cursor, selectionId, tqrepaint );
if ( removeSelCmd )
macroCmd->addCommand( removeSelCmd );
// Insert replacement
insert( cursor, format,
- replacement, QString::null /* no place holder command */,
+ replacement, TQString() /* no place holder command */,
selectionId, insertFlags | DoNotRemoveSelected, customItemsMap );
KoTextDocCommand * cmd = new KoTextInsertCommand( textdoc, undoRedoInfo.id, undoRedoInfo.index,
undoRedoInfo.text.rawData(),
CustomItemsMap(), undoRedoInfo.oldParagLayouts );
textdoc->addCommand( cmd );
- macroCmd->addCommand( new KoTextCommand( this, /*cmd, */QString::null ) );
+ macroCmd->addCommand( new KoTextCommand( this, /*cmd, */TQString() ) );
undoRedoInfo.type = UndoRedoInfo::Invalid; // we don't want clear() to create a command
undoRedoInfo.clear();
@@ -1625,10 +1625,10 @@ KCommand* KoTextObject::replaceSelectionCommand( KoTextCursor * cursor, const QS
format->removeRef();
setLastFormattedParag( c1.parag() );
- if ( repaint )
+ if ( tqrepaint )
{
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit ensureCursorVisible();
emit updateUI( true );
emit showCursor();
@@ -1642,34 +1642,34 @@ KCommand * KoTextObject::insertParagraphCommand( KoTextCursor *cursor )
{
if ( protectContent() )
return 0L;
- return replaceSelectionCommand( cursor, "\n", QString::null, KoTextDocument::Standard, CheckNewLine );
+ return replaceSelectionCommand( cursor, "\n", TQString(), KoTextDocument::Standard, CheckNewLine );
}
-void KoTextObject::highlightPortion( KoTextParag * parag, int index, int length, bool repaint )
+void KoTextObject::highlightPortion( KoTextParag * parag, int index, int length, bool tqrepaint )
{
if ( !m_highlightSelectionAdded )
{
textdoc->addSelection( KoTextDocument::HighlightSelection );
textdoc->setSelectionColor( KoTextDocument::HighlightSelection,
- QApplication::palette().color( QPalette::Active, QColorGroup::Dark ) );
+ TQApplication::palette().color( TQPalette::Active, TQColorGroup::Dark ) );
textdoc->setInvertSelectionText( KoTextDocument::HighlightSelection, true );
m_highlightSelectionAdded = true;
}
- removeHighlight(repaint); // remove previous highlighted selection
+ removeHighlight(tqrepaint); // remove previous highlighted selection
KoTextCursor cursor( textdoc );
cursor.setParag( parag );
cursor.setIndex( index );
textdoc->setSelectionStart( KoTextDocument::HighlightSelection, &cursor );
cursor.setIndex( index + length );
textdoc->setSelectionEnd( KoTextDocument::HighlightSelection, &cursor );
- if ( repaint ) {
+ if ( tqrepaint ) {
parag->setChanged( true );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
}
}
-void KoTextObject::removeHighlight(bool repaint)
+void KoTextObject::removeHighlight(bool tqrepaint)
{
if ( textdoc->hasSelection( KoTextDocument::HighlightSelection, true ) )
{
@@ -1677,8 +1677,8 @@ void KoTextObject::removeHighlight(bool repaint)
oldParag->setChanged( true );
textdoc->removeSelection( KoTextDocument::HighlightSelection );
}
- if ( repaint )
- emit repaintChanged( this );
+ if ( tqrepaint )
+ emit tqrepaintChanged( this );
}
void KoTextObject::selectAll( bool select )
@@ -1692,19 +1692,19 @@ void KoTextObject::selectAll( bool select )
void KoTextObject::selectionChangedNotify( bool enableActions /* = true */)
{
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
if ( enableActions )
emit selectionChanged( hasSelection() );
}
-void KoTextObject::setViewArea( QWidget* w, int maxY )
+void KoTextObject::setViewArea( TQWidget* w, int maxY )
{
- m_mapViewAreas.replace( w, maxY );
+ m_mapViewAreas.tqreplace( w, maxY );
}
void KoTextObject::setLastFormattedParag( KoTextParag *parag )
{
- //kdDebug() << k_funcinfo << parag << " (" << ( parag ? QString::number(parag->paragId()) : QString("(null)") ) << ")" << endl;
+ //kdDebug() << k_funcinfo << parag << " (" << ( parag ? TQString::number(parag->paragId()) : TQString("(null)") ) << ")" << endl;
if ( !m_lastFormatted || !parag || m_lastFormatted->paragId() >= parag->paragId() ) {
m_lastFormatted = parag;
}
@@ -1725,7 +1725,7 @@ void KoTextObject::ensureFormatted( KoTextParag * parag, bool emitAfterFormattin
return;
}
// The paragid diff is "a good guess". The >=1 is a safety measure ;)
- bool ret = formatMore( QMAX( 1, parag->paragId() - m_lastFormatted->paragId() ), emitAfterFormatting );
+ bool ret = formatMore( TQMAX( 1, parag->paragId() - m_lastFormatted->paragId() ), emitAfterFormatting );
if ( !ret ) { // aborted
//kdDebug(32500) << "ensureFormatted aborted!" << endl;
break;
@@ -1760,9 +1760,9 @@ bool KoTextObject::formatMore( int count /* = 10 */, bool emitAfterFormatting /*
d->afterFormattingEmitted = false;
int viewsBottom = 0;
- QMapIterator<QWidget *, int> mapIt = m_mapViewAreas.begin();
+ TQMapIterator<TQWidget *, int> mapIt = m_mapViewAreas.begin();
for ( ; mapIt != m_mapViewAreas.end() ; ++mapIt )
- viewsBottom = QMAX( viewsBottom, mapIt.data() );
+ viewsBottom = TQMAX( viewsBottom, mapIt.data() );
#ifdef DEBUG_FORMAT_MORE
kdDebug(32500) << "formatMore " << name()
@@ -1826,12 +1826,12 @@ bool KoTextObject::formatMore( int count /* = 10 */, bool emitAfterFormatting /*
}
else // formatting was done previously, but not emit afterFormatting
{
- QRect rect = textdoc->lastParag()->rect();
+ TQRect rect = textdoc->lastParag()->rect();
bottom = rect.top() + rect.height();
}
#ifdef DEBUG_FORMAT_MORE
- QString id;
- if ( m_lastFormatted ) id = QString(" (%1)").arg(m_lastFormatted->paragId());
+ TQString id;
+ if ( m_lastFormatted ) id = TQString(" (%1)").tqarg(m_lastFormatted->paragId());
kdDebug(32500) << "formatMore finished formatting. "
<< " bottom=" << bottom
<< " m_lastFormatted=" << m_lastFormatted << id
@@ -1865,7 +1865,7 @@ bool KoTextObject::formatMore( int count /* = 10 */, bool emitAfterFormatting /*
}
else
{
- interval = QMAX( 0, interval );
+ interval = TQMAX( 0, interval );
#ifdef DEBUG_FORMAT_MORE
kdDebug(32500) << name() << " formatMore: all formatted interval=" << interval << endl;
#endif
@@ -1912,7 +1912,7 @@ KCommand *KoTextObject::changeCaseOfTextParag( int cursorPosStart, int cursorPos
KMacroCommand * macroCmd = new KMacroCommand( i18n("Change Case") );
KoTextFormat *curFormat = parag->paragraphFormat();
- const QString text = parag->string()->toString().mid( cursorPosStart, cursorPosEnd - cursorPosStart );
+ const TQString text = parag->string()->toString().mid( cursorPosStart, cursorPosEnd - cursorPosStart );
int posStart = cursorPosStart;
int posEnd = cursorPosStart;
KoTextCursor c1( textdoc );
@@ -1931,12 +1931,12 @@ KCommand *KoTextObject::changeCaseOfTextParag( int cursorPosStart, int cursorPos
c2.setIndex( posEnd );
//kdDebug() << k_funcinfo << "found custom at " << i << " : doing from " << posStart << " to " << posEnd << endl;
- const QString repl = text.mid( posStart, posEnd - posStart );
+ const TQString repl = text.mid( posStart, posEnd - posStart );
textdoc->setSelectionStart( KoTextDocument::Temp, &c1 );
textdoc->setSelectionEnd( KoTextDocument::Temp, &c2 );
macroCmd->addCommand(replaceSelectionCommand(
cursor, textChangedCase(repl,_type),
- QString::null, KoTextDocument::Temp));
+ TQString(), KoTextDocument::Temp));
do
{
++i;
@@ -1956,12 +1956,12 @@ KCommand *KoTextObject::changeCaseOfTextParag( int cursorPosStart, int cursorPos
c2.setIndex( posEnd );
//kdDebug() << k_funcinfo << "found new format at " << i << " : doing from " << posStart << " to " << posEnd << endl;
- const QString repl = text.mid( posStart, posEnd - posStart );
+ const TQString repl = text.mid( posStart, posEnd - posStart );
textdoc->setSelectionStart( KoTextDocument::Temp, &c1 );
textdoc->setSelectionEnd( KoTextDocument::Temp, &c2 );
macroCmd->addCommand(replaceSelectionCommand(
cursor, textChangedCase(repl,_type),
- QString::null, KoTextDocument::Temp));
+ TQString(), KoTextDocument::Temp));
posStart=i;
posEnd=i;
curFormat = newFormat;
@@ -1978,10 +1978,10 @@ KCommand *KoTextObject::changeCaseOfTextParag( int cursorPosStart, int cursorPos
textdoc->setSelectionStart( KoTextDocument::Temp, &c1 );
textdoc->setSelectionEnd( KoTextDocument::Temp, &c2 );
- const QString repl = text.mid( posStart, cursorPosEnd - posStart );
+ const TQString repl = text.mid( posStart, cursorPosEnd - posStart );
macroCmd->addCommand(replaceSelectionCommand(
cursor, textChangedCase(repl,_type),
- QString::null, KoTextDocument::Temp));
+ TQString(), KoTextDocument::Temp));
}
return macroCmd;
@@ -1999,7 +1999,7 @@ KCommand *KoTextObject::changeCaseOfText(KoTextCursor *cursor,KoChangeCaseDia::T
if ( start.parag() == end.parag() )
{
- int endIndex = QMIN( start.parag()->length() - 1, end.index() );
+ int endIndex = TQMIN( start.parag()->length() - 1, end.index() );
macroCmd->addCommand( changeCaseOfTextParag( start.index(), endIndex, _type,
cursor, start.parag() ) );
}
@@ -2015,21 +2015,21 @@ KCommand *KoTextObject::changeCaseOfText(KoTextCursor *cursor,KoChangeCaseDia::T
}
if ( p )
{
- int endIndex = QMIN( p->length() - 1, end.index() );
+ int endIndex = TQMIN( p->length() - 1, end.index() );
macroCmd->addCommand( changeCaseOfTextParag(0, endIndex, _type, cursor, end.parag() ));
}
}
formatMore( 2 );
- emit repaintChanged( this );
+ emit tqrepaintChanged( this );
emit ensureCursorVisible();
emit updateUI( true );
emit showCursor();
return macroCmd;
}
-QString KoTextObject::textChangedCase(const QString& _text,KoChangeCaseDia::TypeOfCase _type)
+TQString KoTextObject::textChangedCase(const TQString& _text,KoChangeCaseDia::TypeOfCase _type)
{
- QString text(_text);
+ TQString text(_text);
switch(_type)
{
case KoChangeCaseDia::UpperCase:
@@ -2041,25 +2041,25 @@ QString KoTextObject::textChangedCase(const QString& _text,KoChangeCaseDia::Type
case KoChangeCaseDia::TitleCase:
for(uint i=0;i<text.length();i++)
{
- if(text.at(i)!=' ')
+ if(text.tqat(i)!=' ')
{
- QChar prev = text.at(QMAX(i-1,0));
+ TQChar prev = text.tqat(TQMAX(i-1,0));
if(i==0 || prev == ' ' || prev == '\n' || prev == '\t')
- text=text.replace(i, 1, text.at(i).upper() );
+ text=text.tqreplace(i, 1, text.tqat(i).upper() );
else
- text=text.replace(i, 1, text.at(i).lower() );
+ text=text.tqreplace(i, 1, text.tqat(i).lower() );
}
}
break;
case KoChangeCaseDia::ToggleCase:
for(uint i=0;i<text.length();i++)
{
- QString repl=QString(text.at(i));
- if(text.at(i)!=text.at(i).upper())
+ TQString repl=TQString(text.at(i));
+ if(text.tqat(i)!=text.tqat(i).upper())
repl=repl.upper();
- else if(text.at(i).lower()!=text.at(i))
+ else if(text.tqat(i).lower()!=text.tqat(i))
repl=repl.lower();
- text=text.replace(i, 1, repl );
+ text=text.tqreplace(i, 1, repl );
}
break;
case KoChangeCaseDia::SentenceCase:
@@ -2067,9 +2067,9 @@ QString KoTextObject::textChangedCase(const QString& _text,KoChangeCaseDia::Type
{
if(text.at(i)!=' ')
{
- QChar prev = text.at(QMAX(i-1,0));
+ TQChar prev = text.at(TQMAX(i-1,0));
if(i==0 || prev == '\n' ||prev.isPunct())
- text=text.replace(i, 1, text.at(i).upper() );
+ text=text.tqreplace(i, 1, text.tqat(i).upper() );
}
}
break;
@@ -2101,7 +2101,7 @@ bool KoTextObject::rtl() const
return textdoc->firstParag()->string()->isRightToLeft();
}
-void KoTextObject::loadOasisContent( const QDomElement &bodyElem, KoOasisContext& context, KoStyleCollection * styleColl )
+void KoTextObject::loadOasisContent( const TQDomElement &bodyElem, KoOasisContext& context, KoStyleCollection * styleColl )
{
textDocument()->clear(false); // Get rid of dummy paragraph (and more if any)
setLastFormattedParag( 0L ); // no more parags, avoid UMR in next setLastFormattedParag call
@@ -2120,7 +2120,7 @@ void KoTextObject::loadOasisContent( const QDomElement &bodyElem, KoOasisContext
setLastFormattedParag( textDocument()->firstParag() );
}
-KoTextCursor KoTextObject::pasteOasisText( const QDomElement &bodyElem, KoOasisContext& context,
+KoTextCursor KoTextObject::pasteOasisText( const TQDomElement &bodyElem, KoOasisContext& context,
KoTextCursor& cursor, KoStyleCollection * styleColl )
{
KoTextCursor resultCursor( cursor );
@@ -2139,16 +2139,16 @@ KoTextCursor KoTextObject::pasteOasisText( const QDomElement &bodyElem, KoOasisC
} else {
// Pasting inside a non-empty paragraph -> insert/append text to it.
// This loop looks for the *FIRST* paragraph only.
- for ( QDomNode text (bodyElem.firstChild()); !text.isNull(); text = text.nextSibling() )
+ for ( TQDomNode text (bodyElem.firstChild()); !text.isNull(); text = text.nextSibling() )
{
- QDomElement tag = text.toElement();
+ TQDomElement tag = text.toElement();
if ( tag.isNull() ) continue;
// The first tag could be a text:p, text:h, text:numbered-paragraph, but also
// a frame (anchored to page), a TOC, etc. For those, don't try to concat-with-existing-paragraph.
// For text:numbered-paragraph, find the text:p or text:h inside it.
- QDomElement tagToLoad = tag;
+ TQDomElement tagToLoad = tag;
if ( tag.localName() == "numbered-paragraph" ) {
- QDomElement npchild;
+ TQDomElement npchild;
forEachElement( npchild, tag )
{
if ( npchild.localName() == "p" || npchild.localName() == "h" ) {
@@ -2167,7 +2167,7 @@ KoTextCursor KoTextObject::pasteOasisText( const QDomElement &bodyElem, KoOasisC
context.styleStack().restore();
lastParagraph->setChanged( true );
- lastParagraph->invalidate( 0 );
+ lastParagraph->tqinvalidate( 0 );
// Now split this parag, to make room for the next paragraphs
resultCursor.setParag( lastParagraph );
@@ -2176,7 +2176,7 @@ KoTextCursor KoTextObject::pasteOasisText( const QDomElement &bodyElem, KoOasisC
removeNewline = true;
// Done with first parag, remove it and exit loop
- const_cast<QDomElement &>( bodyElem ).removeChild( tag ); // somewhat hackish
+ const_cast<TQDomElement &>( bodyElem ).removeChild( tag ); // somewhat hackish
}
break;
}
@@ -2256,23 +2256,23 @@ void KoTextObject::setNeedSpellCheck(bool b)
parag->string()->setNeedsSpellCheck( b );
}
-bool KoTextObject::statistics( QProgressDialog *progress, ulong & charsWithSpace, ulong & charsWithoutSpace, ulong & words, ulong & sentences, ulong & syllables, ulong & lines, bool selected )
+bool KoTextObject::statistics( TQProgressDialog *progress, ulong & charsWithSpace, ulong & charsWithoutSpace, ulong & words, ulong & sentences, ulong & syllables, ulong & lines, bool selected )
{
// parts of words for better counting of syllables:
// (only use reg exp if necessary -> speed up)
- QStringList subs_syl;
+ TQStringList subs_syl;
subs_syl << "cial" << "tia" << "cius" << "cious" << "giu" << "ion" << "iou";
- QStringList subs_syl_regexp;
+ TQStringList subs_syl_regexp;
subs_syl_regexp << "sia$" << "ely$";
- QStringList add_syl;
+ TQStringList add_syl;
add_syl << "ia" << "riet" << "dien" << "iu" << "io" << "ii";
- QStringList add_syl_regexp;
+ TQStringList add_syl_regexp;
add_syl_regexp << "[aeiouym]bl$" << "[aeiou]{3}" << "^mc" << "ism$"
<< "[^l]lien" << "^coa[dglx]." << "[^gq]ua[^auieo]" << "dnt$";
- QString s;
+ TQString s;
KoTextParag * parag = textdoc->firstParag();
for ( ; parag ; parag = parag->next() )
{
@@ -2313,7 +2313,7 @@ bool KoTextObject::statistics( QProgressDialog *progress, ulong & charsWithSpace
// Character count
for ( uint i = 0 ; i < s.length() - ( hasTrailingSpace ? 1 : 0 ) ; ++i )
{
- QChar ch = s[i];
+ TQChar ch = s[i];
++charsWithSpace;
if ( !ch.isSpace() )
++charsWithoutSpace;
@@ -2325,12 +2325,12 @@ bool KoTextObject::statistics( QProgressDialog *progress, ulong & charsWithSpace
// is quite good, as some words get a number that's too high and others get
// one that's too low.
// IMPORTANT: please test any changes against demos/statistics.kwd
- QRegExp re("\\s+");
- QStringList wordlist = QStringList::split(re, s);
+ TQRegExp re("\\s+");
+ TQStringList wordlist = TQStringList::split(re, s);
words += wordlist.count();
re.setCaseSensitive(false);
- for ( QStringList::Iterator it = wordlist.begin(); it != wordlist.end(); ++it ) {
- QString word = *it;
+ for ( TQStringList::Iterator it = wordlist.begin(); it != wordlist.end(); ++it ) {
+ TQString word = *it;
re.setPattern("[!?.,:_\"-]"); // clean word from punctuation
word.remove(re);
if ( word.length() <= 3 ) { // extension to the original algorithm
@@ -2340,24 +2340,24 @@ bool KoTextObject::statistics( QProgressDialog *progress, ulong & charsWithSpace
re.setPattern("e$");
word.remove(re);
re.setPattern("[^aeiouy]+");
- QStringList syls = QStringList::split(re, word);
+ TQStringList syls = TQStringList::split(re, word);
int word_syllables = 0;
- for ( QStringList::Iterator it = subs_syl.begin(); it != subs_syl.end(); ++it ) {
- if( word.find(*it, 0, false) != -1 )
+ for ( TQStringList::Iterator it = subs_syl.begin(); it != subs_syl.end(); ++it ) {
+ if( word.tqfind(*it, 0, false) != -1 )
word_syllables--;
}
- for ( QStringList::Iterator it = subs_syl_regexp.begin(); it != subs_syl_regexp.end(); ++it ) {
+ for ( TQStringList::Iterator it = subs_syl_regexp.begin(); it != subs_syl_regexp.end(); ++it ) {
re.setPattern(*it);
- if( word.find(re) != -1 )
+ if( word.tqfind(re) != -1 )
word_syllables--;
}
- for ( QStringList::Iterator it = add_syl.begin(); it != add_syl.end(); ++it ) {
- if( word.find(*it, 0, false) != -1 )
+ for ( TQStringList::Iterator it = add_syl.begin(); it != add_syl.end(); ++it ) {
+ if( word.tqfind(*it, 0, false) != -1 )
word_syllables++;
}
- for ( QStringList::Iterator it = add_syl_regexp.begin(); it != add_syl_regexp.end(); ++it ) {
+ for ( TQStringList::Iterator it = add_syl_regexp.begin(); it != add_syl_regexp.end(); ++it ) {
re.setPattern(*it);
- if( word.find(re) != -1 )
+ if( word.tqfind(re) != -1 )
word_syllables++;
}
word_syllables += syls.count();
@@ -2370,19 +2370,19 @@ bool KoTextObject::statistics( QProgressDialog *progress, ulong & charsWithSpace
// Sentence count
// Clean up for better result, destroys the original text but we only want to count
s = s.stripWhiteSpace();
- QChar lastchar = s.at(s.length());
+ TQChar lastchar = s.at(s.length());
if( ! s.isEmpty() && ! KoAutoFormat::isMark( lastchar ) ) { // e.g. for headlines
s = s + ".";
}
re.setPattern("[.?!]+"); // count "..." as only one "."
- s.replace(re, ".");
+ s.tqreplace(re, ".");
re.setPattern("\\d\\.\\d"); // don't count floating point numbers as sentences
- s.replace(re, "0,0");
+ s.tqreplace(re, "0,0");
re.setPattern("[A-Z]\\.+"); // don't count "U.S.A." as three sentences
- s.replace(re, "*");
+ s.tqreplace(re, "*");
for ( uint i = 0 ; i < s.length() ; ++i )
{
- QChar ch = s[i];
+ TQChar ch = s[i];
if ( KoAutoFormat::isMark( ch ) )
++sentences;
}
@@ -2403,7 +2403,7 @@ int KoTextObject::numberOfparagraphLineSelected( KoTextParag *parag)
return (lineEnd - lineStart+1);
}
-KoVariable* KoTextObject::variableAtPoint( const QPoint& iPoint ) const
+KoVariable* KoTextObject::variableAtPoint( const TQPoint& iPoint ) const
{
KoTextCursor cursor( textDocument() );
int variablePosition = -1;
@@ -2426,13 +2426,13 @@ const char * KoTextObject::acceptSelectionMimeType()
return "application/vnd.oasis.opendocument.";
}
-QCString KoTextObject::providesOasis( QMimeSource* mime )
+TQCString KoTextObject::providesOasis( TQMimeSource* mime )
{
const char* fmt;
const char* acceptMimeType = acceptSelectionMimeType();
for ( int i = 0; (fmt = mime->format(i)); ++i )
{
- if ( QString( fmt ).startsWith( acceptMimeType ) )
+ if ( TQString( fmt ).startsWith( acceptMimeType ) )
{
return fmt;
}
@@ -2478,7 +2478,7 @@ KCommand *KoTextFormatInterface::setUnderlineCommand( bool on )
return setFormatCommand( &format, KoTextFormat::ExtendUnderLine );
}
-KCommand *KoTextFormatInterface::setUnderlineColorCommand( const QColor &color )
+KCommand *KoTextFormatInterface::setUnderlineColorCommand( const TQColor &color )
{
KoTextFormat format( *currentFormat() );
format.setTextUnderlineColor( color);
@@ -2499,7 +2499,7 @@ KCommand *KoTextFormatInterface::setStrikeOutCommand( bool on )
return setFormatCommand( &format, KoTextFormat::StrikeOut );
}
-KCommand *KoTextFormatInterface::setTextBackgroundColorCommand(const QColor & col)
+KCommand *KoTextFormatInterface::setTextBackgroundColorCommand(const TQColor & col)
{
KoTextFormat format( *currentFormat() );
format.setTextBackgroundColor( col );
@@ -2513,24 +2513,24 @@ KCommand *KoTextFormatInterface::setPointSizeCommand( int s )
return setFormatCommand( &format, KoTextFormat::Size, true /* zoom the font size */ );
}
-KCommand *KoTextFormatInterface::setFamilyCommand(const QString &font)
+KCommand *KoTextFormatInterface::setFamilyCommand(const TQString &font)
{
KoTextFormat format( *currentFormat() );
format.setFamily( font );
return setFormatCommand( &format, KoTextFormat::Family );
}
-QColor KoTextFormatInterface::textBackgroundColor() const
+TQColor KoTextFormatInterface::textBackgroundColor() const
{
return currentFormat()->textBackgroundColor();
}
-QColor KoTextFormatInterface::textUnderlineColor()const
+TQColor KoTextFormatInterface::textUnderlineColor()const
{
return currentFormat()->textUnderlineColor();
}
-QColor KoTextFormatInterface::textColor() const
+TQColor KoTextFormatInterface::textColor() const
{
return currentFormat()->color();
}
@@ -2580,7 +2580,7 @@ double KoTextFormatInterface::shadowDistanceY() const
return currentFormat()->shadowDistanceY();
}
-QColor KoTextFormatInterface::shadowColor() const
+TQColor KoTextFormatInterface::shadowColor() const
{
return currentFormat()->shadowColor();
}
@@ -2630,25 +2630,25 @@ KoTextFormat::StrikeOutStyle KoTextFormatInterface::strikeOutStyle()const
return currentFormat()->strikeOutStyle();
}
-QFont KoTextFormatInterface::textFont() const
+TQFont KoTextFormatInterface::textFont() const
{
- QFont fn( currentFormat()->font() );
+ TQFont fn( currentFormat()->font() );
// "unzoom" the font size
- //fn.setPointSize( static_cast<int>( KoTextZoomHandler::layoutUnitPtToPt( fn.pointSize() ) ) );
+ //fn.setPointSize( static_cast<int>( KoTextZoomHandler::tqlayoutUnitPtToPt( fn.pointSize() ) ) );
return fn;
}
-QString KoTextFormatInterface::textFontFamily()const
+TQString KoTextFormatInterface::textFontFamily()const
{
return currentFormat()->font().family();
}
-QString KoTextFormatInterface::language() const
+TQString KoTextFormatInterface::language() const
{
return currentFormat()->language();
}
-KCommand *KoTextFormatInterface::setTextColorCommand(const QColor &color)
+KCommand *KoTextFormatInterface::setTextColorCommand(const TQColor &color)
{
KoTextFormat format( *currentFormat() );
format.setColor( color );
@@ -2677,7 +2677,7 @@ KCommand *KoTextFormatInterface::setTextSuperScriptCommand(bool on)
KCommand *KoTextFormatInterface::setDefaultFormatCommand()
{
- KoTextFormatCollection * coll = currentFormat()->parent();
+ KoTextFormatCollection * coll = currentFormat()->tqparent();
Q_ASSERT(coll);
if(coll)
{
@@ -2692,7 +2692,7 @@ KCommand *KoTextFormatInterface::setDefaultFormatCommand()
KCommand *KoTextFormatInterface::setAlignCommand(int align)
{
KoParagLayout format( *currentParagLayoutFormat() );
- format.alignment=align;
+ format.tqalignment=align;
return setParagLayoutFormatCommand(&format,KoParagLayout::Alignment);
}
@@ -2704,7 +2704,7 @@ KCommand *KoTextFormatInterface::setHyphenationCommand( bool _b )
}
-KCommand *KoTextFormatInterface::setShadowTextCommand( double shadowDistanceX, double shadowDistanceY, const QColor& shadowColor )
+KCommand *KoTextFormatInterface::setShadowTextCommand( double shadowDistanceX, double shadowDistanceY, const TQColor& shadowColor )
{
KoTextFormat format( *currentFormat() );
format.setShadow( shadowDistanceX, shadowDistanceY, shadowColor );
@@ -2746,7 +2746,7 @@ void KoTextFormatInterface::setAlign(int align)
emitNewCommand( cmd );
}
-void KoTextFormatInterface::setMargin(QStyleSheetItem::Margin m, double margin)
+void KoTextFormatInterface::setMargin(TQStyleSheetItem::Margin m, double margin)
{
KCommand *cmd = setMarginCommand( m, margin );
emitNewCommand( cmd );
@@ -2771,7 +2771,7 @@ void KoTextFormatInterface::setParagLayoutFormat( KoParagLayout *newLayout, int
}
#endif
-KCommand *KoTextFormatInterface::setMarginCommand(QStyleSheetItem::Margin m, double margin)
+KCommand *KoTextFormatInterface::setMarginCommand(TQStyleSheetItem::Margin m, double margin)
{
KoParagLayout format( *currentParagLayoutFormat() );
format.margins[m]=margin;
@@ -2794,14 +2794,14 @@ KCommand *KoTextFormatInterface::setCounterCommand(const KoParagCounter & counte
return setParagLayoutFormatCommand(&format,KoParagLayout::BulletNumber);
}
-KCommand *KoTextFormatInterface::setLanguageCommand(const QString &_lang)
+KCommand *KoTextFormatInterface::setLanguageCommand(const TQString &_lang)
{
KoTextFormat format( *currentFormat() );
format.setLanguage(_lang);
return setFormatCommand( &format, KoTextFormat::Language );
}
-KoTextDocCommand *KoTextFormatInterface::deleteTextCommand( KoTextDocument *textdoc, int id, int index, const QMemArray<KoTextStringChar> & str, const CustomItemsMap & customItemsMap, const QValueList<KoParagLayout> & oldParagLayouts )
+KoTextDocCommand *KoTextFormatInterface::deleteTextCommand( KoTextDocument *textdoc, int id, int index, const TQMemArray<KoTextStringChar> & str, const CustomItemsMap & customItemsMap, const TQValueList<KoParagLayout> & oldParagLayouts )
{
return textdoc->deleteTextCommand( textdoc, id, index, str, customItemsMap, oldParagLayouts );
}