diff options
Diffstat (limited to 'lib/kformula/matrixelement.cc')
| -rw-r--r-- | lib/kformula/matrixelement.cc | 506 |
1 files changed, 253 insertions, 253 deletions
diff --git a/lib/kformula/matrixelement.cc b/lib/kformula/matrixelement.cc index 88a590819..b8abd22b7 100644 --- a/lib/kformula/matrixelement.cc +++ b/lib/kformula/matrixelement.cc @@ -18,9 +18,9 @@ * Boston, MA 02110-1301, USA. */ -#include <qmemarray.h> -#include <qpainter.h> -#include <qptrlist.h> +#include <tqmemarray.h> +#include <tqpainter.h> +#include <tqptrlist.h> #include <kdebug.h> #include <klocale.h> @@ -43,7 +43,7 @@ class MatrixSequenceElement : public SequenceElement { typedef SequenceElement inherited; public: - MatrixSequenceElement( BasicElement* parent = 0 ) : SequenceElement( parent ) {} + MatrixSequenceElement( BasicElement* tqparent = 0 ) : SequenceElement( tqparent ) {} virtual MatrixSequenceElement* clone() { return new MatrixSequenceElement( *this ); } @@ -62,7 +62,7 @@ public: class KFCRemoveRow : public Command { public: - KFCRemoveRow( const QString& name, Container* document, MatrixElement* m, uint r, uint c ); + KFCRemoveRow( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ); ~KFCRemoveRow(); virtual void execute(); @@ -73,13 +73,13 @@ protected: uint rowPos; uint colPos; - QPtrList<MatrixSequenceElement>* row; + TQPtrList<MatrixSequenceElement>* row; }; class KFCInsertRow : public KFCRemoveRow { public: - KFCInsertRow( const QString& name, Container* document, MatrixElement* m, uint r, uint c ); + KFCInsertRow( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ); virtual void execute() { KFCRemoveRow::unexecute(); } virtual void unexecute() { KFCRemoveRow::execute(); } @@ -88,7 +88,7 @@ public: class KFCRemoveColumn : public Command { public: - KFCRemoveColumn( const QString& name, Container* document, MatrixElement* m, uint r, uint c ); + KFCRemoveColumn( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ); ~KFCRemoveColumn(); virtual void execute(); @@ -99,13 +99,13 @@ protected: uint rowPos; uint colPos; - QPtrList<MatrixSequenceElement>* column; + TQPtrList<MatrixSequenceElement>* column; }; class KFCInsertColumn : public KFCRemoveColumn { public: - KFCInsertColumn( const QString& name, Container* document, MatrixElement* m, uint r, uint c ); + KFCInsertColumn( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ); virtual void execute() { KFCRemoveColumn::unexecute(); } virtual void unexecute() { KFCRemoveColumn::execute(); } @@ -166,7 +166,7 @@ KCommand* MatrixSequenceElement::buildCommand( Container* container, Request* re } -KFCRemoveRow::KFCRemoveRow( const QString& name, Container* document, MatrixElement* m, uint r, uint c ) +KFCRemoveRow::KFCRemoveRow( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ) : Command( name, document ), matrix( m ), rowPos( r ), colPos( c ), row( 0 ) { } @@ -206,10 +206,10 @@ void KFCRemoveRow::unexecute() } -KFCInsertRow::KFCInsertRow( const QString& name, Container* document, MatrixElement* m, uint r, uint c ) +KFCInsertRow::KFCInsertRow( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ) : KFCRemoveRow( name, document, m, r, c ) { - row = new QPtrList< MatrixSequenceElement >; + row = new TQPtrList< MatrixSequenceElement >; row->setAutoDelete( true ); for ( uint i = 0; i < matrix->getColumns(); i++ ) { row->append( new MatrixSequenceElement( matrix ) ); @@ -217,10 +217,10 @@ KFCInsertRow::KFCInsertRow( const QString& name, Container* document, MatrixElem } -KFCRemoveColumn::KFCRemoveColumn( const QString& name, Container* document, MatrixElement* m, uint r, uint c ) +KFCRemoveColumn::KFCRemoveColumn( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ) : Command( name, document ), matrix( m ), rowPos( r ), colPos( c ) { - column = new QPtrList< MatrixSequenceElement >; + column = new TQPtrList< MatrixSequenceElement >; column->setAutoDelete( true ); } @@ -260,7 +260,7 @@ void KFCRemoveColumn::unexecute() } -KFCInsertColumn::KFCInsertColumn( const QString& name, Container* document, MatrixElement* m, uint r, uint c ) +KFCInsertColumn::KFCInsertColumn( const TQString& name, Container* document, MatrixElement* m, uint r, uint c ) : KFCRemoveColumn( name, document, m, r, c ) { for ( uint i = 0; i < matrix->getRows(); i++ ) { @@ -269,8 +269,8 @@ KFCInsertColumn::KFCInsertColumn( const QString& name, Container* document, Matr } -MatrixElement::MatrixElement(uint rows, uint columns, BasicElement* parent) - : BasicElement(parent), +MatrixElement::MatrixElement(uint rows, uint columns, BasicElement* tqparent) + : BasicElement(tqparent), m_rowNumber( 0 ), m_align( NoAlign ), m_widthType( NoSize ), @@ -284,7 +284,7 @@ MatrixElement::MatrixElement(uint rows, uint columns, BasicElement* parent) m_customDisplayStyle( false ) { for (uint r = 0; r < rows; r++) { - QPtrList< MatrixSequenceElement >* list = new QPtrList< MatrixSequenceElement >; + TQPtrList< MatrixSequenceElement >* list = new TQPtrList< MatrixSequenceElement >; list->setAutoDelete(true); for (uint c = 0; c < columns; c++) { list->append(new MatrixSequenceElement(this)); @@ -305,12 +305,12 @@ MatrixElement::MatrixElement( const MatrixElement& other ) uint rows = other.getRows(); uint columns = other.getColumns(); - QPtrListIterator< QPtrList< MatrixSequenceElement > > rowIter( other.content ); + TQPtrListIterator< TQPtrList< MatrixSequenceElement > > rowIter( other.content ); for (uint r = 0; r < rows; r++) { ++rowIter; - QPtrListIterator< MatrixSequenceElement > colIter( *rowIter.current() ); + TQPtrListIterator< MatrixSequenceElement > colIter( *rowIter.current() ); - QPtrList< MatrixSequenceElement >* list = new QPtrList< MatrixSequenceElement >; + TQPtrList< MatrixSequenceElement >* list = new TQPtrList< MatrixSequenceElement >; list->setAutoDelete(true); for (uint c = 0; c < columns; c++) { ++colIter; @@ -339,12 +339,12 @@ void MatrixElement::entered( SequenceElement* /*child*/ ) BasicElement* MatrixElement::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()); uint rows = getRows(); uint columns = getColumns(); @@ -430,16 +430,16 @@ BasicElement* MatrixElement::goToPos( FormulaCursor* cursor, bool& handled, /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ void MatrixElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style ) { - QMemArray<luPixel> toMidlines(getRows()); - QMemArray<luPixel> fromMidlines(getRows()); - QMemArray<luPixel> widths(getColumns()); + TQMemArray<luPixel> toMidlines(getRows()); + TQMemArray<luPixel> fromMidlines(getRows()); + TQMemArray<luPixel> widths(getColumns()); toMidlines.fill(0); fromMidlines.fill(0); @@ -453,14 +453,14 @@ void MatrixElement::calcSizes( const ContextStyle& context, double factor = style.sizeFactor(); for (uint r = 0; r < rows; r++) { - QPtrList< MatrixSequenceElement >* list = content.at(r); + TQPtrList< MatrixSequenceElement >* list = content.at(r); for (uint c = 0; c < columns; c++) { SequenceElement* element = list->at(c); element->calcSizes( context, i_tstyle, i_istyle, style ); - toMidlines[r] = QMAX(toMidlines[r], element->axis( context, i_tstyle, factor )); - fromMidlines[r] = QMAX(fromMidlines[r], + toMidlines[r] = TQMAX(toMidlines[r], element->axis( context, i_tstyle, factor )); + fromMidlines[r] = TQMAX(fromMidlines[r], element->getHeight()-element->axis( context, i_tstyle, factor )); - widths[c] = QMAX(widths[c], element->getWidth()); + widths[c] = TQMAX(widths[c], element->getWidth()); } } @@ -469,7 +469,7 @@ void MatrixElement::calcSizes( const ContextStyle& context, luPixel yPos = 0; for (uint r = 0; r < rows; r++) { - QPtrList< MatrixSequenceElement >* list = content.at(r); + TQPtrList< MatrixSequenceElement >* list = content.at(r); luPixel xPos = 0; yPos += toMidlines[r]; for (uint c = 0; c < columns; c++) { @@ -508,18 +508,18 @@ void MatrixElement::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 MatrixElement::draw( QPainter& painter, const LuPixelRect& rect, +void MatrixElement::draw( TQPainter& painter, const LuPixelRect& rect, 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( rect ) ) // return; @@ -537,7 +537,7 @@ void MatrixElement::draw( QPainter& painter, const LuPixelRect& rect, } // Debug - //painter.setPen(Qt::red); + //painter.setPen(TQt::red); //painter.drawRect(myPos.x(), myPos.y(), getWidth(), getHeight()); } @@ -730,12 +730,12 @@ void MatrixElement::selectChild(FormulaCursor* cursor, BasicElement* child) const MatrixSequenceElement* MatrixElement::getElement( uint row, uint column ) const { - QPtrListIterator< QPtrList < MatrixSequenceElement > > rows( content ); + TQPtrListIterator< TQPtrList < MatrixSequenceElement > > rows( content ); rows += row; if ( ! rows.current() ) return 0; - QPtrListIterator< MatrixSequenceElement > cols ( *rows.current() ); + TQPtrListIterator< MatrixSequenceElement > cols ( *rows.current() ); cols += column; return cols.current(); } @@ -761,7 +761,7 @@ bool MatrixElement::searchElement(BasicElement* element, uint& row, uint& column /** * Appends our attributes to the dom element. */ -void MatrixElement::writeDom(QDomElement element) +void MatrixElement::writeDom(TQDomElement element) { BasicElement::writeDom(element); @@ -771,11 +771,11 @@ void MatrixElement::writeDom(QDomElement element) element.setAttribute("ROWS", rows); element.setAttribute("COLUMNS", cols); - QDomDocument doc = element.ownerDocument(); + TQDomDocument doc = element.ownerDocument(); for (uint r = 0; r < rows; r++) { for (uint c = 0; c < cols; c++) { - QDomElement tmp = getElement(r,c)->getElementDom(doc); + TQDomElement tmp = getElement(r,c)->getElementDom(doc); element.appendChild(tmp); } element.appendChild(doc.createComment("end of row")); @@ -786,13 +786,13 @@ void MatrixElement::writeDom(QDomElement element) * Reads our attributes from the element. * Returns false if it failed. */ -bool MatrixElement::readAttributesFromDom(QDomElement element) +bool MatrixElement::readAttributesFromDom(TQDomElement element) { if (!BasicElement::readAttributesFromDom(element)) { return false; } uint rows = 0; - QString rowStr = element.attribute("ROWS"); + TQString rowStr = element.attribute("ROWS"); if(!rowStr.isNull()) { rows = rowStr.toInt(); } @@ -801,7 +801,7 @@ bool MatrixElement::readAttributesFromDom(QDomElement element) return false; } - QString columnStr = element.attribute("COLUMNS"); + TQString columnStr = element.attribute("COLUMNS"); uint cols = 0; if(!columnStr.isNull()) { cols = columnStr.toInt(); @@ -813,7 +813,7 @@ bool MatrixElement::readAttributesFromDom(QDomElement element) content.clear(); for (uint r = 0; r < rows; r++) { - QPtrList< MatrixSequenceElement >* list = new QPtrList< MatrixSequenceElement >; + TQPtrList< MatrixSequenceElement >* list = new TQPtrList< MatrixSequenceElement >; list->setAutoDelete(true); content.append(list); for (uint c = 0; c < cols; c++) { @@ -829,7 +829,7 @@ bool MatrixElement::readAttributesFromDom(QDomElement element) * that needs to be read. * Returns false if it failed. */ -bool MatrixElement::readContentFromDom(QDomNode& node) +bool MatrixElement::readContentFromDom(TQDomNode& node) { if (!BasicElement::readContentFromDom(node)) { return false; @@ -843,7 +843,7 @@ bool MatrixElement::readContentFromDom(QDomNode& node) while ( !node.isNull() && r < rows ) { if ( node.isElement() ) { SequenceElement* element = getElement( r, c ); - QDomElement e = node.toElement(); + TQDomElement e = node.toElement(); if ( !element->buildFromDom( e ) ) { return false; } @@ -858,38 +858,38 @@ bool MatrixElement::readContentFromDom(QDomNode& node) return true; } -bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) +bool MatrixElement::readAttributesFromMathMLDom( const TQDomElement& element ) { if ( ! BasicElement::readAttributesFromMathMLDom( element ) ) { return false; } - QString alignStr = element.attribute( "align" ).lower(); + TQString alignStr = element.attribute( "align" ).lower(); if ( ! alignStr.isNull() ) { - if ( alignStr.find( "top" ) != -1 ) { + if ( alignStr.tqfind( "top" ) != -1 ) { m_align = TopAlign; } - else if ( alignStr.find( "bottom" ) != -1 ) { + else if ( alignStr.tqfind( "bottom" ) != -1 ) { m_align = BottomAlign; } - else if ( alignStr.find( "center" ) != -1 ) { + else if ( alignStr.tqfind( "center" ) != -1 ) { m_align = CenterAlign; } - else if ( alignStr.find( "baseline" ) != -1 ) { + else if ( alignStr.tqfind( "baseline" ) != -1 ) { m_align = BaselineAlign; } - else if ( alignStr.find( "axis" ) != -1 ) { + else if ( alignStr.tqfind( "axis" ) != -1 ) { m_align = AxisAlign; } - int index = alignStr.findRev( ' ' ); + int index = alignStr.tqfindRev( ' ' ); if ( index != -1 ) { m_rowNumber = alignStr.right( index + 1 ).toInt(); } } - QString rowalignStr = element.attribute( "rowalign" ).lower(); + TQString rowalignStr = element.attribute( "rowalign" ).lower(); if ( ! rowalignStr.isNull() ) { - QStringList list = QStringList::split( ' ', rowalignStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', rowalignStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { if ( *it == "top" ) { m_rowAlign.append( TopAlign ); } @@ -907,10 +907,10 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString columnalignStr = element.attribute( "columnalign" ).lower(); + TQString columnalignStr = element.attribute( "columnalign" ).lower(); if ( ! columnalignStr.isNull() ) { - QStringList list = QStringList::split( ' ', columnalignStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', columnalignStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { if ( *it == "left" ) { m_columnAlign.append( LeftHorizontalAlign ); } @@ -922,22 +922,22 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString alignmentscopeStr = element.attribute( "alignmentscope" ).lower(); - if ( ! alignmentscopeStr.isNull() ) { - QStringList list = QStringList::split( ' ', alignmentscopeStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQString tqalignmentscopeStr = element.attribute( "tqalignmentscope" ).lower(); + if ( ! tqalignmentscopeStr.isNull() ) { + TQStringList list = TQStringList::split( ' ', tqalignmentscopeStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { if ( *it == "true" ) { - m_alignmentScope.append( true ); + m_tqalignmentScope.append( true ); } else if ( *it == "false" ) { - m_alignmentScope.append( false ); + m_tqalignmentScope.append( false ); } } } - QString columnwidthStr = element.attribute( "columnwidth" ).lower(); + TQString columnwidthStr = element.attribute( "columnwidth" ).lower(); if ( columnwidthStr.isNull() ) { - QStringList list = QStringList::split( ' ', columnwidthStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', columnwidthStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { SizeType type = NoSize; double length; if ( *it == "auto" ) { @@ -960,7 +960,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString widthStr = element.attribute( "width" ).lower(); + TQString widthStr = element.attribute( "width" ).lower(); if ( ! widthStr.isNull() ) { if ( widthStr == "auto" ) { m_widthType = AutoSize; @@ -969,10 +969,10 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) m_width = getSize( widthStr, &m_widthType ); } } - QString rowspacingStr = element.attribute( "rowspacing" ).lower(); + TQString rowspacingStr = element.attribute( "rowspacing" ).lower(); if ( ! rowspacingStr.isNull() ) { - QStringList list = QStringList::split( ' ', rowspacingStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', rowspacingStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { SizeType type; double length = getSize( *it, &type ); if ( type != NoSize ) { @@ -981,10 +981,10 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString columnspacingStr = element.attribute( "columnspacing" ).lower(); + TQString columnspacingStr = element.attribute( "columnspacing" ).lower(); if ( ! columnspacingStr.isNull() ) { - QStringList list = QStringList::split( ' ', columnspacingStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', columnspacingStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { SizeType type; double length = getSize( *it, &type ); if ( type == NoSize ) { @@ -998,10 +998,10 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString rowlinesStr = element.attribute( "rowlines" ).lower(); + TQString rowlinesStr = element.attribute( "rowlines" ).lower(); if ( ! rowlinesStr.isNull() ) { - QStringList list = QStringList::split( ' ', rowlinesStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', rowlinesStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { if ( *it == "none" ) { m_rowLines.append( NoneLine ); } @@ -1013,10 +1013,10 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString columnlinesStr = element.attribute( "columnlines" ).lower(); + TQString columnlinesStr = element.attribute( "columnlines" ).lower(); if ( ! columnlinesStr.isNull() ) { - QStringList list = QStringList::split( ' ', columnlinesStr ); - for ( QStringList::iterator it = list.begin(); it != list.end(); it++ ) { + TQStringList list = TQStringList::split( ' ', columnlinesStr ); + for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { if ( *it == "none" ) { m_columnLines.append( NoneLine ); } @@ -1028,7 +1028,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString frameStr = element.attribute( "frame" ).stripWhiteSpace().lower(); + TQString frameStr = element.attribute( "frame" ).stripWhiteSpace().lower(); if ( ! frameStr.isNull() ) { if ( frameStr == "none" ) { m_frame = NoneLine; @@ -1040,9 +1040,9 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) m_frame = DashedLine; } } - QString framespacingStr = element.attribute( "framespacing" ); + TQString framespacingStr = element.attribute( "framespacing" ); if ( ! framespacingStr.isNull() ) { - QStringList list = QStringList::split( ' ', framespacingStr ); + TQStringList list = TQStringList::split( ' ', framespacingStr ); m_frameHSpacing = getSize( list[0], &m_frameHSpacingType ); if ( m_frameHSpacingType == NoSize ) { m_frameHSpacingType = getSpace( list[0] ); @@ -1054,7 +1054,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) } } } - QString equalrowsStr = element.attribute( "equalrows" ).stripWhiteSpace().lower(); + TQString equalrowsStr = element.attribute( "equalrows" ).stripWhiteSpace().lower(); if ( ! equalrowsStr.isNull() ) { m_customEqualRows = true; if ( equalrowsStr == "false" ) { @@ -1064,7 +1064,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) m_equalRows = true; } } - QString equalcolumnsStr = element.attribute( "equalcolumns" ).stripWhiteSpace().lower(); + TQString equalcolumnsStr = element.attribute( "equalcolumns" ).stripWhiteSpace().lower(); if ( ! equalcolumnsStr.isNull() ) { m_customEqualColumns = true; if ( equalcolumnsStr == "false" ) { @@ -1074,7 +1074,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) m_equalColumns = true; } } - QString displaystyleStr = element.attribute( "displaystyle" ).stripWhiteSpace().lower(); + TQString displaystyleStr = element.attribute( "displaystyle" ).stripWhiteSpace().lower(); if ( ! displaystyleStr.isNull() ) { m_customDisplayStyle = true; if ( displaystyleStr == "false" ) { @@ -1084,7 +1084,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) m_displayStyle = true; } } - QString sideStr = element.attribute( "side" ).stripWhiteSpace().lower(); + TQString sideStr = element.attribute( "side" ).stripWhiteSpace().lower(); if ( ! sideStr.isNull() ) { if ( sideStr == "left" ) { m_side = LeftSide; @@ -1099,7 +1099,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) m_side = RightOverlapSide; } } - QString minlabelspacingStr = element.attribute( "minlabelspacing" ).stripWhiteSpace().lower(); + TQString minlabelspacingStr = element.attribute( "minlabelspacing" ).stripWhiteSpace().lower(); if ( ! minlabelspacingStr.isNull() ) { m_minLabelSpacing = getSize( minlabelspacingStr, &m_minLabelSpacingType ); if ( m_minLabelSpacingType == NoSize ) { @@ -1115,7 +1115,7 @@ bool MatrixElement::readAttributesFromMathMLDom( const QDomElement& element ) * (e. g. for fence operators). * Returns the number of nodes processed or -1 if it failed. */ -int MatrixElement::readContentFromMathMLDom( QDomNode& node ) +int MatrixElement::readContentFromMathMLDom( TQDomNode& node ) { // We have twice, since there may be empty elements and we need to know how // many of them we have. So, first pass, get number of rows and columns @@ -1126,16 +1126,16 @@ int MatrixElement::readContentFromMathMLDom( QDomNode& node ) uint rows = 0; uint cols = 0; - QDomNode n = node; + TQDomNode n = node; while ( !n.isNull() ) { if ( n.isElement() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.tagName().lower() == "mtr" || e.tagName().lower() == "mlabeledtr" ) { rows++; /* Determins the number of columns */ - QDomNode cellnode = e.firstChild(); + TQDomNode cellnode = e.firstChild(); int cc = 0; while ( !cellnode.isNull() ) { @@ -1155,7 +1155,7 @@ int MatrixElement::readContentFromMathMLDom( QDomNode& node ) // Create elements content.clear(); for (uint r = 0; r < rows; r++) { - QPtrList< MatrixSequenceElement >* list = new QPtrList< MatrixSequenceElement >; + TQPtrList< MatrixSequenceElement >* list = new TQPtrList< MatrixSequenceElement >; list->setAutoDelete(true); content.append(list); for (uint c = 0; c < cols; c++) { @@ -1169,9 +1169,9 @@ int MatrixElement::readContentFromMathMLDom( QDomNode& node ) uint c = 0; while ( !node.isNull() ) { if ( node.isElement() ) { - QDomElement e = node.toElement(); + TQDomElement e = node.toElement(); if ( e.tagName().lower() == "mtr" || e.tagName().lower() == "mlabeledtr" ) { - QDomNode cellnode = e.firstChild(); + TQDomNode cellnode = e.firstChild(); if ( e.tagName().lower() == "mlabeledtr" ) { while ( ! cellnode.isNull() && ! cellnode.isElement() ) cellnode = cellnode.nextSibling(); @@ -1180,7 +1180,7 @@ int MatrixElement::readContentFromMathMLDom( QDomNode& node ) } while ( !cellnode.isNull() ) { if ( cellnode.isElement() ) { - QDomElement cellelement = cellnode.toElement(); + TQDomElement cellelement = cellnode.toElement(); if ( cellelement.tagName().lower() != "mtd" ) { // TODO: Inferred mtd. Deprecated in MathML 2.0 kdWarning( DEBUGID ) << "Unsupported tag " @@ -1205,11 +1205,11 @@ int MatrixElement::readContentFromMathMLDom( QDomNode& node ) return 1; } -QString MatrixElement::toLatex() +TQString MatrixElement::toLatex() { //All the border handling must be implemented here too - QString matrix; + TQString matrix; uint cols=getColumns(); uint rows=getRows(); @@ -1232,9 +1232,9 @@ QString MatrixElement::toLatex() return matrix; } -QString MatrixElement::formulaString() +TQString MatrixElement::formulaString() { - QString matrix = "["; + TQString matrix = "["; uint cols=getColumns(); uint rows=getRows(); for (uint r = 0; r < rows; r++) { @@ -1256,11 +1256,11 @@ SequenceElement* MatrixElement::elementAt(uint row, uint column) return getElement( row, column ); } -void MatrixElement::writeMathMLAttributes( QDomElement& element ) const +void MatrixElement::writeMathMLAttributes( TQDomElement& element ) const { - QString rownumber; + TQString rownumber; if ( m_rowNumber ) { - rownumber = QString( " %1" ).arg( m_rowNumber ); + rownumber = TQString( " %1" ).tqarg( m_rowNumber ); } switch ( m_align ) { case TopAlign: @@ -1281,8 +1281,8 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const default: break; } - QString rowalign; - for ( QValueList< VerticalAlign >::const_iterator it = m_rowAlign.begin(); it != m_rowAlign.end(); it++ ) + TQString rowalign; + for ( TQValueList<VerticalAlign >::const_iterator it = m_rowAlign.begin(); it != m_rowAlign.end(); it++ ) { switch ( *it ) { case TopAlign: @@ -1307,8 +1307,8 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const if ( ! rowalign.isNull() ) { element.setAttribute( "rowalign", rowalign.stripWhiteSpace() ); } - QString columnalign; - for ( QValueList< HorizontalAlign >::const_iterator it = m_columnAlign.begin(); it != m_columnAlign.end(); it++ ) + TQString columnalign; + for ( TQValueList<HorizontalAlign >::const_iterator it = m_columnAlign.begin(); it != m_columnAlign.end(); it++ ) { switch ( *it ) { case LeftHorizontalAlign: @@ -1327,22 +1327,22 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const if ( ! columnalign.isNull() ) { element.setAttribute( "columnalign", columnalign.stripWhiteSpace() ); } - QString alignmentscope; - for ( QValueList< bool >::const_iterator it = m_alignmentScope.begin(); it != m_alignmentScope.end(); it++ ) + TQString tqalignmentscope; + for ( TQValueList< bool >::const_iterator it = m_tqalignmentScope.begin(); it != m_tqalignmentScope.end(); it++ ) { if ( *it ) { - alignmentscope.append( "true " ); + tqalignmentscope.append( "true " ); } else { - alignmentscope.append( "false " ); + tqalignmentscope.append( "false " ); } } - if ( ! alignmentscope.isNull() ) { - element.setAttribute( "alignmentscope", alignmentscope.stripWhiteSpace() ); + if ( ! tqalignmentscope.isNull() ) { + element.setAttribute( "tqalignmentscope", tqalignmentscope.stripWhiteSpace() ); } - QString columnwidth; - QValueList< double >::const_iterator lengthIt = m_columnWidth.begin(); - for ( QValueList< SizeType >::const_iterator typeIt = m_columnWidthType.begin(); + TQString columnwidth; + TQValueList< double >::const_iterator lengthIt = m_columnWidth.begin(); + for ( TQValueList< SizeType >::const_iterator typeIt = m_columnWidthType.begin(); typeIt != m_columnWidthType.end(); typeIt ++ ) { switch ( *typeIt ) { case AutoSize: @@ -1352,15 +1352,15 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const columnwidth.append( "fit " ); break; case AbsoluteSize: - columnwidth.append( QString( "%1pt " ).arg( *lengthIt ) ); + columnwidth.append( TQString( "%1pt " ).tqarg( *lengthIt ) ); lengthIt++; break; case RelativeSize: - columnwidth.append( QString( "%1% " ).arg( *lengthIt * 100.0 ) ); + columnwidth.append( TQString( "%1% " ).tqarg( *lengthIt * 100.0 ) ); lengthIt++; break; case PixelSize: - columnwidth.append( QString( "%1px " ).arg( *lengthIt ) ); + columnwidth.append( TQString( "%1px " ).tqarg( *lengthIt ) ); lengthIt++; break; case NegativeVeryVeryThinMathSpace: @@ -1417,30 +1417,30 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const element.setAttribute( "width", "auto" ); break; case AbsoluteSize: - element.setAttribute( "width", QString( "%1pt" ).arg( m_width ) ); + element.setAttribute( "width", TQString( "%1pt" ).tqarg( m_width ) ); break; case RelativeSize: - element.setAttribute( "width", QString( "%1% " ).arg( m_width * 100.0 ) ); + element.setAttribute( "width", TQString( "%1% " ).tqarg( m_width * 100.0 ) ); break; case PixelSize: - element.setAttribute( "width", QString( "%1px " ).arg( m_width ) ); + element.setAttribute( "width", TQString( "%1px " ).tqarg( m_width ) ); break; default: break; } - QString rowspacing; + TQString rowspacing; lengthIt = m_rowSpacing.begin(); - for ( QValueList< SizeType >::const_iterator typeIt = m_rowSpacingType.begin(); + for ( TQValueList< SizeType >::const_iterator typeIt = m_rowSpacingType.begin(); typeIt != m_rowSpacingType.end(); typeIt++, lengthIt++ ) { switch ( *typeIt ) { case AbsoluteSize: - rowspacing.append( QString( "%1pt " ).arg( *lengthIt ) ); + rowspacing.append( TQString( "%1pt " ).tqarg( *lengthIt ) ); break; case RelativeSize: - rowspacing.append( QString( "%1% " ).arg( *lengthIt * 100.0 ) ); + rowspacing.append( TQString( "%1% " ).tqarg( *lengthIt * 100.0 ) ); break; case PixelSize: - rowspacing.append( QString( "%1px " ).arg( *lengthIt ) ); + rowspacing.append( TQString( "%1px " ).tqarg( *lengthIt ) ); break; default: break; @@ -1449,21 +1449,21 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const if ( ! rowspacing.isNull() ) { element.setAttribute( "rowspacing", rowspacing.stripWhiteSpace() ); } - QString columnspacing; + TQString columnspacing; lengthIt = m_columnSpacing.begin(); - for ( QValueList< SizeType >::const_iterator typeIt = m_columnSpacingType.begin(); + for ( TQValueList< SizeType >::const_iterator typeIt = m_columnSpacingType.begin(); typeIt != m_columnSpacingType.end(); typeIt++ ) { switch ( *typeIt ) { case AbsoluteSize: - columnspacing.append( QString( "%1pt " ).arg( *lengthIt ) ); + columnspacing.append( TQString( "%1pt " ).tqarg( *lengthIt ) ); lengthIt++; break; case RelativeSize: - columnspacing.append( QString( "%1% " ).arg( *lengthIt * 100.0 ) ); + columnspacing.append( TQString( "%1% " ).tqarg( *lengthIt * 100.0 ) ); lengthIt++; break; case PixelSize: - columnspacing.append( QString( "%1px " ).arg( *lengthIt ) ); + columnspacing.append( TQString( "%1px " ).tqarg( *lengthIt ) ); lengthIt++; break; case NegativeVeryVeryThinMathSpace: @@ -1515,8 +1515,8 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const if ( ! rowspacing.isNull() ) { element.setAttribute( "rowspacing", rowspacing.stripWhiteSpace() ); } - QString rowlines; - for ( QValueList< LineType >::const_iterator it = m_rowLines.begin(); it != m_rowLines.end(); it++ ) + TQString rowlines; + for ( TQValueList< LineType >::const_iterator it = m_rowLines.begin(); it != m_rowLines.end(); it++ ) { switch ( *it ) { case NoneLine: @@ -1535,8 +1535,8 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const if ( ! rowlines.isNull() ) { element.setAttribute( "rowlines", rowlines.stripWhiteSpace() ); } - QString columnlines; - for ( QValueList< LineType >::const_iterator it = m_columnLines.begin(); it != m_columnLines.end(); it++ ) + TQString columnlines; + for ( TQValueList< LineType >::const_iterator it = m_columnLines.begin(); it != m_columnLines.end(); it++ ) { switch ( *it ) { case NoneLine: @@ -1568,16 +1568,16 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const default: break; } - QString framespacing; + TQString framespacing; switch ( m_frameHSpacingType ) { case AbsoluteSize: - framespacing.append( QString( "%1pt " ).arg( m_frameHSpacing ) ); + framespacing.append( TQString( "%1pt " ).tqarg( m_frameHSpacing ) ); break; case RelativeSize: - framespacing.append( QString( "%1% " ).arg( m_frameHSpacing * 100.0 ) ); + framespacing.append( TQString( "%1% " ).tqarg( m_frameHSpacing * 100.0 ) ); break; case PixelSize: - framespacing.append( QString( "%1px " ).arg( m_frameHSpacing ) ); + framespacing.append( TQString( "%1px " ).tqarg( m_frameHSpacing ) ); break; case NegativeVeryVeryThinMathSpace: framespacing.append( "negativeveryverythinmathspace " ); @@ -1626,13 +1626,13 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const } switch ( m_frameVSpacingType ) { case AbsoluteSize: - framespacing.append( QString( "%1pt " ).arg( m_frameVSpacing ) ); + framespacing.append( TQString( "%1pt " ).tqarg( m_frameVSpacing ) ); break; case RelativeSize: - framespacing.append( QString( "%1% " ).arg( m_frameVSpacing * 100.0 ) ); + framespacing.append( TQString( "%1% " ).tqarg( m_frameVSpacing * 100.0 ) ); break; case PixelSize: - framespacing.append( QString( "%1px " ).arg( m_frameVSpacing ) ); + framespacing.append( TQString( "%1px " ).tqarg( m_frameVSpacing ) ); break; case NegativeVeryVeryThinMathSpace: framespacing.append( "negativeveryverythinmathspace " ); @@ -1709,13 +1709,13 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const } switch ( m_minLabelSpacingType ) { case AbsoluteSize: - element.setAttribute( "minlabelspacing", QString( "%1pt" ).arg( m_minLabelSpacing ) ); + element.setAttribute( "minlabelspacing", TQString( "%1pt" ).tqarg( m_minLabelSpacing ) ); break; case RelativeSize: - element.setAttribute( "minlabelspacing", QString( "%1%" ).arg( m_minLabelSpacing * 100.0 ) ); + element.setAttribute( "minlabelspacing", TQString( "%1%" ).tqarg( m_minLabelSpacing * 100.0 ) ); break; case PixelSize: - element.setAttribute( "minlabelspacing", QString( "%1px" ).arg( m_minLabelSpacing ) ); + element.setAttribute( "minlabelspacing", TQString( "%1px" ).tqarg( m_minLabelSpacing ) ); break; case NegativeVeryVeryThinMathSpace: element.setAttribute( "minlabelspacing", "negativeveryverythinmathspace" ); @@ -1764,12 +1764,12 @@ void MatrixElement::writeMathMLAttributes( QDomElement& element ) const } } -void MatrixElement::writeMathMLContent( QDomDocument& doc, - QDomElement& element, +void MatrixElement::writeMathMLContent( TQDomDocument& doc, + TQDomElement& element, bool oasisFormat ) const { - QDomElement row; - QDomElement cell; + TQDomElement row; + TQDomElement cell; uint rows = getRows(); uint cols = getColumns(); @@ -1799,18 +1799,18 @@ class MultilineSequenceElement : public SequenceElement { typedef SequenceElement inherited; public: - MultilineSequenceElement( BasicElement* parent = 0 ); + MultilineSequenceElement( BasicElement* tqparent = 0 ); virtual MultilineSequenceElement* clone() { return new MultilineSequenceElement( *this ); } virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); /** * Calculates our width and height and - * our children's parentPosition. + * our tqchildren's tqparentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -1829,9 +1829,9 @@ public: */ virtual KCommand* buildCommand( Container*, Request* ); - virtual KCommand* input( Container* container, QKeyEvent* event ); + virtual KCommand* input( Container* container, TQKeyEvent* event ); - virtual KCommand* input( Container* container, QChar ch ); + virtual KCommand* input( Container* container, TQChar ch ); uint tabCount() const { return tabs.count(); } @@ -1846,18 +1846,18 @@ public: /// Return the position of tab i. int tabPos( uint i ); - virtual void writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat = false ) const ; + virtual void writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat = false ) const ; private: - QPtrList<BasicElement> tabs; + TQPtrList<BasicElement> tabs; }; // Split the line at position pos. class KFCNewLine : public Command { public: - KFCNewLine( const QString& name, Container* document, + KFCNewLine( const TQString& name, Container* document, MultilineSequenceElement* line, uint pos ); virtual ~KFCNewLine(); @@ -1872,7 +1872,7 @@ private: }; -KFCNewLine::KFCNewLine( const QString& name, Container* document, +KFCNewLine::KFCNewLine( const TQString& name, Container* document, MultilineSequenceElement* line, uint pos ) : Command( name, document ), m_line( line ), m_pos( pos ) @@ -1890,17 +1890,17 @@ KFCNewLine::~KFCNewLine() void KFCNewLine::execute() { FormulaCursor* cursor = getExecuteCursor(); - MultilineElement* parent = static_cast<MultilineElement*>( m_line->getParent() ); - int linePos = parent->content.find( m_line ); - parent->content.insert( linePos+1, m_newline ); + MultilineElement* tqparent = static_cast<MultilineElement*>( m_line->getParent() ); + int linePos = tqparent->content.tqfind( m_line ); + tqparent->content.insert( linePos+1, m_newline ); - // If there are children to be moved. + // If there are tqchildren to be moved. if ( m_line->countChildren() > static_cast<int>( m_pos ) ) { // Remove anything after position pos from the current line m_line->selectAllChildren( cursor ); cursor->setMark( m_pos ); - QPtrList<BasicElement> elementList; + TQPtrList<BasicElement> elementList; m_line->remove( cursor, elementList, beforeCursor ); // Insert the removed stuff into the new line @@ -1925,22 +1925,22 @@ void KFCNewLine::execute() void KFCNewLine::unexecute() { FormulaCursor* cursor = getExecuteCursor(); - MultilineElement* parent = static_cast<MultilineElement*>( m_line->getParent() ); - int linePos = parent->content.find( m_line ); + MultilineElement* tqparent = static_cast<MultilineElement*>( m_line->getParent() ); + int linePos = tqparent->content.tqfind( m_line ); // Now the command owns the new line again. - m_newline = parent->content.at( linePos+1 ); + m_newline = tqparent->content.at( linePos+1 ); // Tell all cursors to leave this sequence FormulaElement* formula = m_line->formula(); formula->elementRemoval( m_newline ); - // If there are children to be moved. + // If there are tqchildren to be moved. if ( m_newline->countChildren() > 0 ) { // Remove anything from the line to be deleted m_newline->selectAllChildren( cursor ); - QPtrList<BasicElement> elementList; + TQPtrList<BasicElement> elementList; m_newline->remove( cursor, elementList, beforeCursor ); // Insert the removed stuff into the previous line @@ -1951,7 +1951,7 @@ void KFCNewLine::unexecute() else { m_line->moveEnd( cursor ); } - parent->content.take( linePos+1 ); + tqparent->content.take( linePos+1 ); // Tell that something changed formula->changed(); @@ -1959,19 +1959,19 @@ void KFCNewLine::unexecute() } -MultilineSequenceElement::MultilineSequenceElement( BasicElement* parent ) - : SequenceElement( parent ) +MultilineSequenceElement::MultilineSequenceElement( BasicElement* tqparent ) + : SequenceElement( tqparent ) { tabs.setAutoDelete( false ); } BasicElement* MultilineSequenceElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - //LuPixelPoint myPos(parentOrigin.x() + getX(), - // parentOrigin.y() + getY()); - BasicElement* e = inherited::goToPos(cursor, handled, point, parentOrigin); + //LuPixelPoint myPos(tqparentOrigin.x() + getX(), + // tqparentOrigin.y() + getY()); + BasicElement* e = inherited::goToPos(cursor, handled, point, tqparentOrigin); if (e == 0) { // If the mouse was behind this line put the cursor to the last position. @@ -2033,19 +2033,19 @@ KCommand* MultilineSequenceElement::buildCommand( Container* container, Request* } -KCommand* MultilineSequenceElement::input( Container* container, QKeyEvent* event ) +KCommand* MultilineSequenceElement::input( Container* container, TQKeyEvent* event ) { int action = event->key(); //int state = event->state(); //MoveFlag flag = movementFlag(state); switch ( action ) { - case Qt::Key_Enter: - case Qt::Key_Return: { + case TQt::Key_Enter: + case TQt::Key_Return: { Request newline( req_addNewline ); return buildCommand( container, &newline ); } - case Qt::Key_Tab: { + case TQt::Key_Tab: { Request r( req_addTabMark ); return buildCommand( container, &r ); } @@ -2054,7 +2054,7 @@ KCommand* MultilineSequenceElement::input( Container* container, QKeyEvent* even } -KCommand* MultilineSequenceElement::input( Container* container, QChar ch ) +KCommand* MultilineSequenceElement::input( Container* container, TQChar ch ) { int latin1 = ch.latin1(); switch (latin1) { @@ -2110,12 +2110,12 @@ int MultilineSequenceElement::tabPos( uint i ) } -void MultilineSequenceElement::writeMathML( QDomDocument& doc, - QDomNode& parent, bool oasisFormat ) const +void MultilineSequenceElement::writeMathML( TQDomDocument& doc, + TQDomNode& tqparent, bool oasisFormat ) const { - // parent is required to be a <mtr> tag + // tqparent is required to be a <mtr> tag - QDomElement tmp = doc.createElement( "TMP" ); + TQDomElement tmp = doc.createElement( "TMP" ); inherited::writeMathML( doc, tmp, oasisFormat ); @@ -2124,14 +2124,14 @@ void MultilineSequenceElement::writeMathML( QDomDocument& doc, * end of a <mtd> tag. */ - QDomElement mtd = doc.createElement( oasisFormat ? "math:mtd" : "mtd" ); + TQDomElement mtd = doc.createElement( oasisFormat ? "math:mtd" : "mtd" ); // The mrow, if it exists. - QDomNode n = tmp.firstChild().firstChild(); + TQDomNode n = tmp.firstChild().firstChild(); while ( !n.isNull() ) { - // the illegal TabMarkers are children of the mrow, child of tmp. + // the illegal TabMarkers are tqchildren of the mrow, child of tmp. if ( n.isElement() && n.toElement().tagName() == "TAB" ) { - parent.appendChild( mtd ); + tqparent.appendChild( mtd ); mtd = doc.createElement( oasisFormat ? "math:mtd" : "mtd" ); } else { @@ -2140,12 +2140,12 @@ void MultilineSequenceElement::writeMathML( QDomDocument& doc, n = n.nextSibling(); } - parent.appendChild( mtd ); + tqparent.appendChild( mtd ); } -MultilineElement::MultilineElement( BasicElement* parent ) - : BasicElement( parent ) +MultilineElement::MultilineElement( BasicElement* tqparent ) + : BasicElement( tqparent ) { content.setAutoDelete( true ); content.append( new MultilineSequenceElement( this ) ); @@ -2184,12 +2184,12 @@ void MultilineElement::entered( SequenceElement* /*child*/ ) * Returns the element the point is in. */ BasicElement* MultilineElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) { - BasicElement* e = inherited::goToPos(cursor, handled, point, parentOrigin); + BasicElement* e = inherited::goToPos(cursor, handled, point, tqparentOrigin); if ( e != 0 ) { - LuPixelPoint myPos(parentOrigin.x() + getX(), - parentOrigin.y() + getY()); + LuPixelPoint myPos(tqparentOrigin.x() + getX(), + tqparentOrigin.y() + getY()); uint count = content.count(); for ( uint i = 0; i < count; ++i ) { @@ -2217,15 +2217,15 @@ void MultilineElement::moveLeft( FormulaCursor* cursor, BasicElement* from ) getParent()->moveLeft(cursor, this); } else { - // Coming from the parent (sequence) we go to + // Coming from the tqparent (sequence) we go to // the very last position if (from == getParent()) { content.at( content.count()-1 )->moveLeft(cursor, this); } else { // Coming from one of the lines we go to the previous line - // or to the parent if there is none. - int pos = content.find( static_cast<MultilineSequenceElement*>( from ) ); + // or to the tqparent if there is none. + int pos = content.tqfind( static_cast<MultilineSequenceElement*>( from ) ); if ( pos > -1 ) { if ( pos > 0 ) { content.at( pos-1 )->moveLeft( cursor, this ); @@ -2252,7 +2252,7 @@ void MultilineElement::moveRight( FormulaCursor* cursor, BasicElement* from ) content.at( 0 )->moveRight(cursor, this); } else { - int pos = content.find( static_cast<MultilineSequenceElement*>( from ) ); + int pos = content.tqfind( static_cast<MultilineSequenceElement*>( from ) ); if ( pos > -1 ) { uint upos = pos; if ( upos < content.count() ) { @@ -2279,15 +2279,15 @@ void MultilineElement::moveUp( FormulaCursor* cursor, BasicElement* from ) getParent()->moveLeft(cursor, this); } else { - // Coming from the parent (sequence) we go to + // Coming from the tqparent (sequence) we go to // the very last position if (from == getParent()) { content.at( content.count()-1 )->moveLeft(cursor, this); } else { // Coming from one of the lines we go to the previous line - // or to the parent if there is none. - int pos = content.find( static_cast<MultilineSequenceElement*>( from ) ); + // or to the tqparent if there is none. + int pos = content.tqfind( static_cast<MultilineSequenceElement*>( from ) ); if ( pos > -1 ) { if ( pos > 0 ) { //content.at( pos-1 )->moveLeft( cursor, this ); @@ -2304,7 +2304,7 @@ void MultilineElement::moveUp( FormulaCursor* cursor, BasicElement* from ) cursorPos += newTabPos-oldTabPos; int nextNewTabPos = newLine->tabPos( tabNum+1 ); if ( nextNewTabPos > -1 ) { - cursorPos = QMIN( cursorPos, nextNewTabPos ); + cursorPos = TQMIN( cursorPos, nextNewTabPos ); } } else { @@ -2314,11 +2314,11 @@ void MultilineElement::moveUp( FormulaCursor* cursor, BasicElement* from ) else { int nextNewTabPos = newLine->tabPos( 0 ); if ( nextNewTabPos > -1 ) { - cursorPos = QMIN( cursorPos, nextNewTabPos ); + cursorPos = TQMIN( cursorPos, nextNewTabPos ); } } cursor->setTo( newLine, - QMIN( cursorPos, + TQMIN( cursorPos, newLine->countChildren() ) ); } else { @@ -2343,7 +2343,7 @@ void MultilineElement::moveDown( FormulaCursor* cursor, BasicElement* from ) content.at( 0 )->moveRight(cursor, this); } else { - int pos = content.find( static_cast<MultilineSequenceElement*>( from ) ); + int pos = content.tqfind( static_cast<MultilineSequenceElement*>( from ) ); if ( pos > -1 ) { uint upos = pos; if ( upos < content.count() ) { @@ -2362,7 +2362,7 @@ void MultilineElement::moveDown( FormulaCursor* cursor, BasicElement* from ) cursorPos += newTabPos-oldTabPos; int nextNewTabPos = newLine->tabPos( tabNum+1 ); if ( nextNewTabPos > -1 ) { - cursorPos = QMIN( cursorPos, nextNewTabPos ); + cursorPos = TQMIN( cursorPos, nextNewTabPos ); } } else { @@ -2372,11 +2372,11 @@ void MultilineElement::moveDown( FormulaCursor* cursor, BasicElement* from ) else { int nextNewTabPos = newLine->tabPos( 0 ); if ( nextNewTabPos > -1 ) { - cursorPos = QMIN( cursorPos, nextNewTabPos ); + cursorPos = TQMIN( cursorPos, nextNewTabPos ); } } cursor->setTo( newLine, - QMIN( cursorPos, + TQMIN( cursorPos, newLine->countChildren() ) ); } else { @@ -2399,9 +2399,9 @@ void MultilineElement::calcSizes( const ContextStyle& context, { double factor = style.sizeFactor(); luPt mySize = context.getAdjustedSize( tstyle, factor ); - QFont font = context.getDefaultFont(); - font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) ); - QFontMetrics fm( font ); + TQFont font = context.getDefaultFont(); + font.setPointSizeFloat( context.tqlayoutUnitPtToPt( mySize ) ); + TQFontMetrics fm( font ); luPixel leading = context.ptToLayoutUnitPt( fm.leading() ); luPixel distY = context.ptToPixelY( context.getThinSpace( tstyle, factor ) ); @@ -2412,13 +2412,13 @@ void MultilineElement::calcSizes( const ContextStyle& context, for ( uint i = 0; i < count; ++i ) { MultilineSequenceElement* line = content.at(i); line->calcSizes( context, tstyle, istyle, style ); - tabCount = QMAX( tabCount, line->tabCount() ); + tabCount = TQMAX( tabCount, line->tabCount() ); height += leading; line->setX( 0 ); line->setY( height ); height += line->getHeight() + distY; - width = QMAX( line->getWidth(), width ); + width = TQMAX( line->getWidth(), width ); } // calculate the tab positions @@ -2427,17 +2427,17 @@ void MultilineElement::calcSizes( const ContextStyle& context, for ( uint i = 0; i < count; ++i ) { MultilineSequenceElement* line = content.at(i); if ( t < line->tabCount() ) { - pos = QMAX( pos, line->tab( t )->getX() ); + pos = TQMAX( pos, line->tab( t )->getX() ); } else { - pos = QMAX( pos, line->getWidth() ); + pos = TQMAX( pos, line->getWidth() ); } } for ( uint i = 0; i < count; ++i ) { MultilineSequenceElement* line = content.at(i); if ( t < line->tabCount() ) { line->moveTabTo( t, pos ); - width = QMAX( width, line->getWidth() ); + width = TQMAX( width, line->getWidth() ); } } } @@ -2453,14 +2453,14 @@ void MultilineElement::calcSizes( const ContextStyle& context, } } -void MultilineElement::draw( QPainter& painter, const LuPixelRect& r, +void MultilineElement::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() ); uint count = content.count(); if ( context.edit() ) { @@ -2471,10 +2471,10 @@ void MultilineElement::draw( QPainter& painter, const LuPixelRect& r, if ( tabCount < line->tabCount() ) { for ( uint t = tabCount; t < line->tabCount(); ++t ) { BasicElement* marker = line->tab( t ); - painter.drawLine( context.layoutUnitToPixelX( myPos.x()+marker->getX() ), - context.layoutUnitToPixelY( myPos.y() ), - context.layoutUnitToPixelX( myPos.x()+marker->getX() ), - context.layoutUnitToPixelY( myPos.y()+getHeight() ) ); + painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x()+marker->getX() ), + context.tqlayoutUnitToPixelY( myPos.y() ), + context.tqlayoutUnitToPixelX( myPos.x()+marker->getX() ), + context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ) ); } tabCount = line->tabCount(); } @@ -2498,7 +2498,7 @@ void MultilineElement::dispatchFontCommand( FontCommand* cmd ) } void MultilineElement::insert( FormulaCursor* cursor, - QPtrList<BasicElement>& newChildren, + TQPtrList<BasicElement>& newChildren, Direction direction ) { MultilineSequenceElement* e = static_cast<MultilineSequenceElement*>(newChildren.take(0)); @@ -2516,7 +2516,7 @@ void MultilineElement::insert( FormulaCursor* cursor, } void MultilineElement::remove( FormulaCursor* cursor, - QPtrList<BasicElement>& removedChildren, + TQPtrList<BasicElement>& removedChildren, Direction direction ) { if ( content.count() == 1 ) { //&& ( cursor->getPos() == 0 ) ) { @@ -2566,7 +2566,7 @@ SequenceElement* MultilineElement::getMainChild() void MultilineElement::selectChild(FormulaCursor* cursor, BasicElement* child) { - int pos = content.find( dynamic_cast<MultilineSequenceElement*>( child ) ); + int pos = content.tqfind( dynamic_cast<MultilineSequenceElement*>( child ) ); if ( pos > -1 ) { cursor->setTo( this, pos ); //content.at( pos )->moveRight( cursor, this ); @@ -2577,26 +2577,26 @@ void MultilineElement::selectChild(FormulaCursor* cursor, BasicElement* child) /** * Appends our attributes to the dom element. */ -void MultilineElement::writeDom(QDomElement element) +void MultilineElement::writeDom(TQDomElement element) { BasicElement::writeDom(element); uint lineCount = content.count(); element.setAttribute( "LINES", lineCount ); - QDomDocument doc = element.ownerDocument(); + TQDomDocument doc = element.ownerDocument(); for ( uint i = 0; i < lineCount; ++i ) { - QDomElement tmp = content.at( i )->getElementDom(doc); + TQDomElement tmp = content.at( i )->getElementDom(doc); element.appendChild(tmp); } } -void MultilineElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oasisFormat ) const +void MultilineElement::writeMathML( TQDomDocument& doc, TQDomNode& tqparent, bool oasisFormat ) const { - QDomElement de = doc.createElement( oasisFormat ? "math:mtable" : "mtable" ); - QDomElement row; QDomElement cell; + TQDomElement de = doc.createElement( oasisFormat ? "math:mtable" : "mtable" ); + TQDomElement row; TQDomElement cell; - for ( QPtrListIterator < MultilineSequenceElement > it( content ); it.current(); ++it ) { + for ( TQPtrListIterator < MultilineSequenceElement > it( content ); it.current(); ++it ) { row = doc.createElement( oasisFormat ? "math:mtr" : "mtr" ); de.appendChild( row ); //cell = doc.createElement( "mtd" ); @@ -2606,20 +2606,20 @@ void MultilineElement::writeMathML( QDomDocument& doc, QDomNode& parent, bool oa it.current()->writeMathML( doc, row, oasisFormat ); } - parent.appendChild( de ); + tqparent.appendChild( de ); } /** * Reads our attributes from the element. * Returns false if it failed. */ -bool MultilineElement::readAttributesFromDom(QDomElement element) +bool MultilineElement::readAttributesFromDom(TQDomElement element) { if (!BasicElement::readAttributesFromDom(element)) { return false; } uint lineCount = 0; - QString lineCountStr = element.attribute("LINES"); + TQString lineCountStr = element.attribute("LINES"); if(!lineCountStr.isNull()) { lineCount = lineCountStr.toInt(); } @@ -2641,7 +2641,7 @@ bool MultilineElement::readAttributesFromDom(QDomElement element) * that needs to be read. * Returns false if it failed. */ -bool MultilineElement::readContentFromDom(QDomNode& node) +bool MultilineElement::readContentFromDom(TQDomNode& node) { if (!BasicElement::readContentFromDom(node)) { return false; @@ -2652,7 +2652,7 @@ bool MultilineElement::readContentFromDom(QDomNode& node) while ( !node.isNull() && i < lineCount ) { if ( node.isElement() ) { SequenceElement* element = content.at( i ); - QDomElement e = node.toElement(); + TQDomElement e = node.toElement(); if ( !element->buildFromDom( e ) ) { return false; } @@ -2663,10 +2663,10 @@ bool MultilineElement::readContentFromDom(QDomNode& node) return true; } -QString MultilineElement::toLatex() +TQString MultilineElement::toLatex() { uint lineCount = content.count(); - QString muliline = "\\begin{split} "; + TQString muliline = "\\begin{split} "; for ( uint i = 0; i < lineCount; ++i ) { muliline += content.at( i )->toLatex(); muliline += " \\\\ "; @@ -2676,10 +2676,10 @@ QString MultilineElement::toLatex() } // Does this make any sense at all? -QString MultilineElement::formulaString() +TQString MultilineElement::formulaString() { uint lineCount = content.count(); - QString muliline = ""; + TQString muliline = ""; for ( uint i = 0; i < lineCount; ++i ) { muliline += content.at( i )->formulaString(); muliline += "\n"; |
