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/formulaelement.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/formulaelement.cc')
-rw-r--r-- | lib/kformula/formulaelement.cc | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/lib/kformula/formulaelement.cc b/lib/kformula/formulaelement.cc index 39349fd1..84944150 100644 --- a/lib/kformula/formulaelement.cc +++ b/lib/kformula/formulaelement.cc @@ -19,7 +19,7 @@ */ #include <iostream> -#include <qpainter.h> +#include <tqpainter.h> #include <kdebug.h> @@ -101,7 +101,7 @@ void FormulaElement::moveOutAbove( FormulaCursor* cursor ) document->moveOutAbove( cursor ); } -void FormulaElement::tell( const QString& msg ) +void FormulaElement::tell( const TQString& msg ) { document->tell( msg ); } @@ -125,14 +125,14 @@ void FormulaElement::calcSizes( const ContextStyle& context, } -void FormulaElement::draw( QPainter& painter, const LuPixelRect& r, +void FormulaElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - inherited::draw( painter, r, context, tstyle, istyle, style, parentOrigin ); + inherited::draw( painter, r, context, tstyle, istyle, style, tqparentOrigin ); } @@ -155,7 +155,7 @@ void FormulaElement::calcSizes( ContextStyle& context ) /** * Draws the whole thing. */ -void FormulaElement::draw( QPainter& painter, const LuPixelRect& r, +void FormulaElement::draw( TQPainter& painter, const LuPixelRect& r, ContextStyle& context ) { //kdDebug( DEBUGID ) << "FormulaElement::draw" << endl; @@ -187,9 +187,9 @@ const SymbolTable& FormulaElement::getSymbolTable() const } -QDomElement FormulaElement::emptyFormulaElement( QDomDocument& doc ) +TQDomElement FormulaElement::emptyFormulaElement( TQDomDocument& doc ) { - QDomElement element = doc.createElement( getTagName() ); + TQDomElement element = doc.createElement( getTagName() ); /* element.setAttribute( "VERSION", "6" ); if ( ownBaseSize ) { @@ -199,17 +199,17 @@ QDomElement FormulaElement::emptyFormulaElement( QDomDocument& doc ) return element; } -KCommand* FormulaElement::input( Container* container, QKeyEvent* event ) +KCommand* FormulaElement::input( Container* container, TQKeyEvent* event ) { - QChar ch = event->text().at( 0 ); + TQChar ch = event->text().at( 0 ); if ( !ch.isPrint() ) { int action = event->key(); //int state = event->state(); //MoveFlag flag = movementFlag(state); switch ( action ) { - case Qt::Key_Return: - case Qt::Key_Enter: { + case TQt::Key_Return: + case TQt::Key_Enter: { FormulaCursor* cursor = container->activeCursor(); insertFormula( cursor ); return 0; @@ -222,7 +222,7 @@ KCommand* FormulaElement::input( Container* container, QKeyEvent* event ) /** * Appends our attributes to the dom element. */ -void FormulaElement::writeDom(QDomElement element) +void FormulaElement::writeDom(TQDomElement element) { inherited::writeDom(element); element.setAttribute( "VERSION", "6" ); @@ -235,13 +235,13 @@ void FormulaElement::writeDom(QDomElement element) * Reads our attributes from the element. * Returns false if it failed. */ -bool FormulaElement::readAttributesFromDom(QDomElement element) +bool FormulaElement::readAttributesFromDom(TQDomElement element) { if (!inherited::readAttributesFromDom(element)) { return false; } int version = -1; - QString versionStr = element.attribute( "VERSION" ); + TQString versionStr = element.attribute( "VERSION" ); if ( !versionStr.isNull() ) { version = versionStr.toInt(); } @@ -252,7 +252,7 @@ bool FormulaElement::readAttributesFromDom(QDomElement element) convertNames( element ); } } - QString baseSizeStr = element.attribute( "BASESIZE" ); + TQString baseSizeStr = element.attribute( "BASESIZE" ); if ( !baseSizeStr.isNull() ) { ownBaseSize = true; baseSize = baseSizeStr.toInt(); @@ -268,26 +268,26 @@ bool FormulaElement::readAttributesFromDom(QDomElement element) * that needs to be read. * Returns false if it failed. */ -bool FormulaElement::readContentFromDom(QDomNode& node) +bool FormulaElement::readContentFromDom(TQDomNode& node) { return inherited::readContentFromDom(node); } -void FormulaElement::convertNames( QDomNode node ) +void FormulaElement::convertNames( TQDomNode node ) { if ( node.isElement() && ( node.nodeName().upper() == "TEXT" ) ) { - QDomNamedNodeMap attr = node.attributes(); - QDomAttr ch = attr.namedItem( "CHAR" ).toAttr(); + TQDomNamedNodeMap attr = node.attributes(); + TQDomAttr ch = attr.namedItem( "CHAR" ).toAttr(); if ( ch.value() == "\\" ) { - QDomNode sequence = node.parentNode(); - QDomDocument doc = sequence.ownerDocument(); - QDomElement nameseq = doc.createElement( "NAMESEQUENCE" ); - sequence.replaceChild( nameseq, node ); + TQDomNode sequence = node.tqparentNode(); + TQDomDocument doc = sequence.ownerDocument(); + TQDomElement nameseq = doc.createElement( "NAMESEQUENCE" ); + sequence.tqreplaceChild( nameseq, node ); bool inName = true; while ( inName ) { inName = false; - QDomNode n = nameseq.nextSibling(); + TQDomNode n = nameseq.nextSibling(); if ( n.isElement() && ( n.nodeName().upper() == "TEXT" ) ) { attr = n.attributes(); ch = attr.namedItem( "CHAR" ).toAttr(); @@ -300,7 +300,7 @@ void FormulaElement::convertNames( QDomNode node ) } } if ( node.hasChildNodes() ) { - QDomNode n = node.firstChild(); + TQDomNode n = node.firstChild(); while ( !n.isNull() ) { convertNames( n ); n = n.nextSibling(); @@ -308,23 +308,23 @@ void FormulaElement::convertNames( QDomNode node ) } } -QString FormulaElement::toLatex() +TQString FormulaElement::toLatex() { return inherited::toLatex(); //Consider $$ sorround } -void FormulaElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat ) const +void FormulaElement::writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat ) const { - QDomElement de; + TQDomElement de; if ( !oasisFormat ) { de = doc.createElementNS( "http://www.w3.org/1998/Math/MathML", "math" ); - parent.appendChild( de ); + tqparent.appendChild( de ); } else { - QDomElement element = doc.createElement( "math:semantics" ); + TQDomElement element = doc.createElement( "math:semantics" ); de = doc.createElement( "math:mrow" ); - parent.appendChild( element ); + tqparent.appendChild( element ); element.appendChild( de ); } for ( uint i = 0; i < countChildren(); ++i ) { |