summaryrefslogtreecommitdiffstats
path: root/lib/kformula/bracketelement.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kformula/bracketelement.cc')
-rw-r--r--lib/kformula/bracketelement.cc266
1 files changed, 133 insertions, 133 deletions
diff --git a/lib/kformula/bracketelement.cc b/lib/kformula/bracketelement.cc
index 2e00af12..d95eac78 100644
--- a/lib/kformula/bracketelement.cc
+++ b/lib/kformula/bracketelement.cc
@@ -18,10 +18,10 @@
* Boston, MA 02110-1301, USA.
*/
-#include <qptrlist.h>
-#include <qpainter.h>
-#include <qpen.h>
-#include <qpointarray.h>
+#include <tqptrlist.h>
+#include <tqpainter.h>
+#include <tqpen.h>
+#include <tqpointarray.h>
#include <kdebug.h>
#include <klocale.h>
@@ -35,8 +35,8 @@
KFORMULA_NAMESPACE_BEGIN
-SingleContentElement::SingleContentElement(BasicElement* parent )
- : BasicElement( parent )
+SingleContentElement::SingleContentElement(BasicElement* tqparent )
+ : BasicElement( tqparent )
{
content = new SequenceElement( this );
}
@@ -56,10 +56,10 @@ SingleContentElement::~SingleContentElement()
}
-QChar SingleContentElement::getCharacter() const
+TQChar SingleContentElement::getCharacter() const
{
// This is meant to make the SingleContentElement text only.
- // This "fixes" the parenthesis problem (parenthesis too large).
+ // This "fixes" the tqparenthesis problem (tqparenthesis too large).
// I'm not sure if we really want this. There should be better ways.
if ( content->isTextOnly() ) {
return '\\';
@@ -68,12 +68,12 @@ QChar SingleContentElement::getCharacter() const
}
BasicElement* SingleContentElement::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) {
@@ -132,14 +132,14 @@ void SingleContentElement::moveDown(FormulaCursor* cursor, BasicElement* /*from*
}
void SingleContentElement::remove( FormulaCursor* cursor,
- QPtrList<BasicElement>& removedChildren,
+ TQPtrList<BasicElement>& removedChildren,
Direction direction )
{
switch (cursor->getPos()) {
case contentPos:
- BasicElement* parent = getParent();
- parent->selectChild(cursor, this);
- parent->remove(cursor, removedChildren, direction);
+ BasicElement* tqparent = getParent();
+ tqparent->selectChild(cursor, this);
+ tqparent->remove(cursor, removedChildren, direction);
}
}
@@ -165,18 +165,18 @@ void SingleContentElement::selectChild(FormulaCursor* cursor, BasicElement* chil
}
}
-void SingleContentElement::writeDom(QDomElement element)
+void SingleContentElement::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);
}
-bool SingleContentElement::readContentFromDom(QDomNode& node)
+bool SingleContentElement::readContentFromDom(TQDomNode& node)
{
if (!BasicElement::readContentFromDom(node)) {
return false;
@@ -191,7 +191,7 @@ bool SingleContentElement::readContentFromDom(QDomNode& node)
return true;
}
-int SingleContentElement::readContentFromMathMLDom( QDomNode& node )
+int SingleContentElement::readContentFromMathMLDom( TQDomNode& node )
{
if ( BasicElement::readContentFromMathMLDom( node ) == -1 ) {
return -1;
@@ -206,15 +206,15 @@ int SingleContentElement::readContentFromMathMLDom( QDomNode& node )
return nodeCounter;
}
-void SingleContentElement::writeMathMLContent( QDomDocument& doc, QDomElement& element, bool oasisFormat ) const
+void SingleContentElement::writeMathMLContent( TQDomDocument& doc, TQDomElement& element, bool oasisFormat ) const
{
content->writeMathML( doc, element, oasisFormat );
}
-BracketElement::BracketElement(SymbolType l, SymbolType r, BasicElement* parent)
- : SingleContentElement(parent),
+BracketElement::BracketElement(SymbolType l, SymbolType r, BasicElement* tqparent)
+ : SingleContentElement(tqparent),
left( 0 ), right( 0 ),
leftType( l ), rightType( r ),
m_operator( false ), m_customLeft( false ), m_customRight( false )
@@ -252,12 +252,12 @@ void BracketElement::entered( SequenceElement* /*child*/ )
BasicElement* BracketElement::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 = getContent()->goToPos(cursor, handled, point, myPos);
if (e != 0) {
return e;
@@ -281,7 +281,7 @@ BasicElement* BracketElement::goToPos( FormulaCursor* cursor, bool& handled,
/**
* Calculates our width and height and
- * our children's parentPosition.
+ * our tqchildren's tqparentPosition.
*/
void BracketElement::calcSizes( const ContextStyle& context,
ContextStyle::TextStyle tstyle,
@@ -303,28 +303,28 @@ void BracketElement::calcSizes( const ContextStyle& context,
left->calcSizes(context, tstyle, factor);
right->calcSizes(context, tstyle, factor);
- setBaseline(QMAX(content->getBaseline(),
- QMAX(left->getBaseline(), right->getBaseline())));
+ setBaseline(TQMAX(content->getBaseline(),
+ TQMAX(left->getBaseline(), right->getBaseline())));
content->setY(getBaseline() - content->getBaseline());
left ->setY(getBaseline() - left ->getBaseline());
right ->setY(getBaseline() - right ->getBaseline());
//setMidline(content->getY() + content->getMidline());
- setHeight(QMAX(content->getY() + content->getHeight(),
- QMAX(left ->getY() + left ->getHeight(),
+ setHeight(TQMAX(content->getY() + content->getHeight(),
+ TQMAX(left ->getY() + left ->getHeight(),
right->getY() + right->getHeight())));
}
else {
//kdDebug( DEBUGID ) << "BracketElement::calcSizes " << content->axis( context, tstyle ) << " " << content->getHeight() << endl;
- luPixel contentHeight = 2 * QMAX( content->axis( context, tstyle, factor ),
+ luPixel contentHeight = 2 * TQMAX( content->axis( context, tstyle, factor ),
content->getHeight() - content->axis( context, tstyle, factor ) );
left->calcSizes( context, tstyle, factor, contentHeight );
right->calcSizes( context, tstyle, factor, contentHeight );
// height
- setHeight(QMAX(contentHeight,
- QMAX(left->getHeight(), right->getHeight())));
+ setHeight(TQMAX(contentHeight,
+ TQMAX(left->getHeight(), right->getHeight())));
//setMidline(getHeight() / 2);
content->setY(getHeight() / 2 - content->axis( context, tstyle, factor ));
@@ -360,18 +360,18 @@ void BracketElement::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 BracketElement::draw( QPainter& painter, const LuPixelRect& r,
+void BracketElement::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;
@@ -384,7 +384,7 @@ void BracketElement::draw( QPainter& painter, const LuPixelRect& r,
}
else {
double factor = style.sizeFactor();
- luPixel contentHeight = 2 * QMAX(content->axis( context, tstyle, factor ),
+ luPixel contentHeight = 2 * TQMAX(content->axis( context, tstyle, factor ),
content->getHeight() - content->axis( context, tstyle, factor ));
left->draw(painter, r, context, tstyle, style, contentHeight, myPos);
right->draw(painter, r, context, tstyle, style, contentHeight, myPos);
@@ -392,16 +392,16 @@ void BracketElement::draw( QPainter& painter, const LuPixelRect& r,
// Debug
#if 0
- painter.setBrush( Qt::NoBrush );
- painter.setPen( Qt::red );
- painter.drawRect( context.layoutUnitToPixelX( myPos.x()+left->getX() ),
- context.layoutUnitToPixelY( myPos.y()+left->getY() ),
- context.layoutUnitToPixelX( left->getWidth() ),
- context.layoutUnitToPixelY( left->getHeight() ) );
- painter.drawRect( context.layoutUnitToPixelX( myPos.x()+right->getX() ),
- context.layoutUnitToPixelY( myPos.y()+right->getY() ),
- context.layoutUnitToPixelX( right->getWidth() ),
- context.layoutUnitToPixelY( right->getHeight() ) );
+ painter.setBrush( TQt::NoBrush );
+ painter.setPen( TQt::red );
+ painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x()+left->getX() ),
+ context.tqlayoutUnitToPixelY( myPos.y()+left->getY() ),
+ context.tqlayoutUnitToPixelX( left->getWidth() ),
+ context.tqlayoutUnitToPixelY( left->getHeight() ) );
+ painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x()+right->getX() ),
+ context.tqlayoutUnitToPixelY( myPos.y()+right->getY() ),
+ context.tqlayoutUnitToPixelX( right->getWidth() ),
+ context.tqlayoutUnitToPixelY( right->getHeight() ) );
#endif
}
@@ -409,7 +409,7 @@ void BracketElement::draw( QPainter& painter, const LuPixelRect& r,
/**
* Appends our attributes to the dom element.
*/
-void BracketElement::writeDom(QDomElement element)
+void BracketElement::writeDom(TQDomElement element)
{
SingleContentElement::writeDom(element);
element.setAttribute("LEFT", leftType);
@@ -420,16 +420,16 @@ void BracketElement::writeDom(QDomElement element)
* Reads our attributes from the element.
* Returns false if it failed.
*/
-bool BracketElement::readAttributesFromDom(QDomElement element)
+bool BracketElement::readAttributesFromDom(TQDomElement element)
{
if (!BasicElement::readAttributesFromDom(element)) {
return false;
}
- QString leftStr = element.attribute("LEFT");
+ TQString leftStr = element.attribute("LEFT");
if(!leftStr.isNull()) {
leftType = static_cast<SymbolType>(leftStr.toInt());
}
- QString rightStr = element.attribute("RIGHT");
+ TQString rightStr = element.attribute("RIGHT");
if(!rightStr.isNull()) {
rightType = static_cast<SymbolType>(rightStr.toInt());
}
@@ -440,7 +440,7 @@ bool BracketElement::readAttributesFromDom(QDomElement element)
* Reads our attributes from the MathML element.
* Returns false if it failed.
*/
-bool BracketElement::readAttributesFromMathMLDom(const QDomElement& element)
+bool BracketElement::readAttributesFromMathMLDom(const TQDomElement& element)
{
if ( !BasicElement::readAttributesFromMathMLDom( element ) ) {
return false;
@@ -453,7 +453,7 @@ bool BracketElement::readAttributesFromMathMLDom(const QDomElement& element)
else { // mfenced, see attributes in section 3.3.8.2
leftType = LeftRoundBracket;
rightType = RightRoundBracket;
- QString openStr = element.attribute( "open" ).stripWhiteSpace();
+ TQString openStr = element.attribute( "open" ).stripWhiteSpace();
if ( !openStr.isNull() ) {
m_customLeft = true;
if ( openStr == "[" )
@@ -479,7 +479,7 @@ bool BracketElement::readAttributesFromMathMLDom(const QDomElement& element)
else // TODO: Check for entity references
leftType = LeftRoundBracket;
}
- QString closeStr = element.attribute( "close" ).stripWhiteSpace();
+ TQString closeStr = element.attribute( "close" ).stripWhiteSpace();
if ( !closeStr.isNull() ) {
m_customRight = true;
if ( closeStr == "[" )
@@ -515,14 +515,14 @@ bool BracketElement::readAttributesFromMathMLDom(const QDomElement& element)
* that needs to be read.
* Returns false if it failed.
*/
-int BracketElement::readContentFromMathMLDom(QDomNode& node)
+int BracketElement::readContentFromMathMLDom(TQDomNode& node)
{
bool empty = false;
int nodeCounter = 0;
if ( m_operator ) {
- node = node.parentNode();
- QDomNode open = node;
- QDomNode parent = node.parentNode();
+ node = node.tqparentNode();
+ TQDomNode open = node;
+ TQDomNode tqparent = node.tqparentNode();
if ( ! operatorType( node, true ) )
return -1;
int nodeNum = searchOperator( node );
@@ -540,15 +540,15 @@ int BracketElement::readContentFromMathMLDom(QDomNode& node)
else { // More than two elements inside, infer a mrow
nodeCounter += nodeNum;
kdWarning() << "NodeNum: " << nodeNum << endl;
- QDomDocument doc = node.ownerDocument();
- QDomElement de = doc.createElement( "mrow" );
+ TQDomDocument doc = node.ownerDocument();
+ TQDomElement de = doc.createElement( "mrow" );
int i = 0;
do {
- QDomNode n = node.nextSibling();
+ TQDomNode n = node.nextSibling();
de.appendChild( node.toElement() );
node = n;
} while ( ++i < nodeNum );
- parent.insertAfter( de, open );
+ tqparent.insertAfter( de, open );
node = de;
kdWarning() << doc.toString() << endl;
}
@@ -558,22 +558,22 @@ int BracketElement::readContentFromMathMLDom(QDomNode& node)
// See section 3.3.8
while ( ! node.isNull() && ! node.isElement() )
node = node.nextSibling();
- QDomNode next = node.nextSibling();
+ TQDomNode next = node.nextSibling();
while ( ! next.isNull() && ! next.isElement() )
next = next.nextSibling();
if ( ! next.isNull()) {
- QDomDocument doc = node.ownerDocument();
- QDomNode parent = node.parentNode();
- QString ns = parent.prefix();
- QDomElement de = doc.createElementNS( ns, "mrow" );
+ TQDomDocument doc = node.ownerDocument();
+ TQDomNode tqparent = node.tqparentNode();
+ TQString ns = tqparent.prefix();
+ TQDomElement de = doc.createElementNS( ns, "mrow" );
uint pos = 0;
while ( ! node.isNull() ) {
- QDomNode no = node.nextSibling();
+ TQDomNode no = node.nextSibling();
while ( ! no.isNull() && ! no.isElement() )
no = no.nextSibling();
de.appendChild( node.toElement() );
if ( ! no.isNull() && ( m_separators.isNull() || ! m_separators.isEmpty() ) ) {
- QDomElement sep = doc.createElementNS( ns, "mo" );
+ TQDomElement sep = doc.createElementNS( ns, "mo" );
de.appendChild( sep );
if ( m_separators.isNull() ) {
sep.appendChild( doc.createTextNode( "," ) );
@@ -582,7 +582,7 @@ int BracketElement::readContentFromMathMLDom(QDomNode& node)
if ( m_separators.at( pos ).isSpace() ) {
pos++;
}
- sep.appendChild( doc.createTextNode( QString ( m_separators.at( pos ) ) ) );
+ sep.appendChild( doc.createTextNode( TQString ( m_separators.at( pos ) ) ) );
}
if ( pos < m_separators.length() - 1 ) {
pos++;
@@ -590,8 +590,8 @@ int BracketElement::readContentFromMathMLDom(QDomNode& node)
}
node = no;
}
- parent.appendChild( de );
- node = parent.firstChild();
+ tqparent.appendChild( de );
+ node = tqparent.firstChild();
while ( ! node.isElement() )
node = node.nextSibling();
}
@@ -619,9 +619,9 @@ int BracketElement::readContentFromMathMLDom(QDomNode& node)
return nodeCounter;
}
-QString BracketElement::toLatex()
+TQString BracketElement::toLatex()
{
- QString ls,rs,cs;
+ TQString ls,rs,cs;
cs=getContent()->toLatex();
ls="\\left"+latexString(leftType) + " ";
rs=" \\right"+latexString(rightType);
@@ -629,7 +629,7 @@ QString BracketElement::toLatex()
return ls+cs+rs;
}
-QString BracketElement::latexString(char type)
+TQString BracketElement::latexString(char type)
{
switch (type) {
case ']':
@@ -658,12 +658,12 @@ QString BracketElement::latexString(char type)
return ".";
}
-QString BracketElement::formulaString()
+TQString BracketElement::formulaString()
{
return "(" + getContent()->formulaString() + ")";
}
-int BracketElement::operatorType( QDomNode& node, bool open )
+int BracketElement::operatorType( TQDomNode& node, bool open )
{
int counter = 1;
SymbolType* type = open ? &leftType : &rightType;
@@ -672,11 +672,11 @@ int BracketElement::operatorType( QDomNode& node, bool open )
counter++;
}
if ( node.isElement() ) {
- QDomElement e = node.toElement();
- QDomNode child = e.firstChild();
+ TQDomElement e = node.toElement();
+ TQDomNode child = e.firstChild();
if ( child.isEntityReference() ) {
kdWarning() << "Entity Reference\n";
- QString name = node.nodeName();
+ TQString name = node.nodeName();
// TODO: To fully support these, SymbolType has to be extended,
// and better Unicode support is a must
// CloseCurlyDoubleQuote 0x201D
@@ -704,10 +704,10 @@ int BracketElement::operatorType( QDomNode& node, bool open )
}
}
else {
- QString s = e.text();
+ TQString s = e.text();
if ( s.isNull() )
return -1;
- *type = static_cast<SymbolType>( QString::number( s.at( 0 ).latin1() ).toInt() );
+ *type = static_cast<SymbolType>( TQString::number( s.tqat( 0 ).latin1() ).toInt() );
}
}
else {
@@ -716,21 +716,21 @@ int BracketElement::operatorType( QDomNode& node, bool open )
return counter;
}
-int BracketElement::searchOperator( const QDomNode& node )
+int BracketElement::searchOperator( const TQDomNode& node )
{
- QDomNode n = node;
+ TQDomNode n = node;
for ( int i = -2; ! n.isNull(); n = n.nextSibling() ) {
if ( n.isElement() ) {
i++;
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
if ( e.tagName().lower() == "mo" ) {
// Try to guess looking at attributes
- QString form = e.attribute( "form" );
- QString f;
+ TQString form = e.attribute( "form" );
+ TQString f;
if ( ! form.isNull() ) {
f = form.stripWhiteSpace().lower();
}
- QString fence = e.attribute( "fence" );
+ TQString fence = e.attribute( "fence" );
if ( ! fence.isNull() ) {
if ( fence.stripWhiteSpace().lower() == "false" ) {
continue;
@@ -746,8 +746,8 @@ int BracketElement::searchOperator( const QDomNode& node )
}
// Guess looking at contents
- QDomNode child = e.firstChild();
- QString name;
+ TQDomNode child = e.firstChild();
+ TQString name;
if ( child.isText() )
name = child.toText().data().stripWhiteSpace();
else if ( child.isEntityReference() )
@@ -784,21 +784,21 @@ int BracketElement::searchOperator( const QDomNode& node )
}
-void BracketElement::writeMathMLAttributes( QDomElement& element ) const
+void BracketElement::writeMathMLAttributes( TQDomElement& element ) const
{
if ( left->getType() != LeftRoundBracket ||
right->getType() != RightRoundBracket )
{
- element.setAttribute( "open", QString( QChar( leftType ) ) );
- element.setAttribute( "close", QString( QChar( rightType ) ) );
+ element.setAttribute( "open", TQString( TQChar( leftType ) ) );
+ element.setAttribute( "close", TQString( TQChar( rightType ) ) );
}
if ( ! m_separators.isNull() ) {
element.setAttribute( "separators", m_separators );
}
}
-OverlineElement::OverlineElement( BasicElement* parent )
- : SingleContentElement( parent )
+OverlineElement::OverlineElement( BasicElement* tqparent )
+ : SingleContentElement( tqparent )
{
}
@@ -845,14 +845,14 @@ void OverlineElement::calcSizes( const ContextStyle& context,
setBaseline(content->getBaseline() + content->getY());
}
-void OverlineElement::draw( QPainter& painter, const LuPixelRect& r,
+void OverlineElement::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;
@@ -867,40 +867,40 @@ void OverlineElement::draw( QPainter& painter, const LuPixelRect& r,
luPixel distY = context.ptToPixelY( context.getThinSpace( tstyle, factor ) );
//luPixel unit = (content->getHeight() + distY)/ 3;
- painter.setPen( QPen( context.getDefaultColor(),
- context.layoutUnitToPixelY( context.getLineWidth( factor ) ) ) );
+ painter.setPen( TQPen( context.getDefaultColor(),
+ context.tqlayoutUnitToPixelY( context.getLineWidth( factor ) ) ) );
- painter.drawLine( context.layoutUnitToPixelX( x ),
- context.layoutUnitToPixelY( y+distY/3 ),
- context.layoutUnitToPixelX( x+content->getWidth() ),
- context.layoutUnitToPixelY( y+distY/3 ) );
+ painter.drawLine( context.tqlayoutUnitToPixelX( x ),
+ context.tqlayoutUnitToPixelY( y+distY/3 ),
+ context.tqlayoutUnitToPixelX( x+content->getWidth() ),
+ context.tqlayoutUnitToPixelY( y+distY/3 ) );
}
-QString OverlineElement::toLatex()
+TQString OverlineElement::toLatex()
{
return "\\overline{" + getContent()->toLatex() + "}";
}
-QString OverlineElement::formulaString()
+TQString OverlineElement::formulaString()
{
return getContent()->formulaString();
}
-void OverlineElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat ) const
+void OverlineElement::writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat ) const
{
- QDomElement de = doc.createElement( oasisFormat ? "math:mover" : "mover" );
+ TQDomElement de = doc.createElement( oasisFormat ? "math:mover" : "mover" );
SingleContentElement::writeMathML( doc, de, oasisFormat );
- QDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" );
+ TQDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" );
// is this the right entity? Mozilla renders it correctly.
op.appendChild( doc.createEntityReference( "OverBar" ) );
de.appendChild( op );
- parent.appendChild( de );
+ tqparent.appendChild( de );
}
-UnderlineElement::UnderlineElement( BasicElement* parent )
- : SingleContentElement( parent )
+UnderlineElement::UnderlineElement( BasicElement* tqparent )
+ : SingleContentElement( tqparent )
{
}
@@ -949,14 +949,14 @@ void UnderlineElement::calcSizes( const ContextStyle& context,
setBaseline(content->getBaseline() + content->getY());
}
-void UnderlineElement::draw( QPainter& painter, const LuPixelRect& r,
+void UnderlineElement::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;
@@ -971,35 +971,35 @@ void UnderlineElement::draw( QPainter& painter, const LuPixelRect& r,
//luPixel unit = (content->getHeight() + distY)/ 3;
double factor = style.sizeFactor();
- painter.setPen( QPen( context.getDefaultColor(),
- context.layoutUnitToPixelY( context.getLineWidth( factor ) ) ) );
+ painter.setPen( TQPen( context.getDefaultColor(),
+ context.tqlayoutUnitToPixelY( context.getLineWidth( factor ) ) ) );
- painter.drawLine( context.layoutUnitToPixelX( x ),
- context.layoutUnitToPixelY( y+getHeight()-context.getLineWidth( factor ) ),
- context.layoutUnitToPixelX( x+content->getWidth() ),
- context.layoutUnitToPixelY( y+getHeight()-context.getLineWidth( factor ) ) );
+ painter.drawLine( context.tqlayoutUnitToPixelX( x ),
+ context.tqlayoutUnitToPixelY( y+getHeight()-context.getLineWidth( factor ) ),
+ context.tqlayoutUnitToPixelX( x+content->getWidth() ),
+ context.tqlayoutUnitToPixelY( y+getHeight()-context.getLineWidth( factor ) ) );
}
-QString UnderlineElement::toLatex()
+TQString UnderlineElement::toLatex()
{
return "\\underline{" + getContent()->toLatex() + "}";
}
-QString UnderlineElement::formulaString()
+TQString UnderlineElement::formulaString()
{
return getContent()->formulaString();
}
-void UnderlineElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat ) const
+void UnderlineElement::writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat ) const
{
- QDomElement de = doc.createElement( oasisFormat ? "math:munder" : "munder" );
+ TQDomElement de = doc.createElement( oasisFormat ? "math:munder" : "munder" );
SingleContentElement::writeMathML( doc, de, oasisFormat );
- QDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" );
+ TQDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" );
// is this the right entity? Mozilla renders it correctly.
op.appendChild( doc.createEntityReference( "UnderBar" ) );
de.appendChild( op );
- parent.appendChild( de );
+ tqparent.appendChild( de );
}
KFORMULA_NAMESPACE_END