summaryrefslogtreecommitdiffstats
path: root/lib/kformula/kformulacommand.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kformula/kformulacommand.cc')
-rw-r--r--lib/kformula/kformulacommand.cc110
1 files changed, 55 insertions, 55 deletions
diff --git a/lib/kformula/kformulacommand.cc b/lib/kformula/kformulacommand.cc
index 24d49019..804b66c6 100644
--- a/lib/kformula/kformulacommand.cc
+++ b/lib/kformula/kformulacommand.cc
@@ -20,7 +20,7 @@
#include <klocale.h> //This is for undo descriptions
-#include <qvaluelist.h>
+#include <tqvaluelist.h>
#include "formulacursor.h"
#include "formulaelement.h"
@@ -36,7 +36,7 @@ KFORMULA_NAMESPACE_BEGIN
int PlainCommand::evilDestructionCount = 0;
-PlainCommand::PlainCommand( const QString& name )
+PlainCommand::PlainCommand( const TQString& name )
: KNamedCommand(name)
{
evilDestructionCount++;
@@ -47,7 +47,7 @@ PlainCommand::~PlainCommand()
evilDestructionCount--;
}
-Command::Command(const QString &name, Container* document)
+Command::Command(const TQString &name, Container* document)
: PlainCommand(name), cursordata(0), undocursor(0), doc(document)
{
}
@@ -93,7 +93,7 @@ void Command::setUnexecuteCursor(FormulaCursor* cursor)
// ****** Generic Add command
-KFCAdd::KFCAdd(const QString &name, Container *document)
+KFCAdd::KFCAdd(const TQString &name, Container *document)
: Command(name, document)
{
addList.setAutoDelete( true );
@@ -148,7 +148,7 @@ void KFCRemoveSelection::unexecute()
-KFCReplace::KFCReplace(const QString &name, Container* document)
+KFCReplace::KFCReplace(const TQString &name, Container* document)
: KFCAdd(name, document), removeSelection(0)
{
}
@@ -180,15 +180,15 @@ void KFCReplace::unexecute()
// ****** Token Add command
-KFCAddToken::KFCAddToken(const QString &name, Container *document)
+KFCAddToken::KFCAddToken(const TQString &name, Container *document)
: Command(name, document)
{
}
KFCAddToken::~KFCAddToken()
{
- QPtrDictIterator< QPtrList< BasicElement > > it( contentList );
- QPtrList< BasicElement >* list;
+ TQPtrDictIterator< TQPtrList< BasicElement > > it( contentList );
+ TQPtrList< BasicElement >* list;
while ( ( list = it.current() ) != 0 ) {
delete list;
++it;
@@ -199,15 +199,15 @@ void KFCAddToken::execute()
{
kdDebug( DEBUGID ) << k_funcinfo << endl;
FormulaCursor* cursor = getExecuteCursor();
- QPtrList<BasicElement> tokenListTmp = tokenList;
+ TQPtrList<BasicElement> tokenListTmp = tokenList;
cursor->insert( tokenList, beforeCursor );
tokenList = tokenListTmp;
- QPtrListIterator< BasicElement > it( tokenList );
+ TQPtrListIterator< BasicElement > it( tokenList );
BasicElement* element;
BasicElement* current = cursor->getElement();
while ( (element = it.current()) != 0 ) {
element->goInside( cursor );
- cursor->insert( *contentList.find( element ), beforeCursor );
+ cursor->insert( *contentList.tqfind( element ), beforeCursor );
++it;
}
setUnexecuteCursor( cursor );
@@ -220,20 +220,20 @@ void KFCAddToken::unexecute()
{
kdDebug( DEBUGID ) << k_funcinfo << endl;
FormulaCursor* cursor = getUnexecuteCursor();
- SequenceElement* parent = static_cast<SequenceElement*>(cursor->getElement()->getParent());
+ SequenceElement* tqparent = static_cast<SequenceElement*>(cursor->getElement()->getParent());
for ( int i = 0; i < tokenList.count(); i++ ) {
SequenceElement* current = static_cast<SequenceElement*>(cursor->getElement());
- QPtrList< BasicElement > list;
+ TQPtrList< BasicElement > list;
for ( uint i = 0; i < current->countChildren(); ++i ) {
cursor->remove( list, beforeCursor );
}
- if ( parent ) {
- int pos = parent->childPos( current );
- cursor->setTo( parent, pos + 1);
+ if ( tqparent ) {
+ int pos = tqparent->childPos( current );
+ cursor->setTo( tqparent, pos + 1);
cursor->remove( list, beforeCursor );
if ( pos > 0 ) {
- BasicElement* element = parent->getChild( pos - 1 );
+ BasicElement* element = tqparent->getChild( pos - 1 );
if (element)
element->moveEnd( cursor );
}
@@ -248,11 +248,11 @@ void KFCAddToken::unexecute()
void KFCAddToken::addToken( BasicElement* element )
{
tokenList.append( element );
- contentList.insert( element, new QPtrList< BasicElement > );
- contentList.find( element )->setAutoDelete( true );
+ contentList.insert( element, new TQPtrList< BasicElement > );
+ contentList.tqfind( element )->setAutoDelete( true );
}
-KFCReplaceToken::KFCReplaceToken(const QString &name, Container* document)
+KFCReplaceToken::KFCReplaceToken(const TQString &name, Container* document)
: KFCAddToken(name, document), removeSelection(0)
{
}
@@ -284,7 +284,7 @@ void KFCReplaceToken::unexecute()
}
-KFCSplitToken::KFCSplitToken(const QString &name, Container* document)
+KFCSplitToken::KFCSplitToken(const TQString &name, Container* document)
: KFCAddToken(name, document), removeSelection(0)
{
splitList.setAutoDelete( true );
@@ -306,15 +306,15 @@ void KFCSplitToken::execute()
removeSelection->execute();
}
splitCursor = cursor->getCursorData();
- SequenceElement* parent = static_cast<SequenceElement*>( cursor->getElement() );
- if ( parent ) {
- cursor->setMark( parent->countChildren() );
+ SequenceElement* tqparent = static_cast<SequenceElement*>( cursor->getElement() );
+ if ( tqparent ) {
+ cursor->setMark( tqparent->countChildren() );
cursor->setSelection( true );
}
cursor->remove( splitList, afterCursor );
TokenElement *token = new TokenElement();// TODO
addToken( token );
- QPtrListIterator< BasicElement > it ( splitList );
+ TQPtrListIterator< BasicElement > it ( splitList );
BasicElement* element;
while ( ( element = it.current() ) != 0 ) {
addContent( token, element );
@@ -322,8 +322,8 @@ void KFCSplitToken::execute()
}
KFCAddToken::execute();
cursor = getExecuteCursor();
- if ( parent ) {
- BasicElement* child = parent->getChild( cursor->getPos() );
+ if ( tqparent ) {
+ BasicElement* child = tqparent->getChild( cursor->getPos() );
if ( child ) {
child->moveEnd( cursor );
}
@@ -425,7 +425,7 @@ void KFCRemoveEnclosing::unexecute()
// ****** Add root, bracket etc command
-KFCAddReplacing::KFCAddReplacing(const QString &name, Container* document)
+KFCAddReplacing::KFCAddReplacing(const TQString &name, Container* document)
: Command(name, document), element(0)
{
}
@@ -496,7 +496,7 @@ void KFCAddIndex::unexecute()
}
-KFCChangeBaseSize::KFCChangeBaseSize( const QString& name, Container* document,
+KFCChangeBaseSize::KFCChangeBaseSize( const TQString& name, Container* document,
FormulaElement* formula, int size )
: PlainCommand( name ), m_document( document ), m_formula( formula ), m_size( size )
{
@@ -516,7 +516,7 @@ void KFCChangeBaseSize::unexecute()
}
-FontCommand::FontCommand( const QString& name, Container* document )
+FontCommand::FontCommand( const TQString& name, Container* document )
: Command( name, document )
{
list.setAutoDelete( false );
@@ -534,10 +534,10 @@ void FontCommand::collectChildren()
}
-void FontCommand::parseSequences( const QMap<SequenceElement*, int>& parents )
+void FontCommand::parseSequences( const TQMap<SequenceElement*, int>& tqparents )
{
- QValueList<SequenceElement*> sequences = parents.keys();
- for ( QValueList<SequenceElement*>::iterator i = sequences.begin();
+ TQValueList<SequenceElement*> sequences = tqparents.keys();
+ for ( TQValueList<SequenceElement*>::iterator i = sequences.begin();
i != sequences.end();
++i ) {
( *i )->parse();
@@ -545,7 +545,7 @@ void FontCommand::parseSequences( const QMap<SequenceElement*, int>& parents )
}
-CharStyleCommand::CharStyleCommand( CharStyle cs, const QString& name, Container* document )
+CharStyleCommand::CharStyleCommand( CharStyle cs, const TQString& name, Container* document )
: FontCommand( name, document ), charStyle( cs )
{
}
@@ -553,37 +553,37 @@ CharStyleCommand::CharStyleCommand( CharStyle cs, const QString& name, Container
void CharStyleCommand::execute()
{
collectChildren();
- QMap<SequenceElement*, int> parentCollector;
+ TQMap<SequenceElement*, int> tqparentCollector;
styleList.clear();
- uint count = childrenList().count();
+ uint count = tqchildrenList().count();
styleList.reserve( count );
for ( uint i=0; i<count; ++i ) {
- TextElement* child = childrenList().at( i );
+ TextElement* child = tqchildrenList().at( i );
styleList[i] = child->getCharStyle();
child->setCharStyle( charStyle );
- parentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1;
+ tqparentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1;
}
- parseSequences( parentCollector );
+ parseSequences( tqparentCollector );
testDirty();
}
void CharStyleCommand::unexecute()
{
- QMap<SequenceElement*, int> parentCollector;
- uint count = childrenList().count();
+ TQMap<SequenceElement*, int> tqparentCollector;
+ uint count = tqchildrenList().count();
//styleList.reserve( count );
for ( uint i=0; i<count; ++i ) {
- TextElement* child = childrenList().at( i );
+ TextElement* child = tqchildrenList().at( i );
child->setCharStyle( styleList[i] );
- parentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1;
+ tqparentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1;
}
- parseSequences( parentCollector );
+ parseSequences( tqparentCollector );
testDirty();
}
-CharFamilyCommand::CharFamilyCommand( CharFamily cf, const QString& name, Container* document )
+CharFamilyCommand::CharFamilyCommand( CharFamily cf, const TQString& name, Container* document )
: FontCommand( name, document ), charFamily( cf )
{
}
@@ -592,32 +592,32 @@ void CharFamilyCommand::execute()
{
collectChildren();
- QMap<SequenceElement*, int> parentCollector;
+ TQMap<SequenceElement*, int> tqparentCollector;
familyList.clear();
- uint count = childrenList().count();
+ uint count = tqchildrenList().count();
familyList.reserve( count );
for ( uint i=0; i<count; ++i ) {
- TextElement* child = childrenList().at( i );
+ TextElement* child = tqchildrenList().at( i );
familyList[i] = child->getCharFamily();
child->setCharFamily( charFamily );
- parentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1;
+ tqparentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1;
}
- parseSequences( parentCollector );
+ parseSequences( tqparentCollector );
testDirty();
}
void CharFamilyCommand::unexecute()
{
- QMap<SequenceElement*, int> parentCollector;
- uint count = childrenList().count();
+ TQMap<SequenceElement*, int> tqparentCollector;
+ uint count = tqchildrenList().count();
//familyList.reserve( count );
for ( uint i=0; i<count; ++i ) {
- TextElement* child = childrenList().at( i );
+ TextElement* child = tqchildrenList().at( i );
child->setCharFamily( familyList[i] );
- parentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1;
+ tqparentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1;
}
- parseSequences( parentCollector );
+ parseSequences( tqparentCollector );
testDirty();
}