From 74c05bbf9d92e43a6cf3799355b5f3598884409e Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 19 Dec 2011 11:56:05 -0600 Subject: Remove additional unneeded tq method conversions --- kpdf/ui/pageview.cpp | 84 ++++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'kpdf/ui/pageview.cpp') diff --git a/kpdf/ui/pageview.cpp b/kpdf/ui/pageview.cpp index b44b320c..b0b9da30 100644 --- a/kpdf/ui/pageview.cpp +++ b/kpdf/ui/pageview.cpp @@ -146,8 +146,8 @@ void PageViewTip::maybeTip( const TQPoint &_p ) PageViewItem * pageItem = m_view->pickItemOnPoint( p.x(), p.y() ); if ( pageItem && m_view->d->mouseMode == PageView::MouseNormal ) { - double nX = (double)(p.x() - pageItem->tqgeometry().left()) / (double)pageItem->width(), - nY = (double)(p.y() - pageItem->tqgeometry().top()) / (double)pageItem->height(); + double nX = (double)(p.x() - pageItem->geometry().left()) / (double)pageItem->width(), + nY = (double)(p.y() - pageItem->geometry().top()) / (double)pageItem->height(); // if over a ObjectRect (of type Link) change cursor to hand const ObjectRect * object = pageItem->page()->hasObject( ObjectRect::Link, nX, nY ); @@ -158,8 +158,8 @@ void PageViewTip::maybeTip( const TQPoint &_p ) TQString strtip = link->linkTip(); if ( !strtip.isEmpty() ) { - TQRect linkRect = object->tqgeometry( pageItem->width(), pageItem->height() ); - linkRect.moveBy( - m_view->contentsX() + pageItem->tqgeometry().left(), - m_view->contentsY() + pageItem->tqgeometry().top() ); + TQRect linkRect = object->geometry( pageItem->width(), pageItem->height() ); + linkRect.moveBy( - m_view->contentsX() + pageItem->geometry().left(), - m_view->contentsY() + pageItem->geometry().top() ); tip( linkRect, strtip ); } } @@ -337,7 +337,7 @@ void PageView::notifySetup( const TQValueVector< KPDFPage * > & pageSet, bool do d->items.clear(); d->visibleItems.clear(); - // create tqchildren widgets + // create children widgets TQValueVector< KPDFPage * >::const_iterator setIt = pageSet.begin(), setEnd = pageSet.end(); for ( ; setIt != setEnd; ++setIt ) d->items.push_back( new PageViewItem( *setIt ) ); @@ -397,8 +397,8 @@ void PageView::notifyViewportChanged( bool smoothMove ) if ( !KpdfSettings::viewContinuous() || d->dirtyLayout ) slotRelayoutPages(); - // restore viewport center or use default {x-center,v-top} tqalignment - const TQRect & r = item->tqgeometry(); + // restore viewport center or use default {x-center,v-top} alignment + const TQRect & r = item->geometry(); int newCenterX = r.left(), newCenterY = r.top(); if ( vp.rePos.enabled ) @@ -462,13 +462,13 @@ void PageView::notifyPageChanged( int pageNumber, int changedFlags ) if ( changedFlags & DocumentObserver::Bookmark ) return; - // iterate over visible items: if page(pageNumber) is one of them, tqrepaint it + // iterate over visible items: if page(pageNumber) is one of them, repaint it TQValueList< PageViewItem * >::iterator iIt = d->visibleItems.begin(), iEnd = d->visibleItems.end(); for ( ; iIt != iEnd; ++iIt ) if ( (*iIt)->pageNumber() == pageNumber ) { // update item's rectangle plus the little outline - TQRect expandedRect = (*iIt)->tqgeometry(); + TQRect expandedRect = (*iIt)->geometry(); expandedRect.addCoords( -1, -1, 3, 3 ); updateContents( expandedRect ); @@ -535,7 +535,7 @@ void PageView::viewportPaintEvent( TQPaintEvent * pe ) d->selectionRectColor : TQt::red; // subdivide region into rects - TQMemArray allRects = TQRegion(pe->region()).tqrects(); + TQMemArray allRects = TQRegion(pe->region()).rects(); uint numRects = allRects.count(); // preprocess rects area to see if it worths or not using subdivision @@ -662,7 +662,7 @@ void PageView::keyPressEvent( TQKeyEvent * e ) bool found = d->document->searchText( PAGEVIEW_SEARCH_ID, d->typeAheadString, true, false, KPDFDocument::NextMatch, true, tqRgb( 128, 255, 128 ), true ); TQString status = found ? i18n("Text found: \"%1\".") : i18n("Text not found: \"%1\"."); - d->messageWindow->display( status.tqarg(d->typeAheadString.lower()), + d->messageWindow->display( status.arg(d->typeAheadString.lower()), found ? PageViewMessage::Find : PageViewMessage::Warning, 4000 ); d->findTimeoutTimer->start( 3000, true ); } @@ -682,7 +682,7 @@ void PageView::keyPressEvent( TQKeyEvent * e ) // because it activates the accel releaseKeyboard(); if ( d->document->continueSearch( PAGEVIEW_SEARCH_ID ) ) - d->messageWindow->display( i18n("Text found: \"%1\".").tqarg(d->typeAheadString.lower()), + d->messageWindow->display( i18n("Text found: \"%1\".").arg(d->typeAheadString.lower()), PageViewMessage::Find, 3000 ); d->findTimeoutTimer->start( 3000, true ); // it is needed to grab the keyboard becase people may have Space assigned to a @@ -847,7 +847,7 @@ void PageView::contentsMouseMoveEvent( TQMouseEvent * e ) d->zoomFactor *= ( 1.0 + ( (double)deltaY / 500.0 ) ); updateZoom( ZoomRefreshCurrent ); // uncomment following line to force a complete redraw - viewport()->tqrepaint( false ); + viewport()->repaint( false ); return; } @@ -1006,8 +1006,8 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) // if the mouse has not moved since the press, that's a -click- if ( leftButton && pageItem && d->mousePressPos == e->globalPos()) { - double nX = (double)(e->x() - pageItem->tqgeometry().left()) / (double)pageItem->width(), - nY = (double)(e->y() - pageItem->tqgeometry().top()) / (double)pageItem->height(); + double nX = (double)(e->x() - pageItem->geometry().left()) / (double)pageItem->width(), + nY = (double)(e->y() - pageItem->geometry().top()) / (double)pageItem->height(); const ObjectRect * linkRect, * imageRect; linkRect = pageItem->page()->hasObject( ObjectRect::Link, nX, nY ); if ( linkRect ) @@ -1105,7 +1105,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) for ( ; iIt != iEnd; ++iIt ) { PageViewItem * item = *iIt; - const TQRect & itemRect = item->tqgeometry(); + const TQRect & itemRect = item->geometry(); if ( selectionRect.intersects( itemRect ) ) { // request the textpage if there isn't one @@ -1131,7 +1131,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) if ( KpdfSettings::useKTTSD() ) menu.insertItem( SmallIcon("kttsd"), i18n( "Speak Text" ), 2 ); } - menu.insertTitle( i18n( "Image (%1 by %2 pixels)" ).tqarg( selectionRect.width() ).tqarg( selectionRect.height() ) ); + menu.insertTitle( i18n( "Image (%1 by %2 pixels)" ).arg( selectionRect.width() ).arg( selectionRect.height() ) ); menu.insertItem( SmallIcon("image"), i18n( "Copy to Clipboard" ), 3 ); menu.insertItem( SmallIcon("filesave"), i18n( "Save to File..." ), 4 ); int choice = menu.exec( e->globalPos() ); @@ -1151,7 +1151,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) cb->setPixmap( copyPix, TQClipboard::Clipboard ); if ( cb->supportsSelection() ) cb->setPixmap( copyPix, TQClipboard::Selection ); - d->messageWindow->display( i18n( "Image [%1x%2] copied to clipboard." ).tqarg( copyPix.width() ).tqarg( copyPix.height() ) ); + d->messageWindow->display( i18n( "Image [%1x%2] copied to clipboard." ).arg( copyPix.width() ).arg( copyPix.height() ) ); } else if ( choice == 4 ) { @@ -1165,7 +1165,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) if ( type.isNull() ) type = "PNG"; copyPix.save( fileName, type.latin1() ); - d->messageWindow->display( i18n( "Image [%1x%2] saved to %3 file." ).tqarg( copyPix.width() ).tqarg( copyPix.height() ).tqarg( type ) ); + d->messageWindow->display( i18n( "Image [%1x%2] saved to %3 file." ).arg( copyPix.width() ).arg( copyPix.height() ).arg( type ) ); } } } @@ -1194,7 +1194,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) TQString error; if (KApplication::startServiceByDesktopName("kttsd", TQStringList(), &error)) { - d->messageWindow->display( i18n("Starting KTTSD Failed: %1").tqarg(error) ); + d->messageWindow->display( i18n("Starting KTTSD Failed: %1").arg(error) ); KpdfSettings::setUseKTTSD(false); KpdfSettings::writeConfig(); } @@ -1221,7 +1221,7 @@ void PageView::contentsMouseReleaseEvent( TQMouseEvent * e ) } } - // clear widget selection and tqinvalidate rect + // clear widget selection and invalidate rect selectionClear(); // restore previous action if came from it using right button @@ -1323,17 +1323,17 @@ void PageView::paintItems( TQPainter * p, const TQRect & contentsRect ) for ( ; iIt != iEnd; ++iIt ) { // check if a piece of the page intersects the contents rect - if ( !(*iIt)->tqgeometry().intersects( checkRect ) ) + if ( !(*iIt)->geometry().intersects( checkRect ) ) continue; PageViewItem * item = *iIt; - TQRect pixmapGeometry = item->tqgeometry(); + TQRect pixmapGeometry = item->geometry(); // translate the painter so we draw top-left pixmap corner in 0,0 p->save(); p->translate( pixmapGeometry.left(), pixmapGeometry.top() ); - // item pixmap and outline tqgeometry + // item pixmap and outline geometry TQRect outlineGeometry = pixmapGeometry; outlineGeometry.addCoords( -1, -1, 3, 3 ); @@ -1378,7 +1378,7 @@ void PageView::paintItems( TQPainter * p, const TQRect & contentsRect ) } // paint with background color the unpainted area - TQMemArray backRects = remainingArea.tqrects(); + TQMemArray backRects = remainingArea.rects(); uint backRectsNumber = backRects.count(); for ( uint jr = 0; jr < backRectsNumber; jr++ ) p->fillRect( backRects[ jr ], TQt::gray ); @@ -1424,7 +1424,7 @@ PageViewItem * PageView::pickItemOnPoint( int x, int y ) for ( ; iIt != iEnd; ++iIt ) { PageViewItem * i = *iIt; - const TQRect & r = i->tqgeometry(); + const TQRect & r = i->geometry(); if ( x < r.right() && x > r.left() && y < r.bottom() ) { if ( y > r.top() ) @@ -1485,7 +1485,7 @@ void PageView::selectionEndPoint( int x, int y ) compoundRegion -= intersection; } // tassellate region with rects and enqueue paint events - TQMemArray rects = compoundRegion.tqrects(); + TQMemArray rects = compoundRegion.rects(); for ( uint i = 0; i < rects.count(); i++ ) updateContents( rects[i] ); } @@ -1599,7 +1599,7 @@ void PageView::updateZoomText() selIdx++; TQString localValue( KGlobal::locale()->formatNumber( value * 100.0, 2 ) ); localValue.remove( KGlobal::locale()->decimalSymbol() + double_oh ); - translated << TQString( "%1%" ).tqarg( localValue ); + translated << TQString( "%1%" ).arg( localValue ); } d->aZoom->setItems( translated ); @@ -1619,8 +1619,8 @@ void PageView::updateCursor( const TQPoint &p ) PageViewItem * pageItem = pickItemOnPoint( p.x(), p.y() ); if ( pageItem && d->mouseMode == MouseNormal ) { - double nX = (double)(p.x() - pageItem->tqgeometry().left()) / (double)pageItem->width(), - nY = (double)(p.y() - pageItem->tqgeometry().top()) / (double)pageItem->height(); + double nX = (double)(p.x() - pageItem->geometry().left()) / (double)pageItem->width(), + nY = (double)(p.y() - pageItem->geometry().top()) / (double)pageItem->height(); // if over a ObjectRect (of type Link) change cursor to hand d->mouseOnRect = pageItem->page()->hasObject( ObjectRect::Link, nX, nY ); @@ -1643,7 +1643,7 @@ void PageView::doTypeAheadSearch() bool found = d->document->searchText( PAGEVIEW_SEARCH_ID, d->typeAheadString, false, false, KPDFDocument::NextMatch, true, tqRgb( 128, 255, 128 ), true ); TQString status = found ? i18n("Text found: \"%1\".") : i18n("Text not found: \"%1\"."); - d->messageWindow->display( status.tqarg(d->typeAheadString.lower()), + d->messageWindow->display( status.arg(d->typeAheadString.lower()), found ? PageViewMessage::Find : PageViewMessage::Warning, 4000 ); d->findTimeoutTimer->start( 3000, true ); } @@ -1677,7 +1677,7 @@ void PageView::slotRelayoutPages() fullHeight = 0; TQRect viewportRect( contentsX(), contentsY(), viewportWidth, viewportHeight ); - // set all items tqgeometry and resize contents. handle 'continuous' and 'single' modes separately + // set all items geometry and resize contents. handle 'continuous' and 'single' modes separately if ( KpdfSettings::viewContinuous() ) { // Here we find out column's width and row's height to compute a table @@ -1816,11 +1816,11 @@ void PageView::slotRelayoutPages() { int prevX = contentsX(), prevY = contentsY(); - const TQRect & tqgeometry = d->items[ vp.pageNumber ]->tqgeometry(); + const TQRect & geometry = d->items[ vp.pageNumber ]->geometry(); double nX = vp.rePos.enabled ? vp.rePos.normalizedX : 0.5, nY = vp.rePos.enabled ? vp.rePos.normalizedY : 0.0; - center( tqgeometry.left() + ROUND( nX * (double)tqgeometry.width() ), - tqgeometry.top() + ROUND( nY * (double)tqgeometry.height() ) ); + center( geometry.left() + ROUND( nX * (double)geometry.width() ), + geometry.top() + ROUND( nY * (double)geometry.height() ) ); // center() usually moves the viewport, that requests pixmaps too. // if that doesn't happen we have to request them by hand if ( prevX == contentsX() && prevY == contentsY() ) @@ -1867,7 +1867,7 @@ void PageView::slotRequestVisiblePixmaps( int newLeft, int newTop ) PageViewItem * i = *iIt; // if the item doesn't intersect the viewport, skip it - if ( !viewportRect.intersects( i->tqgeometry() ) ) + if ( !viewportRect.intersects( i->geometry() ) ) continue; // add the item to the 'visible list' @@ -1885,18 +1885,18 @@ void PageView::slotRequestVisiblePixmaps( int newLeft, int newTop ) // position between the item and the viewport center if ( isEvent ) { - const TQRect & tqgeometry = i->tqgeometry(); + const TQRect & geometry = i->geometry(); // compute distance between item center and viewport center - double distance = hypot( (tqgeometry.left() + tqgeometry.right()) / 2 - viewportCenterX, - (tqgeometry.top() + tqgeometry.bottom()) / 2 - viewportCenterY ); + double distance = hypot( (geometry.left() + geometry.right()) / 2 - viewportCenterX, + (geometry.top() + geometry.bottom()) / 2 - viewportCenterY ); if ( distance >= minDistance && nearPageNumber != -1 ) continue; nearPageNumber = i->pageNumber(); minDistance = distance; - if ( tqgeometry.height() > 0 && tqgeometry.width() > 0 ) + if ( geometry.height() > 0 && geometry.width() > 0 ) { - focusedX = ( viewportCenterX - (double)tqgeometry.left() ) / (double)tqgeometry.width(); - focusedY = ( viewportCenterY - (double)tqgeometry.top() ) / (double)tqgeometry.height(); + focusedX = ( viewportCenterX - (double)geometry.left() ) / (double)geometry.width(); + focusedY = ( viewportCenterY - (double)geometry.top() ) / (double)geometry.height(); } } } -- cgit v1.2.1