@@ -427,7 +427,7 @@ void QgsComposerTableV2::render( QPainter *p, const QRectF &, const int frameInd
427
427
{
428
428
// draw the headers
429
429
int col = 0 ;
430
- for ( QList< QgsComposerTableColumn*>::const_iterator columnIt = mColumns . constBegin (); columnIt != mColumns . constEnd (); ++columnIt )
430
+ Q_FOREACH ( const QgsComposerTableColumn* column, mColumns )
431
431
{
432
432
// draw background
433
433
p->save ();
@@ -439,7 +439,7 @@ void QgsComposerTableV2::render( QPainter *p, const QRectF &, const int frameInd
439
439
currentX += mCellMargin ;
440
440
441
441
Qt::TextFlag textFlag = static_cast < Qt::TextFlag >( 0 );
442
- if (( *columnIt ) ->width () <= 0 )
442
+ if ( column ->width () <= 0 )
443
443
{
444
444
// automatic column width, so we use the Qt::TextDontClip flag when drawing contents, as this works nicer for italicised text
445
445
// which may slightly exceed the calculated width
@@ -454,7 +454,7 @@ void QgsComposerTableV2::render( QPainter *p, const QRectF &, const int frameInd
454
454
switch ( mHeaderHAlignment )
455
455
{
456
456
case FollowColumn:
457
- headerAlign = ( *columnIt ) ->hAlignment ();
457
+ headerAlign = column ->hAlignment ();
458
458
break ;
459
459
case HeaderLeft:
460
460
headerAlign = Qt::AlignLeft;
@@ -467,7 +467,7 @@ void QgsComposerTableV2::render( QPainter *p, const QRectF &, const int frameInd
467
467
break ;
468
468
}
469
469
470
- QgsComposerUtils::drawText ( p, cell, ( *columnIt ) ->heading (), mHeaderFont , mHeaderFontColor , headerAlign, Qt::AlignVCenter, textFlag );
470
+ QgsComposerUtils::drawText ( p, cell, column ->heading (), mHeaderFont , mHeaderFontColor , headerAlign, Qt::AlignVCenter, textFlag );
471
471
472
472
currentX += mMaxColumnWidthMap [ col ];
473
473
currentX += mCellMargin ;
@@ -494,7 +494,7 @@ void QgsComposerTableV2::render( QPainter *p, const QRectF &, const int frameInd
494
494
double rowHeight = mMaxRowHeightMap [row + 1 ] + 2 * mCellMargin ;
495
495
496
496
497
- for ( QList< QgsComposerTableColumn*>::const_iterator columnIt = mColumns . constBegin (); columnIt != mColumns . constEnd (); ++columnIt )
497
+ Q_FOREACH ( const QgsComposerTableColumn* column, mColumns )
498
498
{
499
499
// draw background
500
500
p->save ();
@@ -510,20 +510,20 @@ void QgsComposerTableV2::render( QPainter *p, const QRectF &, const int frameInd
510
510
QString str = cellContents.toString ();
511
511
512
512
Qt::TextFlag textFlag = static_cast < Qt::TextFlag >( 0 );
513
- if (( *columnIt ) ->width () <= 0 && mWrapBehaviour == TruncateText )
513
+ if ( column ->width () <= 0 && mWrapBehaviour == TruncateText )
514
514
{
515
515
// automatic column width, so we use the Qt::TextDontClip flag when drawing contents, as this works nicer for italicised text
516
516
// which may slightly exceed the calculated width
517
517
// if column size was manually set then we do apply text clipping, to avoid painting text outside of columns width
518
518
textFlag = Qt::TextDontClip;
519
519
}
520
- else if ( textRequiresWrapping ( str, ( *columnIt ) ->width (), mContentFont ) )
520
+ else if ( textRequiresWrapping ( str, column ->width (), mContentFont ) )
521
521
{
522
- str = wrappedText ( str, ( *columnIt ) ->width (), mContentFont );
522
+ str = wrappedText ( str, column ->width (), mContentFont );
523
523
}
524
524
525
525
cell = QRectF ( currentX, currentY, mMaxColumnWidthMap [col], rowHeight );
526
- QgsComposerUtils::drawText ( p, cell, str, mContentFont , mContentFontColor , ( *columnIt ) ->hAlignment (), ( *columnIt ) ->vAlignment (), textFlag );
526
+ QgsComposerUtils::drawText ( p, cell, str, mContentFont , mContentFontColor , column ->hAlignment (), column ->vAlignment (), textFlag );
527
527
528
528
currentX += mMaxColumnWidthMap [ col ];
529
529
currentX += mCellMargin ;
0 commit comments