diff options
Diffstat (limited to 'kword/KWAnchor.cpp')
-rw-r--r-- | kword/KWAnchor.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/kword/KWAnchor.cpp b/kword/KWAnchor.cpp index 33242554..f9641cf4 100644 --- a/kword/KWAnchor.cpp +++ b/kword/KWAnchor.cpp @@ -55,7 +55,7 @@ void KWAnchor::finalize() KWTextFrameSet * fs = static_cast<KWTextDocument *>(textDocument())->textFrameSet(); KoPoint dPoint; - if ( fs->internalToDocument( QPoint( x()+paragx, y()+paragy ), dPoint ) ) + if ( fs->internalToDocument( TQPoint( x()+paragx, y()+paragy ), dPoint ) ) { //kdDebug(32001) << "KWAnchor::finalize moving frame to " << dPoint.x() << "," << dPoint.y() << endl; // Move the frame to position dPoint. @@ -67,10 +67,10 @@ void KWAnchor::finalize() } } -void KWAnchor::draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected ) +void KWAnchor::draw( TQPainter* p, int x, int y, int cx, int cy, int cw, int ch, const TQColorGroup& cg, bool selected ) { // (x,y) is the position of the inline item (in Layout Units) - // (cx,cy,cw,ch) is the rectangle to be painted, in layout units too + // (cx,cy,cw,ch) is the rectangle to be painted, in tqlayout units too if ( m_deleted ) return; @@ -86,13 +86,13 @@ void KWAnchor::draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, int paragx = paragraph()->rect().x(); int paragy = paragraph()->rect().y(); - QRect inlineFrameLU( paragx+xpos, paragy+ypos, width, height ); + TQRect inlineFrameLU( paragx+xpos, paragy+ypos, width, height ); #ifdef DEBUG_DRAWING kdDebug(32001) << "KWAnchor::draw x:" << x << ", y:" << y << " paragx=" << paragx << " paragy=" << paragy << endl; kdDebug(32001) << " inline frame in LU coordinates: " << inlineFrameLU << endl; #endif - QRect crectLU = QRect( (cx > 0 ? cx : 0)+paragx, cy+paragy, cw, ch ); + TQRect crectLU = TQRect( (cx > 0 ? cx : 0)+paragx, cy+paragy, cw, ch ); #ifdef DEBUG_DRAWING kdDebug(32001) << " crect in LU coordinates: " << DEBUGRECT( crectLU ) << endl; #endif @@ -105,13 +105,13 @@ void KWAnchor::draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, #endif // Convert crect to document coordinates, first topleft then bottomright - QPoint topLeftLU = crectLU.topLeft(); - QPoint bottomRightLU = crectLU.bottomRight(); + TQPoint topLeftLU = crectLU.topLeft(); + TQPoint bottomRightLU = crectLU.bottomRight(); KWFrame* containingFrame = fs->currentDrawnFrame(); // always set, except in the textviewmode if(containingFrame) containingFrame = KWFrameSet::settingsFrame(containingFrame); else { // if its not set (in textviewmode) try to get it from the FS - QPoint paragPos = inlineFrameLU.topLeft(); + TQPoint paragPos = inlineFrameLU.topLeft(); KoPoint dummy(0, 0); containingFrame = fs->internalToDocument(paragPos, dummy); } @@ -122,7 +122,7 @@ void KWAnchor::draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, KoRect crectPt( topLeftPt, bottomRightPt ); // Convert crect to view coords - QRect crect = fs->currentViewMode()->normalToView( zh->zoomRect( crectPt ) ); + TQRect crect = fs->currentViewMode()->normalToView( zh->zoomRect( crectPt ) ); // and add 1 to right and bottom, to avoid rounding errors (and due to qrect semantics) crect.rBottom() += 2; // HACK: 1 doesn't do it, it leaves a white line along window borders crect.rRight() += 1; @@ -137,7 +137,7 @@ void KWAnchor::draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, if ( containingFrame && containingFrame->isCopy() ) { // Find last real frame, in case we are in a copied frame - QPtrListIterator<KWFrame> frameIt( fs->frameIterator() ); + TQPtrListIterator<KWFrame> frameIt( fs->frameIterator() ); frameIt.toLast(); // from the end to avoid a 2*N in the worst case while ( !frameIt.atFirst() && frameIt.current() != containingFrame ) // look for 'containingFrame' --frameIt; @@ -154,12 +154,12 @@ void KWAnchor::draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, if ( containingFrame ) // 0 in the textviewmode topLeftParagPt = containingFrame->innerRect().topLeft(); - topLeftParagPt.rx() += zh->layoutUnitPtToPt( zh->pixelYToPt( paragx ) ); - topLeftParagPt.ry() += zh->layoutUnitPtToPt( zh->pixelYToPt( paragy ) ); + topLeftParagPt.rx() += zh->tqlayoutUnitPtToPt( zh->pixelYToPt( paragx ) ); + topLeftParagPt.ry() += zh->tqlayoutUnitPtToPt( zh->pixelYToPt( paragy ) ); if ( containingFrame ) // 0 in the textviewmode topLeftParagPt.ry() -= containingFrame->internalY(); - QPoint topLeftParag = fs->currentViewMode()->normalToView( zh->zoomPoint( topLeftParagPt ) ); + TQPoint topLeftParag = fs->currentViewMode()->normalToView( zh->zoomPoint( topLeftParagPt ) ); // Finally, make the painter go back to view coord system // (this is exactly the opposite of the code in KWFrameSet::drawContents) @@ -170,26 +170,26 @@ void KWAnchor::draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, kdDebug() << " translating by " << -topLeftParag.x() << "," << -topLeftParag.y() << endl; #endif - QColorGroup cg2( cg ); + TQColorGroup cg2( cg ); KWFrameViewManager *fvm = 0; if(m_frameset->kWordDocument()) { - QValueList<KWView *> views = m_frameset->kWordDocument()->getAllViews(); + TQValueList<KWView *> views = m_frameset->kWordDocument()->getAllViews(); // Note that "views" is empty when the KWDocument is an (inactive) embedded document if ( !views.isEmpty() ) fvm = views.first()->frameViewManager(); } m_frameset->drawContents( p, crect, cg2, false, true, 0L, fs->currentViewMode(), fvm); - if( selected && placement() == PlaceInline && p->device()->devType() != QInternal::Printer ) + if( selected && placement() == PlaceInline && p->device()->devType() != TQInternal::Printer ) { // The above rects are about the containing frame. // To draw the inline frame as selected, we need to look at the inline frame's own size. - QRect frameRect = crect; + TQRect frameRect = crect; #ifdef DEBUG_DRAWING kdDebug() << "KWAnchor::draw selected frame. frameRect=" << frameRect << endl; #endif - p->fillRect( frameRect, QBrush( cg.highlight(), QBrush::Dense4Pattern) ); + p->fillRect( frameRect, TQBrush( cg.highlight(), TQBrush::Dense4Pattern) ); } p->restore(); @@ -198,17 +198,17 @@ void KWAnchor::draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, #endif } -QSize KWAnchor::size() const +TQSize KWAnchor::size() const { KoSize kosz = m_frameset->floatingFrameSize( m_frameNum ); //kdDebug() << "KWAnchor::size in pt: " << kosz.width() << "x" << kosz.height() << endl; KoTextZoomHandler * zh = textDocument()->formattingZoomHandler(); - QSize sz( zh->ptToLayoutUnitPixX( kosz.width() ), zh->ptToLayoutUnitPixY( kosz.height() ) ); + TQSize sz( zh->ptToLayoutUnitPixX( kosz.width() ), zh->ptToLayoutUnitPixY( kosz.height() ) ); //kdDebug() << "KWAnchor::size in LU: " << sz.width() << "x" << sz.height() << endl; - //kdDebug() << " size in pixels: " << zh->layoutUnitToPixelX( sz.width() ) << "x" - // << zh->layoutUnitToPixelY( sz.height() ) << endl; + //kdDebug() << " size in pixels: " << zh->tqlayoutUnitToPixelX( sz.width() ) << "x" + // << zh->tqlayoutUnitToPixelY( sz.height() ) << endl; if ( sz.isNull() ) // for some reason, we don't know the size yet - sz = QSize( width, height ); // LU + sz = TQSize( width, height ); // LU return sz; } @@ -224,7 +224,7 @@ void KWAnchor::resize() { if ( m_deleted ) return; - QSize s = size(); + TQSize s = size(); if ( width != s.width() || height != s.height() ) { width = s.width(); @@ -234,7 +234,7 @@ void KWAnchor::resize() if ( parag ) { kdDebug(32001) << "KWAnchor::resize invalidating parag " << parag->paragId() << endl; - parag->invalidate( 0 ); + parag->tqinvalidate( 0 ); } } } @@ -263,10 +263,10 @@ void KWAnchor::setDeleted( bool b ) m_frameset->setAnchored( static_cast<KWTextDocument *>(textDocument())->textFrameSet() ); } -void KWAnchor::save( QDomElement &parentElem ) +void KWAnchor::save( TQDomElement &tqparentElem ) { - QDomElement anchorElem = parentElem.ownerDocument().createElement( "ANCHOR" ); - parentElem.appendChild( anchorElem ); + TQDomElement anchorElem = tqparentElem.ownerDocument().createElement( "ANCHOR" ); + tqparentElem.appendChild( anchorElem ); anchorElem.setAttribute( "type", "frameset" ); // the only possible value currently //KWDocument * doc = textDocument()->textFrameSet()->kWordDocument(); // ## TODO save the frame number as well ? Only the first frame ? to be determined |