qt3support-- / warning--

svn path=/trunk/KDE/kdegraphics/kpdf/; revision=479237
remotes/origin/kpdf
Laurent Montel 21 years ago
parent 9251a80928
commit b734531e6f
  1. 20
      ui/pageview.cpp
  2. 2
      ui/pageviewutils.cpp
  3. 2
      ui/presentationwidget.cpp
  4. 8
      ui/propertiesdialog.cpp
  5. 2
      ui/thumbnaillist.cpp

@ -586,7 +586,7 @@ void PageView::keyPressEvent( QKeyEvent * e )
bool found = d->document->searchText( PAGEVIEW_SEARCH_ID, d->typeAheadString, true, false, bool found = d->document->searchText( PAGEVIEW_SEARCH_ID, d->typeAheadString, true, false,
KPDFDocument::NextMatch, true, qRgb( 128, 255, 128 ), true ); KPDFDocument::NextMatch, true, qRgb( 128, 255, 128 ), true );
QString status = found ? i18n("Text found: \"%1\".") : i18n("Text not found: \"%1\"."); QString status = found ? i18n("Text found: \"%1\".") : i18n("Text not found: \"%1\".");
d->messageWindow->display( status.arg(d->typeAheadString.lower()), d->messageWindow->display( status.arg(d->typeAheadString.toLower()),
found ? PageViewMessage::Find : PageViewMessage::Warning, 4000 ); found ? PageViewMessage::Find : PageViewMessage::Warning, 4000 );
d->findTimeoutTimer->start( 3000, true ); d->findTimeoutTimer->start( 3000, true );
} }
@ -606,7 +606,7 @@ void PageView::keyPressEvent( QKeyEvent * e )
// because it activates the accel // because it activates the accel
releaseKeyboard(); releaseKeyboard();
if ( d->document->continueSearch( PAGEVIEW_SEARCH_ID ) ) if ( d->document->continueSearch( PAGEVIEW_SEARCH_ID ) )
d->messageWindow->display( i18n("Text found: \"%1\".").arg(d->typeAheadString.lower()), d->messageWindow->display( i18n("Text found: \"%1\".").arg(d->typeAheadString.toLower()),
PageViewMessage::Find, 3000 ); PageViewMessage::Find, 3000 );
d->findTimeoutTimer->start( 3000, true ); d->findTimeoutTimer->start( 3000, true );
// it is needed to grab the keyboard becase people may have Space assigned to a // it is needed to grab the keyboard becase people may have Space assigned to a
@ -626,7 +626,7 @@ void PageView::keyPressEvent( QKeyEvent * e )
bool found = d->document->searchText( PAGEVIEW_SEARCH_ID, d->typeAheadString, false, false, bool found = d->document->searchText( PAGEVIEW_SEARCH_ID, d->typeAheadString, false, false,
KPDFDocument::NextMatch, true, qRgb( 128, 255, 128 ), true ); KPDFDocument::NextMatch, true, qRgb( 128, 255, 128 ), true );
QString status = found ? i18n("Text found: \"%1\".") : i18n("Text not found: \"%1\"."); QString status = found ? i18n("Text found: \"%1\".") : i18n("Text not found: \"%1\".");
d->messageWindow->display( status.arg(d->typeAheadString.lower()), d->messageWindow->display( status.arg(d->typeAheadString.toLower()),
found ? PageViewMessage::Find : PageViewMessage::Warning, 4000 ); found ? PageViewMessage::Find : PageViewMessage::Warning, 4000 );
d->findTimeoutTimer->start( 3000, true ); d->findTimeoutTimer->start( 3000, true );
} }
@ -953,7 +953,7 @@ void PageView::contentsMouseReleaseEvent( QMouseEvent * e )
} }
// find out new zoom ratio and normalized view center (relative to the contentsRect) // find out new zoom ratio and normalized view center (relative to the contentsRect)
double zoom = QMIN( (double)visibleWidth() / (double)selRect.width(), (double)visibleHeight() / (double)selRect.height() ); double zoom = qMin( (double)visibleWidth() / (double)selRect.width(), (double)visibleHeight() / (double)selRect.height() );
double nX = (double)(selRect.left() + selRect.right()) / (2.0 * (double)contentsWidth()); double nX = (double)(selRect.left() + selRect.right()) / (2.0 * (double)contentsWidth());
double nY = (double)(selRect.top() + selRect.bottom()) / (2.0 * (double)contentsHeight()); double nY = (double)(selRect.top() + selRect.bottom()) / (2.0 * (double)contentsHeight());
@ -1066,7 +1066,7 @@ void PageView::contentsMouseReleaseEvent( QMouseEvent * e )
QString type( KImageIO::type( fileName ) ); QString type( KImageIO::type( fileName ) );
if ( type.isNull() ) if ( type.isNull() )
type = "PNG"; type = "PNG";
copyPix.save( fileName, type.latin1() ); copyPix.save( fileName, type.toLatin1() );
d->messageWindow->display( i18n( "Image [%1x%2] saved to %3 file." ).arg( copyPix.width() ).arg( copyPix.height() ).arg( type ) ); d->messageWindow->display( i18n( "Image [%1x%2] saved to %3 file." ).arg( copyPix.width() ).arg( copyPix.height() ).arg( type ) );
} }
} }
@ -1307,7 +1307,7 @@ void PageView::updateItemSize( PageViewItem * item, int colWidth, int rowHeight
{ {
double scaleW = (double)colWidth / (double)width; double scaleW = (double)colWidth / (double)width;
double scaleH = (double)rowHeight / (double)height; double scaleH = (double)rowHeight / (double)height;
zoom = QMIN( scaleW, scaleH ); zoom = qMin( scaleW, scaleH );
item->setWHZ( (int)(zoom * width), (int)(zoom * height), zoom ); item->setWHZ( (int)(zoom * width), (int)(zoom * height), zoom );
d->zoomFactor = zoom; d->zoomFactor = zoom;
} }
@ -1351,8 +1351,8 @@ void PageView::selectionEndPoint( int x, int y )
{ {
// clip selection to the viewport // clip selection to the viewport
QRect viewportRect( contentsX(), contentsY(), visibleWidth(), visibleHeight() ); QRect viewportRect( contentsX(), contentsY(), visibleWidth(), visibleHeight() );
x = QMAX( QMIN( x, viewportRect.right() ), viewportRect.left() ); x = qMax( qMin( x, viewportRect.right() ), viewportRect.left() );
y = QMAX( QMIN( y, viewportRect.bottom() ), viewportRect.top() ); y = qMax( qMin( y, viewportRect.bottom() ), viewportRect.top() );
// if selection changed update rect // if selection changed update rect
if ( d->mouseSelectionRect.right() != x || d->mouseSelectionRect.bottom() != y ) if ( d->mouseSelectionRect.right() != x || d->mouseSelectionRect.bottom() != y )
{ {
@ -1458,7 +1458,7 @@ void PageView::updateZoomText()
{ {
// use current page zoom as zoomFactor if in ZoomFit/* mode // use current page zoom as zoomFactor if in ZoomFit/* mode
if ( d->zoomMode != ZoomFixed && d->items.count() > 0 ) if ( d->zoomMode != ZoomFixed && d->items.count() > 0 )
d->zoomFactor = d->items[ QMAX( 0, (int)d->document->currentPage() ) ]->zoomFactor(); d->zoomFactor = d->items[ qMax( 0, (int)d->document->currentPage() ) ]->zoomFactor();
float newFactor = d->zoomFactor; float newFactor = d->zoomFactor;
d->aZoom->clear(); d->aZoom->clear();
@ -1622,7 +1622,7 @@ void PageView::slotRelayoutPages()
} }
else // viewContinuous is FALSE else // viewContinuous is FALSE
{ {
PageViewItem * currentItem = d->items[ QMAX( 0, (int)d->document->currentPage() ) ]; PageViewItem * currentItem = d->items[ qMax( 0, (int)d->document->currentPage() ) ];
// setup varialbles for a 1(row) x N(columns) grid // setup varialbles for a 1(row) x N(columns) grid
int nCols = KpdfSettings::viewColumns(), int nCols = KpdfSettings::viewColumns(),

@ -73,7 +73,7 @@ void PageViewMessage::display( const QString & message, Icon icon, int durationM
} }
textXOffset = 2 + symbol.width(); textXOffset = 2 + symbol.width();
width += textXOffset; width += textXOffset;
height = QMAX( height, symbol.height() ); height = qMax( height, symbol.height() );
} }
QRect geometry( 0, 0, width + 10, height + 8 ); QRect geometry( 0, 0, width + 10, height + 8 );
QRect geometry2( 0, 0, width + 9, height + 7 ); QRect geometry2( 0, 0, width + 9, height + 7 );

@ -578,7 +578,7 @@ void PresentationWidget::generateContentsPage( int pageNum, QPainter & p )
// fill unpainted areas with background color // fill unpainted areas with background color
QRegion unpainted( QRect( 0, 0, m_width, m_height ) ); QRegion unpainted( QRect( 0, 0, m_width, m_height ) );
QVector<QRect> rects = unpainted.subtract( frame->geometry ).rects(); QVector<QRect> rects = unpainted.subtract( frame->geometry ).rects();
for ( uint i = 0; i < rects.count(); i++ ) for ( int i = 0; i < rects.count(); i++ )
{ {
const QRect & r = rects[i]; const QRect & r = rects[i];
p.fillRect( r, KpdfSettings::slidesBackgroundColor() ); p.fillRect( r, KpdfSettings::slidesBackgroundColor() );

@ -34,7 +34,7 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, KPDFDocument *doc)
} }
// mime name based on mimetype id // mime name based on mimetype id
QString mimeName = info->get( "mimeType" ).section( '/', -1 ).upper(); QString mimeName = info->get( "mimeType" ).section( '/', -1 ).toUpper();
setCaption( i18n("%1 Properties").arg( mimeName ) ); setCaption( i18n("%1 Properties").arg( mimeName ) );
QDomElement docElement = info->documentElement(); QDomElement docElement = info->documentElement();
@ -57,7 +57,7 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, KPDFDocument *doc)
row++; row++;
// refine maximum width of 'value' labels // refine maximum width of 'value' labels
valMaxWidth = QMAX( valMaxWidth, fontMetrics().width( valueString ) ); valMaxWidth = qMax( valMaxWidth, fontMetrics().width( valueString ) );
} }
// add the number of pages if the generator hasn't done it already // add the number of pages if the generator hasn't done it already
@ -85,10 +85,10 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, KPDFDocument *doc)
int width = layout->minimumSize().width() + valMaxWidth + marginHint() + spacingHint() + marginHint() + 30; int width = layout->minimumSize().width() + valMaxWidth + marginHint() + spacingHint() + marginHint() + 30;
if (page2Layout) if (page2Layout)
{ {
width = QMAX( width, page2Layout->sizeHint().width() + marginHint() + spacingHint() + 31 ); width = qMax( width, page2Layout->sizeHint().width() + marginHint() + spacingHint() + 31 );
} }
// stay inside the 2/3 of the screen width // stay inside the 2/3 of the screen width
QRect screenContainer = KGlobalSettings::desktopGeometry( this ); QRect screenContainer = KGlobalSettings::desktopGeometry( this );
width = QMIN( width, 2*screenContainer.width()/3 ); width = qMin( width, 2*screenContainer.width()/3 );
resize(width, 1); resize(width, 1);
} }

@ -170,7 +170,7 @@ void ThumbnailList::notifyViewportChanged( bool /*smoothMove*/ )
m_selected->setSelected( true ); m_selected->setSelected( true );
if ( KpdfSettings::syncThumbnailsViewport() ) if ( KpdfSettings::syncThumbnailsViewport() )
{ {
int yOffset = QMAX( visibleHeight() / 4, m_selected->height() / 2 ); int yOffset = qMax( visibleHeight() / 4, m_selected->height() / 2 );
ensureVisible( 0, childY( m_selected ) + m_selected->height()/2, 0, yOffset ); ensureVisible( 0, childY( m_selected ) + m_selected->height()/2, 0, yOffset );
} }
break; break;

Loading…
Cancel
Save