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/basicelement.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/basicelement.cc')
-rw-r--r-- | lib/kformula/basicelement.cc | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/lib/kformula/basicelement.cc b/lib/kformula/basicelement.cc index 82913cec..bbe6f453 100644 --- a/lib/kformula/basicelement.cc +++ b/lib/kformula/basicelement.cc @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qstring.h> +#include <tqstring.h> #include <kdebug.h> #include "contextstyle.h" @@ -34,7 +34,7 @@ using namespace std; int BasicElement::evilDestructionCount = 0; BasicElement::BasicElement( BasicElement* p ) - : parent( p ), m_baseline( 0 ), elementType( 0 ) + : tqparent( p ), m_baseline( 0 ), elementType( 0 ) { setX( 0 ); setY( 0 ); @@ -49,7 +49,7 @@ BasicElement::~BasicElement() } BasicElement::BasicElement( const BasicElement& other ) - : parent( 0 ), + : tqparent( 0 ), m_baseline( other.m_baseline ), elementType( other.elementType ) { @@ -63,14 +63,14 @@ BasicElement::BasicElement( const BasicElement& other ) bool BasicElement::readOnly( const BasicElement* /*child*/ ) const { - return parent->readOnly( this ); + return tqparent->readOnly( this ); } FormulaElement* BasicElement::formula() { - //if ( parent != 0 ) { - return parent->formula(); + //if ( tqparent != 0 ) { + return tqparent->formula(); //} //return 0; } @@ -80,11 +80,11 @@ FormulaElement* BasicElement::formula() * Returns the element the point is in. */ BasicElement* BasicElement::goToPos( FormulaCursor*, bool&, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - luPixel x = point.x() - (parentOrigin.x() + getX()); + luPixel x = point.x() - (tqparentOrigin.x() + getX()); if ((x >= 0) && (x < getWidth())) { - luPixel y = point.y() - (parentOrigin.y() + getY()); + luPixel y = point.y() - (tqparentOrigin.y() + getY()); if ((y >= 0) && (y < getHeight())) { return this; } @@ -99,7 +99,7 @@ LuPixelPoint BasicElement::widgetPos() { luPixel x = 0; luPixel y = 0; - for (BasicElement* element = this; element != 0; element = element->parent) { + for (BasicElement* element = this; element != 0; element = element->tqparent) { x += element->getX(); y += element->getY(); } @@ -166,23 +166,23 @@ void BasicElement::normalize(FormulaCursor* cursor, Direction direction) } -QDomElement BasicElement::getElementDom( QDomDocument& doc) +TQDomElement BasicElement::getElementDom( TQDomDocument& doc) { - QDomElement de = doc.createElement(getTagName()); + TQDomElement de = doc.createElement(getTagName()); writeDom(de); return de; } -void BasicElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat ) const +void BasicElement::writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat ) const { - QDomElement de = doc.createElement( oasisFormat ? "math:" + getElementName() : getElementName() ); + TQDomElement de = doc.createElement( oasisFormat ? "math:" + getElementName() : getElementName() ); writeMathMLAttributes( de ); writeMathMLContent( doc, de, oasisFormat ); - parent.appendChild( de ); + tqparent.appendChild( de ); } -bool BasicElement::buildFromDom(QDomElement element) +bool BasicElement::buildFromDom(TQDomElement element) { if (element.tagName() != getTagName()) { kdWarning( DEBUGID ) << "Wrong tag name " << element.tagName().latin1() << " for " << getTagName().latin1() << ".\n"; @@ -191,11 +191,11 @@ bool BasicElement::buildFromDom(QDomElement element) if (!readAttributesFromDom(element)) { return false; } - QDomNode node = element.firstChild(); + TQDomNode node = element.firstChild(); return readContentFromDom(node); } -int BasicElement::buildFromMathMLDom(QDomElement element) +int BasicElement::buildFromMathMLDom(TQDomElement element) {/* if (element.tagName() != getTagName()) { kdWarning( DEBUGID ) << "Wrong tag name " << element.tagName().latin1() << " for " << getTagName().latin1() << ".\n"; @@ -204,14 +204,14 @@ int BasicElement::buildFromMathMLDom(QDomElement element) if (!readAttributesFromMathMLDom(element)) { return -1; } - QDomNode node = element.firstChild(); + TQDomNode node = element.firstChild(); return readContentFromMathMLDom(node); } /** * Appends our attributes to the dom element. */ -void BasicElement::writeDom(QDomElement) +void BasicElement::writeDom(TQDomElement) { } @@ -219,7 +219,7 @@ void BasicElement::writeDom(QDomElement) * Reads our attributes from the element. * Returns false if it failed. */ -bool BasicElement::readAttributesFromDom(QDomElement) +bool BasicElement::readAttributesFromDom(TQDomElement) { return true; } @@ -229,7 +229,7 @@ bool BasicElement::readAttributesFromDom(QDomElement) * that needs to be read. * Returns false if it failed. */ -bool BasicElement::readContentFromDom(QDomNode&) +bool BasicElement::readContentFromDom(TQDomNode&) { return true; } @@ -238,14 +238,14 @@ bool BasicElement::readContentFromDom(QDomNode&) * Returns a SequenceElement constructed from the nodes first child * if the nodes name matches the given name. */ -bool BasicElement::buildChild( SequenceElement* child, QDomNode node, QString name ) +bool BasicElement::buildChild( SequenceElement* child, TQDomNode node, TQString name ) { if (node.isElement()) { - QDomElement e = node.toElement(); + TQDomElement e = node.toElement(); if (e.tagName().upper() == name) { - QDomNode nodeInner = e.firstChild(); + TQDomNode nodeInner = e.firstChild(); if (nodeInner.isElement()) { - QDomElement element = nodeInner.toElement(); + TQDomElement element = nodeInner.toElement(); return child->buildFromDom( element ); } } @@ -257,7 +257,7 @@ bool BasicElement::buildChild( SequenceElement* child, QDomNode node, QString na * Reads our attributes from the MathML element. * Returns false if it failed. */ -bool BasicElement::readAttributesFromMathMLDom(const QDomElement& ) +bool BasicElement::readAttributesFromMathMLDom(const TQDomElement& ) { return true; } @@ -267,12 +267,12 @@ bool BasicElement::readAttributesFromMathMLDom(const QDomElement& ) * that needs to be read. * Returns false if it failed. */ -int BasicElement::readContentFromMathMLDom(QDomNode&) +int BasicElement::readContentFromMathMLDom(TQDomNode&) { return 1; } -QString BasicElement::toLatex() +TQString BasicElement::toLatex() { return "{}"; } @@ -287,41 +287,41 @@ QString BasicElement::toLatex() * @param st size type container. It will be properly assigned to its size * type or NoSize if str is invalid */ -double BasicElement::getSize( const QString& str, SizeType* st ) +double BasicElement::getSize( const TQString& str, SizeType* st ) { - int index = str.find( "%" ); + int index = str.tqfind( "%" ); if ( index != -1 ) { return str2size( str, st, index, RelativeSize ) / 100.0; } - index = str.find( "pt", 0, false ); + index = str.tqfind( "pt", 0, false ); if ( index != -1 ) { return str2size( str, st, index, AbsoluteSize ); } - index = str.find( "mm", 0, false ); + index = str.tqfind( "mm", 0, false ); if ( index != -1 ) { return str2size( str, st, index, AbsoluteSize ) * 72.0 / 20.54; } - index = str.find( "cm", 0, false ); + index = str.tqfind( "cm", 0, false ); if ( index != -1 ) { return str2size( str, st, index, AbsoluteSize ) * 72.0 / 2.54; } - index = str.find( "in", 0, false ); + index = str.tqfind( "in", 0, false ); if ( index != -1 ) { return str2size( str, st, index, AbsoluteSize ) * 72.0; } - index = str.find( "em", 0, false ); + index = str.tqfind( "em", 0, false ); if ( index != -1 ) { return str2size( str, st, index, RelativeSize ); } - index = str.find( "ex", 0, false ); + index = str.tqfind( "ex", 0, false ); if ( index != -1 ) { return str2size( str, st, index, RelativeSize ); } - index = str.find( "pc", 0, false ); + index = str.tqfind( "pc", 0, false ); if ( index != -1 ) { return str2size( str, st, index, AbsoluteSize ) * 12.0; } - index = str.find( "px", 0, false ); + index = str.tqfind( "px", 0, false ); if ( index != -1 ) { return str2size( str, st, index, PixelSize ); } @@ -329,7 +329,7 @@ double BasicElement::getSize( const QString& str, SizeType* st ) return str2size( str, st, str.length(),AbsoluteSize ); } -SizeType BasicElement::getSpace( const QString& str ) +SizeType BasicElement::getSpace( const TQString& str ) { if ( str == "negativeveryverythinmathspace" ) { return NegativeVeryVeryThinMathSpace; @@ -380,9 +380,9 @@ SizeType BasicElement::getSpace( const QString& str ) /** * Used internally by getSize() */ -double BasicElement::str2size( const QString& str, SizeType *st, uint index, SizeType type ) +double BasicElement::str2size( const TQString& str, SizeType *st, uint index, SizeType type ) { - QString num = str.left( index ); + TQString num = str.left( index ); bool ok; double size = num.toDouble( &ok ); if ( ok ) { |