Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit c2fc9836 authored by Laurent Montel's avatar Laurent Montel 😁

Fix iterator

svn path=/trunk/KDE/kdegraphics/okular/; revision=882957
parent dbd7fa12
......@@ -25,7 +25,7 @@
using namespace Okular;
#define foreachObserver( cmd ) {\
QMap< int, DocumentObserver * >::const_iterator it = d->document->m_observers.begin(), end = d->document->m_observers.end();\
QMap< int, DocumentObserver * >::const_iterator it = d->document->m_observers.constBegin(), end = d->document->m_observers.constEnd();\
for ( ; it != end ; ++ it ) { (*it)-> cmd ; } }
class OkularBookmarkAction : public KBookmarkAction
......
This diff is collapsed.
......@@ -69,7 +69,7 @@ int FilePrinter::doPrintFiles( QPrinter &printer, QStringList fileList, FileDele
return -8;
}
for (QStringList::ConstIterator it = fileList.begin(); it != fileList.end(); ++it) {
for (QStringList::ConstIterator it = fileList.constBegin(); it != fileList.constEnd(); ++it) {
if (!QFile::exists(*it)) {
return -7;
}
......
......@@ -759,8 +759,8 @@ void PagePrivate::restoreLocalContents( const QDomNode & pageNode )
if ( !ok )
continue;
QHash<int, FormField*>::const_iterator wantedIt = hashedforms.find( index );
if ( wantedIt == hashedforms.end() )
QHash<int, FormField*>::const_iterator wantedIt = hashedforms.constFind( index );
if ( wantedIt == hashedforms.constEnd() )
continue;
QString value = formElement.attribute( "value" );
......@@ -800,7 +800,7 @@ void PagePrivate::saveLocalContents( QDomNode & parentNode, QDomDocument & docum
QDomElement annotListElement = document.createElement( "annotationList" );
// add every annotation to the annotationList
QLinkedList< Annotation * >::const_iterator aIt = m_page->m_annotations.begin(), aEnd = m_page->m_annotations.end();
QLinkedList< Annotation * >::const_iterator aIt = m_page->m_annotations.constBegin(), aEnd = m_page->m_annotations.constEnd();
for ( ; aIt != aEnd; ++aIt )
{
// get annotation
......@@ -828,7 +828,7 @@ void PagePrivate::saveLocalContents( QDomNode & parentNode, QDomDocument & docum
QDomElement formListElement = document.createElement( "forms" );
// add every form data to the formList
QLinkedList< FormField * >::const_iterator fIt = formfields.begin(), fItEnd = formfields.end();
QLinkedList< FormField * >::const_iterator fIt = formfields.constBegin(), fItEnd = formfields.constEnd();
for ( ; fIt != fItEnd; ++fIt )
{
// get the form field
......@@ -862,14 +862,14 @@ const QPixmap * Page::_o_nearestPixmap( int pixID, int w, int h ) const
const QPixmap * pixmap = 0;
// if a pixmap is present for given id, use it
QMap< int, PagePrivate::PixmapObject >::const_iterator itPixmap = d->m_pixmaps.find( pixID );
if ( itPixmap != d->m_pixmaps.end() )
QMap< int, PagePrivate::PixmapObject >::const_iterator itPixmap = d->m_pixmaps.constFind( pixID );
if ( itPixmap != d->m_pixmaps.constEnd() )
pixmap = itPixmap.value().m_pixmap;
// else find the closest match using pixmaps of other IDs (great optim!)
else if ( !d->m_pixmaps.isEmpty() )
{
int minDistance = -1;
QMap< int, PagePrivate::PixmapObject >::const_iterator it = d->m_pixmaps.begin(), end = d->m_pixmaps.end();
QMap< int, PagePrivate::PixmapObject >::const_iterator it = d->m_pixmaps.constBegin(), end = d->m_pixmaps.constEnd();
for ( ; it != end; ++it )
{
int pixWidth = (*it).m_pixmap->width(),
......
......@@ -184,11 +184,11 @@ static KJSObject docGetField( KJSContext *context, void *object,
QString cName = arguments.at( 0 ).toString( context );
QVector< Page * >::const_iterator pIt = doc->m_pagesVector.begin(), pEnd = doc->m_pagesVector.end();
QVector< Page * >::const_iterator pIt = doc->m_pagesVector.constBegin(), pEnd = doc->m_pagesVector.constEnd();
for ( ; pIt != pEnd; ++pIt )
{
const QLinkedList< Okular::FormField * > pageFields = (*pIt)->formFields();
QLinkedList< Okular::FormField * >::const_iterator ffIt = pageFields.begin(), ffEnd = pageFields.end();
QLinkedList< Okular::FormField * >::const_iterator ffIt = pageFields.constBegin(), ffEnd = pageFields.constEnd();
for ( ; ffIt != ffEnd; ++ffIt )
{
if ( (*ffIt)->name() == cName )
......
......@@ -132,7 +132,7 @@ TextPage::TextPage()
TextPage::TextPage( const TextEntity::List &words )
: d( new TextPagePrivate() )
{
TextEntity::List::ConstIterator it = words.begin(), itEnd = words.end();
TextEntity::List::ConstIterator it = words.constBegin(), itEnd = words.constEnd();
for ( ; it != itEnd; ++it )
{
TextEntity *e = *it;
......@@ -285,7 +285,7 @@ RegularAreaRect * TextPage::textArea ( TextSelection * sel) const
double endCx = endC.x;
double endCy = endC.y;
TextList::ConstIterator it = d->m_words.begin(), itEnd = d->m_words.end();
TextList::ConstIterator it = d->m_words.constBegin(), itEnd = d->m_words.constEnd();
MergeSide side = d->m_page ? (MergeSide)d->m_page->m_page->totalOrientation() : MergeRight;
for ( ; it != itEnd; ++it )
{
......@@ -311,8 +311,8 @@ RegularAreaRect* TextPage::findText( int searchID, const QString &query, SearchD
return 0;
TextList::ConstIterator start;
TextList::ConstIterator end;
QMap< int, SearchPoint* >::const_iterator sIt = d->m_searchPoints.find( searchID );
if ( sIt == d->m_searchPoints.end() )
QMap< int, SearchPoint* >::const_iterator sIt = d->m_searchPoints.constFind( searchID );
if ( sIt == d->m_searchPoints.constEnd() )
{
// if no previous run of this search is found, then set it to start
// from the beginning (respecting the search direction)
......@@ -325,12 +325,12 @@ RegularAreaRect* TextPage::findText( int searchID, const QString &query, SearchD
switch ( dir )
{
case FromTop:
start = d->m_words.begin();
end = d->m_words.end();
start = d->m_words.constBegin();
end = d->m_words.constEnd();
break;
case FromBottom:
start = d->m_words.end();
end = d->m_words.begin();
start = d->m_words.constEnd();
end = d->m_words.constBegin();
Q_ASSERT( start != end );
// we can safely go one step back, as we already checked
// that the list is not empty
......@@ -339,13 +339,13 @@ RegularAreaRect* TextPage::findText( int searchID, const QString &query, SearchD
break;
case NextResult:
start = (*sIt)->it_end;
end = d->m_words.end();
end = d->m_words.constEnd();
if ( ( start + 1 ) != end )
++start;
break;
case PreviousResult:
start = (*sIt)->it_begin;
end = d->m_words.begin();
end = d->m_words.constBegin();
if ( start != end )
--start;
forward = false;
......@@ -610,7 +610,7 @@ QString TextPage::text(const RegularAreaRect *area) const
if ( area && area->isNull() )
return QString();
TextList::ConstIterator it = d->m_words.begin(), itEnd = d->m_words.end();
TextList::ConstIterator it = d->m_words.constBegin(), itEnd = d->m_words.constEnd();
QString ret;
if ( area )
{
......
......@@ -336,9 +336,9 @@ QString LCHMFileImpl::decodeEntity( const QString & entity )
}
else
{
QMap<QString, QString>::const_iterator it = m_entityDecodeMap.find( entity );
QMap<QString, QString>::const_iterator it = m_entityDecodeMap.constFind( entity );
if ( it == m_entityDecodeMap.end() )
if ( it == m_entityDecodeMap.constEnd() )
{
qWarning ("LCHMFileImpl::decodeEntity: could not decode HTML entity '%s'", qPrintable( entity ));
return QString::null;
......
......@@ -711,8 +711,8 @@ void KDjVu::closeFile()
QVariant KDjVu::metaData( const QString & key ) const
{
QHash<QString, QVariant>::ConstIterator it = d->m_metaData.find( key );
return it != d->m_metaData.end() ? it.value() : QVariant();
QHash<QString, QVariant>::ConstIterator it = d->m_metaData.constFind( key );
return it != d->m_metaData.constEnd() ? it.value() : QVariant();
}
const QDomDocument * KDjVu::documentBookmarks() const
......
......@@ -312,8 +312,8 @@ const Okular::DocumentSynopsis *DviGenerator::generateDocumentSynopsis()
QStack<QDomElement> stack;
QVector<PreBookmark>::ConstIterator it = prebookmarks.begin();
QVector<PreBookmark>::ConstIterator itEnd = prebookmarks.end();
QVector<PreBookmark>::ConstIterator it = prebookmarks.constBegin();
QVector<PreBookmark>::ConstIterator itEnd = prebookmarks.constEnd();
for( ; it != itEnd; ++it )
{
QDomElement domel = m_docSynopsis->createElement( (*it).title );
......
......@@ -1457,8 +1457,8 @@ void PDFGenerator::loadPdfSync( const QString & filePath, QVector<Okular::Page*>
if ( line.startsWith( QLatin1Char( 'l' ) ) && linere.exactMatch( line ) )
{
int id = linere.cap( 1 ).toInt();
QHash<int, pdfsyncpoint>::const_iterator it = points.find( id );
if ( it == points.end() )
QHash<int, pdfsyncpoint>::const_iterator it = points.constFind( id );
if ( it == points.constEnd() )
{
pdfsyncpoint pt;
pt.x = 0;
......
......@@ -172,8 +172,8 @@ static QString compressedMimeFor( const QString& mime_to_check )
compressedMimeMap[ QString::fromLatin1( "application/x-bzdvi" ) ] =
QString::fromLatin1( "application/x-bzip" );
}
QHash< QString, QString >::const_iterator it = compressedMimeMap.find( mime_to_check );
if ( it != compressedMimeMap.end() )
QHash< QString, QString >::const_iterator it = compressedMimeMap.constFind( mime_to_check );
if ( it != compressedMimeMap.constEnd() )
return it.value();
return QString();
......
......@@ -67,8 +67,8 @@ void FilePrinterPreviewPrivate::getPart()
KService::List offers =
KMimeTypeTrader::self()->query("application/postscript", "KParts/ReadOnlyPart");
KService::List::ConstIterator it = offers.begin();
while (!factory && it != offers.end()) {
KService::List::ConstIterator it = offers.constBegin();
while (!factory && it != offers.constEnd()) {
KPluginLoader loader(**it);
factory = loader.factory();
if (!factory) {
......
......@@ -45,7 +45,7 @@ QButtonGroup* FormWidgetsController::registerRadioButton( FormWidgetIface* widge
for ( ; it != itEnd; ++it )
{
const QList< int >::const_iterator idsIt = qFind( (*it).ids, id );
if ( idsIt != (*it).ids.end() )
if ( idsIt != (*it).ids.constEnd() )
{
(*it).group->addButton( widget->button() );
return (*it).group;
......
......@@ -392,8 +392,8 @@ bool KTreeViewSearchLine::itemMatches( const QModelIndex &index, int row, const
const int columncount = index.model()->columnCount( index );
if ( !d->searchColumns.isEmpty() ) {
QList<int>::ConstIterator it = d->searchColumns.begin();
for ( ; it != d->searchColumns.end(); ++it ) {
QList<int>::ConstIterator it = d->searchColumns.constBegin();
for ( ; it != d->searchColumns.constEnd(); ++it ) {
if ( *it < columncount &&
index.child( row, *it ).data( Qt::DisplayRole ).toString().indexOf( pattern, 0, d->caseSensitive ) >= 0 )
return true;
......
......@@ -134,10 +134,10 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
{*/
Okular::NormalizedRect* limitRect = new Okular::NormalizedRect(nXMin, nYMin, nXMax, nYMax );
QLinkedList< Okular::HighlightAreaRect * >::const_iterator h2It = page->m_highlights.begin(), hEnd = page->m_highlights.end();
QLinkedList< Okular::HighlightAreaRect * >::const_iterator h2It = page->m_highlights.constBegin(), hEnd = page->m_highlights.constEnd();
Okular::HighlightAreaRect::const_iterator hIt;
for ( ; h2It != hEnd; ++h2It )
for (hIt=(*h2It)->begin(); hIt!=(*h2It)->end(); ++hIt)
for (hIt=(*h2It)->constBegin(); hIt!=(*h2It)->constEnd(); ++hIt)
{
if ((*hIt).intersects(limitRect))
bufferedHighlights->append( qMakePair((*h2It)->color,*hIt) );
......@@ -153,7 +153,7 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
{*/
Okular::NormalizedRect* limitRect = new Okular::NormalizedRect(nXMin, nYMin, nXMax, nYMax );
const Okular::RegularAreaRect *textSelection = page->textSelection();
Okular::HighlightAreaRect::const_iterator hIt = textSelection->begin(), hEnd = textSelection->end();
Okular::HighlightAreaRect::const_iterator hIt = textSelection->constBegin(), hEnd = textSelection->constEnd();
for ( ; hIt != hEnd; ++hIt )
{
if ( (*hIt).intersects( limitRect ) )
......@@ -165,7 +165,7 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
// append annotations inside limits to the un/buffered list
if ( canDrawAnnotations )
{
QLinkedList< Okular::Annotation * >::const_iterator aIt = page->m_annotations.begin(), aEnd = page->m_annotations.end();
QLinkedList< Okular::Annotation * >::const_iterator aIt = page->m_annotations.constBegin(), aEnd = page->m_annotations.constEnd();
for ( ; aIt != aEnd; ++aIt )
{
Okular::Annotation * ann = *aIt;
......@@ -288,7 +288,7 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
if ( bufferedHighlights )
{
// draw highlights that are inside the 'limits' paint region
QList< QPair<QColor, Okular::NormalizedRect> >::const_iterator hIt = bufferedHighlights->begin(), hEnd = bufferedHighlights->end();
QList< QPair<QColor, Okular::NormalizedRect> >::const_iterator hIt = bufferedHighlights->constBegin(), hEnd = bufferedHighlights->constEnd();
for ( ; hIt != hEnd; ++hIt )
{
const Okular::NormalizedRect & r = (*hIt).second;
......@@ -334,7 +334,7 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
yScale = (double)scaledHeight / (double)limits.height();
// paint all buffered annotations in the page
QList< Okular::Annotation * >::const_iterator aIt = bufferedAnnotations->begin(), aEnd = bufferedAnnotations->end();
QList< Okular::Annotation * >::const_iterator aIt = bufferedAnnotations->constBegin(), aEnd = bufferedAnnotations->constEnd();
for ( ; aIt != aEnd; ++aIt )
{
Okular::Annotation * a = *aIt;
......@@ -353,8 +353,8 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
NormalizedPath path;
// normalize page point to image
const QLinkedList<Okular::NormalizedPoint> points = la->transformedLinePoints();
QLinkedList<Okular::NormalizedPoint>::const_iterator it = points.begin();
QLinkedList<Okular::NormalizedPoint>::const_iterator itEnd = points.end();
QLinkedList<Okular::NormalizedPoint>::const_iterator it = points.constBegin();
QLinkedList<Okular::NormalizedPoint>::const_iterator itEnd = points.constEnd();
for ( ; it != itEnd; ++it )
{
Okular::NormalizedPoint point;
......@@ -490,7 +490,7 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
const QLinkedList<Okular::NormalizedPoint> & inkPath = transformedInkPaths[ p ];
// normalize page point to image
QLinkedList<Okular::NormalizedPoint>::const_iterator pIt = inkPath.begin(), pEnd = inkPath.end();
QLinkedList<Okular::NormalizedPoint>::const_iterator pIt = inkPath.constBegin(), pEnd = inkPath.constEnd();
for ( ; pIt != pEnd; ++pIt )
{
const Okular::NormalizedPoint & inkPoint = *pIt;
......@@ -518,7 +518,7 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
if ( unbufferedAnnotations )
{
// iterate over annotations and paint AText, AGeom, AStamp
QList< Okular::Annotation * >::const_iterator aIt = unbufferedAnnotations->begin(), aEnd = unbufferedAnnotations->end();
QList< Okular::Annotation * >::const_iterator aIt = unbufferedAnnotations->constBegin(), aEnd = unbufferedAnnotations->constEnd();
for ( ; aIt != aEnd; ++aIt )
{
Okular::Annotation * a = *aIt;
......@@ -668,7 +668,7 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
QRect limitsEnlarged = limits;
limitsEnlarged.adjust( -2, -2, 2, 2 );
// draw rects that are inside the 'limits' paint region as opaque rects
QLinkedList< Okular::ObjectRect * >::const_iterator lIt = page->m_rects.begin(), lEnd = page->m_rects.end();
QLinkedList< Okular::ObjectRect * >::const_iterator lIt = page->m_rects.constBegin(), lEnd = page->m_rects.constEnd();
for ( ; lIt != lEnd; ++lIt )
{
Okular::ObjectRect * rect = *lIt;
......
......@@ -392,7 +392,7 @@ PageView::~PageView()
// delete the local storage structure
qDeleteAll(d->m_annowindows);
// delete all widgets
QVector< PageViewItem * >::const_iterator dIt = d->items.begin(), dEnd = d->items.end();
QVector< PageViewItem * >::const_iterator dIt = d->items.constBegin(), dEnd = d->items.constEnd();
for ( ; dIt != dEnd; ++dIt )
delete *dIt;
delete d->formsWidgetController;
......@@ -601,8 +601,8 @@ void PageView::setAnnotationWindow( Okular::Annotation * annotation )
// find the annot window
AnnotWindow* existWindow = 0;
QHash< Okular::Annotation *, AnnotWindow * >::ConstIterator it = d->m_annowindows.find( annotation );
if ( it != d->m_annowindows.end() )
QHash< Okular::Annotation *, AnnotWindow * >::ConstIterator it = d->m_annowindows.constFind( annotation );
if ( it != d->m_annowindows.constEnd() )
{
existWindow = *it;
}
......@@ -721,7 +721,7 @@ void PageView::selectAll()
if ( d->mouseMode != MouseTextSelect )
return;
QVector< PageViewItem * >::const_iterator it = d->items.begin(), itEnd = d->items.end();
QVector< PageViewItem * >::const_iterator it = d->items.constBegin(), itEnd = d->items.constEnd();
for ( ; it < itEnd; ++it )
{
Okular::RegularAreaRect * area = textSelectionForItem( *it );
......@@ -746,7 +746,7 @@ void PageView::notifySetup( const QVector< Okular::Page * > & pageSet, int setup
}
// delete all widgets (one for each page in pageSet)
QVector< PageViewItem * >::const_iterator dIt = d->items.begin(), dEnd = d->items.end();
QVector< PageViewItem * >::const_iterator dIt = d->items.constBegin(), dEnd = d->items.constEnd();
for ( ; dIt != dEnd; ++dIt )
delete *dIt;
d->items.clear();
......@@ -759,7 +759,7 @@ void PageView::notifySetup( const QVector< Okular::Page * > & pageSet, int setup
bool haspages = !pageSet.isEmpty();
bool hasformwidgets = false;
// create children widgets
QVector< Okular::Page * >::const_iterator setIt = pageSet.begin(), setEnd = pageSet.end();
QVector< Okular::Page * >::const_iterator setIt = pageSet.constBegin(), setEnd = pageSet.constEnd();
for ( ; setIt != setEnd; ++setIt )
{
PageViewItem * item = new PageViewItem( *setIt );
......@@ -768,7 +768,7 @@ void PageView::notifySetup( const QVector< Okular::Page * > & pageSet, int setup
kDebug().nospace() << "cropped geom for " << d->items.last()->pageNumber() << " is " << d->items.last()->croppedGeometry();
#endif
const QLinkedList< Okular::FormField * > pageFields = (*setIt)->formFields();
QLinkedList< Okular::FormField * >::const_iterator ffIt = pageFields.begin(), ffEnd = pageFields.end();
QLinkedList< Okular::FormField * >::const_iterator ffIt = pageFields.constBegin(), ffEnd = pageFields.constEnd();
for ( ; ffIt != ffEnd; ++ffIt )
{
Okular::FormField * ff = *ffIt;
......@@ -784,7 +784,7 @@ void PageView::notifySetup( const QVector< Okular::Page * > & pageSet, int setup
}
}
const QLinkedList< Okular::Annotation * > annotations = (*setIt)->annotations();
QLinkedList< Okular::Annotation * >::const_iterator aIt = annotations.begin(), aEnd = annotations.end();
QLinkedList< Okular::Annotation * >::const_iterator aIt = annotations.constBegin(), aEnd = annotations.constEnd();
for ( ; aIt != aEnd; ++aIt )
{
Okular::Annotation * a = *aIt;
......@@ -882,7 +882,7 @@ void PageView::notifyViewportChanged( bool smoothMove )
// find PageViewItem matching the viewport description
const Okular::DocumentViewport & vp = d->document->viewport();
PageViewItem * item = 0;
QVector< PageViewItem * >::const_iterator iIt = d->items.begin(), iEnd = d->items.end();
QVector< PageViewItem * >::const_iterator iIt = d->items.constBegin(), iEnd = d->items.constEnd();
for ( ; iIt != iEnd; ++iIt )
if ( (*iIt)->pageNumber() == vp.pageNumber )
{
......@@ -1002,7 +1002,7 @@ void PageView::notifyPageChanged( int pageNumber, int changedFlags )
}
// iterate over visible items: if page(pageNumber) is one of them, repaint it
QLinkedList< PageViewItem * >::const_iterator iIt = d->visibleItems.begin(), iEnd = d->visibleItems.end();
QLinkedList< PageViewItem * >::const_iterator iIt = d->visibleItems.constBegin(), iEnd = d->visibleItems.constEnd();
for ( ; iIt != iEnd; ++iIt )
if ( (*iIt)->pageNumber() == pageNumber && (*iIt)->isVisible() )
{
......@@ -1041,7 +1041,7 @@ bool PageView::canUnloadPixmap( int pageNumber ) const
if ( Okular::Settings::memoryLevel() != Okular::Settings::EnumMemoryLevel::Aggressive )
{
// if the item is visible, forbid unloading
QLinkedList< PageViewItem * >::const_iterator vIt = d->visibleItems.begin(), vEnd = d->visibleItems.end();
QLinkedList< PageViewItem * >::const_iterator vIt = d->visibleItems.constBegin(), vEnd = d->visibleItems.constEnd();
for ( ; vIt != vEnd; ++vIt )
if ( (*vIt)->pageNumber() == pageNumber )
return false;
......@@ -1049,7 +1049,7 @@ bool PageView::canUnloadPixmap( int pageNumber ) const
else
{
// forbid unloading of the visible items, and of the previous and next
QLinkedList< PageViewItem * >::const_iterator vIt = d->visibleItems.begin(), vEnd = d->visibleItems.end();
QLinkedList< PageViewItem * >::const_iterator vIt = d->visibleItems.constBegin(), vEnd = d->visibleItems.constEnd();
for ( ; vIt != vEnd; ++vIt )
if ( abs( (*vIt)->pageNumber() - pageNumber ) <= 1 )
return false;
......@@ -1952,7 +1952,7 @@ void PageView::contentsMouseReleaseEvent( QMouseEvent * e )
{
// grab text in selection by extracting it from all intersected pages
const Okular::Page * okularPage=0;
QVector< PageViewItem * >::const_iterator iIt = d->items.begin(), iEnd = d->items.end();
QVector< PageViewItem * >::const_iterator iIt = d->items.constBegin(), iEnd = d->items.constEnd();
for ( ; iIt != iEnd; ++iIt )
{
PageViewItem * item = *iIt;
......@@ -2279,7 +2279,7 @@ void PageView::drawDocumentOnPainter( const QRect & contentsRect, QPainter * p )
QRegion remainingArea( contentsRect );
// iterate over all items painting the ones intersecting contentsRect
QVector< PageViewItem * >::const_iterator iIt = d->items.begin(), iEnd = d->items.end();
QVector< PageViewItem * >::const_iterator iIt = d->items.constBegin(), iEnd = d->items.constEnd();
for ( ; iIt != iEnd; ++iIt )
{
// check if a piece of the page intersects the contents rect
......@@ -2753,7 +2753,7 @@ void PageView::center(int cx, int cy)
void PageView::toggleFormWidgets( bool on )
{
bool somehadfocus = false;
QVector< PageViewItem * >::const_iterator dIt = d->items.begin(), dEnd = d->items.end();
QVector< PageViewItem * >::const_iterator dIt = d->items.constBegin(), dEnd = d->items.constEnd();
for ( ; dIt != dEnd; ++dIt )
{
bool hadfocus = (*dIt)->setFormWidgetsVisible( on );
......@@ -2798,7 +2798,7 @@ void PageView::slotRelayoutPages()
}
// common iterator used in this method and viewport parameters
QVector< PageViewItem * >::const_iterator iIt, iEnd = d->items.end();
QVector< PageViewItem * >::const_iterator iIt, iEnd = d->items.constEnd();
int viewportWidth = viewport()->width(),
viewportHeight = viewport()->height(),
fullWidth = 0,
......@@ -2844,7 +2844,7 @@ void PageView::slotRelayoutPages()
// 1) find the maximum columns width and rows height for a grid in
// which each page must well-fit inside a cell
for ( iIt = d->items.begin(); iIt != iEnd; ++iIt )
for ( iIt = d->items.constBegin(); iIt != iEnd; ++iIt )
{
PageViewItem * item = *iIt;
// update internal page size (leaving a little margin in case of Fit* modes)
......@@ -2896,7 +2896,7 @@ void PageView::slotRelayoutPages()
for ( int i = 0; i < cIdx; ++i )
insertX += colWidth[ i ];
}
for ( iIt = d->items.begin(); iIt != iEnd; ++iIt )
for ( iIt = d->items.constBegin(); iIt != iEnd; ++iIt )
{
PageViewItem * item = *iIt;
int cWidth = colWidth[ cIdx ],
......@@ -3003,7 +3003,7 @@ void PageView::slotRequestVisiblePixmaps( int newValue )
d->visibleItems.clear();
QLinkedList< Okular::PixmapRequest * > requestedPixmaps;
QVector< Okular::VisiblePageRect * > visibleRects;
QVector< PageViewItem * >::const_iterator iIt = d->items.begin(), iEnd = d->items.end();
QVector< PageViewItem * >::const_iterator iIt = d->items.constBegin(), iEnd = d->items.constEnd();
for ( ; iIt != iEnd; ++iIt )
{
PageViewItem * i = *iIt;
......@@ -3392,7 +3392,7 @@ void PageView::slotRefreshPage()
void PageView::slotSpeakDocument()
{
QString text;
QVector< PageViewItem * >::const_iterator it = d->items.begin(), itEnd = d->items.end();
QVector< PageViewItem * >::const_iterator it = d->items.constBegin(), itEnd = d->items.constEnd();
for ( ; it < itEnd; ++it )
{
Okular::RegularAreaRect * area = textSelectionForItem( *it );
......
......@@ -1309,7 +1309,7 @@ void PresentationWidget::setScreen( int newScreen )
m_height = height();
// update the frames
QVector< PresentationFrame * >::const_iterator fIt = m_frames.begin(), fEnd = m_frames.end();
QVector< PresentationFrame * >::const_iterator fIt = m_frames.constBegin(), fEnd = m_frames.constEnd();
const float screenRatio = (float)m_height / (float)m_width;
for ( ; fIt != fEnd; ++fIt )
{
......
......@@ -141,7 +141,7 @@ ThumbnailListPrivate::~ThumbnailListPrivate()
ThumbnailWidget* ThumbnailListPrivate::itemFor( const QPoint & p ) const
{
QVector< ThumbnailWidget * >::const_iterator tIt = m_thumbnails.begin(), tEnd = m_thumbnails.end();
QVector< ThumbnailWidget * >::const_iterator tIt = m_thumbnails.constBegin(), tEnd = m_thumbnails.constEnd();
for ( ; tIt != tEnd; ++tIt )
{
if ( (*tIt)->rect().contains( p ) )
......@@ -153,7 +153,7 @@ ThumbnailWidget* ThumbnailListPrivate::itemFor( const QPoint & p ) const
void ThumbnailListPrivate::paintEvent( QPaintEvent * e )
{
QPainter painter( this );
QVector<ThumbnailWidget *>::const_iterator tIt = m_thumbnails.begin(), tEnd = m_thumbnails.end();
QVector<ThumbnailWidget *>::const_iterator tIt = m_thumbnails.constBegin(), tEnd = m_thumbnails.constEnd();
for ( ; tIt != tEnd; ++tIt )
{
QRect rect = e->rect().intersected( (*tIt)->rect() );
......@@ -219,7 +219,7 @@ void ThumbnailList::notifySetup( const QVector< Okular::Page * > & pages, int se
}
// delete all the Thumbnails
QVector<ThumbnailWidget *>::const_iterator tIt = d->m_thumbnails.begin(), tEnd = d->m_thumbnails.end();
QVector<ThumbnailWidget *>::const_iterator tIt = d->m_thumbnails.constBegin(), tEnd = d->m_thumbnails.constEnd();
for ( ; tIt != tEnd; ++tIt )
delete *tIt;
d->m_thumbnails.clear();
......@@ -237,7 +237,7 @@ void ThumbnailList::notifySetup( const QVector< Okular::Page * > & pages, int se
//RESTORE THIS int flags = Okular::Settings::filterBookmarks() ? Okular::Page::Bookmark : Okular::Page::Highlight;
// if no page matches filter rule, then display all pages
QVector< Okular::Page * >::const_iterator pIt = pages.begin(), pEnd = pages.end();
QVector< Okular::Page * >::const_iterator pIt = pages.constBegin(), pEnd = pages.constEnd();
bool skipCheck = true;
for ( ; pIt != pEnd ; ++pIt )
//if ( (*pIt)->attributes() & flags )
......@@ -247,7 +247,7 @@ void ThumbnailList::notifySetup( const QVector< Okular::Page * > & pages, int se
// generate Thumbnails for the given set of pages
int width = viewport()->width();
int height = 0;
for ( pIt = pages.begin(); pIt != pEnd ; ++pIt )
for ( pIt = pages.constBegin(); pIt != pEnd ; ++pIt )
//if ( skipCheck || (*pIt)->attributes() & flags )
if ( skipCheck || (*pIt)->hasHighlights( SW_SEARCH_ID ) )
{
......@@ -291,7 +291,7 @@ void ThumbnailList::notifyViewportChanged( bool /*smoothMove*/ )
// select the page with viewport and ensure it's centered in the view
d->m_vectorIndex = 0;
QVector<ThumbnailWidget *>::const_iterator tIt = d->m_thumbnails.begin(), tEnd = d->m_thumbnails.end();
QVector<ThumbnailWidget *>::const_iterator tIt = d->m_thumbnails.constBegin(), tEnd = d->m_thumbnails.constEnd();
for ( ; tIt != tEnd; ++tIt )
{
if ( (*tIt)->pageNumber() == newPage )
......@@ -317,7 +317,7 @@ void ThumbnailList::notifyPageChanged( int pageNumber, int changedFlags )
return;
// iterate over visible items: if page(pageNumber) is one of them, repaint it
QList<ThumbnailWidget *>::const_iterator vIt = d->m_visibleThumbnails.begin(), vEnd = d->m_visibleThumbnails.end();
QList<ThumbnailWidget *>::const_iterator vIt = d->m_visibleThumbnails.constBegin(), vEnd = d->m_visibleThumbnails.constEnd();
for ( ; vIt != vEnd; ++vIt )
if ( (*vIt)->pageNumber() == pageNumber )
{
......@@ -361,7 +361,7 @@ void ThumbnailList::notifyVisibleRectsChanged()
bool ThumbnailList::canUnloadPixmap( int pageNumber ) const
{
// if the thubnail 'pageNumber' is one of the visible ones, forbid unloading
QList<ThumbnailWidget *>::const_iterator vIt = d->m_visibleThumbnails.begin(), vEnd = d->m_visibleThumbnails.end();
QList<ThumbnailWidget *>::const_iterator vIt = d->m_visibleThumbnails.constBegin(), vEnd = d->m_visibleThumbnails.constEnd();
for ( ; vIt != vEnd; ++vIt )
if ( (*vIt)->pageNumber() == pageNumber )
return false;
......@@ -375,7 +375,7 @@ void ThumbnailList::updateWidgets()
{
// find all widgets that intersects the viewport and update them
QRect viewportRect = viewport()->rect().translated( viewport()->pos() );
QList<ThumbnailWidget *>::const_iterator vIt = d->m_visibleThumbnails.begin(), vEnd = d->m_visibleThumbnails.end();
QList<ThumbnailWidget *>::const_iterator vIt = d->m_visibleThumbnails.constBegin(), vEnd = d->m_visibleThumbnails.constEnd();
for ( ; vIt != vEnd; ++vIt )
{
ThumbnailWidget * t = *vIt;
......@@ -394,8 +394,8 @@ void ThumbnailListPrivate::forwardTrack( const Okular::Page * p, const QPoint &p
QVector< Okular::VisiblePageRect * > vVpr = m_document->visiblePageRects();
QVector< Okular::VisiblePageRect * >::const_iterator vIt = vVpr.begin();
QVector< Okular::VisiblePageRect * >::const_iterator vEnd = vVpr.end();
QVector< Okular::VisiblePageRect * >::const_iterator vIt = vVpr.constBegin();
QVector< Okular::VisiblePageRect * >::const_iterator vEnd = vVpr.constEnd();
for ( ; vIt != vEnd; ++vIt )
{
Okular::VisiblePageRect *vpr = ( *vIt );
......@@ -507,7 +507,7 @@ void ThumbnailListPrivate::viewportResizeEvent( QResizeEvent * e )
// resize and reposition items
int newWidth = q->viewport()->width();
int newHeight = 0;
QVector<ThumbnailWidget *>::const_iterator tIt = m_thumbnails.begin(), tEnd = m_thumbnails.end();
QVector<ThumbnailWidget *>::const_iterator tIt = m_thumbnails.constBegin(), tEnd = m_thumbnails.constEnd();
for ( ; tIt != tEnd; ++tIt )
{
ThumbnailWidget *t = *tIt;
......@@ -563,7 +563,7 @@ void ThumbnailListPrivate::slotRequestVisiblePixmaps( int /*newContentsY*/ )
// scroll from the top to the last visible thumbnail
m_visibleThumbnails.clear();
QLinkedList< Okular::PixmapRequest * > requestedPixmaps;
QVector<ThumbnailWidget *>::const_iterator tIt = m_thumbnails.begin(), tEnd = m_thumbnails.end();
QVector<ThumbnailWidget *>::const_iterator tIt = m_thumbnails.constBegin(), tEnd = m_thumbnails.constEnd();
QRect viewportRect = q->viewport()->rect().translated( q->horizontalScrollBar()->value(), q->verticalScrollBar()->value() );
for ( ; tIt != tEnd; ++tIt )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment