diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-09 02:23:29 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-09 02:23:29 +0000 |
commit | 7c71ab86d1f7e387fc3df63b48df07231f111862 (patch) | |
tree | 30ba2d2f840ff5fd458b6113e9c3f2e8a71d510d /lib/kformula | |
parent | afbfdc507bfaafc8824a9808311d57a9ece87510 (diff) | |
download | koffice-7c71ab86d1f7e387fc3df63b48df07231f111862.tar.gz koffice-7c71ab86d1f7e387fc3df63b48df07231f111862.zip |
Remove the tq in front of these incorrectly TQt4-converted methods/data members:
tqrepaint[...]
tqinvalidate[...]
tqparent[...]
tqmask[...]
tqlayout[...]
tqalignment[...]
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1240522 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kformula')
42 files changed, 478 insertions, 478 deletions
diff --git a/lib/kformula/DESIGN b/lib/kformula/DESIGN index f060b897..fc404921 100644 --- a/lib/kformula/DESIGN +++ b/lib/kformula/DESIGN @@ -56,7 +56,7 @@ except SequenceElements if they contains a SequenceElement they merge it in the list They can handle splitting of the sequence to allow "select an put selected item -between tqparenthesis" i.e. as content child of a delimiterelement) +between parenthesis" i.e. as content child of a delimiterelement) FormulaElement from SequenceElement @@ -90,7 +90,7 @@ contains one char and no tqchildren at all. Might have its own font and size. But preferes to use a reasonalbe -font and size that are calculated from its tqparents font and a given +font and size that are calculated from its parents font and a given scheme (see below). @@ -353,7 +353,7 @@ turns this on.) Fonts and font size ################### -Each elements font size is calculated starting from its tqparents font +Each elements font size is calculated starting from its parents font size. It knows how it differs to those. The font size might also be used to choose the pen width and other diff --git a/lib/kformula/basicelement.cc b/lib/kformula/basicelement.cc index bbe6f453..da961df3 100644 --- a/lib/kformula/basicelement.cc +++ b/lib/kformula/basicelement.cc @@ -80,11 +80,11 @@ FormulaElement* BasicElement::formula() * Returns the element the point is in. */ BasicElement* BasicElement::goToPos( FormulaCursor*, bool&, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) { - luPixel x = point.x() - (tqparentOrigin.x() + getX()); + luPixel x = point.x() - (parentOrigin.x() + getX()); if ((x >= 0) && (x < getWidth())) { - luPixel y = point.y() - (tqparentOrigin.y() + getY()); + luPixel y = point.y() - (parentOrigin.y() + getY()); if ((y >= 0) && (y < getHeight())) { return this; } diff --git a/lib/kformula/basicelement.h b/lib/kformula/basicelement.h index d373fc6c..025dfbc6 100644 --- a/lib/kformula/basicelement.h +++ b/lib/kformula/basicelement.h @@ -141,7 +141,7 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); /** * Returns our position inside the widget. @@ -158,7 +158,7 @@ public: /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -167,15 +167,15 @@ public: /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ) = 0; + const LuPixelPoint& parentOrigin ) = 0; /** diff --git a/lib/kformula/bracketelement.cc b/lib/kformula/bracketelement.cc index d95eac78..0a599dc0 100644 --- a/lib/kformula/bracketelement.cc +++ b/lib/kformula/bracketelement.cc @@ -59,7 +59,7 @@ SingleContentElement::~SingleContentElement() TQChar SingleContentElement::getCharacter() const { // This is meant to make the SingleContentElement text only. - // This "fixes" the tqparenthesis problem (tqparenthesis too large). + // This "fixes" the parenthesis problem (parenthesis too large). // I'm not sure if we really want this. There should be better ways. if ( content->isTextOnly() ) { return '\\'; @@ -68,12 +68,12 @@ TQChar SingleContentElement::getCharacter() const } BasicElement* SingleContentElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); if (e != 0) { - LuPixelPoint myPos(tqparentOrigin.x() + getX(), - tqparentOrigin.y() + getY()); + LuPixelPoint myPos(parentOrigin.x() + getX(), + parentOrigin.y() + getY()); e = content->goToPos(cursor, handled, point, myPos); if (e != 0) { @@ -252,12 +252,12 @@ void BracketElement::entered( SequenceElement* /*child*/ ) BasicElement* BracketElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); if (e != 0) { - LuPixelPoint myPos(tqparentOrigin.x() + getX(), - tqparentOrigin.y() + getY()); + LuPixelPoint myPos(parentOrigin.x() + getX(), + parentOrigin.y() + getY()); e = getContent()->goToPos(cursor, handled, point, myPos); if (e != 0) { return e; @@ -281,7 +281,7 @@ BasicElement* BracketElement::goToPos( FormulaCursor* cursor, bool& handled, /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ void BracketElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -361,17 +361,17 @@ void BracketElement::calcSizes( const ContextStyle& context, /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ void BracketElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& parentOrigin ) { - LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); + LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -394,14 +394,14 @@ void BracketElement::draw( TQPainter& painter, const LuPixelRect& r, #if 0 painter.setBrush( TQt::NoBrush ); painter.setPen( TQt::red ); - painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x()+left->getX() ), - context.tqlayoutUnitToPixelY( myPos.y()+left->getY() ), - context.tqlayoutUnitToPixelX( left->getWidth() ), - context.tqlayoutUnitToPixelY( left->getHeight() ) ); - painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x()+right->getX() ), - context.tqlayoutUnitToPixelY( myPos.y()+right->getY() ), - context.tqlayoutUnitToPixelX( right->getWidth() ), - context.tqlayoutUnitToPixelY( right->getHeight() ) ); + painter.drawRect( context.layoutUnitToPixelX( myPos.x()+left->getX() ), + context.layoutUnitToPixelY( myPos.y()+left->getY() ), + context.layoutUnitToPixelX( left->getWidth() ), + context.layoutUnitToPixelY( left->getHeight() ) ); + painter.drawRect( context.layoutUnitToPixelX( myPos.x()+right->getX() ), + context.layoutUnitToPixelY( myPos.y()+right->getY() ), + context.layoutUnitToPixelX( right->getWidth() ), + context.layoutUnitToPixelY( right->getHeight() ) ); #endif } @@ -520,9 +520,9 @@ int BracketElement::readContentFromMathMLDom(TQDomNode& node) bool empty = false; int nodeCounter = 0; if ( m_operator ) { - node = node.tqparentNode(); + node = node.parentNode(); TQDomNode open = node; - TQDomNode tqparent = node.tqparentNode(); + TQDomNode tqparent = node.parentNode(); if ( ! operatorType( node, true ) ) return -1; int nodeNum = searchOperator( node ); @@ -563,7 +563,7 @@ int BracketElement::readContentFromMathMLDom(TQDomNode& node) next = next.nextSibling(); if ( ! next.isNull()) { TQDomDocument doc = node.ownerDocument(); - TQDomNode tqparent = node.tqparentNode(); + TQDomNode tqparent = node.parentNode(); TQString ns = tqparent.prefix(); TQDomElement de = doc.createElementNS( ns, "mrow" ); uint pos = 0; @@ -850,9 +850,9 @@ void OverlineElement::draw( TQPainter& painter, const LuPixelRect& r, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& parentOrigin ) { - LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); + LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -868,12 +868,12 @@ void OverlineElement::draw( TQPainter& painter, const LuPixelRect& r, //luPixel unit = (content->getHeight() + distY)/ 3; painter.setPen( TQPen( context.getDefaultColor(), - context.tqlayoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); + context.layoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); - painter.drawLine( context.tqlayoutUnitToPixelX( x ), - context.tqlayoutUnitToPixelY( y+distY/3 ), - context.tqlayoutUnitToPixelX( x+content->getWidth() ), - context.tqlayoutUnitToPixelY( y+distY/3 ) ); + painter.drawLine( context.layoutUnitToPixelX( x ), + context.layoutUnitToPixelY( y+distY/3 ), + context.layoutUnitToPixelX( x+content->getWidth() ), + context.layoutUnitToPixelY( y+distY/3 ) ); } @@ -954,9 +954,9 @@ void UnderlineElement::draw( TQPainter& painter, const LuPixelRect& r, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& parentOrigin ) { - LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); + LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -972,12 +972,12 @@ void UnderlineElement::draw( TQPainter& painter, const LuPixelRect& r, double factor = style.sizeFactor(); painter.setPen( TQPen( context.getDefaultColor(), - context.tqlayoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); + context.layoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); - painter.drawLine( context.tqlayoutUnitToPixelX( x ), - context.tqlayoutUnitToPixelY( y+getHeight()-context.getLineWidth( factor ) ), - context.tqlayoutUnitToPixelX( x+content->getWidth() ), - context.tqlayoutUnitToPixelY( y+getHeight()-context.getLineWidth( factor ) ) ); + painter.drawLine( context.layoutUnitToPixelX( x ), + context.layoutUnitToPixelY( y+getHeight()-context.getLineWidth( factor ) ), + context.layoutUnitToPixelX( x+content->getWidth() ), + context.layoutUnitToPixelY( y+getHeight()-context.getLineWidth( factor ) ) ); } diff --git a/lib/kformula/bracketelement.h b/lib/kformula/bracketelement.h index 98f515a1..eb0e2613 100644 --- a/lib/kformula/bracketelement.h +++ b/lib/kformula/bracketelement.h @@ -59,7 +59,7 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); /** * Dispatch this FontCommand to all our TextElement tqchildren. @@ -196,11 +196,11 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -209,15 +209,15 @@ public: /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); protected: @@ -322,7 +322,7 @@ public: /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -331,15 +331,15 @@ public: /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); /** * @returns the latex representation of the element and @@ -389,7 +389,7 @@ public: /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -398,15 +398,15 @@ public: /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); /** * @returns the latex representation of the element and diff --git a/lib/kformula/errorelement.cc b/lib/kformula/errorelement.cc index 0bf80237..c63cf09c 100644 --- a/lib/kformula/errorelement.cc +++ b/lib/kformula/errorelement.cc @@ -28,24 +28,24 @@ ErrorElement::ErrorElement( BasicElement* tqparent ) : SequenceElement( tqparent /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ void ErrorElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& parentOrigin ) { - LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); + LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); - painter.fillRect( context.tqlayoutUnitToPixelX( myPos.x() ), - context.tqlayoutUnitToPixelY( myPos.y() ), - context.tqlayoutUnitToPixelX( getWidth() ), - context.tqlayoutUnitToPixelY( getHeight() ), + painter.fillRect( context.layoutUnitToPixelX( myPos.x() ), + context.layoutUnitToPixelY( myPos.y() ), + context.layoutUnitToPixelX( getWidth() ), + context.layoutUnitToPixelY( getHeight() ), context.getErrorColor() ); - inherited::draw( painter, r, context, tstyle, istyle, style, tqparentOrigin ); + inherited::draw( painter, r, context, tstyle, istyle, style, parentOrigin ); } KFORMULA_NAMESPACE_END diff --git a/lib/kformula/errorelement.h b/lib/kformula/errorelement.h index bc23b5e2..c7d69fed 100644 --- a/lib/kformula/errorelement.h +++ b/lib/kformula/errorelement.h @@ -31,15 +31,15 @@ public: /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); private: virtual TQString getElementName() const { return "merror"; } diff --git a/lib/kformula/fontstyle.cc b/lib/kformula/fontstyle.cc index 0d1792e0..57088fef 100644 --- a/lib/kformula/fontstyle.cc +++ b/lib/kformula/fontstyle.cc @@ -266,17 +266,17 @@ static short cmex_nextchar( short ch ) bool Artwork::calcCMDelimiterSize( const ContextStyle& context, uchar c, luPt fontSize, - luPt tqparentSize ) + luPt parentSize ) { TQFont f( "cmex10" ); - f.setPointSizeFloat( context.tqlayoutUnitPtToPt( fontSize ) ); + f.setPointSizeFloat( context.layoutUnitPtToPt( fontSize ) ); TQFontMetrics fm( f ); for ( char i=1; c != 0; ++i ) { LuPixelRect bound = fm.boundingRect( c ); luPt height = context.ptToLayoutUnitPt( bound.height() ); - if ( height >= tqparentSize ) { + if ( height >= parentSize ) { luPt width = context.ptToLayoutUnitPt( fm.width( c ) ); luPt baseline = context.ptToLayoutUnitPt( -bound.top() ); @@ -300,7 +300,7 @@ void Artwork::calcLargest( const ContextStyle& context, uchar c, luPt fontSize ) { TQFont f( "cmex10" ); - f.setPointSizeFloat( context.tqlayoutUnitPtToPt( fontSize ) ); + f.setPointSizeFloat( context.layoutUnitPtToPt( fontSize ) ); TQFontMetrics fm( f ); cmChar = c; @@ -329,11 +329,11 @@ void Artwork::drawCMDelimiter( TQPainter& painter, const ContextStyle& style, luPt height ) { TQFont f( "cmex10" ); - f.setPointSizeFloat( style.tqlayoutUnitToFontSize( height, false ) ); + f.setPointSizeFloat( style.layoutUnitToFontSize( height, false ) ); painter.setFont( f ); - painter.drawText( style.tqlayoutUnitToPixelX( x ), - style.tqlayoutUnitToPixelY( y + getBaseline() ), + painter.drawText( style.layoutUnitToPixelX( x ), + style.layoutUnitToPixelY( y + getBaseline() ), TQString( TQChar( cmChar ) ) ); // Debug @@ -342,8 +342,8 @@ void Artwork::drawCMDelimiter( TQPainter& painter, const ContextStyle& style, LuPixelRect bound = fm.boundingRect( cmChar ); painter.setBrush(TQt::NoBrush); painter.setPen(TQt::green); - painter.drawRect( style.tqlayoutUnitToPixelX( x ), - style.tqlayoutUnitToPixelY( y ), + painter.drawRect( style.layoutUnitToPixelX( x ), + style.layoutUnitToPixelY( y ), fm.width( cmChar ), bound.height() ); #endif @@ -359,7 +359,7 @@ Artwork::Artwork(SymbolType t) void Artwork::calcSizes( const ContextStyle& style, ContextStyle::TextStyle tstyle, double factor, - luPt tqparentSize ) + luPt parentSize ) { setBaseline( -1 ); cmChar = -1; @@ -367,86 +367,86 @@ void Artwork::calcSizes( const ContextStyle& style, switch (getType()) { case LeftSquareBracket: if ( calcCMDelimiterSize( style, cmex_LeftSquareBracket, - mySize, tqparentSize ) ) { + mySize, parentSize ) ) { return; } - calcRoundBracket( style, leftSquareBracket, tqparentSize, mySize ); + calcRoundBracket( style, leftSquareBracket, parentSize, mySize ); break; case RightSquareBracket: if ( calcCMDelimiterSize( style, cmex_RightSquareBracket, - mySize, tqparentSize ) ) { + mySize, parentSize ) ) { return; } - calcRoundBracket( style, rightSquareBracket, tqparentSize, mySize ); + calcRoundBracket( style, rightSquareBracket, parentSize, mySize ); break; case LeftLineBracket: - calcRoundBracket( style, leftLineBracket, tqparentSize, mySize ); + calcRoundBracket( style, leftLineBracket, parentSize, mySize ); setWidth( getWidth()/2 ); break; case RightLineBracket: - calcRoundBracket( style, rightLineBracket, tqparentSize, mySize ); + calcRoundBracket( style, rightLineBracket, parentSize, mySize ); setWidth( getWidth()/2 ); break; case SlashBracket: if ( calcCMDelimiterSize( style, cmex_SlashBracket, - mySize, tqparentSize ) ) { + mySize, parentSize ) ) { return; } calcLargest( style, cmex_SlashBracket, mySize ); break; case BackSlashBracket: if ( calcCMDelimiterSize( style, cmex_BackSlashBracket, - mySize, tqparentSize ) ) { + mySize, parentSize ) ) { return; } calcLargest( style, cmex_BackSlashBracket, mySize ); break; case LeftCornerBracket: if ( calcCMDelimiterSize( style, cmex_LeftCornerBracket, - mySize, tqparentSize ) ) { + mySize, parentSize ) ) { return; } calcLargest( style, cmex_LeftCornerBracket, mySize ); break; case RightCornerBracket: if ( calcCMDelimiterSize( style, cmex_RightCornerBracket, - mySize, tqparentSize ) ) { + mySize, parentSize ) ) { return; } calcLargest( style, cmex_RightCornerBracket, mySize ); break; case LeftRoundBracket: if ( calcCMDelimiterSize( style, cmex_LeftRoundBracket, - mySize, tqparentSize ) ) { + mySize, parentSize ) ) { return; } - calcRoundBracket( style, leftRoundBracket, tqparentSize, mySize ); + calcRoundBracket( style, leftRoundBracket, parentSize, mySize ); break; case RightRoundBracket: if ( calcCMDelimiterSize( style, cmex_RightRoundBracket, - mySize, tqparentSize ) ) { + mySize, parentSize ) ) { return; } - calcRoundBracket( style, rightRoundBracket, tqparentSize, mySize ); + calcRoundBracket( style, rightRoundBracket, parentSize, mySize ); break; case EmptyBracket: - setHeight(tqparentSize); + setHeight(parentSize); //setWidth(style.getEmptyRectWidth()); setWidth(0); break; case LeftCurlyBracket: if ( calcCMDelimiterSize( style, cmex_LeftCurlyBracket, - mySize, tqparentSize ) ) { + mySize, parentSize ) ) { return; } - calcCurlyBracket( style, leftCurlyBracket, tqparentSize, mySize ); + calcCurlyBracket( style, leftCurlyBracket, parentSize, mySize ); break; case RightCurlyBracket: if ( calcCMDelimiterSize( style, cmex_RightCurlyBracket, - mySize, tqparentSize ) ) { + mySize, parentSize ) ) { return; } - calcCurlyBracket( style, rightCurlyBracket, tqparentSize, mySize ); + calcCurlyBracket( style, rightCurlyBracket, parentSize, mySize ); break; case Integral: calcCharSize( style, style.getBracketFont(), mySize, cmex_Int ); @@ -516,11 +516,11 @@ void Artwork::calcSizes( const ContextStyle& style, void Artwork::draw(TQPainter& painter, const LuPixelRect& /*r*/, const ContextStyle& context, ContextStyle::TextStyle tstyle, - StyleAttributes& style, const LuPixelPoint& tqparentOrigin) + StyleAttributes& style, const LuPixelPoint& parentOrigin) { luPt mySize = context.getAdjustedSize( tstyle, style.sizeFactor() ); - luPixel myX = tqparentOrigin.x() + getX(); - luPixel myY = tqparentOrigin.y() + getY(); + luPixel myX = parentOrigin.x() + getX(); + luPixel myY = parentOrigin.y() + getY(); /* if ( !LuPixelRect( myX, myY, getWidth(), getHeight() ).intersects( r ) ) return; @@ -685,10 +685,10 @@ void Artwork::draw(TQPainter& painter, const LuPixelRect& , // debug // painter.setBrush(TQt::NoBrush); // painter.setPen(TQt::green); -// painter.drawRect( context.tqlayoutUnitToPixelX( myX ), -// context.tqlayoutUnitToPixelY( myY ), -// context.tqlayoutUnitToPixelX( getWidth() ), -// context.tqlayoutUnitToPixelY( getHeight() ) ); +// painter.drawRect( context.layoutUnitToPixelX( myX ), +// context.layoutUnitToPixelY( myY ), +// context.layoutUnitToPixelX( getWidth() ), +// context.layoutUnitToPixelY( getHeight() ) ); } void Artwork::calcCharSize( const ContextStyle& style, luPt height, TQChar ch ) @@ -708,7 +708,7 @@ void Artwork::drawCharacter( TQPainter& painter, const ContextStyle& style, void Artwork::calcCharSize( const ContextStyle& style, TQFont f, luPt height, TQChar c ) { - f.setPointSizeFloat( style.tqlayoutUnitPtToPt( height ) ); + f.setPointSizeFloat( style.layoutUnitPtToPt( height ) ); //f.setPointSize( height ); TQFontMetrics fm(f); setWidth( style.ptToLayoutUnitPt( fm.width( c ) ) ); @@ -722,11 +722,11 @@ void Artwork::drawCharacter( TQPainter& painter, const ContextStyle& style, TQFont f, luPixel x, luPixel y, luPt height, uchar c ) { - f.setPointSizeFloat( style.tqlayoutUnitToFontSize( height, false ) ); + f.setPointSizeFloat( style.layoutUnitToFontSize( height, false ) ); painter.setFont( f ); - painter.drawText( style.tqlayoutUnitToPixelX( x ), - style.tqlayoutUnitToPixelY( y+getBaseline() ), + painter.drawText( style.layoutUnitToPixelX( x ), + style.layoutUnitToPixelY( y+getBaseline() ), TQString( TQChar( c ) ) ); } @@ -739,7 +739,7 @@ void Artwork::calcRoundBracket( const ContextStyle& style, const TQChar chars[], //uchar line = style.symbolTable().character( chars[2] ); TQFont f = style.getBracketFont(); - f.setPointSizeFloat( style.tqlayoutUnitPtToPt( charHeight ) ); + f.setPointSizeFloat( style.layoutUnitPtToPt( charHeight ) ); TQFontMetrics fm( f ); LuPtRect upperBound = fm.boundingRect( uppercorner ); LuPtRect lowerBound = fm.boundingRect( lowercorner ); @@ -761,7 +761,7 @@ void Artwork::drawBigRoundBracket( TQPainter& p, const ContextStyle& style, cons uchar line = chars[2]; TQFont f = style.getBracketFont(); - f.setPointSizeFloat( style.tqlayoutUnitToFontSize( charHeight, false ) ); + f.setPointSizeFloat( style.layoutUnitToFontSize( charHeight, false ) ); p.setFont(f); TQFontMetrics fm(f); @@ -769,14 +769,14 @@ void Artwork::drawBigRoundBracket( TQPainter& p, const ContextStyle& style, cons TQRect lowerBound = fm.boundingRect(lowercorner); TQRect lineBound = fm.boundingRect(line); - pixel ptX = style.tqlayoutUnitToPixelX( x ); - pixel ptY = style.tqlayoutUnitToPixelY( y ); - pixel height = style.tqlayoutUnitToPixelY( getHeight() ); + pixel ptX = style.layoutUnitToPixelX( x ); + pixel ptY = style.layoutUnitToPixelY( y ); + pixel height = style.layoutUnitToPixelY( getHeight() ); // p.setPen( TQt::red ); // //p.drawRect( ptX, ptY, upperBound.width(), upperBound.height() + lowerBound.height() ); -// p.drawRect( ptX, ptY, style.tqlayoutUnitToPixelX( getWidth() ), -// style.tqlayoutUnitToPixelY( getHeight() ) ); +// p.drawRect( ptX, ptY, style.layoutUnitToPixelX( getWidth() ), +// style.layoutUnitToPixelY( getHeight() ) ); // p.setPen( TQt::black ); p.drawText( ptX, ptY-upperBound.top(), TQString( TQChar( uppercorner ) ) ); @@ -810,7 +810,7 @@ void Artwork::calcCurlyBracket( const ContextStyle& style, const TQChar chars[], uchar middle = chars[3]; TQFont f = style.getBracketFont(); - f.setPointSizeFloat( style.tqlayoutUnitPtToPt( charHeight ) ); + f.setPointSizeFloat( style.layoutUnitPtToPt( charHeight ) ); TQFontMetrics fm( f ); LuPtRect upperBound = fm.boundingRect( uppercorner ); LuPtRect lowerBound = fm.boundingRect( lowercorner ); @@ -832,7 +832,7 @@ void Artwork::drawBigCurlyBracket( TQPainter& p, const ContextStyle& style, cons { //TQFont f = style.getSymbolFont(); TQFont f = style.getBracketFont(); - f.setPointSizeFloat( style.tqlayoutUnitToFontSize( charHeight, false ) ); + f.setPointSizeFloat( style.layoutUnitToFontSize( charHeight, false ) ); p.setFont(f); uchar uppercorner = chars[0]; @@ -846,9 +846,9 @@ void Artwork::drawBigCurlyBracket( TQPainter& p, const ContextStyle& style, cons TQRect middleBound = fm.boundingRect(middle); TQRect lineBound = fm.boundingRect(line); - pixel ptX = style.tqlayoutUnitToPixelX( x ); - pixel ptY = style.tqlayoutUnitToPixelY( y ); - pixel height = style.tqlayoutUnitToPixelY( getHeight() ); + pixel ptX = style.layoutUnitToPixelX( x ); + pixel ptY = style.layoutUnitToPixelY( y ); + pixel height = style.layoutUnitToPixelY( getHeight() ); //p.setPen(TQt::gray); //p.drawRect(x, y, upperBound.width() + offset, height); diff --git a/lib/kformula/fontstyle.h b/lib/kformula/fontstyle.h index 72db8caf..8132bbb6 100644 --- a/lib/kformula/fontstyle.h +++ b/lib/kformula/fontstyle.h @@ -111,7 +111,7 @@ public: virtual void calcSizes( const ContextStyle& style, ContextStyle::TextStyle tstyle, double factor, - luPt tqparentSize ); + luPt parentSize ); virtual void calcSizes( const ContextStyle& style, ContextStyle::TextStyle tstyle, double factor ); @@ -120,12 +120,12 @@ public: const ContextStyle& context, ContextStyle::TextStyle tstyle, StyleAttributes& style, - luPt tqparentSize, const LuPixelPoint& origin ); + luPt parentSize, const LuPixelPoint& origin ); virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); luPixel getWidth() const { return size.width(); } luPixel getHeight() const { return size.height(); } @@ -179,7 +179,7 @@ private: SymbolType type; bool calcCMDelimiterSize( const ContextStyle& context, uchar c, - luPt fontSize, luPt tqparentSize ); + luPt fontSize, luPt parentSize ); void calcLargest( const ContextStyle& context, uchar c, luPt fontSize ); void drawCMDelimiter( TQPainter& painter, const ContextStyle& style, luPixel x, luPixel y, luPt height ); diff --git a/lib/kformula/formulaelement.cc b/lib/kformula/formulaelement.cc index 84944150..29ae7cdd 100644 --- a/lib/kformula/formulaelement.cc +++ b/lib/kformula/formulaelement.cc @@ -130,9 +130,9 @@ void FormulaElement::draw( TQPainter& painter, const LuPixelRect& r, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& parentOrigin ) { - inherited::draw( painter, r, context, tstyle, istyle, style, tqparentOrigin ); + inherited::draw( painter, r, context, tstyle, istyle, style, parentOrigin ); } @@ -279,7 +279,7 @@ void FormulaElement::convertNames( TQDomNode node ) TQDomNamedNodeMap attr = node.attributes(); TQDomAttr ch = attr.namedItem( "CHAR" ).toAttr(); if ( ch.value() == "\\" ) { - TQDomNode sequence = node.tqparentNode(); + TQDomNode sequence = node.parentNode(); TQDomDocument doc = sequence.ownerDocument(); TQDomElement nameseq = doc.createElement( "NAMESEQUENCE" ); sequence.tqreplaceChild( nameseq, node ); diff --git a/lib/kformula/formulaelement.h b/lib/kformula/formulaelement.h index 831456a7..8f230128 100644 --- a/lib/kformula/formulaelement.h +++ b/lib/kformula/formulaelement.h @@ -113,7 +113,7 @@ public: /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -122,15 +122,15 @@ public: /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); /** * Calculates the formulas sizes and positions. diff --git a/lib/kformula/fractionelement.cc b/lib/kformula/fractionelement.cc index a8c1db9c..fb76a11e 100644 --- a/lib/kformula/fractionelement.cc +++ b/lib/kformula/fractionelement.cc @@ -81,12 +81,12 @@ void FractionElement::entered( SequenceElement* child ) BasicElement* FractionElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); if (e != 0) { - LuPixelPoint myPos(tqparentOrigin.x() + getX(), - tqparentOrigin.y() + getY()); + LuPixelPoint myPos(parentOrigin.x() + getX(), + parentOrigin.y() + getY()); e = numerator->goToPos(cursor, handled, point, myPos); if (e != 0) { return e; @@ -121,7 +121,7 @@ BasicElement* FractionElement::goToPos( FormulaCursor* cursor, bool& handled, /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ void FractionElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -156,17 +156,17 @@ void FractionElement::calcSizes( const ContextStyle& context, /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ void FractionElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& parentOrigin ) { - LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); + LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -185,11 +185,11 @@ void FractionElement::draw( TQPainter& painter, const LuPixelRect& r, double factor = style.sizeFactor(); double linethickness = lineThickness( context, factor ); painter.setPen( TQPen( style.color(), - context.tqlayoutUnitToPixelY( linethickness ) ) ); - painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x() ), - context.tqlayoutUnitToPixelY( myPos.y() + axis( context, tstyle, factor ) ), - context.tqlayoutUnitToPixelX( myPos.x() + getWidth() ), - context.tqlayoutUnitToPixelY( myPos.y() + axis( context, tstyle, factor ) ) ); + context.layoutUnitToPixelY( linethickness ) ) ); + painter.drawLine( context.layoutUnitToPixelX( myPos.x() ), + context.layoutUnitToPixelY( myPos.y() + axis( context, tstyle, factor ) ), + context.layoutUnitToPixelX( myPos.x() + getWidth() ), + context.layoutUnitToPixelY( myPos.y() + axis( context, tstyle, factor ) ) ); } } diff --git a/lib/kformula/fractionelement.h b/lib/kformula/fractionelement.h index c578ee5b..18c870fe 100644 --- a/lib/kformula/fractionelement.h +++ b/lib/kformula/fractionelement.h @@ -66,11 +66,11 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -79,15 +79,15 @@ public: /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); /** * Dispatch this FontCommand to all our TextElement tqchildren. diff --git a/lib/kformula/glyphelement.cc b/lib/kformula/glyphelement.cc index 381bbcf9..79421f40 100644 --- a/lib/kformula/glyphelement.cc +++ b/lib/kformula/glyphelement.cc @@ -69,7 +69,7 @@ bool GlyphElement::readAttributesFromMathMLDom( const TQDomElement& element ) /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ void GlyphElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -82,14 +82,14 @@ void GlyphElement::calcSizes( const ContextStyle& context, if ( m_hasFont ) { TQFont font( m_fontFamily ); - font.setPointSizeFloat( context.tqlayoutUnitPtToPt( mySize ) ); + font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) ); TQFontMetrics fm ( font ); bound = fm.boundingRect( m_char ); setWidth( context.ptToLayoutUnitPt( fm.width( m_char ) ) ); } else { TQFont font( context.getDefaultFont() ); - font.setPointSizeFloat( context.tqlayoutUnitPtToPt( mySize ) ); + font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) ); TQFontMetrics fm ( font ); bound = fm.boundingRect( m_alt ); setWidth( context.ptToLayoutUnitPt( fm.width( m_alt ) ) ); @@ -106,17 +106,17 @@ void GlyphElement::calcSizes( const ContextStyle& context, /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ void GlyphElement::draw( TQPainter& painter, const LuPixelRect& /*r*/, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle /*istyle*/, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& parentOrigin ) { - LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); + LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -131,10 +131,10 @@ void GlyphElement::draw( TQPainter& painter, const LuPixelRect& /*r*/, setCharFamily( style.charFamily() ); font = TQFont( m_fontFamily ); text = m_char; - painter.fillRect( context.tqlayoutUnitToPixelX( myPos.x() ), - context.tqlayoutUnitToPixelY( myPos.y() ), - context.tqlayoutUnitToPixelX( getWidth() ), - context.tqlayoutUnitToPixelY( getHeight() ), + painter.fillRect( context.layoutUnitToPixelX( myPos.x() ), + context.layoutUnitToPixelY( myPos.y() ), + context.layoutUnitToPixelX( getWidth() ), + context.layoutUnitToPixelY( getHeight() ), style.background() ); } else { @@ -142,10 +142,10 @@ void GlyphElement::draw( TQPainter& painter, const LuPixelRect& /*r*/, font = context.getDefaultFont(); text = m_alt; } - font.setPointSizeFloat( context.tqlayoutUnitToFontSize( mySize, false ) ); + font.setPointSizeFloat( context.layoutUnitToFontSize( mySize, false ) ); painter.setFont( font ); - painter.drawText( context.tqlayoutUnitToPixelX( myPos.x() ), - context.tqlayoutUnitToPixelY( myPos.y()+getBaseline() ), + painter.drawText( context.layoutUnitToPixelX( myPos.x() ), + context.layoutUnitToPixelY( myPos.y()+getBaseline() ), text ); } diff --git a/lib/kformula/glyphelement.h b/lib/kformula/glyphelement.h index dd6c6e8c..1d3b6d8d 100644 --- a/lib/kformula/glyphelement.h +++ b/lib/kformula/glyphelement.h @@ -31,7 +31,7 @@ public: /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -40,15 +40,15 @@ public: /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); protected: virtual bool readAttributesFromMathMLDom( const TQDomElement &element ); diff --git a/lib/kformula/indexelement.cc b/lib/kformula/indexelement.cc index 5e2ee3e5..a8d3b68a 100644 --- a/lib/kformula/indexelement.cc +++ b/lib/kformula/indexelement.cc @@ -227,11 +227,11 @@ void IndexElement::entered( SequenceElement* child ) * Returns the element the point is in. */ BasicElement* IndexElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); if (e != 0) { - LuPixelPoint myPos(tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY()); + LuPixelPoint myPos(parentOrigin.x()+getX(), parentOrigin.y()+getY()); e = content->goToPos(cursor, handled, point, myPos); if (e != 0) return e; @@ -341,7 +341,7 @@ void IndexElement::setMiddleX(int xOffset, int middleWidth) /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ void IndexElement::calcSizes(const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -446,7 +446,7 @@ void IndexElement::calcSizes(const ContextStyle& context, if (content->isTextOnly()) { luPt mySize = context.getAdjustedSize( tstyle, factor ); TQFont font = context.getDefaultFont(); - font.setPointSizeFloat( context.tqlayoutUnitPtToPt( mySize ) ); + font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) ); TQFontMetrics fm(font); LuPixelRect bound = fm.boundingRect('x'); @@ -543,17 +543,17 @@ void IndexElement::calcSizes(const ContextStyle& context, /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ void IndexElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& parentOrigin ) { - LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); + LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -645,7 +645,7 @@ int IndexElement::getFromPos(BasicElement* from) else if (from == upperLeft) { return upperLeftPos; } - return tqparentPos; + return parentPos; } /** @@ -680,7 +680,7 @@ void IndexElement::moveLeft(FormulaCursor* cursor, BasicElement* from) } } switch (fromPos) { - case tqparentPos: + case parentPos: if (hasLowerRight() && linear) { lowerRight->moveLeft(cursor, this); break; @@ -751,7 +751,7 @@ void IndexElement::moveRight(FormulaCursor* cursor, BasicElement* from) } } switch (fromPos) { - case tqparentPos: + case parentPos: if (hasUpperLeft() && linear) { upperLeft->moveRight(cursor, this); break; @@ -1426,7 +1426,7 @@ int IndexElement::readContentFromMathMLDom( TQDomNode& node ) node = node.nextSibling(); } - TQString indexType = node.tqparentNode().toElement().tagName().lower(); + TQString indexType = node.parentNode().toElement().tagName().lower(); if ( indexType == "msub" ) { lowerRight = new SequenceElement( this ); int lowerRightNumber = lowerRight->buildMathMLChild( node ); diff --git a/lib/kformula/indexelement.h b/lib/kformula/indexelement.h index 49b03bc7..b86f0dc4 100644 --- a/lib/kformula/indexelement.h +++ b/lib/kformula/indexelement.h @@ -66,7 +66,7 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); // drawing // @@ -77,7 +77,7 @@ public: /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -86,15 +86,15 @@ public: /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); /** * Dispatch this FontCommand to all our TextElement tqchildren. diff --git a/lib/kformula/kformulacommand.cc b/lib/kformula/kformulacommand.cc index 804b66c6..2a5e7ddd 100644 --- a/lib/kformula/kformulacommand.cc +++ b/lib/kformula/kformulacommand.cc @@ -534,9 +534,9 @@ void FontCommand::collectChildren() } -void FontCommand::parseSequences( const TQMap<SequenceElement*, int>& tqparents ) +void FontCommand::parseSequences( const TQMap<SequenceElement*, int>& parents ) { - TQValueList<SequenceElement*> sequences = tqparents.keys(); + TQValueList<SequenceElement*> sequences = parents.keys(); for ( TQValueList<SequenceElement*>::iterator i = sequences.begin(); i != sequences.end(); ++i ) { @@ -553,7 +553,7 @@ CharStyleCommand::CharStyleCommand( CharStyle cs, const TQString& name, Containe void CharStyleCommand::execute() { collectChildren(); - TQMap<SequenceElement*, int> tqparentCollector; + TQMap<SequenceElement*, int> parentCollector; styleList.clear(); uint count = tqchildrenList().count(); @@ -562,23 +562,23 @@ void CharStyleCommand::execute() TextElement* child = tqchildrenList().at( i ); styleList[i] = child->getCharStyle(); child->setCharStyle( charStyle ); - tqparentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1; + parentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1; } - parseSequences( tqparentCollector ); + parseSequences( parentCollector ); testDirty(); } void CharStyleCommand::unexecute() { - TQMap<SequenceElement*, int> tqparentCollector; + TQMap<SequenceElement*, int> parentCollector; uint count = tqchildrenList().count(); //styleList.reserve( count ); for ( uint i=0; i<count; ++i ) { TextElement* child = tqchildrenList().at( i ); child->setCharStyle( styleList[i] ); - tqparentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1; + parentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1; } - parseSequences( tqparentCollector ); + parseSequences( parentCollector ); testDirty(); } @@ -592,7 +592,7 @@ void CharFamilyCommand::execute() { collectChildren(); - TQMap<SequenceElement*, int> tqparentCollector; + TQMap<SequenceElement*, int> parentCollector; familyList.clear(); uint count = tqchildrenList().count(); @@ -601,23 +601,23 @@ void CharFamilyCommand::execute() TextElement* child = tqchildrenList().at( i ); familyList[i] = child->getCharFamily(); child->setCharFamily( charFamily ); - tqparentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1; + parentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1; } - parseSequences( tqparentCollector ); + parseSequences( parentCollector ); testDirty(); } void CharFamilyCommand::unexecute() { - TQMap<SequenceElement*, int> tqparentCollector; + TQMap<SequenceElement*, int> parentCollector; uint count = tqchildrenList().count(); //familyList.reserve( count ); for ( uint i=0; i<count; ++i ) { TextElement* child = tqchildrenList().at( i ); child->setCharFamily( familyList[i] ); - tqparentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1; + parentCollector[static_cast<SequenceElement*>( child->getParent() )] = 1; } - parseSequences( tqparentCollector ); + parseSequences( parentCollector ); testDirty(); } diff --git a/lib/kformula/kformulacommand.h b/lib/kformula/kformulacommand.h index ec014604..8b1d2555 100644 --- a/lib/kformula/kformulacommand.h +++ b/lib/kformula/kformulacommand.h @@ -505,7 +505,7 @@ protected: void collectChildren(); - void parseSequences( const TQMap<SequenceElement*, int>& tqparents ); + void parseSequences( const TQMap<SequenceElement*, int>& parents ); private: diff --git a/lib/kformula/kformulacontainer.cc b/lib/kformula/kformulacontainer.cc index a141aa50..774c7e79 100644 --- a/lib/kformula/kformulacontainer.cc +++ b/lib/kformula/kformulacontainer.cc @@ -273,10 +273,10 @@ void Container::recalc() ContextStyle& context = impl->document->getContextStyle(); rootElement()->calcSizes( context ); - emit formulaChanged( context.tqlayoutUnitToPixelX( rootElement()->getWidth() ), - context.tqlayoutUnitToPixelY( rootElement()->getHeight() ) ); - emit formulaChanged( context.tqlayoutUnitPtToPt( context.pixelXToPt( rootElement()->getWidth() ) ), - context.tqlayoutUnitPtToPt( context.pixelYToPt( rootElement()->getHeight() ) ) ); + emit formulaChanged( context.layoutUnitToPixelX( rootElement()->getWidth() ), + context.layoutUnitToPixelY( rootElement()->getHeight() ) ); + emit formulaChanged( context.layoutUnitPtToPt( context.pixelXToPt( rootElement()->getWidth() ) ), + context.layoutUnitPtToPt( context.pixelYToPt( rootElement()->getHeight() ) ) ); emit cursorMoved( activeCursor() ); } @@ -408,10 +408,10 @@ void Container::execute(KCommand* command) TQRect Container::boundingRect() const { const ContextStyle& context = document()->getContextStyle(); - return TQRect( context.tqlayoutUnitToPixelX( rootElement()->getX() ), - context.tqlayoutUnitToPixelY( rootElement()->getY() ), - context.tqlayoutUnitToPixelX( rootElement()->getWidth() ), - context.tqlayoutUnitToPixelY( rootElement()->getHeight() ) ); + return TQRect( context.layoutUnitToPixelX( rootElement()->getX() ), + context.layoutUnitToPixelY( rootElement()->getY() ), + context.layoutUnitToPixelX( rootElement()->getWidth() ), + context.layoutUnitToPixelY( rootElement()->getHeight() ) ); } TQRect Container::coveredRect() @@ -419,14 +419,14 @@ TQRect Container::coveredRect() if ( impl->activeCursor != 0 ) { const ContextStyle& context = document()->getContextStyle(); const LuPixelRect& cursorRect = impl->activeCursor->getCursorSize(); - return TQRect( context.tqlayoutUnitToPixelX( rootElement()->getX() ), - context.tqlayoutUnitToPixelY( rootElement()->getY() ), - context.tqlayoutUnitToPixelX( rootElement()->getWidth() ), - context.tqlayoutUnitToPixelY( rootElement()->getHeight() ) ) | - TQRect( context.tqlayoutUnitToPixelX( cursorRect.x() ), - context.tqlayoutUnitToPixelY( cursorRect.y() ), - context.tqlayoutUnitToPixelX( cursorRect.width() ), - context.tqlayoutUnitToPixelY( cursorRect.height() ) ); + return TQRect( context.layoutUnitToPixelX( rootElement()->getX() ), + context.layoutUnitToPixelY( rootElement()->getY() ), + context.layoutUnitToPixelX( rootElement()->getWidth() ), + context.layoutUnitToPixelY( rootElement()->getHeight() ) ) | + TQRect( context.layoutUnitToPixelX( cursorRect.x() ), + context.layoutUnitToPixelY( cursorRect.y() ), + context.layoutUnitToPixelX( cursorRect.width() ), + context.layoutUnitToPixelY( cursorRect.height() ) ); } return boundingRect(); } @@ -434,20 +434,20 @@ TQRect Container::coveredRect() double Container::width() const { const ContextStyle& context = document()->getContextStyle(); - return context.tqlayoutUnitPtToPt( context.pixelXToPt( rootElement()->getWidth() ) ); + return context.layoutUnitPtToPt( context.pixelXToPt( rootElement()->getWidth() ) ); } double Container::height() const { const ContextStyle& context = document()->getContextStyle(); - return context.tqlayoutUnitPtToPt( context.pixelYToPt( rootElement()->getHeight() ) ); + return context.layoutUnitPtToPt( context.pixelYToPt( rootElement()->getHeight() ) ); } double Container::baseline() const { const ContextStyle& context = document()->getContextStyle(); - //return context.tqlayoutUnitToPixelY( rootElement()->getBaseline() ); - return context.tqlayoutUnitPtToPt( context.pixelYToPt( rootElement()->getBaseline() ) ); + //return context.layoutUnitToPixelY( rootElement()->getBaseline() ); + return context.layoutUnitPtToPt( context.pixelYToPt( rootElement()->getBaseline() ) ); } void Container::moveTo( int x, int y ) @@ -601,8 +601,8 @@ TQImage Container::drawImage( int width, int height ) TQRect rect(impl->rootElement->getX(), impl->rootElement->getY(), impl->rootElement->getWidth(), impl->rootElement->getHeight()); - int realWidth = context.tqlayoutUnitToPixelX( impl->rootElement->getWidth() ); - int realHeight = context.tqlayoutUnitToPixelY( impl->rootElement->getHeight() ); + int realWidth = context.layoutUnitToPixelX( impl->rootElement->getWidth() ); + int realHeight = context.layoutUnitToPixelY( impl->rootElement->getHeight() ); double f = TQMAX( static_cast<double>( width )/static_cast<double>( realWidth ), static_cast<double>( height )/static_cast<double>( realHeight ) ); @@ -612,12 +612,12 @@ TQImage Container::drawImage( int width, int height ) kdDebug( DEBUGID ) << "Container::drawImage " << "(" << width << " " << height << ")" - << "(" << context.tqlayoutUnitToPixelX( impl->rootElement->getWidth() ) - << " " << context.tqlayoutUnitToPixelY( impl->rootElement->getHeight() ) << ")" + << "(" << context.layoutUnitToPixelX( impl->rootElement->getWidth() ) + << " " << context.layoutUnitToPixelY( impl->rootElement->getHeight() ) << ")" << endl; - TQPixmap pm( context.tqlayoutUnitToPixelX( impl->rootElement->getWidth() ), - context.tqlayoutUnitToPixelY( impl->rootElement->getHeight() ) ); + TQPixmap pm( context.layoutUnitToPixelX( impl->rootElement->getWidth() ), + context.layoutUnitToPixelY( impl->rootElement->getHeight() ) ); pm.fill(); TQPainter paint(&pm); impl->rootElement->draw(paint, rect, context); diff --git a/lib/kformula/kformuladefs.h b/lib/kformula/kformuladefs.h index 2e9d8a8b..80879f98 100644 --- a/lib/kformula/kformuladefs.h +++ b/lib/kformula/kformuladefs.h @@ -235,7 +235,7 @@ enum IndexPosition { lowerMiddlePos, upperRightPos, lowerRightPos, - tqparentPos + parentPos }; diff --git a/lib/kformula/kformulamimesource.cc b/lib/kformula/kformulamimesource.cc index af727959..58a6ad35 100644 --- a/lib/kformula/kformulamimesource.cc +++ b/lib/kformula/kformulamimesource.cc @@ -122,8 +122,8 @@ TQByteArray MimeSource::tqencodedData ( const char *format ) const TQRect rect(rootElement->getX(), rootElement->getY(), rootElement->getWidth(), rootElement->getHeight()); - TQPixmap pm( context.tqlayoutUnitToPixelX( rootElement->getWidth() ), - context.tqlayoutUnitToPixelY( rootElement->getHeight() ) ); + TQPixmap pm( context.layoutUnitToPixelX( rootElement->getWidth() ), + context.layoutUnitToPixelY( rootElement->getHeight() ) ); pm.fill(); TQPainter paint(&pm); rootElement->draw(paint, rect, context); diff --git a/lib/kformula/kformulaview.cc b/lib/kformula/kformulaview.cc index 8099f633..f4385b38 100644 --- a/lib/kformula/kformulaview.cc +++ b/lib/kformula/kformulaview.cc @@ -132,7 +132,7 @@ View::~View() TQPoint View::getCursorPoint() const { - return contextStyle().tqlayoutUnitToPixel( cursor()->getCursorPoint() ); + return contextStyle().layoutUnitToPixel( cursor()->getCursorPoint() ); } void View::setReadOnly(bool ro) diff --git a/lib/kformula/matrixelement.cc b/lib/kformula/matrixelement.cc index b8abd22b..38020904 100644 --- a/lib/kformula/matrixelement.cc +++ b/lib/kformula/matrixelement.cc @@ -339,12 +339,12 @@ void MatrixElement::entered( SequenceElement* /*child*/ ) BasicElement* MatrixElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); if (e != 0) { - LuPixelPoint myPos(tqparentOrigin.x() + getX(), - tqparentOrigin.y() + getY()); + LuPixelPoint myPos(parentOrigin.x() + getX(), + parentOrigin.y() + getY()); uint rows = getRows(); uint columns = getColumns(); @@ -430,7 +430,7 @@ BasicElement* MatrixElement::goToPos( FormulaCursor* cursor, bool& handled, /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ void MatrixElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -509,17 +509,17 @@ void MatrixElement::calcSizes( const ContextStyle& context, /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ void MatrixElement::draw( TQPainter& painter, const LuPixelRect& rect, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& parentOrigin ) { - LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); + LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( rect ) ) // return; @@ -922,15 +922,15 @@ bool MatrixElement::readAttributesFromMathMLDom( const TQDomElement& element ) } } } - TQString tqalignmentscopeStr = element.attribute( "tqalignmentscope" ).lower(); - if ( ! tqalignmentscopeStr.isNull() ) { - TQStringList list = TQStringList::split( ' ', tqalignmentscopeStr ); + TQString alignmentscopeStr = element.attribute( "alignmentscope" ).lower(); + if ( ! alignmentscopeStr.isNull() ) { + TQStringList list = TQStringList::split( ' ', alignmentscopeStr ); for ( TQStringList::iterator it = list.begin(); it != list.end(); it++ ) { if ( *it == "true" ) { - m_tqalignmentScope.append( true ); + m_alignmentScope.append( true ); } else if ( *it == "false" ) { - m_tqalignmentScope.append( false ); + m_alignmentScope.append( false ); } } } @@ -1327,18 +1327,18 @@ void MatrixElement::writeMathMLAttributes( TQDomElement& element ) const if ( ! columnalign.isNull() ) { element.setAttribute( "columnalign", columnalign.stripWhiteSpace() ); } - TQString tqalignmentscope; - for ( TQValueList< bool >::const_iterator it = m_tqalignmentScope.begin(); it != m_tqalignmentScope.end(); it++ ) + TQString alignmentscope; + for ( TQValueList< bool >::const_iterator it = m_alignmentScope.begin(); it != m_alignmentScope.end(); it++ ) { if ( *it ) { - tqalignmentscope.append( "true " ); + alignmentscope.append( "true " ); } else { - tqalignmentscope.append( "false " ); + alignmentscope.append( "false " ); } } - if ( ! tqalignmentscope.isNull() ) { - element.setAttribute( "tqalignmentscope", tqalignmentscope.stripWhiteSpace() ); + if ( ! alignmentscope.isNull() ) { + element.setAttribute( "alignmentscope", alignmentscope.stripWhiteSpace() ); } TQString columnwidth; TQValueList< double >::const_iterator lengthIt = m_columnWidth.begin(); @@ -1806,11 +1806,11 @@ public: } virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ virtual void calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -1967,11 +1967,11 @@ MultilineSequenceElement::MultilineSequenceElement( BasicElement* tqparent ) BasicElement* MultilineSequenceElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) { - //LuPixelPoint myPos(tqparentOrigin.x() + getX(), - // tqparentOrigin.y() + getY()); - BasicElement* e = inherited::goToPos(cursor, handled, point, tqparentOrigin); + //LuPixelPoint myPos(parentOrigin.x() + getX(), + // parentOrigin.y() + getY()); + BasicElement* e = inherited::goToPos(cursor, handled, point, parentOrigin); if (e == 0) { // If the mouse was behind this line put the cursor to the last position. @@ -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& tqparentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) { - BasicElement* e = inherited::goToPos(cursor, handled, point, tqparentOrigin); + BasicElement* e = inherited::goToPos(cursor, handled, point, parentOrigin); if ( e != 0 ) { - LuPixelPoint myPos(tqparentOrigin.x() + getX(), - tqparentOrigin.y() + getY()); + LuPixelPoint myPos(parentOrigin.x() + getX(), + parentOrigin.y() + getY()); uint count = content.count(); for ( uint i = 0; i < count; ++i ) { @@ -2400,7 +2400,7 @@ void MultilineElement::calcSizes( const ContextStyle& context, double factor = style.sizeFactor(); luPt mySize = context.getAdjustedSize( tstyle, factor ); TQFont font = context.getDefaultFont(); - font.setPointSizeFloat( context.tqlayoutUnitPtToPt( mySize ) ); + font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) ); TQFontMetrics fm( font ); luPixel leading = context.ptToLayoutUnitPt( fm.leading() ); luPixel distY = context.ptToPixelY( context.getThinSpace( tstyle, factor ) ); @@ -2458,9 +2458,9 @@ void MultilineElement::draw( TQPainter& painter, const LuPixelRect& r, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& parentOrigin ) { - LuPixelPoint myPos( tqparentOrigin.x() + getX(), tqparentOrigin.y() + getY() ); + LuPixelPoint myPos( parentOrigin.x() + getX(), parentOrigin.y() + getY() ); uint count = content.count(); if ( context.edit() ) { @@ -2471,10 +2471,10 @@ void MultilineElement::draw( TQPainter& painter, const LuPixelRect& r, if ( tabCount < line->tabCount() ) { for ( uint t = tabCount; t < line->tabCount(); ++t ) { BasicElement* marker = line->tab( t ); - painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x()+marker->getX() ), - context.tqlayoutUnitToPixelY( myPos.y() ), - context.tqlayoutUnitToPixelX( myPos.x()+marker->getX() ), - context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ) ); + painter.drawLine( context.layoutUnitToPixelX( myPos.x()+marker->getX() ), + context.layoutUnitToPixelY( myPos.y() ), + context.layoutUnitToPixelX( myPos.x()+marker->getX() ), + context.layoutUnitToPixelY( myPos.y()+getHeight() ) ); } tabCount = line->tabCount(); } diff --git a/lib/kformula/matrixelement.h b/lib/kformula/matrixelement.h index ede10114..04203257 100644 --- a/lib/kformula/matrixelement.h +++ b/lib/kformula/matrixelement.h @@ -69,7 +69,7 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); // drawing // @@ -80,7 +80,7 @@ public: /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -89,15 +89,15 @@ public: /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); /** * Dispatch this FontCommand to all our TextElement tqchildren. @@ -271,7 +271,7 @@ private: VerticalAlign m_align; TQValueList< VerticalAlign > m_rowAlign; TQValueList< HorizontalAlign > m_columnAlign; - TQValueList< bool > m_tqalignmentScope; + TQValueList< bool > m_alignmentScope; TQValueList< SizeType > m_columnWidthType; TQValueList< double > m_columnWidth; SizeType m_widthType; @@ -337,7 +337,7 @@ public: * Returns the element the point is in. */ BasicElement* goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); /** * Sets the cursor inside this element to its start position. @@ -375,7 +375,7 @@ public: /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -384,15 +384,15 @@ public: /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); /** * Dispatch this FontCommand to all our TextElement tqchildren. diff --git a/lib/kformula/paddedelement.cc b/lib/kformula/paddedelement.cc index f79e6789..d84bb064 100644 --- a/lib/kformula/paddedelement.cc +++ b/lib/kformula/paddedelement.cc @@ -36,7 +36,7 @@ PaddedElement::PaddedElement( BasicElement* tqparent ) : SequenceElement( tqpare /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ void PaddedElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, diff --git a/lib/kformula/paddedelement.h b/lib/kformula/paddedelement.h index 6d552837..811f861e 100644 --- a/lib/kformula/paddedelement.h +++ b/lib/kformula/paddedelement.h @@ -32,7 +32,7 @@ public: /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, diff --git a/lib/kformula/phantomelement.cc b/lib/kformula/phantomelement.cc index 662ec53d..72b564a6 100644 --- a/lib/kformula/phantomelement.cc +++ b/lib/kformula/phantomelement.cc @@ -27,8 +27,8 @@ PhantomElement::PhantomElement( BasicElement* tqparent ) : SequenceElement( tqpa /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ void PhantomElement::draw( TQPainter&, const LuPixelRect&, const ContextStyle&, ContextStyle::TextStyle, ContextStyle::IndexStyle, diff --git a/lib/kformula/phantomelement.h b/lib/kformula/phantomelement.h index 885a9651..cf89d893 100644 --- a/lib/kformula/phantomelement.h +++ b/lib/kformula/phantomelement.h @@ -31,15 +31,15 @@ public: /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); private: virtual TQString getElementName() const { return "mphantom"; } diff --git a/lib/kformula/rootelement.cc b/lib/kformula/rootelement.cc index 098d069f..f9331f13 100644 --- a/lib/kformula/rootelement.cc +++ b/lib/kformula/rootelement.cc @@ -138,12 +138,12 @@ void RootElement::entered( SequenceElement* child ) BasicElement* RootElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin) + const LuPixelPoint& point, const LuPixelPoint& parentOrigin) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); if (e != 0) { - LuPixelPoint myPos(tqparentOrigin.x() + getX(), - tqparentOrigin.y() + getY()); + LuPixelPoint myPos(parentOrigin.x() + getX(), + parentOrigin.y() + getY()); e = content->goToPos(cursor, handled, point, myPos); if (e != 0) { @@ -176,7 +176,7 @@ BasicElement* RootElement::goToPos( FormulaCursor* cursor, bool& handled, /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ void RootElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -235,17 +235,17 @@ void RootElement::calcSizes( const ContextStyle& context, /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ void RootElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& parentOrigin ) { - LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); + LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -265,27 +265,27 @@ void RootElement::draw( TQPainter& painter, const LuPixelRect& r, luPixel unit = (content->getHeight() + distY)/ 3; painter.setPen( TQPen( style.color(), - context.tqlayoutUnitToPixelX( 2*context.getLineWidth( factor ) ) ) ); - painter.drawLine( context.tqlayoutUnitToPixelX( x+unit/3 ), - context.tqlayoutUnitToPixelY( y+unit+distY/3 ), - context.tqlayoutUnitToPixelX( x+unit/2+unit/3 ), - context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ) ); + context.layoutUnitToPixelX( 2*context.getLineWidth( factor ) ) ) ); + painter.drawLine( context.layoutUnitToPixelX( x+unit/3 ), + context.layoutUnitToPixelY( y+unit+distY/3 ), + context.layoutUnitToPixelX( x+unit/2+unit/3 ), + context.layoutUnitToPixelY( myPos.y()+getHeight() ) ); painter.setPen( TQPen( style.color(), - context.tqlayoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); - - painter.drawLine( context.tqlayoutUnitToPixelX( x+unit+unit/3 ), - context.tqlayoutUnitToPixelY( y+distY/3 ), - context.tqlayoutUnitToPixelX( x+unit/2+unit/3 ), - context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ) ); - painter.drawLine( context.tqlayoutUnitToPixelX( x+unit+unit/3 ), - context.tqlayoutUnitToPixelY( y+distY/3 ), - context.tqlayoutUnitToPixelX( x+unit+unit/3+content->getWidth() ), - context.tqlayoutUnitToPixelY( y+distY/3 ) ); - painter.drawLine( context.tqlayoutUnitToPixelX( x+unit/3 ), - context.tqlayoutUnitToPixelY( y+unit+distY/2 ), - context.tqlayoutUnitToPixelX( x ), - context.tqlayoutUnitToPixelY( y+unit+unit/2 ) ); + context.layoutUnitToPixelY( context.getLineWidth( factor ) ) ) ); + + painter.drawLine( context.layoutUnitToPixelX( x+unit+unit/3 ), + context.layoutUnitToPixelY( y+distY/3 ), + context.layoutUnitToPixelX( x+unit/2+unit/3 ), + context.layoutUnitToPixelY( myPos.y()+getHeight() ) ); + painter.drawLine( context.layoutUnitToPixelX( x+unit+unit/3 ), + context.layoutUnitToPixelY( y+distY/3 ), + context.layoutUnitToPixelX( x+unit+unit/3+content->getWidth() ), + context.layoutUnitToPixelY( y+distY/3 ) ); + painter.drawLine( context.layoutUnitToPixelX( x+unit/3 ), + context.layoutUnitToPixelY( y+unit+distY/2 ), + context.layoutUnitToPixelX( x ), + context.layoutUnitToPixelY( y+unit+unit/2 ) ); } diff --git a/lib/kformula/rootelement.h b/lib/kformula/rootelement.h index b836228e..4908a643 100644 --- a/lib/kformula/rootelement.h +++ b/lib/kformula/rootelement.h @@ -62,11 +62,11 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -75,15 +75,15 @@ public: /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); /** * Dispatch this FontCommand to all our TextElement tqchildren. diff --git a/lib/kformula/sequenceelement.cc b/lib/kformula/sequenceelement.cc index eb64a13e..46c00817 100644 --- a/lib/kformula/sequenceelement.cc +++ b/lib/kformula/sequenceelement.cc @@ -114,12 +114,12 @@ bool SequenceElement::readOnly( const FormulaCursor* ) const * Returns the element the point is in. */ BasicElement* SequenceElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); if (e != 0) { - LuPixelPoint myPos(tqparentOrigin.x() + getX(), - tqparentOrigin.y() + getY()); + LuPixelPoint myPos(parentOrigin.x() + getX(), + parentOrigin.y() + getY()); uint count = tqchildren.count(); for (uint i = 0; i < count; i++) { @@ -174,7 +174,7 @@ bool SequenceElement::isEmpty() /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ void SequenceElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -247,17 +247,17 @@ void SequenceElement::setChildrenPositions() /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ void SequenceElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& parentOrigin ) { - LuPixelPoint myPos( tqparentOrigin.x() + getX(), tqparentOrigin.y() + getY() ); + LuPixelPoint myPos( parentOrigin.x() + getX(), parentOrigin.y() + getY() ); // There might be zero sized elements that still want to be drawn at least // in edit mode. (EmptyElement) //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) @@ -292,17 +292,17 @@ void SequenceElement::draw( TQPainter& painter, const LuPixelRect& r, } // Debug //painter.setPen(TQt::green); - //painter.drawRect(tqparentOrigin.x() + getX(), tqparentOrigin.y() + getY(), + //painter.drawRect(parentOrigin.x() + getX(), parentOrigin.y() + getY(), // getWidth(), getHeight()); -// painter.drawLine( context.tqlayoutUnitToPixelX( tqparentOrigin.x() + getX() ), -// context.tqlayoutUnitToPixelY( tqparentOrigin.y() + getY() + axis( context, tstyle ) ), -// context.tqlayoutUnitToPixelX( tqparentOrigin.x() + getX() + getWidth() ), -// context.tqlayoutUnitToPixelY( tqparentOrigin.y() + getY() + axis( context, tstyle ) ) ); +// painter.drawLine( context.layoutUnitToPixelX( parentOrigin.x() + getX() ), +// context.layoutUnitToPixelY( parentOrigin.y() + getY() + axis( context, tstyle ) ), +// context.layoutUnitToPixelX( parentOrigin.x() + getX() + getWidth() ), +// context.layoutUnitToPixelY( parentOrigin.y() + getY() + axis( context, tstyle ) ) ); // painter.setPen(TQt::red); -// painter.drawLine( context.tqlayoutUnitToPixelX( tqparentOrigin.x() + getX() ), -// context.tqlayoutUnitToPixelY( tqparentOrigin.y() + getY() + getBaseline() ), -// context.tqlayoutUnitToPixelX( tqparentOrigin.x() + getX() + getWidth() ), -// context.tqlayoutUnitToPixelY( tqparentOrigin.y() + getY() + getBaseline() ) ); +// painter.drawLine( context.layoutUnitToPixelX( parentOrigin.x() + getX() ), +// context.layoutUnitToPixelY( parentOrigin.y() + getY() + getBaseline() ), +// context.layoutUnitToPixelX( parentOrigin.x() + getX() + getWidth() ), +// context.layoutUnitToPixelY( parentOrigin.y() + getY() + getBaseline() ) ); } @@ -322,11 +322,11 @@ void SequenceElement::drawEmptyRect( TQPainter& painter, const ContextStyle& con if ( context.edit() ) { painter.setBrush(TQt::NoBrush); painter.setPen( TQPen( context.getEmptyColor(), - context.tqlayoutUnitToPixelX( context.getLineWidth( factor ) ) ) ); - painter.drawRect( context.tqlayoutUnitToPixelX( upperLeft.x() ), - context.tqlayoutUnitToPixelY( upperLeft.y() ), - context.tqlayoutUnitToPixelX( getWidth() ), - context.tqlayoutUnitToPixelY( getHeight() ) ); + context.layoutUnitToPixelX( context.getLineWidth( factor ) ) ) ); + painter.drawRect( context.layoutUnitToPixelX( upperLeft.x() ), + context.layoutUnitToPixelY( upperLeft.y() ), + context.layoutUnitToPixelX( getWidth() ), + context.layoutUnitToPixelY( getHeight() ) ); } } @@ -384,14 +384,14 @@ void SequenceElement::drawCursor( TQPainter& painter, const ContextStyle& contex painter.setRasterOp( TQt::XorROP ); if ( cursor->isSelection() ) { const LuPixelRect& r = cursor->cursorSize; - painter.fillRect( context.tqlayoutUnitToPixelX( r.x() ), - context.tqlayoutUnitToPixelY( r.y() ), - context.tqlayoutUnitToPixelX( r.width() ), - context.tqlayoutUnitToPixelY( r.height() ), + painter.fillRect( context.layoutUnitToPixelX( r.x() ), + context.layoutUnitToPixelY( r.y() ), + context.layoutUnitToPixelX( r.width() ), + context.layoutUnitToPixelY( r.height() ), TQt::white ); } painter.setPen( TQPen( TQt::white, - context.tqlayoutUnitToPixelX( context.getLineWidth( style.sizeFactor() )/2 ) ) ); + context.layoutUnitToPixelX( context.getLineWidth( style.sizeFactor() )/2 ) ) ); const LuPixelPoint& point = cursor->getCursorPoint(); const LuPixelRect& size = cursor->getCursorSize(); if ( activeCursor ) @@ -399,20 +399,20 @@ void SequenceElement::drawCursor( TQPainter& painter, const ContextStyle& contex int offset = 0; if ( cursor->isSelection() && cursor->getPos() > cursor->getMark() ) offset = -1; - painter.drawLine( context.tqlayoutUnitToPixelX( point.x() ) + offset, - context.tqlayoutUnitToPixelY( size.top() ), - context.tqlayoutUnitToPixelX( point.x() ) + offset, - context.tqlayoutUnitToPixelY( size.bottom() )-1 ); - painter.drawLine( context.tqlayoutUnitToPixelX( point.x() ) + offset + 1, - context.tqlayoutUnitToPixelY( size.top() ), - context.tqlayoutUnitToPixelX( point.x() ) + offset + 1, - context.tqlayoutUnitToPixelY( size.bottom() )-1 ); + painter.drawLine( context.layoutUnitToPixelX( point.x() ) + offset, + context.layoutUnitToPixelY( size.top() ), + context.layoutUnitToPixelX( point.x() ) + offset, + context.layoutUnitToPixelY( size.bottom() )-1 ); + painter.drawLine( context.layoutUnitToPixelX( point.x() ) + offset + 1, + context.layoutUnitToPixelY( size.top() ), + context.layoutUnitToPixelX( point.x() ) + offset + 1, + context.layoutUnitToPixelY( size.bottom() )-1 ); } if ( !smallCursor && !cursor->isSelection() ) - painter.drawLine( context.tqlayoutUnitToPixelX( size.left() ), - context.tqlayoutUnitToPixelY( size.bottom() )-1, - context.tqlayoutUnitToPixelX( size.right() )-1, - context.tqlayoutUnitToPixelY( size.bottom() )-1 ); + painter.drawLine( context.layoutUnitToPixelX( size.left() ), + context.layoutUnitToPixelY( size.bottom() )-1, + context.layoutUnitToPixelX( size.right() )-1, + context.layoutUnitToPixelY( size.bottom() )-1 ); // This might be wrong but probably isn't. painter.setRasterOp( TQt::CopyROP ); } @@ -1629,13 +1629,13 @@ void NameSequence::drawCursor( TQPainter& painter, const ContextStyle& context, { LuPixelPoint point = widgetPos(); painter.setPen( TQPen( context.getEmptyColor(), - context.tqlayoutUnitToPixelX( context.getLineWidth( style.sizeFactor() )/2 ) ) ); + context.layoutUnitToPixelX( context.getLineWidth( style.sizeFactor() )/2 ) ) ); luPixel unitX = context.ptToLayoutUnitPixX( 1 ); luPixel unitY = context.ptToLayoutUnitPixY( 1 ); - painter.drawRect( context.tqlayoutUnitToPixelX( point.x()-unitX ), - context.tqlayoutUnitToPixelY( point.y()-unitY ), - context.tqlayoutUnitToPixelX( getWidth()+2*unitX ), - context.tqlayoutUnitToPixelY( getHeight()+2*unitY ) ); + painter.drawRect( context.layoutUnitToPixelX( point.x()-unitX ), + context.layoutUnitToPixelY( point.y()-unitY ), + context.layoutUnitToPixelX( getWidth()+2*unitX ), + context.layoutUnitToPixelY( getHeight()+2*unitY ) ); inherited::drawCursor( painter, context, style, cursor, smallCursor, activeCursor ); } diff --git a/lib/kformula/sequenceelement.h b/lib/kformula/sequenceelement.h index 167c1ae3..ab6828fd 100644 --- a/lib/kformula/sequenceelement.h +++ b/lib/kformula/sequenceelement.h @@ -70,7 +70,7 @@ public: */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, const LuPixelPoint& point, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); // drawing // @@ -92,7 +92,7 @@ public: /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -101,15 +101,15 @@ public: /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); /** * Dispatch this FontCommand to all our TextElement tqchildren. diff --git a/lib/kformula/spaceelement.cc b/lib/kformula/spaceelement.cc index 7bc21d24..f3f43d1c 100644 --- a/lib/kformula/spaceelement.cc +++ b/lib/kformula/spaceelement.cc @@ -99,24 +99,24 @@ void SpaceElement::calcSizes( const ContextStyle& context, double width = style.getSpace( m_widthType, m_width ); if ( m_widthType == AbsoluteSize ) { - width = m_width / context.tqlayoutUnitPtToPt( context.getBaseSize() ); + width = m_width / context.layoutUnitPtToPt( context.getBaseSize() ); } else if ( m_widthType == PixelSize ) { - width = context.pixelYToPt( m_width ) / context.tqlayoutUnitPtToPt( context.getBaseSize() ); + width = context.pixelYToPt( m_width ) / context.layoutUnitPtToPt( context.getBaseSize() ); } double height = style.getSpace( m_heightType, m_height ); if ( m_heightType == AbsoluteSize ) { - height = m_height / context.tqlayoutUnitPtToPt( context.getBaseSize() ); + height = m_height / context.layoutUnitPtToPt( context.getBaseSize() ); } else if ( m_heightType == PixelSize ) { - height = context.pixelYToPt( m_height ) / context.tqlayoutUnitPtToPt( context.getBaseSize() ); + height = context.pixelYToPt( m_height ) / context.layoutUnitPtToPt( context.getBaseSize() ); } double depth = style.getSpace( m_depthType, m_depth ); if ( m_depthType == AbsoluteSize ) { - depth = m_depth / context.tqlayoutUnitPtToPt( context.getBaseSize() ); + depth = m_depth / context.layoutUnitPtToPt( context.getBaseSize() ); } else if ( m_depthType == PixelSize ) { - depth = context.pixelYToPt( m_depth ) / context.tqlayoutUnitPtToPt( context.getBaseSize() ); + depth = context.pixelYToPt( m_depth ) / context.layoutUnitPtToPt( context.getBaseSize() ); } setWidth( hbound.width() * width ); @@ -133,27 +133,27 @@ void SpaceElement::draw( TQPainter& painter, const LuPixelRect& /*r*/, ContextStyle::TextStyle /*tstyle*/, ContextStyle::IndexStyle /*istyle*/, StyleAttributes& /*style*/, - const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& parentOrigin ) { - LuPixelPoint myPos(tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY()); + LuPixelPoint myPos(parentOrigin.x()+getX(), parentOrigin.y()+getY()); // there is such a thing as negative space! //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; if ( context.edit() ) { painter.setPen( context.getEmptyColor() ); - painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x() ), - context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ), - context.tqlayoutUnitToPixelX( myPos.x()+getWidth()-1 ), - context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ) ); - painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x() ), - context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ), - context.tqlayoutUnitToPixelX( myPos.x() ), - context.tqlayoutUnitToPixelY( myPos.y()+getHeight()-getHeight()/5 ) ); - painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x()+getWidth()-1 ), - context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ), - context.tqlayoutUnitToPixelX( myPos.x()+getWidth()-1 ), - context.tqlayoutUnitToPixelY( myPos.y()+getHeight()-getHeight()/5 ) ); + painter.drawLine( context.layoutUnitToPixelX( myPos.x() ), + context.layoutUnitToPixelY( myPos.y()+getHeight() ), + context.layoutUnitToPixelX( myPos.x()+getWidth()-1 ), + context.layoutUnitToPixelY( myPos.y()+getHeight() ) ); + painter.drawLine( context.layoutUnitToPixelX( myPos.x() ), + context.layoutUnitToPixelY( myPos.y()+getHeight() ), + context.layoutUnitToPixelX( myPos.x() ), + context.layoutUnitToPixelY( myPos.y()+getHeight()-getHeight()/5 ) ); + painter.drawLine( context.layoutUnitToPixelX( myPos.x()+getWidth()-1 ), + context.layoutUnitToPixelY( myPos.y()+getHeight() ), + context.layoutUnitToPixelX( myPos.x()+getWidth()-1 ), + context.layoutUnitToPixelY( myPos.y()+getHeight()-getHeight()/5 ) ); } } diff --git a/lib/kformula/spaceelement.h b/lib/kformula/spaceelement.h index 0f5db35d..856af25e 100644 --- a/lib/kformula/spaceelement.h +++ b/lib/kformula/spaceelement.h @@ -78,7 +78,7 @@ public: /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -87,15 +87,15 @@ public: /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); /** * Moves the cursor away from the given child. The cursor is diff --git a/lib/kformula/styleelement.cc b/lib/kformula/styleelement.cc index 1a8f20ae..fc61386c 100644 --- a/lib/kformula/styleelement.cc +++ b/lib/kformula/styleelement.cc @@ -193,7 +193,7 @@ void StyleElement::setStyleSize( const ContextStyle& context, StyleAttributes& s // Get scriptminsize attribute in absolute units, so we don't depend on // context to get the default value - double basesize = context.tqlayoutUnitPtToPt( context.getBaseSize() ); + double basesize = context.layoutUnitPtToPt( context.getBaseSize() ); double size = style.scriptMinSize(); switch ( m_scriptMinSizeType ) { case AbsoluteSize: @@ -236,7 +236,7 @@ void StyleElement::setStyleSize( const ContextStyle& context, StyleAttributes& s double StyleElement::sizeFactor( const ContextStyle& context, SizeType st, double length, double defvalue ) { - double basesize = context.tqlayoutUnitPtToPt( context.getBaseSize() ); + double basesize = context.layoutUnitPtToPt( context.getBaseSize() ); switch ( st ) { case AbsoluteSize: return length / basesize; diff --git a/lib/kformula/symbolelement.cc b/lib/kformula/symbolelement.cc index 518fba2f..fb2eb69d 100644 --- a/lib/kformula/symbolelement.cc +++ b/lib/kformula/symbolelement.cc @@ -134,12 +134,12 @@ bool SymbolElement::accept( ElementVisitor* visitor ) BasicElement* SymbolElement::goToPos( FormulaCursor* cursor, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ) { - BasicElement* e = BasicElement::goToPos(cursor, handled, point, tqparentOrigin); + BasicElement* e = BasicElement::goToPos(cursor, handled, point, parentOrigin); if (e != 0) { - LuPixelPoint myPos(tqparentOrigin.x() + getX(), - tqparentOrigin.y() + getY()); + LuPixelPoint myPos(parentOrigin.x() + getX(), + parentOrigin.y() + getY()); e = content->goToPos(cursor, handled, point, myPos); if (e != 0) { @@ -192,7 +192,7 @@ BasicElement* SymbolElement::goToPos( FormulaCursor* cursor, bool& handled, /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ void SymbolElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -212,7 +212,7 @@ void SymbolElement::calcSizes( const ContextStyle& context, symbol->calcSizes(context, tstyle, factor, mySize); content->calcSizes( context, tstyle, istyle, style ); - //symbol->scale(((double)tqparentSize)/symbol->getHeight()*2); + //symbol->scale(((double)parentSize)/symbol->getHeight()*2); luPixel upperWidth = 0; luPixel upperHeight = 0; @@ -300,17 +300,17 @@ void SymbolElement::calcSizes( const ContextStyle& context, /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ void SymbolElement::draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& parentOrigin ) { - LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); + LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -330,19 +330,19 @@ void SymbolElement::draw( TQPainter& painter, const LuPixelRect& r, #if 0 painter.setBrush(TQt::NoBrush); painter.setPen(TQt::red); -// painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x() ), -// context.tqlayoutUnitToPixelY( myPos.y() ), -// context.tqlayoutUnitToPixelX( getWidth() ), -// context.tqlayoutUnitToPixelY( getHeight() ) ); - painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x()+symbol->getX() ), - context.tqlayoutUnitToPixelY( myPos.y()+symbol->getY() ), - context.tqlayoutUnitToPixelX( symbol->getWidth() ), - context.tqlayoutUnitToPixelY( symbol->getHeight() ) ); +// painter.drawRect( context.layoutUnitToPixelX( myPos.x() ), +// context.layoutUnitToPixelY( myPos.y() ), +// context.layoutUnitToPixelX( getWidth() ), +// context.layoutUnitToPixelY( getHeight() ) ); + painter.drawRect( context.layoutUnitToPixelX( myPos.x()+symbol->getX() ), + context.layoutUnitToPixelY( myPos.y()+symbol->getY() ), + context.layoutUnitToPixelX( symbol->getWidth() ), + context.layoutUnitToPixelY( symbol->getHeight() ) ); painter.setPen(TQt::green); - painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x() ), - context.tqlayoutUnitToPixelY( myPos.y()+axis(context, tstyle) ), - context.tqlayoutUnitToPixelX( myPos.x()+getWidth() ), - context.tqlayoutUnitToPixelY( myPos.y()+axis(context, tstyle) ) ); + painter.drawLine( context.layoutUnitToPixelX( myPos.x() ), + context.layoutUnitToPixelY( myPos.y()+axis(context, tstyle) ), + context.layoutUnitToPixelX( myPos.x()+getWidth() ), + context.layoutUnitToPixelY( myPos.y()+axis(context, tstyle) ) ); #endif } diff --git a/lib/kformula/symbolelement.h b/lib/kformula/symbolelement.h index 799703a6..877c4493 100644 --- a/lib/kformula/symbolelement.h +++ b/lib/kformula/symbolelement.h @@ -54,7 +54,7 @@ public: * is allowed to set the cursor. */ virtual BasicElement* goToPos( FormulaCursor*, bool& handled, - const LuPixelPoint& point, const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& point, const LuPixelPoint& parentOrigin ); // drawing // @@ -65,7 +65,7 @@ public: /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -74,15 +74,15 @@ public: /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); /** * Dispatch this FontCommand to all our TextElement tqchildren. diff --git a/lib/kformula/textelement.cc b/lib/kformula/textelement.cc index 24eae2d8..c42a6e2f 100644 --- a/lib/kformula/textelement.cc +++ b/lib/kformula/textelement.cc @@ -106,7 +106,7 @@ bool TextElement::isInvisible() const /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ void TextElement::calcSizes( const ContextStyle& context, ContextStyle::TextStyle tstyle, @@ -120,7 +120,7 @@ void TextElement::calcSizes( const ContextStyle& context, setCharFamily( style.charFamily() ); TQFont font = getFont( context, style ); - double fontsize = context.tqlayoutUnitPtToPt( mySize ); + double fontsize = context.layoutUnitPtToPt( mySize ); double scriptsize = pow( style.scriptSizeMultiplier(), style.scriptLevel() ); double size = fontsize * scriptsize; font.setPointSizeFloat( size < style.scriptMinSize() ? style.scriptMinSize() : size ); @@ -156,21 +156,21 @@ void TextElement::calcSizes( const ContextStyle& context, /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ void TextElement::draw( TQPainter& painter, const LuPixelRect& /*r*/, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle /*istyle*/, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& parentOrigin ) { if ( character == applyFunctionChar || character == invisibleTimes || character == invisibleComma ) { return; } - LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); + LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); //if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) // return; @@ -184,7 +184,7 @@ void TextElement::draw( TQPainter& painter, const LuPixelRect& /*r*/, double factor = style.sizeFactor(); luPt mySize = context.getAdjustedSize( tstyle, factor ); TQFont font = getFont( context, style ); - double fontsize = context.tqlayoutUnitPtToPt( mySize ); + double fontsize = context.layoutUnitPtToPt( mySize ); double scriptsize = pow( style.scriptSizeMultiplier(), style.scriptLevel() ); double size = fontsize * scriptsize; font.setPointSizeFloat( size < style.scriptMinSize() ? style.scriptMinSize() : size ); @@ -192,7 +192,7 @@ void TextElement::draw( TQPainter& painter, const LuPixelRect& /*r*/, //kdDebug( DEBUGID ) << "TextElement::draw font=" << font.rawName() << endl; //kdDebug( DEBUGID ) << "TextElement::draw size=" << mySize << endl; - //kdDebug( DEBUGID ) << "TextElement::draw size=" << context.tqlayoutUnitToFontSize( mySize, false ) << endl; + //kdDebug( DEBUGID ) << "TextElement::draw size=" << context.layoutUnitToFontSize( mySize, false ) << endl; //kdDebug( DEBUGID ) << "TextElement::draw height: " << getHeight() << endl; //kdDebug( DEBUGID ) << "TextElement::draw width: " << getWidth() << endl; //kdDebug( DEBUGID ) << endl; @@ -205,13 +205,13 @@ void TextElement::draw( TQPainter& painter, const LuPixelRect& /*r*/, // kdDebug() << "draw text: " << text[0].tqunicode() // << " " << painter.font().family().latin1() // << endl; - painter.fillRect( context.tqlayoutUnitToPixelX( tqparentOrigin.x() ), - context.tqlayoutUnitToPixelY( tqparentOrigin.y() ), - context.tqlayoutUnitToPixelX( getParent()->getWidth() ), - context.tqlayoutUnitToPixelY( getParent()->getHeight() ), + painter.fillRect( context.layoutUnitToPixelX( parentOrigin.x() ), + context.layoutUnitToPixelY( parentOrigin.y() ), + context.layoutUnitToPixelX( getParent()->getWidth() ), + context.layoutUnitToPixelY( getParent()->getHeight() ), style.background() ); - painter.drawText( context.tqlayoutUnitToPixelX( myPos.x() ), - context.tqlayoutUnitToPixelY( myPos.y()+getBaseline() ), + painter.drawText( context.layoutUnitToPixelX( myPos.x() ), + context.layoutUnitToPixelY( myPos.y()+getBaseline() ), text ); } else { @@ -226,17 +226,17 @@ void TextElement::draw( TQPainter& painter, const LuPixelRect& /*r*/, // baseline==0 glyphs without yet another flag. bl = -( getHeight()/2 + context.axisHeight( tstyle, factor ) ); } - painter.drawText( context.tqlayoutUnitToPixelX( myPos.x() ), - context.tqlayoutUnitToPixelY( myPos.y()+bl ), + painter.drawText( context.layoutUnitToPixelX( myPos.x() ), + context.layoutUnitToPixelY( myPos.y()+bl ), TQString(ch) ); } else { painter.setPen( TQPen( context.getErrorColor(), - context.tqlayoutUnitToPixelX( context.getLineWidth( factor ) ) ) ); - painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x() ), - context.tqlayoutUnitToPixelY( myPos.y() ), - context.tqlayoutUnitToPixelX( getWidth() ), - context.tqlayoutUnitToPixelY( getHeight() ) ); + context.layoutUnitToPixelX( context.getLineWidth( factor ) ) ) ); + painter.drawRect( context.layoutUnitToPixelX( myPos.x() ), + context.layoutUnitToPixelY( myPos.y() ), + context.layoutUnitToPixelX( getWidth() ), + context.layoutUnitToPixelY( getHeight() ) ); } // } @@ -244,10 +244,10 @@ void TextElement::draw( TQPainter& painter, const LuPixelRect& /*r*/, //painter.setBrush(TQt::NoBrush); // if ( isSymbol() ) { // painter.setPen( TQt::red ); -// painter.drawRect( context.tqlayoutUnitToPixelX( myPos.x() ), -// context.tqlayoutUnitToPixelX( myPos.y() ), -// context.tqlayoutUnitToPixelX( getWidth() ), -// context.tqlayoutUnitToPixelX( getHeight() ) ); +// painter.drawRect( context.layoutUnitToPixelX( myPos.x() ), +// context.layoutUnitToPixelX( myPos.y() ), +// context.layoutUnitToPixelX( getWidth() ), +// context.layoutUnitToPixelX( getHeight() ) ); // painter.setPen(TQt::green); // painter.drawLine(myPos.x(), myPos.y()+axis( context, tstyle ), // myPos.x()+getWidth(), myPos.y()+axis( context, tstyle )); @@ -527,7 +527,7 @@ void EmptyElement::calcSizes( const ContextStyle& context, //kdDebug( DEBUGID ) << "TextElement::calcSizes size=" << mySize << endl; TQFont font = context.getDefaultFont(); - font.setPointSizeFloat( context.tqlayoutUnitPtToPt( mySize ) ); + font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) ); TQFontMetrics fm( font ); TQChar ch = 'A'; @@ -542,9 +542,9 @@ void EmptyElement::draw( TQPainter& painter, const LuPixelRect& /*r*/, ContextStyle::TextStyle /*tstyle*/, ContextStyle::IndexStyle /*istyle*/, StyleAttributes& /*style*/ , - const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& parentOrigin ) { - LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() ); + LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() ); /* if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) ) return; @@ -552,10 +552,10 @@ void EmptyElement::draw( TQPainter& painter, const LuPixelRect& /*r*/, if ( context.edit() ) { painter.setPen( context.getHelpColor() ); - painter.drawLine( context.tqlayoutUnitToPixelX( myPos.x() ), - context.tqlayoutUnitToPixelY( myPos.y() ), - context.tqlayoutUnitToPixelX( myPos.x() ), - context.tqlayoutUnitToPixelY( myPos.y()+getHeight() ) ); + painter.drawLine( context.layoutUnitToPixelX( myPos.x() ), + context.layoutUnitToPixelY( myPos.y() ), + context.layoutUnitToPixelX( myPos.x() ), + context.layoutUnitToPixelY( myPos.y()+getHeight() ) ); } } diff --git a/lib/kformula/textelement.h b/lib/kformula/textelement.h index 0b97f441..48eb1d43 100644 --- a/lib/kformula/textelement.h +++ b/lib/kformula/textelement.h @@ -73,7 +73,7 @@ public: /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -82,15 +82,15 @@ public: /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); /** * Dispatch this FontCommand to all our TextElement tqchildren. @@ -244,7 +244,7 @@ public: /** * Calculates our width and height and - * our tqchildren's tqparentPosition. + * our tqchildren's parentPosition. */ virtual void calcSizes( const ContextStyle& cstyle, ContextStyle::TextStyle tstyle, @@ -253,15 +253,15 @@ public: /** * 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. + * The `parentOrigin' is the point this element's tqparent starts. + * We can use our parentPosition to get our own origin then. */ virtual void draw( TQPainter& painter, const LuPixelRect& r, const ContextStyle& context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); /** diff --git a/lib/kformula/tokenstyleelement.cc b/lib/kformula/tokenstyleelement.cc index 43731425..3b1e6224 100644 --- a/lib/kformula/tokenstyleelement.cc +++ b/lib/kformula/tokenstyleelement.cc @@ -59,20 +59,20 @@ void TokenStyleElement::draw( TQPainter& painter, const LuPixelRect& r, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ) + const LuPixelPoint& parentOrigin ) { setStyleSize( context, style ); setStyleVariant( style ); setStyleColor( style ); setStyleBackground( style ); if ( style.background() != TQt::color0 ) { - painter.fillRect( context.tqlayoutUnitToPixelX( tqparentOrigin.x() + getX() ), - context.tqlayoutUnitToPixelY( tqparentOrigin.y() + getY() ), - context.tqlayoutUnitToPixelX( getWidth() ), - context.tqlayoutUnitToPixelY( getHeight() ), + painter.fillRect( context.layoutUnitToPixelX( parentOrigin.x() + getX() ), + context.layoutUnitToPixelY( parentOrigin.y() + getY() ), + context.layoutUnitToPixelX( getWidth() ), + context.layoutUnitToPixelY( getHeight() ), style.background() ); } - inherited::draw( painter, r, context, tstyle, istyle, style, tqparentOrigin ); + inherited::draw( painter, r, context, tstyle, istyle, style, parentOrigin ); resetStyle( style ); } @@ -550,7 +550,7 @@ void TokenStyleElement::resetStyle( StyleAttributes& style ) double TokenStyleElement::sizeFactor( const ContextStyle& context, double factor ) { - double basesize = context.tqlayoutUnitPtToPt( context.getBaseSize() ); + double basesize = context.layoutUnitPtToPt( context.getBaseSize() ); switch ( m_mathSizeType ) { case AbsoluteSize: return m_mathSize / basesize; diff --git a/lib/kformula/tokenstyleelement.h b/lib/kformula/tokenstyleelement.h index db7d14f6..3e601ca8 100644 --- a/lib/kformula/tokenstyleelement.h +++ b/lib/kformula/tokenstyleelement.h @@ -48,7 +48,7 @@ public: ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes& style, - const LuPixelPoint& tqparentOrigin ); + const LuPixelPoint& parentOrigin ); protected: virtual bool readAttributesFromMathMLDom( const TQDomElement &element ); |