Skip to content

Commit 7dd58aa

Browse files
committed
indentation update
1 parent 7172347 commit 7dd58aa

17 files changed

Lines changed: 310 additions & 308 deletions

‎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 )

0 commit comments

Comments
 (0)