diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kword/KWFrameSet.cpp | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kword/KWFrameSet.cpp')
-rw-r--r-- | kword/KWFrameSet.cpp | 272 |
1 files changed, 136 insertions, 136 deletions
diff --git a/kword/KWFrameSet.cpp b/kword/KWFrameSet.cpp index 154cd22b..0e72f168 100644 --- a/kword/KWFrameSet.cpp +++ b/kword/KWFrameSet.cpp @@ -37,8 +37,8 @@ #include <KoXmlNS.h> #include <KoXmlWriter.h> -#include <qpopupmenu.h> -#include <qapplication.h> +#include <tqpopupmenu.h> +#include <tqapplication.h> //#define DEBUG_DRAW @@ -49,11 +49,11 @@ KWFrameSet::KWFrameSet( KWDocument *doc ) m_protectSize( false ), m_anchorTextFs( 0L ), m_dcop( 0L ), m_pageManager( 0 ) { - // Send our "repaintChanged" signals to the document. + // Send our "tqrepaintChanged" signals to the document. setName("KWFrameSet"); if(m_doc) { - connect( this, SIGNAL( repaintChanged( KWFrameSet * ) ), - doc, SLOT( slotRepaintChanged( KWFrameSet * ) ) ); + connect( this, TQT_SIGNAL( tqrepaintChanged( KWFrameSet * ) ), + doc, TQT_SLOT( slotRepaintChanged( KWFrameSet * ) ) ); m_pageManager = doc->pageManager(); } m_frames.setAutoDelete( true ); @@ -76,7 +76,7 @@ KWFrameSet::~KWFrameSet() void KWFrameSet::addFrame( KWFrame *frame, bool recalc ) { - if ( m_frames.findRef( frame ) != -1 ) + if ( m_frames.tqfindRef( frame ) != -1 ) return; //kdDebug(32001) << k_funcinfo << name() << " adding frame" << frame << " recalc=" << recalc << endl; @@ -96,11 +96,11 @@ void KWFrameSet::deleteFrame( unsigned int num, bool remove, bool recalc ) KWFrame *frm = m_frames.at( num ); Q_ASSERT( frm ); m_frames.take( num ); - Q_ASSERT( !m_frames.contains(frm) ); + Q_ASSERT( !m_frames.tqcontains(frm) ); unsigned int index = frm->pageNumber() - m_firstPage; if(m_framesInPage.count() >= index) { - QPtrList<KWFrame> *lst = m_framesInPage.at(index); + TQPtrList<KWFrame> *lst = m_framesInPage.at(index); lst->remove(frm); } @@ -127,7 +127,7 @@ void KWFrameSet::deleteFrame( unsigned int num, bool remove, bool recalc ) void KWFrameSet::deleteFrame( KWFrame *frm, bool remove, bool recalc ) { //kdDebug(32001) << "KWFrameSet::deleteFrame " << frm << " remove=" << remove << endl; - int num = m_frames.findRef( frm ); + int num = m_frames.tqfindRef( frm ); Q_ASSERT( num != -1 ); if ( num == -1 ) return; @@ -139,7 +139,7 @@ void KWFrameSet::deleteAllFrames() { if ( !m_frames.isEmpty() ) { - for ( QPtrListIterator<KWFrame> frameIt( m_frames ); frameIt.current(); ++frameIt ) + for ( TQPtrListIterator<KWFrame> frameIt( m_frames ); frameIt.current(); ++frameIt ) emit sigFrameRemoved( *frameIt ); m_frames.clear(); updateFrames(); @@ -157,7 +157,7 @@ void KWFrameSet::deleteAllCopies() } } -void KWFrameSet::createEmptyRegion( const QRect & crect, QRegion & emptyRegion, KWViewMode *viewMode ) +void KWFrameSet::createEmptyRegion( const TQRect & crect, TQRegion & emptyRegion, KWViewMode *viewMode ) { KWPage *page = m_doc->pageManager()->page( frame(0) ); if( !page ) { @@ -166,11 +166,11 @@ void KWFrameSet::createEmptyRegion( const QRect & crect, QRegion & emptyRegion, } double paperHeight = page->height(); //kdDebug(32001) << "KWFrameSet::createEmptyRegion " << name() << endl; - for (QPtrListIterator<KWFrame> frameIt = frameIterator(); frameIt.current(); ++frameIt ) + for (TQPtrListIterator<KWFrame> frameIt = frameIterator(); frameIt.current(); ++frameIt ) { if ( !frameIt.current()->isTransparent() ) { - QRect outerRect( viewMode->normalToView( frameIt.current()->outerRect(viewMode) ) ); + TQRect outerRect( viewMode->normalToView( frameIt.current()->outerRect(viewMode) ) ); //kdDebug(32001) << "KWFrameSet::createEmptyRegion outerRect=" << outerRect << " crect=" << crect << endl; outerRect &= crect; // This is important, to avoid calling subtract with a Y difference > 65536 if ( !outerRect.isEmpty() ) @@ -184,9 +184,9 @@ void KWFrameSet::createEmptyRegion( const QRect & crect, QRegion & emptyRegion, } } -void KWFrameSet::drawPadding( KWFrame *frame, QPainter *p, const QRect &crect, const QColorGroup &, KWViewMode *viewMode ) +void KWFrameSet::drawPadding( KWFrame *frame, TQPainter *p, const TQRect &crect, const TQColorGroup &, KWViewMode *viewMode ) { - QRect outerRect( viewMode->normalToView( frame->outerRect(viewMode) ) ); + TQRect outerRect( viewMode->normalToView( frame->outerRect(viewMode) ) ); //kdDebug(32001) << "KWFrameSet::drawPadding frame: " << frameFromPtr( frame ) // << " outerRect: " << outerRect // << " crect: " << crect << endl; @@ -198,9 +198,9 @@ void KWFrameSet::drawPadding( KWFrame *frame, QPainter *p, const QRect &crect, c #endif return; } - QRect frameRect( viewMode->normalToView( m_doc->zoomRect( *frame ) ) ); + TQRect frameRect( viewMode->normalToView( m_doc->zoomRect( *frame ) ) ); p->save(); - QBrush bgBrush( frame->backgroundColor() ); + TQBrush bgBrush( frame->backgroundColor() ); bgBrush.setColor( KWDocument::resolveBgColor( bgBrush.color(), p ) ); p->setBrush( bgBrush ); int leftMargin = m_doc->zoomItX(frame->paddingLeft()); @@ -211,22 +211,22 @@ void KWFrameSet::drawPadding( KWFrame *frame, QPainter *p, const QRect &crect, c if ( topMargin != 0 ) { - QRect r( frameRect.left(), frameRect.top(), frameRect.width(), topMargin ); + TQRect r( frameRect.left(), frameRect.top(), frameRect.width(), topMargin ); p->fillRect( r, bgBrush ); } if ( leftMargin != 0 ) { - QRect r( frameRect.left(), frameRect.top(), leftMargin, frameRect.height() ); + TQRect r( frameRect.left(), frameRect.top(), leftMargin, frameRect.height() ); p->fillRect( r, bgBrush ); } if ( rightMargin != 0 ) { - QRect r( frameRect.right()-rightMargin, frameRect.top(), rightMargin, frameRect.height() ); + TQRect r( frameRect.right()-rightMargin, frameRect.top(), rightMargin, frameRect.height() ); p->fillRect( r, bgBrush ); } if ( bottomMargin != 0 ) { - QRect r( frameRect.left(), frameRect.bottom()-bottomMargin, frameRect.width(), bottomMargin ); + TQRect r( frameRect.left(), frameRect.bottom()-bottomMargin, frameRect.width(), bottomMargin ); p->fillRect( r, bgBrush ); } p->restore(); @@ -234,9 +234,9 @@ void KWFrameSet::drawPadding( KWFrame *frame, QPainter *p, const QRect &crect, c } -void KWFrameSet::drawFrameBorder( QPainter *painter, KWFrame *frame, KWFrame *settingsFrame, const QRect &crect, KWViewMode *viewMode ) +void KWFrameSet::drawFrameBorder( TQPainter *painter, KWFrame *frame, KWFrame *settingsFrame, const TQRect &crect, KWViewMode *viewMode ) { - QRect outerRect( viewMode->normalToView( frame->outerRect( viewMode ) ) ); + TQRect outerRect( viewMode->normalToView( frame->outerRect( viewMode ) ) ); //kdDebug(32001) << "KWFrameSet::drawFrameBorder frame: " << frameFromPtr( frame ) // << " outerRect: " << outerRect << endl; @@ -246,21 +246,21 @@ void KWFrameSet::drawFrameBorder( QPainter *painter, KWFrame *frame, KWFrame *se return; } - QRect frameRect( viewMode->normalToView( m_doc->zoomRect( *frame ) ) ); + TQRect frameRect( viewMode->normalToView( m_doc->zoomRect( *frame ) ) ); painter->save(); - QBrush bgBrush( settingsFrame->backgroundColor() ); + TQBrush bgBrush( settingsFrame->backgroundColor() ); //bool defaultColor = !bgBrush.color().isValid(); bgBrush.setColor( KWDocument::resolveBgColor( bgBrush.color(), painter ) ); painter->setBrush( bgBrush ); // Draw default borders using view settings... - QPen viewSetting( QApplication::palette().color( QPalette::Active, QColorGroup::Mid ) ); + TQPen viewSetting( TQApplication::palette().color( TQPalette::Active, TQColorGroup::Mid ) ); int minBorder = 1; // ...except when printing, or embedded doc, or disabled. if ( !viewMode || !viewMode->drawFrameBorders() ) { - viewSetting = NoPen; + viewSetting = TQPen(Qt::NoPen); minBorder = 0; } @@ -278,7 +278,7 @@ void KWFrameSet::drawFrameBorder( QPainter *painter, KWFrame *frame, KWFrame *se void KWFrameSet::setFloating() { // Find main text frame - QPtrListIterator<KWFrameSet> fit = m_doc->framesetsIterator(); + TQPtrListIterator<KWFrameSet> fit = m_doc->framesetsIterator(); for ( ; fit.current() ; ++fit ) { KWTextFrameSet * frameSet = dynamic_cast<KWTextFrameSet *>( fit.current() ); @@ -292,7 +292,7 @@ void KWFrameSet::setFloating() frameSet->findPosition( dPoint, parag, index ); // Create anchor. TODO: refcount the anchors! setAnchored( frameSet, parag, index ); - frameSet->layout(); + frameSet->tqlayout(); m_doc->frameChanged( m_frames.first() ); return; } @@ -303,15 +303,15 @@ void KWFrameSet::setProtectSize( bool b) m_protectSize = b; } -void KWFrameSet::setAnchored( KWTextFrameSet* textfs, int paragId, int index, bool placeHolderExists /* = false */, bool repaint ) +void KWFrameSet::setAnchored( KWTextFrameSet* textfs, int paragId, int index, bool placeHolderExists /* = false */, bool tqrepaint ) { KWTextParag * parag = static_cast<KWTextParag *>( textfs->textDocument()->paragAt( paragId ) ); Q_ASSERT( parag ); if ( parag ) - setAnchored( textfs, parag, index, placeHolderExists, repaint ); + setAnchored( textfs, parag, index, placeHolderExists, tqrepaint ); } -void KWFrameSet::setAnchored( KWTextFrameSet* textfs, KoTextParag* parag, int index, bool placeHolderExists /* = false */, bool repaint ) +void KWFrameSet::setAnchored( KWTextFrameSet* textfs, KoTextParag* parag, int index, bool placeHolderExists /* = false */, bool tqrepaint ) { kdDebug(32001) << "KWFrameSet::setAnchored " << textfs << " " << parag->paragId() << " " << index << " " << placeHolderExists << endl; Q_ASSERT( textfs ); @@ -321,7 +321,7 @@ void KWFrameSet::setAnchored( KWTextFrameSet* textfs, KoTextParag* parag, int in m_anchorTextFs = textfs; KWFrameList::createFrameList(textfs, m_doc); // remove ourselves from others list now we are inline if ( parag ) - createAnchors( parag, index, placeHolderExists, repaint ); + createAnchors( parag, index, placeHolderExists, tqrepaint ); if ( !placeHolderExists ) // i.e. not while loading { @@ -345,7 +345,7 @@ KWAnchor * KWFrameSet::findAnchor( int frameNum ) Q_ASSERT( m_anchorTextFs ); // Yes, a linear search, but only among all customitems of the correct textdoc, // whose number is assumed to be quite small. - QPtrListIterator<KoTextCustomItem> cit( m_anchorTextFs->textDocument()->allCustomItems() ); + TQPtrListIterator<KoTextCustomItem> cit( m_anchorTextFs->textDocument()->allCustomItems() ); for ( ; cit.current() ; ++cit ) { KWAnchor * anchor = dynamic_cast<KWAnchor *>( cit.current() ); @@ -366,11 +366,11 @@ void KWFrameSet::setFixed() m_anchorTextFs = 0L; // make sure the frames are on top // (their z-order didn't matter when they were inline) - QPtrListIterator<KWFrame> frameIt = frameIterator(); + TQPtrListIterator<KWFrame> frameIt = frameIterator(); for ( ; frameIt.current(); ++frameIt ) frameIt.current()->setZOrder( m_doc->maxZOrder( frameIt.current()->pageNumber(m_doc) ) + 1 ); - m_doc->repaintAllViews(); + m_doc->tqrepaintAllViews(); m_doc->updateRulerFrameStartEnd(); } @@ -381,11 +381,11 @@ KWAnchor * KWFrameSet::createAnchor( KoTextDocument *txt, int frameNum ) } void KWFrameSet::createAnchors( KoTextParag * parag, int index, bool placeHolderExists /*= false */ /*only used when loading*/, - bool repaint ) + bool tqrepaint ) { kdDebug(32001) << "KWFrameSet::createAnchors" << endl; Q_ASSERT( m_anchorTextFs ); - QPtrListIterator<KWFrame> frameIt = frameIterator(); + TQPtrListIterator<KWFrame> frameIt = frameIterator(); for ( ; frameIt.current(); ++frameIt, ++index ) { //if ( ! frameIt.current()->anchor() ) @@ -398,8 +398,8 @@ void KWFrameSet::createAnchors( KoTextParag * parag, int index, bool placeHolder } } parag->setChanged( true ); - if ( repaint ) - emit repaintChanged( m_anchorTextFs ); + if ( tqrepaint ) + emit tqrepaintChanged( m_anchorTextFs ); } void KWFrameSet::deleteAnchor( KWAnchor * anchor ) @@ -424,7 +424,7 @@ void KWFrameSet::deleteAnchors() Q_ASSERT( textfs ); if ( !textfs ) return; - //QPtrListIterator<KWFrame> frameIt = frameIterator(); + //TQPtrListIterator<KWFrame> frameIt = frameIterator(); int frameNum = 0; // At the moment there's only one anchor per frameset // With tables the loop below will be wrong anyway... @@ -437,7 +437,7 @@ void KWFrameSet::deleteAnchors() KWAnchor * anchor = findAnchor( frameNum ); deleteAnchor( anchor ); } - emit repaintChanged( textfs ); + emit tqrepaintChanged( textfs ); } void KWFrameSet::moveFloatingFrame( int frameNum, const KoPoint &position ) @@ -460,7 +460,7 @@ void KWFrameSet::moveFloatingFrame( int frameNum, const KoPoint &position ) if( frame->frameStack() ) frame->frameStack()->updateAfterMove( oldPageNum ); } - invalidate(); + tqinvalidate(); } KoRect KWFrameSet::floatingFrameRect( int frameNum ) @@ -471,11 +471,11 @@ KoRect KWFrameSet::floatingFrameRect( int frameNum ) KWAnchor* anchor = findAnchor( frameNum ); Q_ASSERT( anchor ); - QRect paragRect = anchor->paragraph()->rect(); + TQRect paragRect = anchor->paragraph()->rect(); int x = anchor->x() + paragRect.x(); // in LU int y = anchor->y() + paragRect.y(); // in LU - KoPoint topLeft( m_doc->layoutUnitToPixelX( x ), m_doc->layoutUnitToPixelY( y ) ); + KoPoint topLeft( m_doc->tqlayoutUnitToPixelX( x ), m_doc->tqlayoutUnitToPixelY( y ) ); return KoRect( topLeft, frame->outerKoRect().size() ); } @@ -490,35 +490,35 @@ KCommand * KWFrameSet::anchoredObjectCreateCommand( int frameNum ) { KWFrame * frame = m_frames.at( frameNum ); Q_ASSERT( frame ); - return new KWCreateFrameCommand( QString::null, frame ); + return new KWCreateFrameCommand( TQString(), frame ); } KCommand * KWFrameSet::anchoredObjectDeleteCommand( int frameNum ) { KWFrame * frame = m_frames.at( frameNum ); Q_ASSERT( frame ); - return new KWDeleteFrameCommand( QString::null, frame ); + return new KWDeleteFrameCommand( TQString(), frame ); } KWFrame * KWFrameSet::frameAtPos( double x, double y ) const { KoPoint docPoint( x, y ); - QPtrListIterator<KWFrame> frameIt = frameIterator(); + TQPtrListIterator<KWFrame> frameIt = frameIterator(); for ( ; frameIt.current(); ++frameIt ) - if ( frameIt.current()->contains( docPoint ) ) + if ( frameIt.current()->tqcontains( docPoint ) ) return frameIt.current(); return 0L; } KWFrame *KWFrameSet::frame( unsigned int num ) const { - // QPtrList sucks + // TQPtrList sucks return const_cast<KWFrameSet*>( this )->m_frames.at( num ); } int KWFrameSet::frameFromPtr( KWFrame *frame ) { - return m_frames.findRef( frame ); + return m_frames.tqfindRef( frame ); } KWFrame * KWFrameSet::settingsFrame( const KWFrame* frame ) @@ -526,7 +526,7 @@ KWFrame * KWFrameSet::settingsFrame( const KWFrame* frame ) if ( !frame->isCopy() ) return const_cast<KWFrame *>( frame ); KWFrame* lastRealFrame=0L; - QPtrListIterator<KWFrame> frameIt( frame->frameSet()->frameIterator() ); + TQPtrListIterator<KWFrame> frameIt( frame->frameSet()->frameIterator() ); for ( ; frameIt.current(); ++frameIt ) { KWFrame *curFrame = frameIt.current(); @@ -553,7 +553,7 @@ void KWFrameSet::updateFrames( int flags ) // For each of our frames, clear old list of frames on top, and grab min/max page nums m_firstPage = m_frames.first()->pageNumber(); // we know m_frames is not empty here int lastPage = m_firstPage; - QPtrListIterator<KWFrame> fIt( frameIterator() ); + TQPtrListIterator<KWFrame> fIt( frameIterator() ); for ( ; fIt.current(); ++fIt ) { int pg = fIt.current()->pageNumber(); m_firstPage = KMIN( m_firstPage, pg ); @@ -570,7 +570,7 @@ void KWFrameSet::updateFrames( int flags ) m_framesInPage[i]->clear(); // Initialize the new elements. for ( int i = oldElements ; i < (int)m_framesInPage.size() ; ++i ) - m_framesInPage.insert( i, new QPtrList<KWFrame>() ); + m_framesInPage.insert( i, new TQPtrList<KWFrame>() ); // Iterate over m_frames again, to fill the m_framesInPage array fIt.toFirst(); @@ -584,7 +584,7 @@ void KWFrameSet::updateFrames( int flags ) if ( isFloating() ) { //kdDebug(32001) << "KWFrameSet::updateFrames " << name() << " is floating" << endl; - QPtrListIterator<KWFrame> frameIt = frameIterator(); + TQPtrListIterator<KWFrame> frameIt = frameIterator(); int frameNum = 0; // At the moment there's only one anchor per frameset //for ( ; frameIt.current(); ++frameIt, ++frameNum ) @@ -603,8 +603,8 @@ bool KWFrameSet::isPaintedBy( KWFrameSet* fs ) const return true; if ( isFloating() ) { - KWFrameSet* parentFs = anchorFrameset(); - if ( parentFs && parentFs->isPaintedBy( fs ) ) + KWFrameSet* tqparentFs = anchorFrameset(); + if ( tqparentFs && tqparentFs->isPaintedBy( fs ) ) return true; } if ( groupmanager() ) @@ -615,7 +615,7 @@ bool KWFrameSet::isPaintedBy( KWFrameSet* fs ) const return false; } -const QPtrList<KWFrame> & KWFrameSet::framesInPage( int pageNum ) const +const TQPtrList<KWFrame> & KWFrameSet::framesInPage( int pageNum ) const { if ( pageNum < m_firstPage || pageNum >= (int)m_framesInPage.size() + m_firstPage ) { @@ -624,12 +624,12 @@ const QPtrList<KWFrame> & KWFrameSet::framesInPage( int pageNum ) const << " Min value: " << m_firstPage << " Max value: " << m_framesInPage.size() + m_firstPage - 1 << endl; #endif - return m_emptyList; // QPtrList<KWFrame>() doesn't work, it's a temporary + return m_emptyList; // TQPtrList<KWFrame>() doesn't work, it's a temporary } return * m_framesInPage[pageNum - m_firstPage]; } -void KWFrameSet::drawContents( QPainter *p, const QRect & crect, const QColorGroup &cg, +void KWFrameSet::drawContents( TQPainter *p, const TQRect & crect, const TQColorGroup &cg, bool onlyChanged, bool resetChanged, KWFrameSetEdit *edit, KWViewMode *viewMode, KWFrameViewManager *frameViewManager ) @@ -642,7 +642,7 @@ void KWFrameSet::drawContents( QPainter *p, const QRect & crect, const QColorGro #endif if ( !viewMode->isTextModeFrameset( this ) ) { - QPtrListIterator<KWFrame> frameIt( frameIterator() ); + TQPtrListIterator<KWFrame> frameIt( frameIterator() ); KWFrame * lastRealFrame = 0L; //double lastRealFrameTop = 0; //double totalHeight = 0; // in pt, to avoid accumulating rounding errors @@ -673,15 +673,15 @@ void KWFrameSet::drawContents( QPainter *p, const QRect & crect, const QColorGro } } else { // Text view mode - QRect normalRect = viewMode->viewToNormal(crect); - drawFrame( 0L /*frame*/, p, normalRect, crect, QPoint(KWViewModeText::OFFSET, 0), + TQRect normalRect = viewMode->viewToNormal(crect); + drawFrame( 0L /*frame*/, p, normalRect, crect, TQPoint(KWViewModeText::OFFSET, 0), 0L /*settingsFrame*/, cg, onlyChanged, resetChanged, edit, viewMode, true ); } } void KWFrameSet::drawFrameAndBorders( KWFrame *frame, - QPainter *painter, const QRect &crect, - const QColorGroup &cg, bool onlyChanged, bool resetChanged, + TQPainter *painter, const TQRect &crect, + const TQColorGroup &cg, bool onlyChanged, bool resetChanged, KWFrameSetEdit *edit, KWViewMode *viewMode, KWFrame *settingsFrame, bool drawUnderlyingFrames ) { @@ -691,9 +691,9 @@ void KWFrameSet::drawFrameAndBorders( KWFrame *frame, return; } - QRect normalOuterFrameRect( frame->outerRect( viewMode ) ); - QRect outerFrameRect( viewMode->normalToView( normalOuterFrameRect ) ); - QRect outerCRect = crect.intersect( outerFrameRect ); + TQRect normalOuterFrameRect( frame->outerRect( viewMode ) ); + TQRect outerFrameRect( viewMode->normalToView( normalOuterFrameRect ) ); + TQRect outerCRect = crect.intersect( outerFrameRect ); #ifdef DEBUG_DRAW kdDebug(32001) << "KWFrameSet::drawFrameAndBorders " << name() << " frame " << frameFromPtr( frame ) << " " << *frame << endl; kdDebug(32001) << " (outer) normalFrameRect=" << normalOuterFrameRect << " frameRect=" << outerFrameRect << endl; @@ -705,8 +705,8 @@ void KWFrameSet::drawFrameAndBorders( KWFrame *frame, if ( !settingsFrame ) settingsFrame = this->settingsFrame( frame ); - QRect normalInnerFrameRect( m_doc->zoomRect( frame->innerRect() ) ); - QRect innerFrameRect( viewMode->normalToView( normalInnerFrameRect ) ); + TQRect normalInnerFrameRect( m_doc->zoomRect( frame->innerRect() ) ); + TQRect innerFrameRect( viewMode->normalToView( normalInnerFrameRect ) ); // This translates the coordinates in the document contents // ( frame and r are up to here in this system ) @@ -714,10 +714,10 @@ void KWFrameSet::drawFrameAndBorders( KWFrame *frame, int offsetX = normalInnerFrameRect.left(); int offsetY = normalInnerFrameRect.top() - m_doc->zoomItY( frame->internalY() ); - QRect innerCRect = outerCRect.intersect( innerFrameRect ); + TQRect innerCRect = outerCRect.intersect( innerFrameRect ); if ( !innerCRect.isEmpty() ) { - QRect fcrect = viewMode->viewToNormal( innerCRect ); + TQRect fcrect = viewMode->viewToNormal( innerCRect ); #ifdef DEBUG_DRAW kdDebug(32001) << " (inner) normalFrameRect=" << normalInnerFrameRect << " frameRect=" << innerFrameRect << endl; //kdDebug(32001) << " crect after view-to-normal:" << fcrect << "." << " Will move by (" << -offsetX << ", -(" << normalInnerFrameRect.top() << "-" << m_doc->zoomItY(frame->internalY()) << ") == " << -offsetY << ")." << endl; @@ -731,7 +731,7 @@ void KWFrameSet::drawFrameAndBorders( KWFrame *frame, #ifdef DEBUG_DRAW kdDebug(32001) << "KWFrameSet::drawFrameAndBorders in frame coords:" << fcrect << ". Will translate painter by intersec-fcrect: " << innerCRect.x()-fcrect.x() << "," << innerCRect.y()-fcrect.y() << "." << endl; #endif - QRegion reg; + TQRegion reg; if ( drawUnderlyingFrames ) reg = frameClipRegion( painter, frame, outerCRect, viewMode ); else // false means we are being drawn _as_ an underlying frame, so no clipping! @@ -754,9 +754,9 @@ void KWFrameSet::drawFrameAndBorders( KWFrame *frame, } } -void KWFrameSet::drawFrame( KWFrame *frame, QPainter *painter, const QRect &fcrect, const QRect &outerCRect, - const QPoint& translationOffset, - KWFrame *settingsFrame, const QColorGroup &cg, bool onlyChanged, bool resetChanged, +void KWFrameSet::drawFrame( KWFrame *frame, TQPainter *painter, const TQRect &fcrect, const TQRect &outerCRect, + const TQPoint& translationOffset, + KWFrame *settingsFrame, const TQColorGroup &cg, bool onlyChanged, bool resetChanged, KWFrameSetEdit *edit, KWViewMode* viewMode, bool drawUnderlyingFrames ) { // In this method the painter is NOT translated yet. It's still in view coordinates. @@ -767,29 +767,29 @@ void KWFrameSet::drawFrame( KWFrame *frame, QPainter *painter, const QRect &fcre #endif Q_ASSERT( fcrect.isValid() ); - QColorGroup frameColorGroup( cg ); + TQColorGroup frameColorGroup( cg ); if ( settingsFrame ) // 0L in text viewmode { - QBrush bgBrush( settingsFrame->backgroundColor() ); + TQBrush bgBrush( settingsFrame->backgroundColor() ); bgBrush.setColor( KWDocument::resolveBgColor( bgBrush.color(), painter ) ); - frameColorGroup.setBrush( QColorGroup::Base, bgBrush ); + frameColorGroup.setBrush( TQColorGroup::Base, bgBrush ); } if ( drawUnderlyingFrames && frame && frame->frameStack()) { - QValueList<KWFrame*> below = frame->frameStack()->framesBelow(); + TQValueList<KWFrame*> below = frame->frameStack()->framesBelow(); if ( !below.isEmpty() ) { // Double-buffering - not when printing - QPainter* doubleBufPainter = painter; - QPixmap* pix = 0L; - if ( painter->device()->devType() != QInternal::Printer ) + TQPainter* doubleBufPainter = painter; + TQPixmap* pix = 0L; + if ( painter->device()->devType() != TQInternal::Printer ) { pix = m_doc->doubleBufferPixmap( outerCRect.size() ); - doubleBufPainter = new QPainter; + doubleBufPainter = new TQPainter; doubleBufPainter->begin( pix ); // Initialize the pixmap to the page background color // (if the frame is over the page margins, no underlying frame will paint anything there) - doubleBufPainter->fillRect( 0, 0, outerCRect.width(), outerCRect.height(), QApplication::palette().active().brush( QColorGroup::Base ) ); + doubleBufPainter->fillRect( 0, 0, outerCRect.width(), outerCRect.height(), TQApplication::tqpalette().active().brush( TQColorGroup::Base ) ); // The double-buffer pixmap has (0,0) at outerCRect.topLeft(), so we need to // translate the double-buffer painter; drawFrameAndBorders will draw using view coordinates. @@ -803,14 +803,14 @@ void KWFrameSet::drawFrame( KWFrame *frame, QPainter *painter, const QRect &fcre #ifdef DEBUG_DRAW kdDebug(32001) << " below: " << below.count() << endl; #endif - for (QValueListIterator<KWFrame*> it = below.begin(); it != below.end(); ++it ) + for (TQValueListIterator<KWFrame*> it = below.begin(); it != below.end(); ++it ) { KWFrame* f = (*it); #ifdef DEBUG_DRAW kdDebug(32001) << " looking at frame below us: " << f->frameSet()->name() << " frame " << frameFromPtr( frame ) << endl; #endif - QRect viewFrameCRect = outerCRect.intersect( viewMode->normalToView( f->outerRect( viewMode ) ) ); + TQRect viewFrameCRect = outerCRect.intersect( viewMode->normalToView( f->outerRect( viewMode ) ) ); if ( !viewFrameCRect.isEmpty() ) { #ifdef DEBUG_DRAW @@ -828,11 +828,11 @@ void KWFrameSet::drawFrame( KWFrame *frame, QPainter *painter, const QRect &fcre kdDebug(32001) << " translating by " << translationOffset.x() << ", " << translationOffset.y() << " before drawFrameContents" << endl; #endif doubleBufPainter->translate( translationOffset.x(), translationOffset.y() ); // This assume that viewToNormal() is only a translation - // We can't "repaint changed parags only" if we just drew the underlying frames, hence the "false" + // We can't "tqrepaint changed parags only" if we just drew the underlying frames, hence the "false" drawFrameContents( frame, doubleBufPainter, fcrect, frameColorGroup, false, resetChanged, edit, viewMode ); doubleBufPainter->restore(); - if ( painter->device()->devType() != QInternal::Printer ) + if ( painter->device()->devType() != TQInternal::Printer ) { doubleBufPainter->end(); #ifdef DEBUG_DRAW @@ -846,7 +846,7 @@ void KWFrameSet::drawFrame( KWFrame *frame, QPainter *painter, const QRect &fcre else { // nothing below? paint a bg color then - frameColorGroup.setBrush( QColorGroup::Base, m_doc->defaultBgColor( painter ) ); + frameColorGroup.setBrush( TQColorGroup::Base, m_doc->defaultBgColor( painter ) ); } } if ( frame && (frame->paddingLeft() || frame->paddingTop() || @@ -859,31 +859,31 @@ void KWFrameSet::drawFrame( KWFrame *frame, QPainter *painter, const QRect &fcre painter->restore(); } -void KWFrameSet::drawFrameContents( KWFrame *, QPainter *, const QRect &, - const QColorGroup &, bool, bool, KWFrameSetEdit*, KWViewMode * ) +void KWFrameSet::drawFrameContents( KWFrame *, TQPainter *, const TQRect &, + const TQColorGroup &, bool, bool, KWFrameSetEdit*, KWViewMode * ) { kdWarning() << "Default implementation of drawFrameContents called for " << className() << " " << this << " " << name() << kdBacktrace(); } -void KWFrameSet::saveCommon( QDomElement &parentElem, bool saveFrames ) +void KWFrameSet::saveCommon( TQDomElement &tqparentElem, bool saveFrames ) { if ( m_frames.isEmpty() ) // Deleted frameset -> don't save return; // Save all the common attributes for framesets. - parentElem.setAttribute( "frameType", static_cast<int>( type() ) ); - parentElem.setAttribute( "frameInfo", static_cast<int>( m_info ) ); - parentElem.setAttribute( "name", m_name ); - parentElem.setAttribute( "visible", static_cast<int>( m_visible ) ); - parentElem.setAttribute( "protectSize", static_cast<int>( m_protectSize ) ); + tqparentElem.setAttribute( "frameType", static_cast<int>( type() ) ); + tqparentElem.setAttribute( "frameInfo", static_cast<int>( m_info ) ); + tqparentElem.setAttribute( "name", m_name ); + tqparentElem.setAttribute( "visible", static_cast<int>( m_visible ) ); + tqparentElem.setAttribute( "protectSize", static_cast<int>( m_protectSize ) ); if ( saveFrames ) { - QPtrListIterator<KWFrame> frameIt = frameIterator(); + TQPtrListIterator<KWFrame> frameIt = frameIterator(); for ( ; frameIt.current(); ++frameIt ) { KWFrame *frame = frameIt.current(); - QDomElement frameElem = parentElem.ownerDocument().createElement( "FRAME" ); - parentElem.appendChild( frameElem ); + TQDomElement frameElem = tqparentElem.ownerDocument().createElement( "FRAME" ); + tqparentElem.appendChild( frameElem ); frame->save( frameElem ); @@ -906,7 +906,7 @@ void KWFrameSet::saveCommon( QDomElement &parentElem, bool saveFrames ) // This function is intended as a helper for all the derived classes. It reads // in all the attributes common to all framesets and loads all frames. // -void KWFrameSet::load( QDomElement &framesetElem, bool loadFrames ) +void KWFrameSet::load( TQDomElement &framesetElem, bool loadFrames ) { m_info = static_cast<KWFrameSet::Info>( KWDocument::getAttribute( framesetElem, "frameInfo", KWFrameSet::FI_BODY ) ); m_visible = static_cast<bool>( KWDocument::getAttribute( framesetElem, "visible", true ) ); @@ -914,7 +914,7 @@ void KWFrameSet::load( QDomElement &framesetElem, bool loadFrames ) if ( loadFrames ) { // <FRAME> - QDomElement frameElem = framesetElem.firstChild().toElement(); + TQDomElement frameElem = framesetElem.firstChild().toElement(); for ( ; !frameElem.isNull() ; frameElem = frameElem.nextSibling().toElement() ) { if ( frameElem.tagName() == "FRAME" ) @@ -933,31 +933,31 @@ void KWFrameSet::load( QDomElement &framesetElem, bool loadFrames ) } } -KWFrame* KWFrameSet::loadOasisFrame( const QDomElement& tag, KoOasisContext& context ) +KWFrame* KWFrameSet::loadOasisFrame( const TQDomElement& tag, KoOasisContext& context ) { double width = 100; if ( tag.hasAttributeNS( KoXmlNS::svg, "width" ) ) { // fixed width // TODO handle percentage (of enclosing table/frame/page) - width = KoUnit::parseValue( tag.attributeNS( KoXmlNS::svg, "width", QString::null ) ); + width = KoUnit::parseValue( tag.attributeNS( KoXmlNS::svg, "width", TQString() ) ); } else if ( tag.hasAttributeNS( KoXmlNS::fo, "min-width" ) ) { // min-width is not supported in KWord. Let's use it as a fixed width. - width = KoUnit::parseValue( tag.attributeNS( KoXmlNS::fo, "min-width", QString::null ) ); + width = KoUnit::parseValue( tag.attributeNS( KoXmlNS::fo, "min-width", TQString() ) ); } else { - kdWarning(32001) << "Error in frame " << tag.tagName() << " " << tag.attributeNS( KoXmlNS::draw, "name", QString::null ) << " : neither width nor min-width specified!" << endl; + kdWarning(32001) << "Error in frame " << tag.tagName() << " " << tag.attributeNS( KoXmlNS::draw, "name", TQString() ) << " : neither width nor min-width specified!" << endl; } double height = 100; if ( tag.hasAttributeNS( KoXmlNS::svg, "height" ) ) { // fixed height // TODO handle percentage (of enclosing table/frame/page) - height = KoUnit::parseValue( tag.attributeNS( KoXmlNS::svg, "height", QString::null ) ); + height = KoUnit::parseValue( tag.attributeNS( KoXmlNS::svg, "height", TQString() ) ); } //kdDebug(32001) << k_funcinfo << "width=" << width << " height=" << height << " pt" << endl; KWFrame * frame = new KWFrame(this, - KoUnit::parseValue( tag.attributeNS( KoXmlNS::svg, "x", QString::null ) ), - KoUnit::parseValue( tag.attributeNS( KoXmlNS::svg, "y", QString::null ) ), + KoUnit::parseValue( tag.attributeNS( KoXmlNS::svg, "x", TQString() ) ), + KoUnit::parseValue( tag.attributeNS( KoXmlNS::svg, "y", TQString() ) ), width, height ); - frame->setZOrder( tag.attributeNS( KoXmlNS::draw, "z-index", QString::null ).toInt() ); + frame->setZOrder( tag.attributeNS( KoXmlNS::draw, "z-index", TQString() ).toInt() ); // Copy-frames. // We currently ignore the value of the copy-of attribute. It probably needs to // be handled like chain-next-name (kwtextframeset.cc) but for all types of frameset. @@ -970,10 +970,10 @@ KWFrame* KWFrameSet::loadOasisFrame( const QDomElement& tag, KoOasisContext& con // A frame with protected contents means that the frameset is protected (makes sense) // A frame with protected size means that the frameset is size-protected (hmm, kword did it that way) // TODO implement position protection - QString protectList = context.styleStack().attributeNS( KoXmlNS::style, "protect" ); - if ( protectList.contains( "content" ) ) + TQString protectList = context.styleStack().attributeNS( KoXmlNS::style, "protect" ); + if ( protectList.tqcontains( "content" ) ) setProtectContent( true ); - if ( protectList.contains( "size" ) ) + if ( protectList.tqcontains( "size" ) ) m_protectSize = true; // TODO m_visible ? User-toggeable or internal? @@ -1077,11 +1077,11 @@ void KWFrameSet::finalize() updateFrames(); } -QRegion KWFrameSet::frameClipRegion( QPainter * painter, KWFrame *frame, const QRect & crect, +TQRegion KWFrameSet::frameClipRegion( TQPainter * painter, KWFrame *frame, const TQRect & crect, KWViewMode * viewMode ) { // KWDocument * doc = kWordDocument(); - QRect rc = painter->xForm( crect ); + TQRect rc = painter->xForm( crect ); #ifdef DEBUG_DRAW //kdDebug(32002) << "KWFrameSet::frameClipRegion rc initially " << rc << endl; #endif @@ -1100,19 +1100,19 @@ QRegion KWFrameSet::frameClipRegion( QPainter * painter, KWFrame *frame, const Q #endif if ( !rc.isEmpty() ) { - QRegion reg( rc ); + TQRegion reg( rc ); // This breaks when a frame is under another one, it still appears if !onlyChanged. // cvs log says this is about frame borders... hmm. /// ### if ( onlyChanged ) Q_ASSERT( frame->frameStack() ); - QValueList<KWFrame *> onTop = frame->frameStack()->framesOnTop(); - for (QValueListIterator<KWFrame*> fIt = onTop.begin(); fIt != onTop.end(); ++fIt ) + TQValueList<KWFrame *> onTop = frame->frameStack()->framesOnTop(); + for (TQValueListIterator<KWFrame*> fIt = onTop.begin(); fIt != onTop.end(); ++fIt ) { KWFrame* frameOnTop = (*fIt); Q_ASSERT( frameOnTop->frameSet() ); - QRect r = painter->xForm( viewMode->normalToView( frameOnTop->outerRect( viewMode ) ) ); + TQRect r = painter->xForm( viewMode->normalToView( frameOnTop->outerRect( viewMode ) ) ); #ifdef DEBUG_DRAW //kdDebug(32002) << "frameClipRegion subtract rect "<< r << endl; #endif @@ -1123,12 +1123,12 @@ QRegion KWFrameSet::frameClipRegion( QPainter * painter, KWFrame *frame, const Q #endif return reg; } - return QRegion(); + return TQRegion(); } bool KWFrameSet::canRemovePage( int num ) { - QPtrListIterator<KWFrame> frameIt( frameIterator() ); + TQPtrListIterator<KWFrame> frameIt( frameIterator() ); for ( ; frameIt.current(); ++frameIt ) { KWFrame * frame = frameIt.current(); @@ -1156,22 +1156,22 @@ void KWFrameSet::setNewFrameBehavior( KWFrame::NewFrameBehavior nfb ) { } // ## this should pass the viewmode as argument, probably. -bool KWFrameSet::isFrameAtPos( const KWFrame* frame, const QPoint& point, bool borderOfFrameOnly) const { - QRect outerRect( frame->outerRect( m_doc->layoutViewMode() ) ); +bool KWFrameSet::isFrameAtPos( const KWFrame* frame, const TQPoint& point, bool borderOfFrameOnly) const { + TQRect outerRect( frame->outerRect( m_doc->tqlayoutViewMode() ) ); // Give the user a bit of margin for clicking on it :) const int margin = 2; outerRect.rLeft() -= margin; outerRect.rTop() -= margin; outerRect.rRight() += margin; outerRect.rBottom() += margin; - if ( outerRect.contains( point ) ) { + if ( outerRect.tqcontains( point ) ) { if(borderOfFrameOnly) { - QRect innerRect( m_doc->zoomRect( *frame ) ); + TQRect innerRect( m_doc->zoomRect( *frame ) ); innerRect.rLeft() += margin; innerRect.rTop() += margin; innerRect.rRight() -= margin; innerRect.rBottom() -= margin; - return (!innerRect.contains(point) ); + return (!innerRect.tqcontains(point) ); } return true; } @@ -1181,12 +1181,12 @@ bool KWFrameSet::isFrameAtPos( const KWFrame* frame, const QPoint& point, bool b void KWFrameSet::setZOrder() { //kdDebug(32001) << "KWFrameSet::setZOrder (to max) " << name() << endl; - QPtrListIterator<KWFrame> fit = frameIterator(); + TQPtrListIterator<KWFrame> fit = frameIterator(); for ( ; fit.current() ; ++fit ) fit.current()->setZOrder( m_doc->maxZOrder( fit.current()->pageNumber(m_doc) ) + 1 ); } -void KWFrameSet::setName( const QString &name ) +void KWFrameSet::setName( const TQString &name ) { m_name = name; emit sigNameChanged(this); @@ -1221,7 +1221,7 @@ void KWFrameSet::printDebug() kdDebug() << " | Frames in page array: " << endl; for ( uint i = 0 ; i < m_framesInPage.size() ; ++i ) { - QPtrListIterator<KWFrame> it( *m_framesInPage[i] ); + TQPtrListIterator<KWFrame> it( *m_framesInPage[i] ); int pgNum = i + m_firstPage; for ( ; it.current() ; ++it ) kdDebug() << " | " << pgNum << ": " << it.current() << " " << *it.current() @@ -1232,24 +1232,24 @@ void KWFrameSet::printDebug() << endl; } - QPtrListIterator<KWFrame> frameIt = frameIterator(); + TQPtrListIterator<KWFrame> frameIt = frameIterator(); for ( unsigned int j = 0; frameIt.current(); ++frameIt, ++j ) { KWFrame * frame = frameIt.current(); - QCString copy = frame->isCopy() ? "[copy]" : ""; + TQCString copy = frame->isCopy() ? "[copy]" : ""; kdDebug() << " +-- Frame " << j << " of "<< frameCount() << " (" << frame << ") " << copy << endl; printDebug( frame ); kdDebug() << " Rectangle : " << frame->x() << "," << frame->y() << " " << frame->width() << "x" << frame->height() << endl; kdDebug() << " RunAround: "<< runaround[ frame->runAround() ] << " side:" << runaroundSide[ frame->runAroundSide() ]<< endl; kdDebug() << " FrameBehavior: "<< frameBh[ frame->frameBehavior() ] << endl; kdDebug() << " NewFrameBehavior: "<< newFrameBh[ frame->newFrameBehavior() ] << endl; - QColor col = frame->backgroundColor().color(); + TQColor col = frame->backgroundColor().color(); kdDebug() << " BackgroundColor: "<< ( col.isValid() ? col.name().latin1() : "(default)" ) << endl; kdDebug() << " SheetSide "<< frame->sheetSide() << endl; kdDebug() << " Z Order: " << frame->zOrder() << endl; if( frame->frameStack() ) { - QValueList<KWFrame*> onTop = frame->frameStack()->framesOnTop(); - QValueList<KWFrame*> below = frame->frameStack()->framesBelow(); + TQValueList<KWFrame*> onTop = frame->frameStack()->framesOnTop(); + TQValueList<KWFrame*> below = frame->frameStack()->framesBelow(); kdDebug() << " Frames below: " << below.count() << ", frames on top: " << onTop.count() << endl; @@ -1257,7 +1257,7 @@ void KWFrameSet::printDebug() else kdDebug() << " no frameStack set." << endl; kdDebug() << " minFrameHeight "<< frame->minimumFrameHeight() << endl; - QString page = pageManager() && pageManager()->pageCount() > 0 ? QString::number(frame->pageNumber()) : " [waiting for pages to be created]"; + TQString page = pageManager() && pageManager()->pageCount() > 0 ? TQString::number(frame->pageNumber()) : " [waiting for pages to be created]"; KWFrameView *fv = 0; if(fvm) fv = fvm->view(frame); |