diff options
Diffstat (limited to 'lib/kformula/rootelement.cc')
| -rw-r--r-- | lib/kformula/rootelement.cc | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/lib/kformula/rootelement.cc b/lib/kformula/rootelement.cc index 08a738f2d..098d069f1 100644 --- a/lib/kformula/rootelement.cc +++ b/lib/kformula/rootelement.cc @@ -18,8 +18,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qpainter.h> -#include <qpen.h> +#include <tqpainter.h> +#include <tqpen.h> #include <kdebug.h> #include <klocale.h> @@ -38,7 +38,7 @@ class RootSequenceElement : public SequenceElement { typedef SequenceElement inherited; public: - RootSequenceElement( BasicElement* parent = 0 ) : SequenceElement( parent ) {} + RootSequenceElement( BasicElement* tqparent = 0 ) : SequenceElement( tqparent ) {} virtual RootSequenceElement* clone() { return new RootSequenceElement( *this ); } @@ -92,8 +92,8 @@ KCommand* RootSequenceElement::buildCommand( Container* container, Request* requ } -RootElement::RootElement(BasicElement* parent) - : BasicElement(parent) +RootElement::RootElement(BasicElement* tqparent) + : BasicElement(tqparent) { content = new RootSequenceElement( this ); index = 0; @@ -138,12 +138,12 @@ void RootElement::entered( SequenceElement* child ) BasicElement* RootElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); if (e != 0) { - LuPixelPoint myPos(parentOrigin.x() + getX(), - parentOrigin.y() + getY()); + LuPixelPoint myPos(tqparentOrigin.x() + getX(), + tqparentOrigin.y() + getY()); e = content->goToPos(cursor, handled, point, myPos); if (e != 0) { @@ -176,7 +176,7 @@ BasicElement* RootElement::goToPos( FormulaCursor* cursor, bool& handled, /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void RootElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -234,18 +234,18 @@ void RootElement::calcSizes( const ContextStyle& context, } /** - * Draws the whole element including its children. - * The `parentOrigin' is the point this element's parent starts. - * We can use our parentPosition to get our own origin then. + * Draws the whole element including its tqchildren. + * The `tqparentOrigin' is the point this element's tqparent starts. + * We can use our tqparentPosition to get our own origin then. */ -void RootElement::draw( QPainter& painter, const LuPixelRect& r, +void RootElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& parentOrigin ) + const LuPixelPoint& tqparentOrigin ) { - LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); + LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -264,28 +264,28 @@ void RootElement::draw( QPainter& painter, const LuPixelRect& r, luPixel distY = context.ptToPixelY( context.getThinSpace( tstyle, factor ) ); luPixel unit = (content->getHeight() + distY)/ 3; - painter.setPen( QPen( style.color(), - context.layoutUnitToPixelX( 2*context.getLineWidth( factor ) ) ) ); - painter.drawLine( context.layoutUnitToPixelX( x+unit/3 ), - context.layoutUnitToPixelY( y+unit+distY/3 ), - context.layoutUnitToPixelX( x+unit/2+unit/3 ), - context.layoutUnitToPixelY( myPos.y()+getHeight() ) ); - - painter.setPen( QPen( style.color(), - context.layoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); - - painter.drawLine( context.layoutUnitToPixelX( x+unit+unit/3 ), - context.layoutUnitToPixelY( y+distY/3 ), - context.layoutUnitToPixelX( x+unit/2+unit/3 ), - context.layoutUnitToPixelY( myPos.y()+getHeight() ) ); - painter.drawLine( context.layoutUnitToPixelX( x+unit+unit/3 ), - context.layoutUnitToPixelY( y+distY/3 ), - context.layoutUnitToPixelX( x+unit+unit/3+content->getWidth() ), - context.layoutUnitToPixelY( y+distY/3 ) ); - painter.drawLine( context.layoutUnitToPixelX( x+unit/3 ), - context.layoutUnitToPixelY( y+unit+distY/2 ), - context.layoutUnitToPixelX( x ), - context.layoutUnitToPixelY( y+unit+unit/2 ) ); + painter.setPen( TQPen( style.color(), + context.tqlayoutUnitToPixelX( 2*context.getLineWidth( factor ) ) ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( x+unit/3 ), + context.tqlayoutUnitToPixelY( y+unit+distY/3 ), + context.tqlayoutUnitToPixelX( x+unit/2+unit/3 ), + context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ) ); + + painter.setPen( TQPen( style.color(), + context.tqlayoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); + + painter.drawLine( context.tqlayoutUnitToPixelX( x+unit+unit/3 ), + context.tqlayoutUnitToPixelY( y+distY/3 ), + context.tqlayoutUnitToPixelX( x+unit/2+unit/3 ), + context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( x+unit+unit/3 ), + context.tqlayoutUnitToPixelY( y+distY/3 ), + context.tqlayoutUnitToPixelX( x+unit+unit/3+content->getWidth() ), + context.tqlayoutUnitToPixelY( y+distY/3 ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( x+unit/3 ), + context.tqlayoutUnitToPixelY( y+unit+distY/2 ), + context.tqlayoutUnitToPixelX( x ), + context.tqlayoutUnitToPixelY( y+unit+unit/2 ) ); } @@ -415,7 +415,7 @@ void RootElement::moveDown(FormulaCursor* cursor, BasicElement* from) * Reinserts the index if it has been removed. */ void RootElement::insert(FormulaCursor* cursor, - QPtrList<BasicElement>& newChildren, + TQPtrList<BasicElement>& newChildren, Direction direction) { if (cursor->getPos() == upperLeftPos) { @@ -434,13 +434,13 @@ void RootElement::insert(FormulaCursor* cursor, } /** - * Removes all selected children and returns them. Places the - * cursor to where the children have been. + * Removes all selected tqchildren and returns them. Places the + * cursor to where the tqchildren have been. * * We remove ourselve if we are requested to remove our content. */ void RootElement::remove(FormulaCursor* cursor, - QPtrList<BasicElement>& removedChildren, + TQPtrList<BasicElement>& removedChildren, Direction direction) { switch (cursor->getPos()) { @@ -476,7 +476,7 @@ void RootElement::normalize(FormulaCursor* cursor, Direction direction) // main child // -// If an element has children one has to become the main one. +// If an element has tqchildren one has to become the main one. SequenceElement* RootElement::getMainChild() { @@ -528,18 +528,18 @@ void RootElement::setToIndex(FormulaCursor* cursor) /** * Appends our attributes to the dom element. */ -void RootElement::writeDom(QDomElement element) +void RootElement::writeDom(TQDomElement element) { BasicElement::writeDom(element); - QDomDocument doc = element.ownerDocument(); + TQDomDocument doc = element.ownerDocument(); - QDomElement con = doc.createElement("CONTENT"); + TQDomElement con = doc.createElement("CONTENT"); con.appendChild(content->getElementDom(doc)); element.appendChild(con); if(hasIndex()) { - QDomElement ind = doc.createElement("ROOTINDEX"); + TQDomElement ind = doc.createElement("ROOTINDEX"); ind.appendChild(index->getElementDom(doc)); element.appendChild(ind); } @@ -549,7 +549,7 @@ void RootElement::writeDom(QDomElement element) * Reads our attributes from the element. * Returns false if it failed. */ -bool RootElement::readAttributesFromDom(QDomElement element) +bool RootElement::readAttributesFromDom(TQDomElement element) { return BasicElement::readAttributesFromDom(element); } @@ -559,7 +559,7 @@ bool RootElement::readAttributesFromDom(QDomElement element) * that needs to be read. * Returns false if it failed. */ -bool RootElement::readContentFromDom(QDomNode& node) +bool RootElement::readContentFromDom(TQDomNode& node) { if (!BasicElement::readContentFromDom(node)) { return false; @@ -592,7 +592,7 @@ bool RootElement::readContentFromDom(QDomNode& node) * Also checks whether it's a msqrt or mroot. * Returns false if it failed. */ -bool RootElement::readAttributesFromMathMLDom(const QDomElement& element) +bool RootElement::readAttributesFromMathMLDom(const TQDomElement& element) { if ( element.tagName().lower() == "mroot" ) square = false; @@ -607,7 +607,7 @@ bool RootElement::readAttributesFromMathMLDom(const QDomElement& element) * that needs to be read. * Returns false if it failed. */ -int RootElement::readContentFromMathMLDom(QDomNode& node) +int RootElement::readContentFromMathMLDom(TQDomNode& node) { if ( BasicElement::readContentFromMathMLDom( node ) == -1 ) { return -1; @@ -644,9 +644,9 @@ int RootElement::readContentFromMathMLDom(QDomNode& node) return 1; } -QString RootElement::toLatex() +TQString RootElement::toLatex() { - QString root; + TQString root; root="\\sqrt"; if(hasIndex()) { root+="["; @@ -660,7 +660,7 @@ QString RootElement::toLatex() return root; } -QString RootElement::formulaString() +TQString RootElement::formulaString() { if ( hasIndex() ) { return "(" + content->formulaString() + ")**(1.0/(" + index->formulaString() + "))"; @@ -668,7 +668,7 @@ QString RootElement::formulaString() return "sqrt(" + content->formulaString() + ")"; } -void RootElement::writeMathMLContent( QDomDocument& doc, QDomElement& element, bool oasisFormat ) const +void RootElement::writeMathMLContent( TQDomDocument& doc, TQDomElement& element, bool oasisFormat ) const { content->writeMathML( doc, element, oasisFormat ); if( hasIndex() ) |
