diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kformula/formulacursor.cc | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-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/kformula/formulacursor.cc')
-rw-r--r-- | lib/kformula/formulacursor.cc | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/lib/kformula/formulacursor.cc b/lib/kformula/formulacursor.cc index 83b46e45..6545b18c 100644 --- a/lib/kformula/formulacursor.cc +++ b/lib/kformula/formulacursor.cc @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qpainter.h> +#include <tqpainter.h> #include <kdebug.h> #include <assert.h> @@ -79,7 +79,7 @@ void FormulaCursor::calcCursorSize( const ContextStyle& context, bool smallCurso } } -void FormulaCursor::draw( QPainter& painter, const ContextStyle& context, +void FormulaCursor::draw( TQPainter& painter, const ContextStyle& context, StyleAttributes& style, bool smallCursor, bool activeCursor ) { //if (readOnly && !isSelection()) @@ -296,26 +296,26 @@ void FormulaCursor::normalize(Direction direction) */ void FormulaCursor::insert(BasicElement* child, Direction direction) { - QPtrList<BasicElement> list; + TQPtrList<BasicElement> list; list.append(child); insert(list, direction); } -void FormulaCursor::insert(QPtrList<BasicElement>& children, +void FormulaCursor::insert(TQPtrList<BasicElement>& tqchildren, Direction direction) { assert( !isReadOnly() ); BasicElement* element = getElement(); - element->insert(this, children, direction); + element->insert(this, tqchildren, direction); } /** - * Removes the current selected children and returns them. + * Removes the current selected tqchildren and returns them. * The cursor needs to be normal (that is be inside a SequenceElement) * for this to have any effect. */ -void FormulaCursor::remove(QPtrList<BasicElement>& children, +void FormulaCursor::remove(TQPtrList<BasicElement>& tqchildren, Direction direction) { assert( !isReadOnly() ); @@ -325,15 +325,15 @@ void FormulaCursor::remove(QPtrList<BasicElement>& children, // If there is no child to remove in the sequence // remove the sequence instead. if (sequence->countChildren() == 0) { - BasicElement* parent = sequence->getParent(); - if (parent != 0) { - parent->selectChild(this, sequence); - parent->remove(this, children, direction); + BasicElement* tqparent = sequence->getParent(); + if (tqparent != 0) { + tqparent->selectChild(this, sequence); + tqparent->remove(this, tqchildren, direction); return; } } else { - sequence->remove(this, children, direction); + sequence->remove(this, tqchildren, direction); } } } @@ -347,7 +347,7 @@ void FormulaCursor::replaceSelectionWith(BasicElement* element, Direction direction) { assert( !isReadOnly() ); - QPtrList<BasicElement> list; + TQPtrList<BasicElement> list; // we suppres deletion here to get an error if something // was left in the list. //list.setAutoDelete(true); @@ -363,12 +363,12 @@ void FormulaCursor::replaceSelectionWith(BasicElement* element, mainChild->goInside(this); insert(list); /* - BasicElement* parent = element->getParent(); + BasicElement* tqparent = element->getParent(); if (direction == beforeCursor) { - parent->moveRight(this, element); + tqparent->moveRight(this, element); } else { - parent->moveLeft(this, element); + tqparent->moveLeft(this, element); } */ element->selectChild(this, mainChild); @@ -383,18 +383,18 @@ void FormulaCursor::replaceSelectionWith(BasicElement* element, BasicElement* FormulaCursor::replaceByMainChildContent(Direction direction) { assert( !isReadOnly() ); - QPtrList<BasicElement> childrenList; - QPtrList<BasicElement> list; + TQPtrList<BasicElement> tqchildrenList; + TQPtrList<BasicElement> list; BasicElement* element = getElement(); SequenceElement* mainChild = element->getMainChild(); if ((mainChild != 0) && (mainChild->countChildren() > 0)) { mainChild->selectAllChildren(this); - remove(childrenList); + remove(tqchildrenList); } element->getParent()->selectChild(this, element); setSelection(false); remove(list); - insert(childrenList, direction); + insert(tqchildrenList, direction); if (list.count() > 0) { return list.take(0); } @@ -403,7 +403,7 @@ BasicElement* FormulaCursor::replaceByMainChildContent(Direction direction) /** - * Trys to find the element we are the main child of and replace + * Trys to find the element we are the main child of and tqreplace * it with our content. * * This is simply another form of replaceByMainChildContent. You @@ -412,10 +412,10 @@ BasicElement* FormulaCursor::replaceByMainChildContent(Direction direction) BasicElement* FormulaCursor::removeEnclosingElement(Direction direction) { assert( !isReadOnly() ); - BasicElement* parent = getElement()->getParent(); - if (parent != 0) { - if (getElement() == parent->getMainChild()) { - parent->selectChild(this, getElement()); + BasicElement* tqparent = getElement()->getParent(); + if (tqparent != 0) { + if (getElement() == tqparent->getMainChild()) { + tqparent->selectChild(this, getElement()); return replaceByMainChildContent(direction); } } @@ -582,7 +582,7 @@ MatrixElement* FormulaCursor::getActiveMatrixElement() } /** - * The element is going to leave the formula with and all its children. + * The element is going to leave the formula with and all its tqchildren. */ void FormulaCursor::elementWillVanish(BasicElement* element) { @@ -636,15 +636,15 @@ bool FormulaCursor::isReadOnly() const /** * Stores the currently selected elements inside a dom. */ -void FormulaCursor::copy( QDomDocument& doc ) +void FormulaCursor::copy( TQDomDocument& doc ) { if (isSelection()) { SequenceElement* sequence = normal(); if (sequence != 0) { - QDomElement root = doc.createElementNS( "http://www.w3.org/1998/Math/MathML", + TQDomElement root = doc.createElementNS( "http://www.w3.org/1998/Math/MathML", "math" ); doc.appendChild( root ); - QDomElement de = doc.createElement( "mrow" ); + TQDomElement de = doc.createElement( "mrow" ); root.appendChild( de ); sequence->getChildrenMathMLDom(doc, de, getSelectionStart(), getSelectionEnd()); } @@ -659,12 +659,12 @@ void FormulaCursor::copy( QDomDocument& doc ) * Inserts the elements that could be read from the dom into * the list. Returns true on success. */ -bool FormulaCursor::buildElementsFromDom( QDomElement root, QPtrList<BasicElement>& list ) +bool FormulaCursor::buildElementsFromDom( TQDomElement root, TQPtrList<BasicElement>& list ) { assert( !isReadOnly() ); SequenceElement* sequence = normal(); if (sequence != 0) { - QDomElement e = root.firstChild().toElement(); + TQDomElement e = root.firstChild().toElement(); if (sequence->buildChildrenFromDom(list, e.firstChild())) { return true; } @@ -676,12 +676,12 @@ bool FormulaCursor::buildElementsFromDom( QDomElement root, QPtrList<BasicElemen * Inserts the elements that could be read from the MathML dom into * the list. Returns true on success. */ -bool FormulaCursor::buildElementsFromMathMLDom( QDomElement root, QPtrList<BasicElement>& list ) +bool FormulaCursor::buildElementsFromMathMLDom( TQDomElement root, TQPtrList<BasicElement>& list ) { assert( !isReadOnly() ); SequenceElement* sequence = normal(); if (sequence != 0) { - QDomElement e = root.firstChild().toElement(); + TQDomElement e = root.firstChild().toElement(); if (sequence->buildChildrenFromMathMLDom(list, e.firstChild())) { return true; } |