Skip to content

Commit

Permalink
fix all occurrences of multiple statements in a single line
Browse files Browse the repository at this point in the history
This was accomplished by running scripts/astyle-all.sh.
  • Loading branch information
SebDieBln committed Dec 21, 2015
1 parent 95fa866 commit c28c493
Show file tree
Hide file tree
Showing 101 changed files with 1,582 additions and 659 deletions.
9 changes: 6 additions & 3 deletions src/analysis/interpolation/DualEdgeTriangulation.cc
Expand Up @@ -1527,7 +1527,8 @@ int DualEdgeTriangulation::insertForcedSegment( int p1, int p2, bool breakline )

//set the necessary nexts of leftPolygon(exept the first)
int actedgel = leftPolygon[1];
leftiter = leftPolygon.constBegin(); leftiter += 2;
leftiter = leftPolygon.constBegin();
leftiter += 2;
for ( ; leftiter != leftPolygon.constEnd(); ++leftiter )
{
mHalfEdge[actedgel]->setNext(( *leftiter ) );
Expand All @@ -1536,7 +1537,8 @@ int DualEdgeTriangulation::insertForcedSegment( int p1, int p2, bool breakline )

//set all the necessary nexts of rightPolygon
int actedger = rightPolygon[1];
rightiter = rightPolygon.constBegin(); rightiter += 2;
rightiter = rightPolygon.constBegin();
rightiter += 2;
for ( ; rightiter != rightPolygon.constEnd(); ++rightiter )
{
mHalfEdge[actedger]->setNext(( *rightiter ) );
Expand Down Expand Up @@ -2526,7 +2528,8 @@ void DualEdgeTriangulation::triangulatePolygon( QList<int>* poly, QList<int>* fr
mHalfEdge[( *( --poly->end() ) )]->setNext( inserta );

QList<int> polya;
iterator = poly->constBegin(); iterator += 2;
iterator = poly->constBegin();
iterator += 2;
while ( iterator != poly->constEnd() )
{
polya.append(( *iterator ) );
Expand Down
11 changes: 8 additions & 3 deletions src/analysis/raster/qgsrastermatrix.cpp
Expand Up @@ -72,7 +72,9 @@ void QgsRasterMatrix::setData( int cols, int rows, double* data, double nodataVa
double* QgsRasterMatrix::takeData()
{
double* data = mData;
mData = nullptr; mColumns = 0; mRows = 0;
mData = nullptr;
mColumns = 0;
mRows = 0;
return data;
}

Expand Down Expand Up @@ -337,7 +339,8 @@ bool QgsRasterMatrix::twoArgumentOperation( TwoArgOperator op, const QgsRasterMa

for ( int i = 0; i < nEntries; ++i )
{
value1 = mData[i]; value2 = matrix[i];
value1 = mData[i];
value2 = matrix[i];
if ( value1 == mNodataValue || value2 == other.mNodataValue )
{
mData[i] = mNodataValue;
Expand All @@ -357,7 +360,9 @@ bool QgsRasterMatrix::twoArgumentOperation( TwoArgOperator op, const QgsRasterMa
int nEntries = other.nColumns() * other.nRows();
double value = mData[0];
delete[] mData;
mData = new double[nEntries]; mColumns = other.nColumns(); mRows = other.nRows();
mData = new double[nEntries];
mColumns = other.nColumns();
mRows = other.nRows();
mNodataValue = other.nodataValue();

if ( value == mNodataValue )
Expand Down
4 changes: 3 additions & 1 deletion src/analysis/raster/qgsrelief.cpp
Expand Up @@ -330,7 +330,9 @@ bool QgsRelief::processNineCellWindow( float* x1, float* x2, float* x3, float* x
}
else
{
r2 = hillShadeValue315; g2 = hillShadeValue315; b2 = hillShadeValue315;
r2 = hillShadeValue315;
g2 = hillShadeValue315;
b2 = hillShadeValue315;
}

//combine with r,g,b with 70 percentage coverage
Expand Down
38 changes: 26 additions & 12 deletions src/analysis/vector/qgsgeometryanalyzer.cpp
Expand Up @@ -1303,7 +1303,9 @@ const unsigned char* QgsGeometryAnalyzer::locateBetweenWkbString( const unsigned
}
}
}
prevx = *x; prevy = *y; prevz = *z;
prevx = *x;
prevy = *y;
prevz = *z;
}
return ptr;
}
Expand Down Expand Up @@ -1339,7 +1341,9 @@ const unsigned char* QgsGeometryAnalyzer::locateAlongWkbString( const unsigned c
result.append( pt2 );
}
}
prevx = *x; prevy = *y; prevz = *z;
prevx = *x;
prevy = *y;
prevz = *z;
}
return ptr;
}
Expand Down Expand Up @@ -1385,13 +1389,17 @@ bool QgsGeometryAnalyzer::clipSegmentByRange( double x1, double y1, double m1, d
{
if ( reversed )
{
pt1.setX( x2 ); pt1.setY( y2 );
pt2.setX( x1 ); pt2.setY( y1 );
pt1.setX( x2 );
pt1.setY( y2 );
pt2.setX( x1 );
pt2.setY( y1 );
}
else
{
pt1.setX( x1 ); pt1.setY( y1 );
pt2.setX( x2 ); pt2.setY( y2 );
pt1.setX( x1 );
pt1.setY( y1 );
pt2.setX( x2 );
pt2.setY( y2 );
}
secondPointClipped = false;
return true;
Expand All @@ -1400,7 +1408,8 @@ bool QgsGeometryAnalyzer::clipSegmentByRange( double x1, double y1, double m1, d
//m1 inside and m2 not
if ( m1 >= range1 && m1 <= range2 )
{
pt1.setX( x1 ); pt1.setY( y1 );
pt1.setX( x1 );
pt1.setY( y1 );
double dist = ( range2 - m1 ) / ( m2 - m1 );
pt2.setX( x1 + ( x2 - x1 ) * dist );
pt2.setY( y1 + ( y2 - y1 ) * dist );
Expand All @@ -1410,7 +1419,8 @@ bool QgsGeometryAnalyzer::clipSegmentByRange( double x1, double y1, double m1, d
//m2 inside and m1 not
if ( m2 >= range1 && m2 <= range2 )
{
pt2.setX( x2 ); pt2.setY( y2 );
pt2.setX( x2 );
pt2.setY( y2 );
double dist = ( m2 - range1 ) / ( m2 - m1 );
pt1.setX( x2 - ( x2 - x1 ) * dist );
pt1.setY( y2 - ( y2 - y1 ) * dist );
Expand Down Expand Up @@ -1468,12 +1478,14 @@ void QgsGeometryAnalyzer::locateAlongSegment( double x1, double y1, double m1, d
if ( reversed )
{
pt2Ok = true;
pt2.setX( x2 ); pt2.setY( y2 );
pt2.setX( x2 );
pt2.setY( y2 );
}
else
{
pt1Ok = true;
pt1.setX( x1 ); pt1.setY( y1 );
pt1.setX( x1 );
pt1.setY( y1 );
}
}

Expand All @@ -1483,12 +1495,14 @@ void QgsGeometryAnalyzer::locateAlongSegment( double x1, double y1, double m1, d
if ( reversed )
{
pt1Ok = true;
pt1.setX( x1 ); pt1.setY( y1 );
pt1.setX( x1 );
pt1.setY( y1 );
}
else
{
pt2Ok = true;
pt2.setX( x2 ); pt2.setY( y2 );
pt2.setX( x2 );
pt2.setY( y2 );
}
}

Expand Down
28 changes: 20 additions & 8 deletions src/analysis/vector/qgstransectsample.cpp
Expand Up @@ -235,14 +235,16 @@ int QgsTransectSample::createSample( QProgressDialog* pd )
QgsGeometry* lineClipStratum = lineFarAwayGeom->intersection( strataGeom );
if ( !lineClipStratum )
{
delete lineFarAwayGeom; delete lineClipStratum;
delete lineFarAwayGeom;
delete lineClipStratum;
continue;
}

//cancel if distance between sample point and line is too large (line does not start at point
if ( lineClipStratum->distance( *samplePoint ) > 0.000001 )
{
delete lineFarAwayGeom; delete lineClipStratum;
delete lineFarAwayGeom;
delete lineClipStratum;
continue;
}

Expand All @@ -262,14 +264,16 @@ int QgsTransectSample::createSample( QProgressDialog* pd )
double transectLength = distanceArea.measureLength( lineClipStratum );
if ( transectLength < mMinTransectLength )
{
delete lineFarAwayGeom; delete lineClipStratum;
delete lineFarAwayGeom;
delete lineClipStratum;
continue;
}

//search closest existing profile. Cancel if dist < minDist
if ( otherTransectWithinDistance( lineClipStratum, minDistanceLayerUnits, minDistance, sIndex, lineFeatureMap, distanceArea ) )
{
delete lineFarAwayGeom; delete lineClipStratum;
delete lineFarAwayGeom;
delete lineClipStratum;
continue;
}

Expand Down Expand Up @@ -441,22 +445,30 @@ bool QgsTransectSample::closestSegmentPoints( QgsGeometry& g1, QgsGeometry& g2,

if ( d1 <= d2 && d1 <= d3 && d1 <= d4 )
{
dist = sqrt( d1 ); pt1 = p11; pt2 = minDistPoint1;
dist = sqrt( d1 );
pt1 = p11;
pt2 = minDistPoint1;
return true;
}
else if ( d2 <= d1 && d2 <= d3 && d2 <= d4 )
{
dist = sqrt( d2 ); pt1 = p12; pt2 = minDistPoint2;
dist = sqrt( d2 );
pt1 = p12;
pt2 = minDistPoint2;
return true;
}
else if ( d3 <= d1 && d3 <= d2 && d3 <= d4 )
{
dist = sqrt( d3 ); pt1 = p21; pt2 = minDistPoint3;
dist = sqrt( d3 );
pt1 = p21;
pt2 = minDistPoint3;
return true;
}
else
{
dist = sqrt( d4 ); pt1 = p21; pt2 = minDistPoint4;
dist = sqrt( d4 );
pt1 = p21;
pt2 = minDistPoint4;
return true;
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/analysis/vector/qgszonalstatistics.cpp
Expand Up @@ -392,7 +392,10 @@ int QgsZonalStatistics::cellInfoForBBox( const QgsRectangle& rasterBBox, const Q
QgsRectangle intersectBox = rasterBBox.intersect( &featureBBox );
if ( intersectBox.isEmpty() )
{
nCellsX = 0; nCellsY = 0; offsetX = 0; offsetY = 0;
nCellsX = 0;
nCellsY = 0;
offsetX = 0;
offsetY = 0;
return 0;
}

Expand Down
6 changes: 4 additions & 2 deletions src/app/composer/qgscomposerpicturewidget.cpp
Expand Up @@ -475,7 +475,8 @@ int QgsComposerPictureWidget::addDirectoryToPreview( const QString& path )
//exclude files that are not svg or image
if ( !fileIsSvg && !fileIsPixel )
{
++counter; continue;
++counter;
continue;
}

QListWidgetItem * listItem = new QListWidgetItem( mPreviewListWidget );
Expand All @@ -491,7 +492,8 @@ int QgsComposerPictureWidget::addDirectoryToPreview( const QString& path )
QPixmap iconPixmap( filePath );
if ( iconPixmap.isNull() )
{
++counter; continue; //unknown file format or other problem
++counter;
continue; //unknown file format or other problem
}
//set pixmap hardcoded to 30/30, same as icon size for mPreviewListWidget
QPixmap scaledPixmap( iconPixmap.scaled( QSize( 30, 30 ), Qt::KeepAspectRatio ) );
Expand Down
64 changes: 48 additions & 16 deletions src/app/qgisapp.cpp
Expand Up @@ -1831,11 +1831,21 @@ void QgisApp::createToolBars()
QAction* defSelectAction = mActionSelectFeatures;
switch ( settings.value( "/UI/selectTool", 0 ).toInt() )
{
case 0: defSelectAction = mActionSelectFeatures; break;
case 1: defSelectAction = mActionSelectFeatures; break;
case 2: defSelectAction = mActionSelectRadius; break;
case 3: defSelectAction = mActionSelectPolygon; break;
case 4: defSelectAction = mActionSelectFreehand; break;
case 0:
defSelectAction = mActionSelectFeatures;
break;
case 1:
defSelectAction = mActionSelectFeatures;
break;
case 2:
defSelectAction = mActionSelectRadius;
break;
case 3:
defSelectAction = mActionSelectPolygon;
break;
case 4:
defSelectAction = mActionSelectFreehand;
break;
}
bt->setDefaultAction( defSelectAction );
QAction* selectAction = mAttributesToolBar->insertWidget( mActionDeselectAll, bt );
Expand Down Expand Up @@ -1865,9 +1875,15 @@ void QgisApp::createToolBars()
QAction* defMeasureAction = mActionMeasure;
switch ( settings.value( "/UI/measureTool", 0 ).toInt() )
{
case 0: defMeasureAction = mActionMeasure; break;
case 1: defMeasureAction = mActionMeasureArea; break;
case 2: defMeasureAction = mActionMeasureAngle; break;
case 0:
defMeasureAction = mActionMeasure;
break;
case 1:
defMeasureAction = mActionMeasureArea;
break;
case 2:
defMeasureAction = mActionMeasureAngle;
break;
}
bt->setDefaultAction( defMeasureAction );
QAction* measureAction = mAttributesToolBar->insertWidget( mActionMapTips, bt );
Expand All @@ -1887,11 +1903,21 @@ void QgisApp::createToolBars()
QAction* defAnnotationAction = mActionTextAnnotation;
switch ( settings.value( "/UI/annotationTool", 0 ).toInt() )
{
case 0: defAnnotationAction = mActionTextAnnotation; break;
case 1: defAnnotationAction = mActionFormAnnotation; break;
case 2: defAnnotationAction = mActionHtmlAnnotation; break;
case 3: defAnnotationAction = mActionSvgAnnotation; break;
case 4: defAnnotationAction = mActionAnnotation; break;
case 0:
defAnnotationAction = mActionTextAnnotation;
break;
case 1:
defAnnotationAction = mActionFormAnnotation;
break;
case 2:
defAnnotationAction = mActionHtmlAnnotation;
break;
case 3:
defAnnotationAction = mActionSvgAnnotation;
break;
case 4:
defAnnotationAction = mActionAnnotation;
break;

}
bt->setDefaultAction( defAnnotationAction );
Expand All @@ -1914,9 +1940,15 @@ void QgisApp::createToolBars()
QAction* defNewLayerAction = mActionNewVectorLayer;
switch ( settings.value( "/UI/defaultNewLayer", 1 ).toInt() )
{
case 0: defNewLayerAction = mActionNewSpatiaLiteLayer; break;
case 1: defNewLayerAction = mActionNewVectorLayer; break;
case 2: defNewLayerAction = mActionNewMemoryLayer; break;
case 0:
defNewLayerAction = mActionNewSpatiaLiteLayer;
break;
case 1:
defNewLayerAction = mActionNewVectorLayer;
break;
case 2:
defNewLayerAction = mActionNewMemoryLayer;
break;
}
bt->setDefaultAction( defNewLayerAction );
QAction* newLayerAction = mLayerToolBar->addWidget( bt );
Expand Down
3 changes: 2 additions & 1 deletion src/app/qgsconfigureshortcutsdialog.cpp
Expand Up @@ -81,7 +81,8 @@ void QgsConfigureShortcutsDialog::populateActions()
QString actionText = actions[i]->text();
actionText.remove( '&' ); // remove the accelerator

QStringList lst; lst << actionText << actions[i]->shortcut().toString();
QStringList lst;
lst << actionText << actions[i]->shortcut().toString();
QTreeWidgetItem* item = new QTreeWidgetItem( lst );
item->setIcon( 0, actions[i]->icon() );
item->setData( 0, Qt::UserRole, qVariantFromValue(( QObject* )actions[i] ) );
Expand Down
3 changes: 2 additions & 1 deletion src/app/qgsidentifyresultsdialog.cpp
Expand Up @@ -795,7 +795,8 @@ void QgsIdentifyResultsDialog::addFeature( QgsRasterLayer *layer,

tblResults->resizeRowToContents( j );

j++; i++;
j++;
i++;
}
//tblResults->resizeColumnToContents( 1 );

Expand Down

0 comments on commit c28c493

Please sign in to comment.