Skip to content

Commit 7dd58aa

Browse files
committedSep 29, 2012
indentation update
1 parent 7172347 commit 7dd58aa

17 files changed

+310
-308
lines changed
 

‎src/app/composer/qgscomposer.cpp

Lines changed: 132 additions & 130 deletions
Large diffs are not rendered by default.

‎src/app/composer/qgscomposerlabelwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void QgsComposerLabelWidget::on_mFontColorButton_clicked()
102102

103103
void QgsComposerLabelWidget::on_mInsertExpressionButton_clicked()
104104
{
105-
if ( !mComposerLabel)
105+
if ( !mComposerLabel )
106106
{
107107
return;
108108
}

‎src/app/composer/qgscomposermapwidget.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -422,13 +422,13 @@ void QgsComposerMapWidget::updateGuiElements()
422422
{
423423
mIsAtlasCheckBox->setCheckState( Qt::Checked );
424424

425-
int idx = mAtlasCoverageLayerComboBox->findData( qVariantFromValue( (void*)mComposerMap->atlasCoverageLayer() ));
425+
int idx = mAtlasCoverageLayerComboBox->findData( qVariantFromValue(( void* )mComposerMap->atlasCoverageLayer() ) );
426426
if ( idx != -1 )
427427
{
428-
mAtlasCoverageLayerComboBox->setCurrentIndex( idx );
428+
mAtlasCoverageLayerComboBox->setCurrentIndex( idx );
429429
}
430-
431-
mAtlasMarginSpinBox->setValue( static_cast<int>(mComposerMap->atlasMargin() * 100) );
430+
431+
mAtlasMarginSpinBox->setValue( static_cast<int>( mComposerMap->atlasMargin() * 100 ) );
432432
mAtlasFilenamePatternEdit->setText( mComposerMap->atlasFilenamePattern() );
433433
mAtlasFixedScaleCheckBox->setCheckState( mComposerMap->atlasFixedScale() ? Qt::Checked : Qt::Unchecked );
434434
mAtlasHideCoverageCheckBox->setCheckState( mComposerMap->atlasHideCoverage() ? Qt::Checked : Qt::Unchecked );
@@ -438,7 +438,7 @@ void QgsComposerMapWidget::updateGuiElements()
438438
{
439439
mIsAtlasCheckBox->setCheckState( Qt::Unchecked );
440440
}
441-
441+
442442
blockAllSignals( false );
443443
}
444444
}
@@ -940,14 +940,14 @@ void QgsComposerMapWidget::on_mIsAtlasCheckBox_stateChanged( int state )
940940
if ( composition->atlasMap() != 0 && composition->atlasMap() != mComposerMap )
941941
{
942942
QMessageBox msgBox;
943-
msgBox.setText(tr("An atlas map already exists."));
944-
msgBox.setInformativeText("Are you sure to define this map as the new atlas map ?");
945-
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No );
946-
msgBox.setDefaultButton(QMessageBox::No);
943+
msgBox.setText( tr( "An atlas map already exists." ) );
944+
msgBox.setInformativeText( "Are you sure to define this map as the new atlas map ?" );
945+
msgBox.setStandardButtons( QMessageBox::Yes | QMessageBox::No );
946+
msgBox.setDefaultButton( QMessageBox::No );
947947
if ( msgBox.exec() != QMessageBox::Yes )
948948
{
949-
mIsAtlasCheckBox->setCheckState( Qt::Unchecked );
950-
return;
949+
mIsAtlasCheckBox->setCheckState( Qt::Unchecked );
950+
return;
951951
}
952952
}
953953
composition->setAtlasMap( mComposerMap );
@@ -959,9 +959,9 @@ void QgsComposerMapWidget::on_mIsAtlasCheckBox_stateChanged( int state )
959959
for ( QMap<QString, QgsMapLayer*>::const_iterator it = layers.begin(); it != layers.end(); ++it )
960960
{
961961
// Only consider vector layers
962-
if ( dynamic_cast<QgsVectorLayer*>(it.value()) )
962+
if ( dynamic_cast<QgsVectorLayer*>( it.value() ) )
963963
{
964-
mAtlasCoverageLayerComboBox->insertItem( idx++, it.key(), /* userdata */ qVariantFromValue( (void*)it.value() ) );
964+
mAtlasCoverageLayerComboBox->insertItem( idx++, it.key(), /* userdata */ qVariantFromValue(( void* )it.value() ) );
965965
}
966966
}
967967

@@ -987,7 +987,7 @@ void QgsComposerMapWidget::on_mAtlasCoverageLayerComboBox_currentIndexChanged( i
987987
return;
988988
}
989989

990-
QgsVectorLayer* layer = reinterpret_cast<QgsVectorLayer*>(mAtlasCoverageLayerComboBox->itemData( index ).value<void*>());
990+
QgsVectorLayer* layer = reinterpret_cast<QgsVectorLayer*>( mAtlasCoverageLayerComboBox->itemData( index ).value<void*>() );
991991
mComposerMap->setAtlasCoverageLayer( layer );
992992
}
993993

@@ -1026,7 +1026,7 @@ void QgsComposerMapWidget::on_mAtlasFilenameExpressionButton_clicked()
10261026

10271027
void QgsComposerMapWidget::on_mAtlasHideCoverageCheckBox_stateChanged( int state )
10281028
{
1029-
if (!mComposerMap)
1029+
if ( !mComposerMap )
10301030
{
10311031
return;
10321032
}
@@ -1035,7 +1035,7 @@ void QgsComposerMapWidget::on_mAtlasHideCoverageCheckBox_stateChanged( int state
10351035

10361036
void QgsComposerMapWidget::on_mAtlasFixedScaleCheckBox_stateChanged( int state )
10371037
{
1038-
if (!mComposerMap)
1038+
if ( !mComposerMap )
10391039
{
10401040
return;
10411041
}
@@ -1054,7 +1054,7 @@ void QgsComposerMapWidget::on_mAtlasFixedScaleCheckBox_stateChanged( int state )
10541054

10551055
void QgsComposerMapWidget::on_mAtlasSingleFileCheckBox_stateChanged( int state )
10561056
{
1057-
if (!mComposerMap)
1057+
if ( !mComposerMap )
10581058
{
10591059
return;
10601060
}

‎src/core/composer/qgscomposerhtml.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,18 @@ void QgsComposerHtml::setUrl( const QUrl& url )
5858
qApp->processEvents();
5959
}
6060

61-
if ( frameCount() < 1) return;
61+
if ( frameCount() < 1 ) return;
6262
//QSize contentsSize = mWebPage->mainFrame()->contentsSize();
6363

64-
QRectF contentRect = this->mFrameItems.at(0)->boundingRect();
64+
QRectF contentRect = this->mFrameItems.at( 0 )->boundingRect();
6565
//there is going to be a little rounding error converting from float to int
66-
QSize contentsSize = QSize( (int)(contentRect.width() * mHtmlUnitsToMM),
67-
(int)(contentRect.height() * mHtmlUnitsToMM));
66+
QSize contentsSize = QSize(( int )( contentRect.width() * mHtmlUnitsToMM ),
67+
( int )( contentRect.height() * mHtmlUnitsToMM ) );
6868
mWebPage->setViewportSize( contentsSize );
6969

7070
//suppress scroll bars always
71-
mWebPage->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
72-
mWebPage->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
71+
mWebPage->mainFrame()->setScrollBarPolicy( Qt::Horizontal, Qt::ScrollBarAlwaysOff );
72+
mWebPage->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAlwaysOff );
7373

7474
mSize.setWidth( contentsSize.width() / mHtmlUnitsToMM );
7575
mSize.setHeight( contentsSize.height() / mHtmlUnitsToMM );

‎src/core/composer/qgscomposerlabel.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
#include <QPainter>
2323

2424
QgsComposerLabel::QgsComposerLabel( QgsComposition *composition ):
25-
QgsComposerItem( composition ), mMargin( 1.0 ), mFontColor( QColor( 0, 0, 0 ) ),
26-
mHAlignment( Qt::AlignLeft ), mVAlignment( Qt::AlignTop ),
27-
mExpressionFeature( 0 ), mExpressionLayer( 0 )
25+
QgsComposerItem( composition ), mMargin( 1.0 ), mFontColor( QColor( 0, 0, 0 ) ),
26+
mHAlignment( Qt::AlignLeft ), mVAlignment( Qt::AlignTop ),
27+
mExpressionFeature( 0 ), mExpressionLayer( 0 )
2828
{
2929
//default font size is 10 point
3030
mFont.setPointSizeF( 10 );
@@ -90,7 +90,7 @@ QString QgsComposerLabel::displayText() const
9090
QString displayText = mText;
9191
replaceDateText( displayText );
9292
QMap<QString, QVariant> subs = mSubstitutions;
93-
subs[ "$page" ] = QVariant((int)mComposition->itemPageNumber( this ) + 1);
93+
subs[ "$page" ] = QVariant(( int )mComposition->itemPageNumber( this ) + 1 );
9494
return QgsExpression::replaceExpressionText( displayText, mExpressionFeature, mExpressionLayer, &subs );
9595
}
9696

@@ -105,9 +105,9 @@ void QgsComposerLabel::replaceDateText( QString& text ) const
105105
int openingBracketPos = text.indexOf( "(", currentDatePos );
106106
int closingBracketPos = text.indexOf( ")", openingBracketPos + 1 );
107107
if ( openingBracketPos != -1 &&
108-
closingBracketPos != -1 &&
109-
( closingBracketPos - openingBracketPos ) > 1 &&
110-
openingBracketPos == currentDatePos + constant.size() )
108+
closingBracketPos != -1 &&
109+
( closingBracketPos - openingBracketPos ) > 1 &&
110+
openingBracketPos == currentDatePos + constant.size() )
111111
{
112112
formatText = text.mid( openingBracketPos + 1, closingBracketPos - openingBracketPos - 1 );
113113
text.replace( currentDatePos, closingBracketPos - currentDatePos + 1, QDate::currentDate().toString( formatText ) );

‎src/core/composer/qgscomposermap.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939

4040
QgsComposerMap::QgsComposerMap( QgsComposition *composition, int x, int y, int width, int height )
4141
: QgsComposerItem( x, y, width, height, composition ), mKeepLayerSet( false ),
42-
mOverviewFrameMapId( -1 ), mGridEnabled( false ), mGridStyle( Solid ),
42+
mOverviewFrameMapId( -1 ), mGridEnabled( false ), mGridStyle( Solid ),
4343
mGridIntervalX( 0.0 ), mGridIntervalY( 0.0 ), mGridOffsetX( 0.0 ), mGridOffsetY( 0.0 ), mGridAnnotationPrecision( 3 ), mShowGridAnnotation( false ),
4444
mLeftGridAnnotationPosition( OutsideMapFrame ), mRightGridAnnotationPosition( OutsideMapFrame ), mTopGridAnnotationPosition( OutsideMapFrame ),
4545
mBottomGridAnnotationPosition( OutsideMapFrame ), mAnnotationFrameDistance( 1.0 ), mLeftGridAnnotationDirection( Horizontal ), mRightGridAnnotationDirection( Horizontal ),
4646
mTopGridAnnotationDirection( Horizontal ), mBottomGridAnnotationDirection( Horizontal ), mGridFrameStyle( NoGridFrame ), mGridFrameWidth( 2.0 ),
47-
mCrossLength( 3 ), mMapCanvas( 0 ), mDrawCanvasItems( true ),
48-
mAtlasHideCoverage( false ), mAtlasFixedScale( false ), mAtlasMargin( 0.10 ), mAtlasFilenamePattern("'output_'||$feature"), mAtlasCoverageLayer(0), mAtlasSingleFile( false )
47+
mCrossLength( 3 ), mMapCanvas( 0 ), mDrawCanvasItems( true ),
48+
mAtlasHideCoverage( false ), mAtlasFixedScale( false ), mAtlasMargin( 0.10 ), mAtlasFilenamePattern( "'output_'||$feature" ), mAtlasCoverageLayer( 0 ), mAtlasSingleFile( false )
4949
{
5050
mComposition = composition;
5151
mOverviewFrameMapSymbol = 0;
@@ -86,8 +86,8 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition )
8686
mLeftGridAnnotationPosition( OutsideMapFrame ), mRightGridAnnotationPosition( OutsideMapFrame ), mTopGridAnnotationPosition( OutsideMapFrame ),
8787
mBottomGridAnnotationPosition( OutsideMapFrame ), mAnnotationFrameDistance( 1.0 ), mLeftGridAnnotationDirection( Horizontal ), mRightGridAnnotationDirection( Horizontal ),
8888
mTopGridAnnotationDirection( Horizontal ), mBottomGridAnnotationDirection( Horizontal ), mGridFrameStyle( NoGridFrame ), mGridFrameWidth( 2.0 ), mCrossLength( 3 ),
89-
mMapCanvas( 0 ), mDrawCanvasItems( true ),
90-
mAtlasHideCoverage( false ), mAtlasFixedScale( false ), mAtlasMargin( 0.10 ), mAtlasFilenamePattern("'output_'||$feature"), mAtlasCoverageLayer(0), mAtlasSingleFile( false )
89+
mMapCanvas( 0 ), mDrawCanvasItems( true ),
90+
mAtlasHideCoverage( false ), mAtlasFixedScale( false ), mAtlasMargin( 0.10 ), mAtlasFilenamePattern( "'output_'||$feature" ), mAtlasCoverageLayer( 0 ), mAtlasSingleFile( false )
9191
{
9292
mOverviewFrameMapSymbol = 0;
9393
createDefaultOverviewFrameSymbol();
@@ -762,7 +762,7 @@ bool QgsComposerMap::writeXML( QDomElement& elem, QDomDocument & doc ) const
762762
atlasElem.setAttribute( "hideCoverage", mAtlasHideCoverage ? "true" : "false" );
763763
atlasElem.setAttribute( "fixedScale", mAtlasFixedScale ? "true" : "false" );
764764
atlasElem.setAttribute( "singleFile", mAtlasSingleFile ? "true" : "false" );
765-
atlasElem.setAttribute( "margin", QString::number(mAtlasMargin) );
765+
atlasElem.setAttribute( "margin", QString::number( mAtlasMargin ) );
766766
atlasElem.setAttribute( "filenamePattern", mAtlasFilenamePattern );
767767

768768
composerMapElem.appendChild( atlasElem );
@@ -918,10 +918,10 @@ bool QgsComposerMap::readXML( const QDomElement& itemElem, const QDomDocument& d
918918
QMap<QString, QgsMapLayer*> layers = QgsMapLayerRegistry::instance()->mapLayers();
919919
for ( QMap<QString, QgsMapLayer*>::const_iterator it = layers.begin(); it != layers.end(); ++it )
920920
{
921-
if ( it.key() == atlasElem.attribute("coverageLayer") )
921+
if ( it.key() == atlasElem.attribute( "coverageLayer" ) )
922922
{
923-
mAtlasCoverageLayer = dynamic_cast<QgsVectorLayer*>(it.value());
924-
break;
923+
mAtlasCoverageLayer = dynamic_cast<QgsVectorLayer*>( it.value() );
924+
break;
925925
}
926926
}
927927
mAtlasMargin = atlasElem.attribute( "margin", "0.0" ).toDouble();

‎src/core/composer/qgslegendmodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ void QgsLegendModel::setLayerSet( const QStringList& layerIds )
119119

120120
QStandardItem* QgsLegendModel::addGroup( QString text, int position )
121121
{
122-
if( text.isNull() )
122+
if ( text.isNull() )
123123
text = tr( "Group" );
124124

125125
QgsComposerGroupItem* groupItem = new QgsComposerGroupItem( text );

‎src/core/qgscoordinatereferencesystem.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -902,8 +902,8 @@ void QgsCoordinateReferenceSystem::setProj4String( QString theProj4String )
902902
{
903903
char *oldlocale = setlocale( LC_NUMERIC, NULL );
904904
/* the next setlocale() invalides the return of previous setlocale() */
905-
if (oldlocale != NULL)
906-
oldlocale = strdup(oldlocale);
905+
if ( oldlocale != NULL )
906+
oldlocale = strdup( oldlocale );
907907

908908
setlocale( LC_NUMERIC, "C" );
909909
OSRDestroySpatialReference( mCRS );
@@ -919,7 +919,7 @@ void QgsCoordinateReferenceSystem::setProj4String( QString theProj4String )
919919
#endif
920920

921921
setlocale( LC_NUMERIC, oldlocale );
922-
free(oldlocale);
922+
free( oldlocale );
923923
}
924924
void QgsCoordinateReferenceSystem::setGeographicFlag( bool theGeoFlag )
925925
{

‎src/core/qgscoordinatetransform.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ void QgsCoordinateTransform::transformInPlace( double& x, double& y, double& z,
319319
}
320320

321321
void QgsCoordinateTransform::transformInPlace(
322-
QVector<double>& x, QVector<double>& y, QVector<double>& z,
323-
TransformDirection direction ) const
322+
QVector<double>& x, QVector<double>& y, QVector<double>& z,
323+
TransformDirection direction ) const
324324
{
325325
if ( mShortCircuit || !mInitialisedFlag )
326326
return;
@@ -373,8 +373,8 @@ void QgsCoordinateTransform::transformInPlace( float& x, float& y, float& z,
373373
}
374374

375375
void QgsCoordinateTransform::transformInPlace(
376-
QVector<float>& x, QVector<float>& y, QVector<float>& z,
377-
TransformDirection direction ) const
376+
QVector<float>& x, QVector<float>& y, QVector<float>& z,
377+
TransformDirection direction ) const
378378
{
379379
if ( mShortCircuit || !mInitialisedFlag )
380380
return;

‎src/core/qgsexpression.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ static QVariant fcnFormatNumber( const QVariantList& values, QgsFeature*, QgsExp
802802
static QVariant fcnFormatDate( const QVariantList& values, QgsFeature*, QgsExpression* parent )
803803
{
804804
QDateTime dt = getDateTimeValue( values.at( 0 ), parent );
805-
QString format = getStringValue( values.at( 1 ), parent );
805+
QString format = getStringValue( values.at( 1 ), parent );
806806
return dt.toString( format );
807807
}
808808

@@ -882,7 +882,7 @@ const QList<QgsExpression::FunctionDef> &QgsExpression::BuiltinFunctions()
882882
<< FunctionDef( "$rownum", 0, fcnRowNumber, QObject::tr( "Record" ) )
883883
<< FunctionDef( "$id", 0, fcnFeatureId, QObject::tr( "Record" ) )
884884
<< FunctionDef( "$scale", 0, fcnScale, QObject::tr( "Record" ) )
885-
// private functions
885+
// private functions
886886
<< FunctionDef( "_specialcol_", 1, fcnSpecialColumn, QObject::tr( "Special" ) )
887887
;
888888
}
@@ -933,7 +933,7 @@ QList<QgsExpression::FunctionDef> QgsExpression::specialColumns()
933933
QList<FunctionDef> defs;
934934
for ( QMap<QString, QVariant>::const_iterator it = gmSpecialColumns.begin(); it != gmSpecialColumns.end(); ++it )
935935
{
936-
defs << FunctionDef( it.key(), 0, 0, QObject::tr( "Record" ));
936+
defs << FunctionDef( it.key(), 0, 0, QObject::tr( "Record" ) );
937937
}
938938
return defs;
939939
}
@@ -1126,7 +1126,7 @@ QString QgsExpression::replaceExpressionText( QString action, QgsFeature* feat,
11261126
{
11271127
QVariant oldValue = QgsExpression::specialColumn( sit.key() );
11281128
if ( !oldValue.isNull() )
1129-
savedValues.insert( sit.key(), oldValue );
1129+
savedValues.insert( sit.key(), oldValue );
11301130

11311131
// set the new value
11321132
QgsExpression::setSpecialColumn( sit.key(), sit.value() );
@@ -2146,7 +2146,7 @@ QVariant QgsExpression::NodeColumnRef::eval( QgsExpression* /*parent*/, QgsFeatu
21462146
{
21472147
return f->attributeMap()[mIndex];
21482148
}
2149-
return QVariant("[" + mName + "]");
2149+
return QVariant( "[" + mName + "]" );
21502150
}
21512151

21522152
bool QgsExpression::NodeColumnRef::prepare( QgsExpression* parent, const QgsFieldMap& fields )

‎src/core/qgsgeometry.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3946,10 +3946,10 @@ QString QgsGeometry::exportToWkt()
39463946
{
39473947
mWkt += "POINT(";
39483948
x = ( double * )( mGeometry + 5 );
3949-
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
3949+
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
39503950
mWkt += " ";
39513951
y = ( double * )( mGeometry + 5 + sizeof( double ) );
3952-
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
3952+
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
39533953
mWkt += ")";
39543954
return mWkt;
39553955
}
@@ -3975,11 +3975,11 @@ QString QgsGeometry::exportToWkt()
39753975
mWkt += ", ";
39763976
}
39773977
x = ( double * ) ptr;
3978-
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
3978+
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
39793979
mWkt += " ";
39803980
ptr += sizeof( double );
39813981
y = ( double * ) ptr;
3982-
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
3982+
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
39833983
ptr += sizeof( double );
39843984
if ( hasZValue )
39853985
{
@@ -4030,11 +4030,11 @@ QString QgsGeometry::exportToWkt()
40304030
mWkt += ",";
40314031
}
40324032
x = ( double * ) ptr;
4033-
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4033+
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
40344034
mWkt += " ";
40354035
ptr += sizeof( double );
40364036
y = ( double * ) ptr;
4037-
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4037+
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
40384038
ptr += sizeof( double );
40394039
if ( hasZValue )
40404040
{
@@ -4068,11 +4068,11 @@ QString QgsGeometry::exportToWkt()
40684068
mWkt += ", ";
40694069
}
40704070
x = ( double * )( ptr );
4071-
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4071+
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
40724072
mWkt += " ";
40734073
ptr += sizeof( double );
40744074
y = ( double * )( ptr );
4075-
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4075+
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
40764076
ptr += sizeof( double );
40774077
if ( hasZValue )
40784078
{
@@ -4112,11 +4112,11 @@ QString QgsGeometry::exportToWkt()
41124112
mWkt += ", ";
41134113
}
41144114
x = ( double * ) ptr;
4115-
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4115+
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
41164116
ptr += sizeof( double );
41174117
mWkt += " ";
41184118
y = ( double * ) ptr;
4119-
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4119+
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
41204120
ptr += sizeof( double );
41214121
if ( hasZValue )
41224122
{
@@ -4168,11 +4168,11 @@ QString QgsGeometry::exportToWkt()
41684168
mWkt += ",";
41694169
}
41704170
x = ( double * ) ptr;
4171-
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4171+
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
41724172
ptr += sizeof( double );
41734173
mWkt += " ";
41744174
y = ( double * ) ptr;
4175-
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4175+
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
41764176
ptr += sizeof( double );
41774177
if ( hasZValue )
41784178
{
@@ -4226,10 +4226,10 @@ QString QgsGeometry::exportToGeoJSON()
42264226
{
42274227
mWkt += "{ \"type\": \"Point\", \"coordinates\": [";
42284228
x = ( double * )( mGeometry + 5 );
4229-
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4229+
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
42304230
mWkt += ", ";
42314231
y = ( double * )( mGeometry + 5 + sizeof( double ) );
4232-
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4232+
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
42334233
mWkt += "] }";
42344234
return mWkt;
42354235
}
@@ -4256,11 +4256,11 @@ QString QgsGeometry::exportToGeoJSON()
42564256
}
42574257
mWkt += "[";
42584258
x = ( double * ) ptr;
4259-
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4259+
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
42604260
mWkt += ", ";
42614261
ptr += sizeof( double );
42624262
y = ( double * ) ptr;
4263-
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4263+
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
42644264
ptr += sizeof( double );
42654265
if ( hasZValue )
42664266
{
@@ -4313,11 +4313,11 @@ QString QgsGeometry::exportToGeoJSON()
43134313
}
43144314
mWkt += "[";
43154315
x = ( double * ) ptr;
4316-
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4316+
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
43174317
mWkt += ", ";
43184318
ptr += sizeof( double );
43194319
y = ( double * ) ptr;
4320-
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4320+
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
43214321
ptr += sizeof( double );
43224322
if ( hasZValue )
43234323
{
@@ -4353,11 +4353,11 @@ QString QgsGeometry::exportToGeoJSON()
43534353
}
43544354
mWkt += "[";
43554355
x = ( double * )( ptr );
4356-
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4356+
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
43574357
mWkt += ", ";
43584358
ptr += sizeof( double );
43594359
y = ( double * )( ptr );
4360-
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4360+
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
43614361
ptr += sizeof( double );
43624362
if ( hasZValue )
43634363
{
@@ -4399,11 +4399,11 @@ QString QgsGeometry::exportToGeoJSON()
43994399
}
44004400
mWkt += "[";
44014401
x = ( double * ) ptr;
4402-
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4402+
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
44034403
ptr += sizeof( double );
44044404
mWkt += ", ";
44054405
y = ( double * ) ptr;
4406-
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4406+
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
44074407
ptr += sizeof( double );
44084408
if ( hasZValue )
44094409
{
@@ -4457,11 +4457,11 @@ QString QgsGeometry::exportToGeoJSON()
44574457
}
44584458
mWkt += "[";
44594459
x = ( double * ) ptr;
4460-
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4460+
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
44614461
ptr += sizeof( double );
44624462
mWkt += ", ";
44634463
y = ( double * ) ptr;
4464-
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
4464+
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
44654465
ptr += sizeof( double );
44664466
if ( hasZValue )
44674467
{

‎src/gui/qgscomposerview.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -311,13 +311,13 @@ void QgsComposerView::mouseReleaseEvent( QMouseEvent* e )
311311
}
312312
if ( composition() )
313313
{
314-
QgsComposerMap* composerMap = new QgsComposerMap( composition(), mRubberBandItem->transform().dx(), mRubberBandItem->transform().dy(), mRubberBandItem->rect().width(), mRubberBandItem->rect().height() );
315-
composition()->addComposerMap( composerMap );
316-
scene()->removeItem( mRubberBandItem );
317-
delete mRubberBandItem;
318-
mRubberBandItem = 0;
319-
emit actionFinished();
320-
composition()->pushAddRemoveCommand( composerMap, tr( "Map added" ) );
314+
QgsComposerMap* composerMap = new QgsComposerMap( composition(), mRubberBandItem->transform().dx(), mRubberBandItem->transform().dy(), mRubberBandItem->rect().width(), mRubberBandItem->rect().height() );
315+
composition()->addComposerMap( composerMap );
316+
scene()->removeItem( mRubberBandItem );
317+
delete mRubberBandItem;
318+
mRubberBandItem = 0;
319+
emit actionFinished();
320+
composition()->pushAddRemoveCommand( composerMap, tr( "Map added" ) );
321321
}
322322
break;
323323

‎src/mapserver/qgswfsserver.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,10 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
442442
if ( bboxOk )
443443
searchRect.set( minx, miny, maxx, maxy );
444444
else
445-
searchRect.set( searchRect.xMinimum()-0.000001
446-
, searchRect.yMinimum()-0.000001
447-
, searchRect.xMaximum()+0.000001
448-
, searchRect.yMaximum()+0.000001 );
445+
searchRect.set( searchRect.xMinimum() - 0.000001
446+
, searchRect.yMinimum() - 0.000001
447+
, searchRect.xMaximum() + 0.000001
448+
, searchRect.yMaximum() + 0.000001 );
449449
QgsCoordinateReferenceSystem layerCrs = layer->crs();
450450

451451
startGetFeature( request, format, layerCrs, &searchRect );
@@ -516,7 +516,7 @@ void QgsWFSServer::startGetFeature( QgsRequestHandler& request, const QString& f
516516
if ( format == "GeoJSON" )
517517
{
518518
fcString = "{\"type\": \"FeatureCollection\",\n";
519-
fcString += " \"bbox\": [ " + QString::number( rect->xMinimum(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") ) + ", " + QString::number( rect->yMinimum(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") ) + ", " + QString::number( rect->xMaximum(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") ) + ", " + QString::number( rect->yMaximum(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") ) + "],\n";
519+
fcString += " \"bbox\": [ " + QString::number( rect->xMinimum(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) ) + ", " + QString::number( rect->yMinimum(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) ) + ", " + QString::number( rect->xMaximum(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) ) + ", " + QString::number( rect->yMaximum(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) ) + "],\n";
520520
fcString += " \"features\": [\n";
521521
result = fcString.toUtf8();
522522
request.startGetFeatureResponse( &result, format );
@@ -696,7 +696,7 @@ QString QgsWFSServer::createFeatureGeoJSON( QgsFeature* feat, QgsCoordinateRefer
696696
{
697697
QgsRectangle box = geom->boundingBox();
698698

699-
fStr += " \"bbox\": [ " + QString::number( box.xMinimum(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") ) + ", " + QString::number( box.yMinimum(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") ) + ", " + QString::number( box.xMaximum(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") ) + ", " + QString::number( box.yMaximum(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") ) + "],\n";
699+
fStr += " \"bbox\": [ " + QString::number( box.xMinimum(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) ) + ", " + QString::number( box.yMinimum(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) ) + ", " + QString::number( box.xMaximum(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) ) + ", " + QString::number( box.yMaximum(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) ) + "],\n";
700700

701701
fStr += " \"geometry\": ";
702702
fStr += geom->exportToGeoJSON();
@@ -1025,9 +1025,9 @@ QDomElement QgsWFSServer::createCoordinateElem( const QVector<QgsPoint> points,
10251025
{
10261026
coordString += " ";
10271027
}
1028-
coordString += QString::number( pointIt->x(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
1028+
coordString += QString::number( pointIt->x(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
10291029
coordString += ",";
1030-
coordString += QString::number( pointIt->y(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
1030+
coordString += QString::number( pointIt->y(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
10311031
}
10321032

10331033
QDomText coordText = doc.createTextNode( coordString );

‎src/providers/gdal/qgsgdalprovider.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@ QString QgsGdalProvider::buildPyramids( QList<QgsRasterPyramid> const & theRaste
13771377
}
13781378

13791379
// are we using Erdas Imagine external overviews?
1380-
char* myConfigUseRRD = strdup(CPLGetConfigOption( "USE_RRD", "NO" ));
1380+
char* myConfigUseRRD = strdup( CPLGetConfigOption( "USE_RRD", "NO" ) );
13811381
if ( theFormat == PyramidsErdas )
13821382
CPLSetConfigOption( "USE_RRD", "YES" );
13831383
else
@@ -1471,7 +1471,7 @@ QString QgsGdalProvider::buildPyramids( QList<QgsRasterPyramid> const & theRaste
14711471
//emit drawingProgress( 0, 0 );
14721472
// restore former USE_RRD config (Erdas)
14731473
CPLSetConfigOption( "USE_RRD", myConfigUseRRD );
1474-
free(myConfigUseRRD);
1474+
free( myConfigUseRRD );
14751475
return "FAILED_NOT_SUPPORTED";
14761476
}
14771477
else
@@ -1488,7 +1488,7 @@ QString QgsGdalProvider::buildPyramids( QList<QgsRasterPyramid> const & theRaste
14881488

14891489
// restore former USE_RRD config (Erdas)
14901490
CPLSetConfigOption( "USE_RRD", myConfigUseRRD );
1491-
free(myConfigUseRRD);
1491+
free( myConfigUseRRD );
14921492

14931493
QgsDebugMsg( "Pyramid overviews built" );
14941494

‎tests/src/core/testqgscomposerlabel.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,24 @@
2727

2828
class TestQgsComposerLabel: public QObject
2929
{
30-
Q_OBJECT;
31-
private slots:
32-
void initTestCase();// will be called before the first testfunction is executed.
33-
void cleanupTestCase();// will be called after the last testfunction was executed.
34-
void init();// will be called before each testfunction is executed.
35-
void cleanup();// will be called after every testfunction.
36-
37-
// test simple expression evaluation
38-
void evaluation();
39-
// test expression evaluation when a feature is set
40-
void feature_evaluation();
41-
// test "$page" expressions
42-
void page_evaluation();
30+
Q_OBJECT;
31+
private slots:
32+
void initTestCase();// will be called before the first testfunction is executed.
33+
void cleanupTestCase();// will be called after the last testfunction was executed.
34+
void init();// will be called before each testfunction is executed.
35+
void cleanup();// will be called after every testfunction.
36+
37+
// test simple expression evaluation
38+
void evaluation();
39+
// test expression evaluation when a feature is set
40+
void feature_evaluation();
41+
// test "$page" expressions
42+
void page_evaluation();
4343
private:
44-
QgsComposition* mComposition;
45-
QgsComposerLabel* mComposerLabel;
46-
QgsMapRenderer* mMapRenderer;
47-
QgsVectorLayer* mVectorLayer;
44+
QgsComposition* mComposition;
45+
QgsComposerLabel* mComposerLabel;
46+
QgsMapRenderer* mMapRenderer;
47+
QgsVectorLayer* mVectorLayer;
4848
};
4949

5050
void TestQgsComposerLabel::initTestCase()
@@ -56,7 +56,7 @@ void TestQgsComposerLabel::initTestCase()
5656
QFileInfo vectorFileInfo( QString( TEST_DATA_DIR ) + QDir::separator() + "france_parts.shp" );
5757
mVectorLayer = new QgsVectorLayer( vectorFileInfo.filePath(),
5858
vectorFileInfo.completeBaseName(),
59-
"ogr" );
59+
"ogr" );
6060
QgsMapLayerRegistry::instance()->addMapLayers( QList<QgsMapLayer*>() << mVectorLayer );
6161

6262
//create composition with composer map
@@ -108,8 +108,8 @@ void TestQgsComposerLabel::evaluation()
108108
// $CURRENT_DATE() evaluation (inside an expression)
109109
QDate now = QDate::currentDate();
110110
int dd = now.day();
111-
112-
QString expected = "__" + QString("%1").arg(dd+1, 2, 10, QChar('0')) + "(ok)__";
111+
112+
QString expected = "__" + QString( "%1" ).arg( dd + 1, 2, 10, QChar( '0' ) ) + "(ok)__";
113113
mComposerLabel->setText( "__[%$CURRENT_DATE(dd) + 1%](ok)__" );
114114
QString evaluated = mComposerLabel->displayText();
115115
QCOMPARE( evaluated, expected );
@@ -173,7 +173,7 @@ void TestQgsComposerLabel::page_evaluation()
173173

174174
// move to the second page and re-evaluate
175175
mComposerLabel->setItemPosition( 0, 320 );
176-
QCOMPARE( mComposerLabel->displayText(), QString("2/2") );
176+
QCOMPARE( mComposerLabel->displayText(), QString( "2/2" ) );
177177
}
178178
}
179179

‎tests/src/core/testqgscomposermapatlas.cpp

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,29 @@
3131

3232
class TestQgsComposerMapAtlas: public QObject
3333
{
34-
Q_OBJECT;
35-
private slots:
36-
void initTestCase();// will be called before the first testfunction is executed.
37-
void cleanupTestCase();// will be called after the last testfunction was executed.
38-
void init();// will be called before each testfunction is executed.
39-
void cleanup();// will be called after every testfunction.
40-
41-
// test filename pattern evaluation
42-
void filename();
43-
// test rendering with an autoscale atlas
44-
void autoscale_render();
45-
// test rendering with a fixed scale atlas
46-
void fixedscale_render();
47-
// test rendering with a hidden coverage
48-
void hiding_render();
34+
Q_OBJECT;
35+
private slots:
36+
void initTestCase();// will be called before the first testfunction is executed.
37+
void cleanupTestCase();// will be called after the last testfunction was executed.
38+
void init();// will be called before each testfunction is executed.
39+
void cleanup();// will be called after every testfunction.
40+
41+
// test filename pattern evaluation
42+
void filename();
43+
// test rendering with an autoscale atlas
44+
void autoscale_render();
45+
// test rendering with a fixed scale atlas
46+
void fixedscale_render();
47+
// test rendering with a hidden coverage
48+
void hiding_render();
4949
private:
50-
QgsComposition* mComposition;
51-
QgsComposerLabel* mLabel1;
52-
QgsComposerLabel* mLabel2;
53-
QgsComposerMap* mAtlasMap;
54-
QgsComposerMap* mOverview;
55-
QgsMapRenderer* mMapRenderer;
56-
QgsVectorLayer* mVectorLayer;
50+
QgsComposition* mComposition;
51+
QgsComposerLabel* mLabel1;
52+
QgsComposerLabel* mLabel2;
53+
QgsComposerMap* mAtlasMap;
54+
QgsComposerMap* mOverview;
55+
QgsMapRenderer* mMapRenderer;
56+
QgsVectorLayer* mVectorLayer;
5757
};
5858

5959
void TestQgsComposerMapAtlas::initTestCase()
@@ -65,7 +65,7 @@ void TestQgsComposerMapAtlas::initTestCase()
6565
QFileInfo vectorFileInfo( QString( TEST_DATA_DIR ) + QDir::separator() + "france_parts.shp" );
6666
mVectorLayer = new QgsVectorLayer( vectorFileInfo.filePath(),
6767
vectorFileInfo.completeBaseName(),
68-
"ogr" );
68+
"ogr" );
6969

7070
QgsMapLayerRegistry::instance()->addMapLayers( QList<QgsMapLayer*>() << mVectorLayer );
7171

@@ -141,7 +141,7 @@ void TestQgsComposerMapAtlas::filename()
141141
for ( size_t fi = 0; fi < atlasRender.numFeatures(); ++fi )
142142
{
143143
atlasRender.prepareForFeature( fi );
144-
QString expected = QString( "output_%1" ).arg( (int)(fi+1) );
144+
QString expected = QString( "output_%1" ).arg(( int )( fi + 1 ) );
145145
QCOMPARE( atlasRender.currentFilename(), expected );
146146
}
147147
atlasRender.end();
@@ -151,7 +151,7 @@ void TestQgsComposerMapAtlas::filename()
151151
void TestQgsComposerMapAtlas::autoscale_render()
152152
{
153153
mAtlasMap->setAtlasFixedScale( false );
154-
mAtlasMap->setAtlasMargin( 0.10 );
154+
mAtlasMap->setAtlasMargin( 0.10f );
155155

156156
QgsAtlasRendering atlasRender( mComposition );
157157

@@ -163,12 +163,12 @@ void TestQgsComposerMapAtlas::autoscale_render()
163163
mLabel1->adjustSizeToText();
164164

165165
QgsCompositionChecker checker( "Atlas autoscale test", mComposition,
166-
QString( TEST_DATA_DIR ) + QDir::separator() + "control_images" + QDir::separator() +
167-
"expected_composermapatlas" + QDir::separator() +
168-
QString( "autoscale_%1.png" ).arg((int)fit) );
166+
QString( TEST_DATA_DIR ) + QDir::separator() + "control_images" + QDir::separator() +
167+
"expected_composermapatlas" + QDir::separator() +
168+
QString( "autoscale_%1.png" ).arg(( int )fit ) );
169169
QVERIFY( checker.testComposition( 0 ) );
170170
}
171-
atlasRender.end();
171+
atlasRender.end();
172172
}
173173

174174
void TestQgsComposerMapAtlas::fixedscale_render()
@@ -186,12 +186,12 @@ void TestQgsComposerMapAtlas::fixedscale_render()
186186
mLabel1->adjustSizeToText();
187187

188188
QgsCompositionChecker checker( "Atlas fixedscale test", mComposition,
189-
QString( TEST_DATA_DIR ) + QDir::separator() + "control_images" + QDir::separator() +
190-
"expected_composermapatlas" + QDir::separator() +
191-
QString( "fixedscale_%1.png" ).arg((int)fit) );
189+
QString( TEST_DATA_DIR ) + QDir::separator() + "control_images" + QDir::separator() +
190+
"expected_composermapatlas" + QDir::separator() +
191+
QString( "fixedscale_%1.png" ).arg(( int )fit ) );
192192
QVERIFY( checker.testComposition( 0 ) );
193193
}
194-
atlasRender.end();
194+
atlasRender.end();
195195

196196
}
197197

@@ -211,12 +211,12 @@ void TestQgsComposerMapAtlas::hiding_render()
211211
mLabel1->adjustSizeToText();
212212

213213
QgsCompositionChecker checker( "Atlas hidden test", mComposition,
214-
QString( TEST_DATA_DIR ) + QDir::separator() + "control_images" + QDir::separator() +
215-
"expected_composermapatlas" + QDir::separator() +
216-
QString( "hiding_%1.png" ).arg((int)fit) );
214+
QString( TEST_DATA_DIR ) + QDir::separator() + "control_images" + QDir::separator() +
215+
"expected_composermapatlas" + QDir::separator() +
216+
QString( "hiding_%1.png" ).arg(( int )fit ) );
217217
QVERIFY( checker.testComposition( 0 ) );
218218
}
219-
atlasRender.end();
219+
atlasRender.end();
220220

221221
}
222222

‎tests/src/core/testqgsexpression.cpp

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -545,31 +545,31 @@ class TestQgsExpression: public QObject
545545
QCOMPARE( vPerimeter.toDouble(), 20. );
546546
}
547547

548-
void eval_special_columns()
549-
{
550-
QTest::addColumn<QString>( "string" );
551-
QTest::addColumn<QVariant>( "result" );
552-
553-
QgsExpression::setSpecialColumn( "$var1", QVariant((int)42) );
554-
555-
QgsExpression exp( "$var1 + 1" );
556-
QVariant v1 = exp.evaluate();
557-
QCOMPARE( v1.toInt(), 43 );
558-
559-
QgsExpression::setSpecialColumn( "$var1", QVariant((int)100) );
560-
QVariant v2 = exp.evaluate();
561-
QCOMPARE( v2.toInt(), 101 );
562-
563-
QgsExpression exp2( "_specialcol_('$var1')+1" );
564-
QVariant v3 = exp2.evaluate();
565-
QCOMPARE( v3.toInt(), 101 );
566-
567-
QgsExpression exp3( "_specialcol_('undefined')");
568-
QVariant v4 = exp3.evaluate();
569-
QCOMPARE( v4, QVariant() );
570-
571-
QgsExpression::unsetSpecialColumn( "$var1" );
572-
}
548+
void eval_special_columns()
549+
{
550+
QTest::addColumn<QString>( "string" );
551+
QTest::addColumn<QVariant>( "result" );
552+
553+
QgsExpression::setSpecialColumn( "$var1", QVariant(( int )42 ) );
554+
555+
QgsExpression exp( "$var1 + 1" );
556+
QVariant v1 = exp.evaluate();
557+
QCOMPARE( v1.toInt(), 43 );
558+
559+
QgsExpression::setSpecialColumn( "$var1", QVariant(( int )100 ) );
560+
QVariant v2 = exp.evaluate();
561+
QCOMPARE( v2.toInt(), 101 );
562+
563+
QgsExpression exp2( "_specialcol_('$var1')+1" );
564+
QVariant v3 = exp2.evaluate();
565+
QCOMPARE( v3.toInt(), 101 );
566+
567+
QgsExpression exp3( "_specialcol_('undefined')" );
568+
QVariant v4 = exp3.evaluate();
569+
QCOMPARE( v4, QVariant() );
570+
571+
QgsExpression::unsetSpecialColumn( "$var1" );
572+
}
573573

574574
};
575575

0 commit comments

Comments
 (0)
Please sign in to comment.