summaryrefslogtreecommitdiffstats
path: root/lib/kformula/kformulamathmlread.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kformula/kformulamathmlread.cc
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-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/kformulamathmlread.cc')
-rw-r--r--lib/kformula/kformulamathmlread.cc498
1 files changed, 249 insertions, 249 deletions
diff --git a/lib/kformula/kformulamathmlread.cc b/lib/kformula/kformulamathmlread.cc
index 1bee8550..f42e3ae1 100644
--- a/lib/kformula/kformulamathmlread.cc
+++ b/lib/kformula/kformulamathmlread.cc
@@ -19,8 +19,8 @@
*/
#include <iostream>
-#include <qstring.h>
-#include <qfontmetrics.h>
+#include <tqstring.h>
+#include <tqfontmetrics.h>
#include <klocale.h>
#include <kmessagebox.h>
@@ -40,53 +40,53 @@ class MathML2KFormulaPrivate
public:
MathML2KFormulaPrivate( MathML2KFormula* mml_filter,
const ContextStyle& contextStyle,
- const QDomDocument& formuladoc );
+ const TQDomDocument& formuladoc );
~MathML2KFormulaPrivate();
- void math( QDomElement element );
+ void math( TQDomElement element );
// Token Elements
- void mi( QDomElement element, QDomNode docnode );
- void mn( QDomElement element, QDomNode docnode );
- void mo( QDomElement element, QDomNode docnode );
- void mtext( QDomElement element, QDomNode docnode );
- void mspace( QDomElement element, QDomNode docnode );
- void ms( QDomElement element, QDomNode docnode );
+ void mi( TQDomElement element, TQDomNode docnode );
+ void mn( TQDomElement element, TQDomNode docnode );
+ void mo( TQDomElement element, TQDomNode docnode );
+ void mtext( TQDomElement element, TQDomNode docnode );
+ void mspace( TQDomElement element, TQDomNode docnode );
+ void ms( TQDomElement element, TQDomNode docnode );
// mglyph not supported
// General Layout Schemata
- void mrow( QDomElement element, QDomNode docnode );
- void mfrac( QDomElement element, QDomNode docnode );
- void msqrt( QDomElement element, QDomNode docnode );
- void mroot( QDomElement element, QDomNode docnode );
- void mstyle( QDomElement element, QDomNode docnode );
+ void mrow( TQDomElement element, TQDomNode docnode );
+ void mfrac( TQDomElement element, TQDomNode docnode );
+ void msqrt( TQDomElement element, TQDomNode docnode );
+ void mroot( TQDomElement element, TQDomNode docnode );
+ void mstyle( TQDomElement element, TQDomNode docnode );
// merror not supported
// mpadded not supported
// mphantom not supported
- void mfenced( QDomElement element, QDomNode docnode );
+ void mfenced( TQDomElement element, TQDomNode docnode );
// menclose not supported
// Script and Limit Schemata
- void msub_msup( QDomElement element, QDomNode docnode );
- void msubsup( QDomElement element, QDomNode docnode );
- void munder( QDomElement element, QDomNode docnode, bool oasisFormat );
- void mover( QDomElement element, QDomNode docnode, bool oasisFormat );
- void munderover( QDomElement element, QDomNode docnode, bool oasisFormat );
+ void msub_msup( TQDomElement element, TQDomNode docnode );
+ void msubsup( TQDomElement element, TQDomNode docnode );
+ void munder( TQDomElement element, TQDomNode docnode, bool oasisFormat );
+ void mover( TQDomElement element, TQDomNode docnode, bool oasisFormat );
+ void munderover( TQDomElement element, TQDomNode docnode, bool oasisFormat );
// mmultiscripts not supported
// Tables and Matrices
- void mtable( QDomElement element, QDomNode docnode );
+ void mtable( TQDomElement element, TQDomNode docnode );
// not much supported
// Enlivening Expressions
// maction not supported
protected:
- void createTextElements( QString text, QDomNode docnode );
- void createNameSequence( QString text, QDomNode docnode );
- double convertToPoint( QString value, bool* ok );
- bool isEmbellishedOperator( QDomNode node, QDomElement* mo, bool oasisFormat );
- bool isSpaceLike( QDomNode node, bool oasisFormat );
+ void createTextElements( TQString text, TQDomNode docnode );
+ void createNameSequence( TQString text, TQDomNode docnode );
+ double convertToPoint( TQString value, bool* ok );
+ bool isEmbellishedOperator( TQDomNode node, TQDomElement* mo, bool oasisFormat );
+ bool isSpaceLike( TQDomNode node, bool oasisFormat );
enum MathVariant {
normal,
@@ -132,7 +132,7 @@ protected:
<< endl;
}
- void setStyles( QDomElement element )
+ void setStyles( TQDomElement element )
{
if ( !useVariant )
return;
@@ -189,7 +189,7 @@ protected:
}
}
- void readStyles( QDomElement mmlElement )
+ void readStyles( TQDomElement mmlElement )
{
if ( mmlElement.hasAttribute( "mathvariant" ) )
{
@@ -250,14 +250,14 @@ protected:
};
MathStyle style;
- QDomDocument doc;
+ TQDomDocument doc;
private:
const ContextStyle& context;
MathML2KFormula* filter;
};
-MathML2KFormulaPrivate::MathML2KFormulaPrivate( MathML2KFormula* mml_filter, const ContextStyle& cs, const QDomDocument& formuladoc )
+MathML2KFormulaPrivate::MathML2KFormulaPrivate( MathML2KFormula* mml_filter, const ContextStyle& cs, const TQDomDocument& formuladoc )
: doc( formuladoc ), context( cs ), filter( mml_filter )
{
}
@@ -266,12 +266,12 @@ MathML2KFormulaPrivate::~MathML2KFormulaPrivate()
{
}
-void MathML2KFormulaPrivate::math( QDomElement element )
+void MathML2KFormulaPrivate::math( TQDomElement element )
{
- QDomElement formula = doc.createElement( "FORMULA" );
- QDomNode n = element.firstChild();
+ TQDomElement formula = doc.createElement( "FORMULA" );
+ TQDomNode n = element.firstChild();
- QString display = element.attribute( "display" );
+ TQString display = element.attribute( "display" );
if ( display == "block" ) {
style.displaystyle = true;
@@ -295,10 +295,10 @@ void MathML2KFormulaPrivate::math( QDomElement element )
doc.appendChild( formula );
}
-void MathML2KFormulaPrivate::mi( QDomElement element, QDomNode docnode )
+void MathML2KFormulaPrivate::mi( TQDomElement element, TQDomNode docnode )
{
MathStyle previousStyle( style );
- QString text = element.text().stripWhiteSpace();
+ TQString text = element.text().stripWhiteSpace();
if ( text.length() == 1 ) { // Default italic, only when content is one char
style.mathvariant = italic;
style.useVariant = true;
@@ -311,38 +311,38 @@ void MathML2KFormulaPrivate::mi( QDomElement element, QDomNode docnode )
style = previousStyle;
}
-void MathML2KFormulaPrivate::mo( QDomElement element, QDomNode docnode )
+void MathML2KFormulaPrivate::mo( TQDomElement element, TQDomNode docnode )
{
MathStyle previousStyle( style );
style.readStyles( element );
- QString text = element.text().stripWhiteSpace();
+ TQString text = element.text().stripWhiteSpace();
createTextElements( text, docnode );
style = previousStyle;
}
-void MathML2KFormulaPrivate::mn( QDomElement element, QDomNode docnode )
+void MathML2KFormulaPrivate::mn( TQDomElement element, TQDomNode docnode )
{
MathStyle previousStyle( style );
style.readStyles( element );
- QString text = element.text().stripWhiteSpace();
+ TQString text = element.text().stripWhiteSpace();
createTextElements( text, docnode );
style = previousStyle;
}
-void MathML2KFormulaPrivate::mtext( QDomElement element, QDomNode docnode )
+void MathML2KFormulaPrivate::mtext( TQDomElement element, TQDomNode docnode )
{
MathStyle previousStyle( style );
style.readStyles( element );
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
while ( !n.isNull() ) {
if ( n.isText() ) {
- QString text = n.toText().data().stripWhiteSpace();
+ TQString text = n.toText().data().stripWhiteSpace();
createTextElements( text, docnode );
}
else if ( n.isElement() ) {
@@ -358,11 +358,11 @@ void MathML2KFormulaPrivate::mtext( QDomElement element, QDomNode docnode )
style = previousStyle;
}
-void MathML2KFormulaPrivate::ms( QDomElement element, QDomNode docnode )
+void MathML2KFormulaPrivate::ms( TQDomElement element, TQDomNode docnode )
{
- QString lquote = element.attribute( "lquote", "\"" );
- QString rquote = element.attribute( "rquote", "\"" );
- QString text;
+ TQString lquote = element.attribute( "lquote", "\"" );
+ TQString rquote = element.attribute( "rquote", "\"" );
+ TQString text;
text = lquote;
text += element.text().stripWhiteSpace();
@@ -371,12 +371,12 @@ void MathML2KFormulaPrivate::ms( QDomElement element, QDomNode docnode )
createTextElements( text, docnode );
}
-void MathML2KFormulaPrivate::mspace( QDomElement element, QDomNode docnode )
+void MathML2KFormulaPrivate::mspace( TQDomElement element, TQDomNode docnode )
{
// we support only horizontal space
- QString width = element.attribute( "width" );
+ TQString width = element.attribute( "width" );
- QDomElement spaceelement = doc.createElement( "SPACE" );
+ TQDomElement spaceelement = doc.createElement( "SPACE" );
// check for namedspace. We don't support much...
if ( width == "veryverythinmathspace" ) {
@@ -411,7 +411,7 @@ void MathML2KFormulaPrivate::mspace( QDomElement element, QDomNode docnode )
// See MathML specification, Appendix H
w = context.getDefaultFont().pointSize();
if ( w == -1 ) {
- QFontMetrics fm( context.getDefaultFont() );
+ TQFontMetrics fm( context.getDefaultFont() );
w = fm.width( 'm' );
}
w = w * width.remove( width.length() - 2, 2 ).toDouble( &ok );
@@ -461,12 +461,12 @@ void MathML2KFormulaPrivate::mspace( QDomElement element, QDomNode docnode )
docnode.appendChild( spaceelement );
}
-void MathML2KFormulaPrivate::mrow( QDomElement element, QDomNode docnode )
+void MathML2KFormulaPrivate::mrow( TQDomElement element, TQDomNode docnode )
{
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
while ( !n.isNull() ) {
if ( n.isElement () ) {
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
// We do not allow sequence inside sequence
filter->processElement( e, doc, docnode );
}
@@ -477,10 +477,10 @@ void MathML2KFormulaPrivate::mrow( QDomElement element, QDomNode docnode )
}
}
-void MathML2KFormulaPrivate::mfrac( QDomElement element, QDomNode docnode )
+void MathML2KFormulaPrivate::mfrac( TQDomElement element, TQDomNode docnode )
{
- QDomNode n = element.firstChild();
- QDomElement fraction = doc.createElement( "FRACTION" );
+ TQDomNode n = element.firstChild();
+ TQDomElement fraction = doc.createElement( "FRACTION" );
MathStyle previousStyle( style );
style.displaystyle ? style.displaystyle = false : style.scriptlevel += 1;
@@ -491,21 +491,21 @@ void MathML2KFormulaPrivate::mfrac( QDomElement element, QDomNode docnode )
if ( n.isElement() ) {
++i;
if ( i == 1 ) { //first is numerator
- QDomElement numerator =
+ TQDomElement numerator =
doc.createElement( "NUMERATOR" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
numerator.appendChild( sequence );
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
filter->processElement( e, doc, sequence );
fraction.appendChild( numerator );
}
else {
- QDomElement denominator =
+ TQDomElement denominator =
doc.createElement( "DENOMINATOR" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
denominator.appendChild( sequence );
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
filter->processElement( e, doc, sequence );
fraction.appendChild( denominator );
@@ -521,20 +521,20 @@ void MathML2KFormulaPrivate::mfrac( QDomElement element, QDomNode docnode )
docnode.appendChild( fraction );
}
-void MathML2KFormulaPrivate::mroot( QDomElement element, QDomNode docnode )
+void MathML2KFormulaPrivate::mroot( TQDomElement element, TQDomNode docnode )
{
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
int i = 0;
- QDomElement root = doc.createElement( "ROOT" );
+ TQDomElement root = doc.createElement( "ROOT" );
while ( !n.isNull() && i < 2 ) {
if ( n.isElement() ) {
++i;
if ( i == 1 ) { //first is content (base)
- QDomElement content = doc.createElement( "CONTENT" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement content = doc.createElement( "CONTENT" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
content.appendChild( sequence );
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
filter->processElement( e, doc, sequence );
root.appendChild(content);
@@ -545,10 +545,10 @@ void MathML2KFormulaPrivate::mroot( QDomElement element, QDomNode docnode )
style.displaystyle = false;
style.styleChange();
- QDomElement index = doc.createElement( "INDEX" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement index = doc.createElement( "INDEX" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
index.appendChild( sequence );
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
filter->processElement( e, doc, sequence );
root.appendChild( index );
@@ -563,13 +563,13 @@ void MathML2KFormulaPrivate::mroot( QDomElement element, QDomNode docnode )
docnode.appendChild( root );
}
-void MathML2KFormulaPrivate::msqrt( QDomElement element, QDomNode docnode )
+void MathML2KFormulaPrivate::msqrt( TQDomElement element, TQDomNode docnode )
{
- QDomNode n = element.firstChild();
- QDomElement root = doc.createElement( "ROOT" );
+ TQDomNode n = element.firstChild();
+ TQDomElement root = doc.createElement( "ROOT" );
- QDomElement content = doc.createElement( "CONTENT" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement content = doc.createElement( "CONTENT" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
content.appendChild( sequence );
root.appendChild( content );
@@ -586,7 +586,7 @@ void MathML2KFormulaPrivate::msqrt( QDomElement element, QDomNode docnode )
docnode.appendChild( root );
}
-void MathML2KFormulaPrivate::mstyle( QDomElement element, QDomNode docnode )
+void MathML2KFormulaPrivate::mstyle( TQDomElement element, TQDomNode docnode )
{
bool ok;
@@ -594,7 +594,7 @@ void MathML2KFormulaPrivate::mstyle( QDomElement element, QDomNode docnode )
style.readStyles( element );
if ( element.hasAttribute( "scriptlevel" ) ) {
- QString scriptlevel = element.attribute( "scriptlevel" );
+ TQString scriptlevel = element.attribute( "scriptlevel" );
if ( scriptlevel.startsWith( "+" ) || scriptlevel.startsWith( "-" ) )
style.scriptlevel += scriptlevel.toInt( &ok );
else
@@ -603,7 +603,7 @@ void MathML2KFormulaPrivate::mstyle( QDomElement element, QDomNode docnode )
style.scriptlevel = previousStyle.scriptlevel;
}
if ( element.hasAttribute( "displaystyle" ) ) {
- QString displaystyle = element.attribute( "displaystyle" );
+ TQString displaystyle = element.attribute( "displaystyle" );
if ( displaystyle == "true" )
style.displaystyle = true;
else if ( displaystyle == "false" )
@@ -616,50 +616,50 @@ void MathML2KFormulaPrivate::mstyle( QDomElement element, QDomNode docnode )
style.scriptsizemultiplier = previousStyle.scriptsizemultiplier;
}
if ( element.hasAttribute( "scriptminsize" ) ) {
- QString scriptminsize = element.attribute( "scriptminsize" );
+ TQString scriptminsize = element.attribute( "scriptminsize" );
style.scriptminsize = convertToPoint( scriptminsize, &ok );
if ( !ok )
style.scriptminsize = previousStyle.scriptminsize;
}
if ( element.hasAttribute( "veryverythinmathspace" ) ) {
- QString vvthinmspace = element.attribute( "veryverythinmathspace" );
+ TQString vvthinmspace = element.attribute( "veryverythinmathspace" );
style.veryverythinmathspace = convertToPoint( vvthinmspace, &ok );
if ( !ok )
style.veryverythinmathspace = previousStyle.veryverythinmathspace;
}
if ( element.hasAttribute( "verythinmathspace" ) ) {
- QString vthinmspace = element.attribute( "verythinmathspace" );
+ TQString vthinmspace = element.attribute( "verythinmathspace" );
style.verythinmathspace = convertToPoint( vthinmspace, &ok );
if ( !ok )
style.verythinmathspace = previousStyle.verythinmathspace;
}
if ( element.hasAttribute( "thinmathspace" ) ) {
- QString thinmathspace = element.attribute( "thinmathspace" );
+ TQString thinmathspace = element.attribute( "thinmathspace" );
style.thinmathspace = convertToPoint( thinmathspace, &ok );
if ( !ok )
style.thinmathspace = previousStyle.thinmathspace;
}
if ( element.hasAttribute( "mediummathspace" ) ) {
- QString mediummathspace = element.attribute( "mediummathspace" );
+ TQString mediummathspace = element.attribute( "mediummathspace" );
style.mediummathspace = convertToPoint( mediummathspace, &ok );
if ( !ok )
style.mediummathspace = previousStyle.mediummathspace;
}
if ( element.hasAttribute( "thickmathspace" ) ) {
- QString thickmathspace = element.attribute( "thickmathspace" );
+ TQString thickmathspace = element.attribute( "thickmathspace" );
style.thickmathspace = convertToPoint( thickmathspace, &ok );
if ( !ok )
style.thickmathspace = previousStyle.thickmathspace;
}
if ( element.hasAttribute( "verythickmathspace" ) ) {
- QString vthickmspace = element.attribute( "verythickmathspace" );
+ TQString vthickmspace = element.attribute( "verythickmathspace" );
style.verythickmathspace = convertToPoint( vthickmspace, &ok );
if ( !ok )
style.verythickmathspace = previousStyle.verythickmathspace;
}
if ( element.hasAttribute( "veryverythickmathspace" ) ) {
- QString vvthickmspace = element.attribute( "veryverythickmathspace" );
+ TQString vvthickmspace = element.attribute( "veryverythickmathspace" );
style.veryverythickmathspace = convertToPoint( vvthickmspace, &ok );
if ( !ok )
style.veryverythickmathspace =
@@ -668,7 +668,7 @@ void MathML2KFormulaPrivate::mstyle( QDomElement element, QDomNode docnode )
style.styleChange();
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
while ( !n.isNull() ) {
filter->processElement( n, doc, docnode );
n = n.nextSibling();
@@ -677,34 +677,34 @@ void MathML2KFormulaPrivate::mstyle( QDomElement element, QDomNode docnode )
style = previousStyle;
}
-void MathML2KFormulaPrivate::mfenced( QDomElement element, QDomNode docnode )
+void MathML2KFormulaPrivate::mfenced( TQDomElement element, TQDomNode docnode )
{
- QDomElement bracket = doc.createElement( "BRACKET" );
- QString value = element.attribute( "open", "(" );
- bracket.setAttribute( "LEFT", QString::number( value.at( 0 ).latin1() ) );
+ TQDomElement bracket = doc.createElement( "BRACKET" );
+ TQString value = element.attribute( "open", "(" );
+ bracket.setAttribute( "LEFT", TQString::number( value.at( 0 ).latin1() ) );
value = element.attribute( "close", ")" );
- bracket.setAttribute( "RIGHT", QString::number( value.at( 0 ).latin1() ) );
+ bracket.setAttribute( "RIGHT", TQString::number( value.at( 0 ).latin1() ) );
- QDomElement content = doc.createElement( "CONTENT" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement content = doc.createElement( "CONTENT" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
content.appendChild( sequence );
- QString separators = element.attribute( "separators", "," );
+ TQString separators = element.attribute( "separators", "," );
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
uint i = 0;
while ( !n.isNull() ) {
if ( n.isElement() ) {
if ( i != 0 && !separators.isEmpty() ) {
- QDomElement textelement = doc.createElement( "TEXT" );
+ TQDomElement textelement = doc.createElement( "TEXT" );
if ( i > separators.length() )
i = separators.length();
- textelement.setAttribute( "CHAR", QString( separators.at( i - 1 ) ) );
+ textelement.setAttribute( "CHAR", TQString( separators.at( i - 1 ) ) );
//style.setStyles( textelement );
sequence.appendChild( textelement );
}
++i;
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
filter->processElement( e, doc, sequence );
}
else {
@@ -716,10 +716,10 @@ void MathML2KFormulaPrivate::mfenced( QDomElement element, QDomNode docnode )
docnode.appendChild( bracket );
}
-void MathML2KFormulaPrivate::mtable( QDomElement element, QDomNode docnode )
+void MathML2KFormulaPrivate::mtable( TQDomElement element, TQDomNode docnode )
{
MathStyle previousStyle( style );
- QString displaystyle = element.attribute( "displaystyle", "false" );
+ TQString displaystyle = element.attribute( "displaystyle", "false" );
if ( displaystyle == "true" ) {
style.displaystyle = true;
}
@@ -729,13 +729,13 @@ void MathML2KFormulaPrivate::mtable( QDomElement element, QDomNode docnode )
}
style.styleChange();
- QString subtag;
+ TQString subtag;
int rows = 0; int cols = 0;
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
while ( !n.isNull() ) {
if ( n.isElement() ) {
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
subtag = e.tagName();
if (subtag == "mtr")
{
@@ -743,7 +743,7 @@ void MathML2KFormulaPrivate::mtable( QDomElement element, QDomNode docnode )
/* Determins the number of columns */
- QDomNode cellnode = e.firstChild();
+ TQDomNode cellnode = e.firstChild();
int cc = 0;
while ( !cellnode.isNull() ) {
@@ -767,22 +767,22 @@ void MathML2KFormulaPrivate::mtable( QDomElement element, QDomNode docnode )
of rows and cols to leave empty spaces */
n = element.firstChild();
- QDomElement matrix = doc.createElement( "MATRIX" );
+ TQDomElement matrix = doc.createElement( "MATRIX" );
matrix.setAttribute( "COLUMNS", cols );
matrix.setAttribute( "ROWS", rows );
while ( !n.isNull() ) {
if ( n.isElement() ) {
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
subtag = e.tagName();
if ( subtag == "mtr" ) {
- QDomNode cellnode = e.firstChild();
+ TQDomNode cellnode = e.firstChild();
int cc = 0;
while ( !cellnode.isNull() ) {
if ( cellnode.isElement() ) {
++cc;
- QDomElement cell = doc.createElement( "SEQUENCE" );
- QDomElement cellelement = cellnode.toElement();
+ TQDomElement cell = doc.createElement( "SEQUENCE" );
+ TQDomElement cellelement = cellnode.toElement();
filter->processElement( cellelement, doc, cell );
matrix.appendChild( cell );
}
@@ -791,7 +791,7 @@ void MathML2KFormulaPrivate::mtable( QDomElement element, QDomNode docnode )
/* Add empty elements */
for(; cc < cols; cc++ ) {
- QDomElement cell = doc.createElement( "SEQUENCE" );
+ TQDomElement cell = doc.createElement( "SEQUENCE" );
matrix.appendChild( cell );
}
}
@@ -803,26 +803,26 @@ void MathML2KFormulaPrivate::mtable( QDomElement element, QDomNode docnode )
docnode.appendChild(matrix);
}
-void MathML2KFormulaPrivate::msub_msup( QDomElement element, QDomNode docnode )
+void MathML2KFormulaPrivate::msub_msup( TQDomElement element, TQDomNode docnode )
{
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
int i = 0;
- QDomElement root = doc.createElement( "INDEX" );
+ TQDomElement root = doc.createElement( "INDEX" );
while ( !n.isNull() && i < 2 ) {
if ( n.isElement() ) {
++i;
if ( i == 1 ) { // first is content (base)
- QDomElement content = doc.createElement( "CONTENT" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement content = doc.createElement( "CONTENT" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
content.appendChild( sequence );
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
filter->processElement( e, doc, sequence );
root.appendChild( content );
}
else {
- QDomElement index;
+ TQDomElement index;
if ( element.tagName() == "msup" )
index = doc.createElement( "UPPERRIGHT" );
else
@@ -833,9 +833,9 @@ void MathML2KFormulaPrivate::msub_msup( QDomElement element, QDomNode docnode )
style.displaystyle = false;
style.styleChange();
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
index.appendChild( sequence );
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
filter->processElement( e, doc, sequence );
root.appendChild( index );
@@ -851,11 +851,11 @@ void MathML2KFormulaPrivate::msub_msup( QDomElement element, QDomNode docnode )
docnode.appendChild( root );
}
-void MathML2KFormulaPrivate::munder( QDomElement element, QDomNode docnode, bool oasisFormat )
+void MathML2KFormulaPrivate::munder( TQDomElement element, TQDomNode docnode, bool oasisFormat )
{
bool accentunder;
- QString au = element.attribute( "accentunder" );
+ TQString au = element.attribute( "accentunder" );
if ( au == "true" )
accentunder = true;
else if ( au == "false" )
@@ -863,7 +863,7 @@ void MathML2KFormulaPrivate::munder( QDomElement element, QDomNode docnode, bool
else {
// use default
- QDomElement mo;
+ TQDomElement mo;
// is underscript an embellished operator?
if ( isEmbellishedOperator( element.childNodes().item( 1 ), &mo, oasisFormat ) ) {
if ( mo.attribute( "accent" ) == "true" )
@@ -875,18 +875,18 @@ void MathML2KFormulaPrivate::munder( QDomElement element, QDomNode docnode, bool
accentunder = false;
}
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
int i = 0;
- QDomElement root = doc.createElement( "INDEX" );
+ TQDomElement root = doc.createElement( "INDEX" );
while ( !n.isNull() && i < 2 ) {
if ( n.isElement() ) {
++i;
if ( i == 1 ) { // first is content (base)
- QDomElement content = doc.createElement( "CONTENT" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement content = doc.createElement( "CONTENT" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
content.appendChild( sequence );
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
filter->processElement( e, doc, sequence );
root.appendChild( content );
@@ -899,7 +899,7 @@ void MathML2KFormulaPrivate::munder( QDomElement element, QDomNode docnode, bool
style.styleChange();
}
- QDomElement mo; QDomElement index;
+ TQDomElement mo; TQDomElement index;
if ( isEmbellishedOperator( n.previousSibling(), &mo, oasisFormat ) &&
!previousStyle.displaystyle &&
mo.attribute( "movablelimits" ) == "true" )
@@ -910,9 +910,9 @@ void MathML2KFormulaPrivate::munder( QDomElement element, QDomNode docnode, bool
index = doc.createElement( "LOWERMIDDLE" );
}
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
index.appendChild( sequence );
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
filter->processElement( e, doc, sequence );
root.appendChild( index );
@@ -929,11 +929,11 @@ void MathML2KFormulaPrivate::munder( QDomElement element, QDomNode docnode, bool
docnode.appendChild( root );
}
-void MathML2KFormulaPrivate::mover( QDomElement element, QDomNode docnode, bool oasisFormat )
+void MathML2KFormulaPrivate::mover( TQDomElement element, TQDomNode docnode, bool oasisFormat )
{
bool accent;
- QString ac = element.attribute( "accent" );
+ TQString ac = element.attribute( "accent" );
if ( ac == "true" )
accent = true;
else if ( ac == "false" )
@@ -941,7 +941,7 @@ void MathML2KFormulaPrivate::mover( QDomElement element, QDomNode docnode, bool
else {
// use default
- QDomElement mo;
+ TQDomElement mo;
// is overscript an embellished operator?
if ( isEmbellishedOperator( element.childNodes().item( 1 ), &mo, oasisFormat ) ) {
if ( mo.attribute( "accent" ) == "true" )
@@ -953,18 +953,18 @@ void MathML2KFormulaPrivate::mover( QDomElement element, QDomNode docnode, bool
accent = false;
}
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
int i = 0;
- QDomElement root = doc.createElement( "INDEX" );
+ TQDomElement root = doc.createElement( "INDEX" );
while ( !n.isNull() && i < 2 ) {
if ( n.isElement() ) {
++i;
if ( i == 1 ) { // first is content (base)
- QDomElement content = doc.createElement( "CONTENT" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement content = doc.createElement( "CONTENT" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
content.appendChild( sequence );
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
filter->processElement( e, doc, sequence );
root.appendChild( content );
@@ -977,7 +977,7 @@ void MathML2KFormulaPrivate::mover( QDomElement element, QDomNode docnode, bool
style.styleChange();
}
- QDomElement mo; QDomElement index;
+ TQDomElement mo; TQDomElement index;
if ( isEmbellishedOperator( n.previousSibling(), &mo, oasisFormat ) &&
!previousStyle.displaystyle &&
mo.attribute( "movablelimits" ) == "true" )
@@ -988,9 +988,9 @@ void MathML2KFormulaPrivate::mover( QDomElement element, QDomNode docnode, bool
index = doc.createElement( "UPPERMIDDLE" );
}
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
index.appendChild( sequence );
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
filter->processElement( e, doc, sequence );
root.appendChild( index );
@@ -1007,12 +1007,12 @@ void MathML2KFormulaPrivate::mover( QDomElement element, QDomNode docnode, bool
docnode.appendChild( root );
}
-void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode, bool oasisFormat )
+void MathML2KFormulaPrivate::munderover( TQDomElement element, TQDomNode docnode, bool oasisFormat )
{
bool accent;
bool accentunder;
- QString value = element.attribute( "accentunder" );
+ TQString value = element.attribute( "accentunder" );
if ( value == "true" )
accentunder = true;
else if ( value == "false" )
@@ -1020,7 +1020,7 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode,
else {
// use default
- QDomElement mo;
+ TQDomElement mo;
// is underscript an embellished operator?
if ( isEmbellishedOperator( element.childNodes().item( 1 ), &mo, oasisFormat ) ) {
if ( mo.attribute( "accent" ) == "true" )
@@ -1039,7 +1039,7 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode,
else {
// use default
- QDomElement mo;
+ TQDomElement mo;
// is overscript an embellished operator?
if ( isEmbellishedOperator( element.childNodes().item( 2 ), &mo,oasisFormat ) ) {
kdDebug( DEBUGID ) << "embellished operator" << endl;
@@ -1054,18 +1054,18 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode,
kdDebug( DEBUGID ) << "munderover:\n accentunder = " << accentunder
<< "\n accent = " << accent << endl;
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
int i = 0;
- QDomElement root = doc.createElement( "INDEX" );
+ TQDomElement root = doc.createElement( "INDEX" );
while ( !n.isNull() && i < 3 ) {
if ( n.isElement() ) {
++i;
if ( i == 1 ) { // base
- QDomElement content = doc.createElement( "CONTENT" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement content = doc.createElement( "CONTENT" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
content.appendChild( sequence );
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
filter->processElement( e, doc, sequence );
root.appendChild( content );
@@ -1078,7 +1078,7 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode,
style.styleChange();
}
- QDomElement mo; QDomElement index;
+ TQDomElement mo; TQDomElement index;
// is the base an embellished operator?
if ( isEmbellishedOperator( element.firstChild(), &mo, oasisFormat ) &&
!previousStyle.displaystyle &&
@@ -1090,9 +1090,9 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode,
index = doc.createElement( "LOWERMIDDLE" );
}
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
index.appendChild( sequence );
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
filter->processElement( e, doc, sequence );
root.appendChild( index );
@@ -1106,7 +1106,7 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode,
style.styleChange();
}
- QDomElement mo; QDomElement index;
+ TQDomElement mo; TQDomElement index;
if ( isEmbellishedOperator( element.firstChild(), &mo, oasisFormat ) &&
!previousStyle.displaystyle &&
mo.attribute( "movablelimits" ) == "true" )
@@ -1117,9 +1117,9 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode,
index = doc.createElement( "UPPERMIDDLE" );
}
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
index.appendChild( sequence );
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
filter->processElement( e, doc, sequence );
root.appendChild( index );
@@ -1136,21 +1136,21 @@ void MathML2KFormulaPrivate::munderover( QDomElement element, QDomNode docnode,
docnode.appendChild( root );
}
-void MathML2KFormulaPrivate::msubsup( QDomElement element, QDomNode docnode )
+void MathML2KFormulaPrivate::msubsup( TQDomElement element, TQDomNode docnode )
{
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
int i = 0;
- QDomElement root = doc.createElement("INDEX");
+ TQDomElement root = doc.createElement("INDEX");
MathStyle previousStyle( style );
while ( !n.isNull() && i < 2 ) {
if ( n.isElement() ) {
++i;
if ( i == 1 ) { // base
- QDomElement content = doc.createElement( "CONTENT" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement content = doc.createElement( "CONTENT" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
content.appendChild( sequence );
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
filter->processElement( e, doc, sequence );
root.appendChild( content );
@@ -1160,22 +1160,22 @@ void MathML2KFormulaPrivate::msubsup( QDomElement element, QDomNode docnode )
style.displaystyle = false;
style.styleChange();
- QDomElement index;
+ TQDomElement index;
index = doc.createElement( "LOWERRIGHT" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
index.appendChild( sequence );
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
filter->processElement( e, doc, sequence );
root.appendChild( index );
}
else { // superscript
- QDomElement index;
+ TQDomElement index;
index = doc.createElement( "UPPERRIGHT" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
index.appendChild( sequence );
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
filter->processElement( e, doc, sequence );
root.appendChild( index );
@@ -1191,11 +1191,11 @@ void MathML2KFormulaPrivate::msubsup( QDomElement element, QDomNode docnode )
docnode.appendChild( root );
}
-void MathML2KFormulaPrivate::createTextElements( QString text, QDomNode docnode )
+void MathML2KFormulaPrivate::createTextElements( TQString text, TQDomNode docnode )
{
for ( uint i = 0; i < text.length(); ++i ) {
- QDomElement textelement = doc.createElement( "TEXT" );
- textelement.setAttribute( "CHAR", QString( text.at( i ) ) );
+ TQDomElement textelement = doc.createElement( "TEXT" );
+ textelement.setAttribute( "CHAR", TQString( text.at( i ) ) );
style.setStyles( textelement );
if ( context.symbolTable().inTable( text.at( i ) ) ) {
// The element is a symbol.
@@ -1205,12 +1205,12 @@ void MathML2KFormulaPrivate::createTextElements( QString text, QDomNode docnode
}
}
-void MathML2KFormulaPrivate::createNameSequence( QString text, QDomNode docnode )
+void MathML2KFormulaPrivate::createNameSequence( TQString text, TQDomNode docnode )
{
- QDomElement namesequence = doc.createElement( "NAMESEQUENCE" );
+ TQDomElement namesequence = doc.createElement( "NAMESEQUENCE" );
for ( uint i = 0; i < text.length(); ++i ) {
- QDomElement textelement = doc.createElement( "TEXT" );
- textelement.setAttribute( "CHAR", QString( text.at( i ) ) );
+ TQDomElement textelement = doc.createElement( "TEXT" );
+ textelement.setAttribute( "CHAR", TQString( text.at( i ) ) );
style.setStyles( textelement );
if ( context.symbolTable().inTable( text.at( i ) ) ) {
// The element is a symbol.
@@ -1221,7 +1221,7 @@ void MathML2KFormulaPrivate::createNameSequence( QString text, QDomNode docnode
docnode.appendChild( namesequence );
}
-double MathML2KFormulaPrivate::convertToPoint( QString value, bool* ok )
+double MathML2KFormulaPrivate::convertToPoint( TQString value, bool* ok )
{
double pt = 0;
@@ -1229,14 +1229,14 @@ double MathML2KFormulaPrivate::convertToPoint( QString value, bool* ok )
// See MathML specification, Appendix H
pt = context.getDefaultFont().pointSize();
if ( pt == -1 ) {
- QFontMetrics fm( context.getDefaultFont() );
+ TQFontMetrics fm( context.getDefaultFont() );
pt = fm.width( 'M' );
// PIXELS!
}
pt = pt * value.remove( value.length() - 2, 2 ).toDouble( ok );
}
else if ( value.endsWith( "ex" ) ) {
- QFontMetrics fm( context.getDefaultFont() );
+ TQFontMetrics fm( context.getDefaultFont() );
pt = fm.height();
// PIXELS, and totally wrong!
}
@@ -1270,16 +1270,16 @@ double MathML2KFormulaPrivate::convertToPoint( QString value, bool* ok )
return pt;
}
-bool MathML2KFormulaPrivate::isEmbellishedOperator( QDomNode node,
- QDomElement* mo, bool oasisFormat )
+bool MathML2KFormulaPrivate::isEmbellishedOperator( TQDomNode node,
+ TQDomElement* mo, bool oasisFormat )
{
// See MathML 2.0 specification: 3.2.5.7
if ( !node.isElement() )
return false;
- QDomElement element = node.toElement();
- QString tag = element.tagName();
+ TQDomElement element = node.toElement();
+ TQString tag = element.tagName();
if ( tag == "mo" )
{
@@ -1297,7 +1297,7 @@ bool MathML2KFormulaPrivate::isEmbellishedOperator( QDomNode node,
return false; // not supported
}
if ( tag == "mrow" || tag == "mstyle" || tag == "mphantom" || tag == "mpadded" ) {
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
int i = 0;
while ( !n.isNull() ) {
@@ -1315,22 +1315,22 @@ bool MathML2KFormulaPrivate::isEmbellishedOperator( QDomNode node,
return false;
}
-bool MathML2KFormulaPrivate::isSpaceLike( QDomNode node, bool oasisFormat )
+bool MathML2KFormulaPrivate::isSpaceLike( TQDomNode node, bool oasisFormat )
{
// See MathML 2.0 specification: 3.2.7.3
if ( !node.isElement() )
return false;
- QDomElement element = node.toElement();
- QString tag = element.tagName();
+ TQDomElement element = node.toElement();
+ TQString tag = element.tagName();
if ( tag == "mtext" || tag == "mspace" ||
tag == "maligngroup" || tag == "malignmark" ) {
return true;
}
if ( tag == "mstyle" || tag == "mphantom" || tag == "mpadded" || tag == "mrow" ) {
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
while ( !n.isNull() ) {
if ( isSpaceLike( n,oasisFormat ) )
n = n.nextSibling();
@@ -1347,20 +1347,20 @@ bool MathML2KFormulaPrivate::isSpaceLike( QDomNode node, bool oasisFormat )
}
-MathML2KFormula::MathML2KFormula( const QDomDocument& mmldoc, const ContextStyle &contextStyle, bool _oasisFormat )
+MathML2KFormula::MathML2KFormula( const TQDomDocument& mmldoc, const ContextStyle &contextStyle, bool _oasisFormat )
: m_error( false ), oasisFormat( _oasisFormat ), context( contextStyle )
{
orig_element = mmldoc.documentElement();
done = false;
}
-MathML2KFormula::MathML2KFormula( const QDomElement& mmlelm, const ContextStyle &contextStyle, bool _oasisFormat )
+MathML2KFormula::MathML2KFormula( const TQDomElement& mmlelm, const ContextStyle &contextStyle, bool _oasisFormat )
: m_error( false ), orig_element( mmlelm ), oasisFormat( _oasisFormat ), context( contextStyle )
{
done = false;
}
-QDomDocument MathML2KFormula::getKFormulaDom()
+TQDomDocument MathML2KFormula::getKFormulaDom()
{
return formuladoc;
}
@@ -1372,7 +1372,7 @@ void MathML2KFormula::startConversion()
//TODO:let it be async
//kdDebug() << origdoc.toString() << endl;
done = false;
- formuladoc = QDomDocument( "KFORMULA" );
+ formuladoc = TQDomDocument( "KFORMULA" );
impl = new MathML2KFormulaPrivate( this, context, formuladoc );
if ( orig_element.tagName() == "math" ) {
impl->math( orig_element );
@@ -1386,15 +1386,15 @@ void MathML2KFormula::startConversion()
done = true;
}
-bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode docnode )
+bool MathML2KFormula::processElement( TQDomNode node, TQDomDocument& doc, TQDomNode docnode )
{
- //QDomElement *element;
+ //TQDomElement *element;
Type type = UNKNOWN;
if ( node.isElement() ) {
- QDomElement element = node.toElement();
- QString tag = element.tagName();
+ TQDomElement element = node.toElement();
+ TQString tag = element.tagName();
if ( tag == "mi" ) {
type = TOKEN;
@@ -1472,16 +1472,16 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode
// content markup (not yet complete)
else if ( tag == "apply" ) {
type = CONTENT;
- QDomNode n = element.firstChild();
- QDomElement op = n.toElement();
+ TQDomNode n = element.firstChild();
+ TQDomElement op = n.toElement();
uint count = element.childNodes().count();
- //adding explicit brackets to replace "apply"s implicit ones
- QDomElement brackets = doc.createElement("BRACKET");
+ //adding explicit brackets to tqreplace "apply"s implicit ones
+ TQDomElement brackets = doc.createElement("BRACKET");
brackets.setAttribute("RIGHT", "41");
brackets.setAttribute("LEFT", "40");
- QDomElement content = doc.createElement("CONTENT");
+ TQDomElement content = doc.createElement("CONTENT");
brackets.appendChild(content);
- QDomElement base = doc.createElement("SEQUENCE");
+ TQDomElement base = doc.createElement("SEQUENCE");
content.appendChild(base);
docnode.appendChild(brackets);
//Arithmetic, Algebra and Logic operators status
@@ -1523,8 +1523,8 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode
while ( !n.isNull() ) {
if ( n.isElement() ) {
if ( !first ) {
- QDomElement text = doc.createElement( "TEXT" );
- QString value;
+ TQDomElement text = doc.createElement( "TEXT" );
+ TQString value;
if ( op.tagName() == "plus" )
value = "+";
@@ -1541,7 +1541,7 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode
base.appendChild( text );
}
first = false;
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
processElement( e, doc, base );
}
n = n.nextSibling();
@@ -1549,7 +1549,7 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode
}
else if ( op.tagName() == "factorial" ) {
- QDomElement e = n.nextSibling().toElement();
+ TQDomElement e = n.nextSibling().toElement();
processElement( e, doc, docnode );
impl->createTextElements( "!", base );
}
@@ -1557,11 +1557,11 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode
n = n.nextSibling();
if ( count == 2 ) { // unary
impl->createTextElements( "-", base );
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
processElement( e, doc, base );
}
else if ( count == 3 ) { // binary
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
processElement( e, doc, base );
impl->createTextElements( "-", base );
n = n.nextSibling();
@@ -1572,7 +1572,7 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode
else if ( op.tagName() == "divide" && count == 3 ) {
n = n.nextSibling();
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
processElement( e, doc, base );
impl->createTextElements("/", base);
n = n.nextSibling();
@@ -1582,15 +1582,15 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode
else if ( op.tagName() == "power" && count == 3 ) {
//code duplication of msub_sup(), but I can't find a way to cleanly call it
n = n.nextSibling();
- QDomElement e = n.toElement();
- QDomElement index = doc.createElement("INDEX");
+ TQDomElement e = n.toElement();
+ TQDomElement index = doc.createElement("INDEX");
base.appendChild(index);
- QDomElement content = doc.createElement("CONTENT");
+ TQDomElement content = doc.createElement("CONTENT");
index.appendChild(content);
- QDomElement sequence = doc.createElement("SEQUENCE");
+ TQDomElement sequence = doc.createElement("SEQUENCE");
content.appendChild(sequence);
processElement(e, doc, sequence);
- QDomElement upper = doc.createElement("UPPERRIGHT");
+ TQDomElement upper = doc.createElement("UPPERRIGHT");
index.appendChild(upper);
sequence = doc.createElement("SEQUENCE");
upper.appendChild(sequence);
@@ -1600,28 +1600,28 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode
}
else if ( op.tagName() == "abs" && count == 2) {
n = n.nextSibling();
- QDomElement e = n.toElement();
- QDomElement bracket = doc.createElement("BRACKET");
+ TQDomElement e = n.toElement();
+ TQDomElement bracket = doc.createElement("BRACKET");
bracket.setAttribute("RIGHT", "257");
bracket.setAttribute("LEFT", "256");
base.appendChild(bracket);
- QDomElement content = doc.createElement("CONTENT");
+ TQDomElement content = doc.createElement("CONTENT");
bracket.appendChild(content);
- QDomElement sequence = doc.createElement("SEQUENCE");
+ TQDomElement sequence = doc.createElement("SEQUENCE");
content.appendChild(sequence);
processElement(e, doc, sequence);
}
else if ( op.tagName() == "not" && count == 2) {
n = n.nextSibling();
- QDomElement e = n.toElement();
- impl->createTextElements(QString(QChar(0xAC)), base);
+ TQDomElement e = n.toElement();
+ impl->createTextElements(TQString(TQChar(0xAC)), base);
processElement(e, doc, base);
}
else if ( op.tagName() == "implies" && count == 3 ) {
n = n.nextSibling();
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
processElement( e, doc, base );
- impl->createTextElements(QString(QChar(0x21D2)), base);
+ impl->createTextElements(TQString(TQChar(0x21D2)), base);
n = n.nextSibling();
e = n.toElement();
processElement( e, doc, base );
@@ -1632,28 +1632,28 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode
else if ( tag == "cn" ) {
type = CONTENT;
- QString type = element.attribute( "type", "real" );
+ TQString type = element.attribute( "type", "real" );
if ( type == "real" || type == "constant" ) {
impl->createTextElements( element.text().stripWhiteSpace(),
docnode );
}
else if ( type == "integer" ) {
- QString base = element.attribute( "base" );
+ TQString base = element.attribute( "base" );
if ( !base ) {
impl->createTextElements( element.text().stripWhiteSpace(),
docnode );
}
else {
- QDomElement index = doc.createElement( "INDEX" );
- QDomElement content = doc.createElement( "CONTENT" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement index = doc.createElement( "INDEX" );
+ TQDomElement content = doc.createElement( "CONTENT" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
impl->createTextElements( element.text().stripWhiteSpace(),
sequence );
content.appendChild( sequence );
index.appendChild( content );
- QDomElement lowerright = doc.createElement( "LOWERRIGHT" );
+ TQDomElement lowerright = doc.createElement( "LOWERRIGHT" );
sequence = doc.createElement( "SEQUENCE" );
impl->createTextElements( base, sequence );
@@ -1665,7 +1665,7 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode
}
}
else if ( type == "rational" ) {
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
impl->createTextElements( n.toText().data().stripWhiteSpace(),
docnode );
@@ -1677,7 +1677,7 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode
docnode );
}
else if ( type == "complex-cartesian" ) {
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
impl->createTextElements( n.toText().data().stripWhiteSpace(),
docnode );
@@ -1692,21 +1692,21 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode
}
else if ( type == "complex-polar" ) {
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
impl->createTextElements( n.toText().data().stripWhiteSpace(),
docnode );
n = n.nextSibling(); // <sep/>
- QDomElement index = doc.createElement( "INDEX" );
- QDomElement content = doc.createElement( "CONTENT" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
- QDomElement textelement = doc.createElement( "TEXT" );
+ TQDomElement index = doc.createElement( "INDEX" );
+ TQDomElement content = doc.createElement( "CONTENT" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement textelement = doc.createElement( "TEXT" );
textelement.setAttribute( "CHAR", "e" );
sequence.appendChild( textelement );
content.appendChild( sequence );
index.appendChild( content );
- QDomElement upperright = doc.createElement( "UPPERRIGHT" );
+ TQDomElement upperright = doc.createElement( "UPPERRIGHT" );
sequence = doc.createElement( "SEQUENCE" );
textelement = doc.createElement( "TEXT" );
textelement.setAttribute( "CHAR", "i" );
@@ -1725,14 +1725,14 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode
else if ( tag == "ci" ) {
type = CONTENT;
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
if ( n.isText() ) {
impl->createTextElements( n.toText().data().stripWhiteSpace(),
docnode );
}
else if ( n.isElement() ) {
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
processElement( e, doc, docnode );
}
else if ( n.isEntityReference() ) {
@@ -1746,25 +1746,25 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode
else if ( tag == "list" ) {
type = CONTENT;
- QDomNode n = element.firstChild();
+ TQDomNode n = element.firstChild();
- QDomElement bracket = doc.createElement( "BRACKET" );
+ TQDomElement bracket = doc.createElement( "BRACKET" );
bracket.setAttribute( "LEFT", 91 ); // [
bracket.setAttribute( "RIGHT", 93 ); // ]
- QDomElement content = doc.createElement( "CONTENT" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement content = doc.createElement( "CONTENT" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
bool first = true;
while ( !n.isNull() ) {
if ( n.isElement() ) {
if ( !first ) {
- QDomElement textelement = doc.createElement( "TEXT" );
+ TQDomElement textelement = doc.createElement( "TEXT" );
textelement.setAttribute( "CHAR", "," );
sequence.appendChild( textelement );
}
first = false;
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
processElement( e, doc, sequence );
}
n = n.nextSibling();
@@ -1776,9 +1776,9 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode
}
}
- if ( type == UNKNOWN && node.nodeType() != QDomNode::AttributeNode ) {
+ if ( type == UNKNOWN && node.nodeType() != TQDomNode::AttributeNode ) {
kdDebug() << "Not an element: " << node.nodeName() << endl;
- QDomNode n = node.firstChild();
+ TQDomNode n = node.firstChild();
while ( !n.isNull() ) {
processElement( n, doc, docnode );
n = n.nextSibling();