Skip to content

Commit c254be1

Browse files
committedDec 1, 2012
indentation update
1 parent 4571b1d commit c254be1

20 files changed

+220
-217
lines changed
 

‎src/app/qgsmaptoolsvgannotation.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ QgsMapToolSvgAnnotation::~QgsMapToolSvgAnnotation()
3131

3232
QgsAnnotationItem* QgsMapToolSvgAnnotation::createItem( QMouseEvent* e )
3333
{
34-
QgsSvgAnnotationItem* svgItem = new QgsSvgAnnotationItem( mCanvas );
35-
svgItem->setMapPosition( toMapCoordinates( e->pos() ) );
36-
svgItem->setSelected( true );
37-
svgItem->setFrameSize( QSizeF( 200, 100 ) );
38-
return svgItem;
34+
QgsSvgAnnotationItem* svgItem = new QgsSvgAnnotationItem( mCanvas );
35+
svgItem->setMapPosition( toMapCoordinates( e->pos() ) );
36+
svgItem->setSelected( true );
37+
svgItem->setFrameSize( QSizeF( 200, 100 ) );
38+
return svgItem;
3939
}

‎src/app/qgsmaptoolsvgannotation.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222

2323
class QgsMapToolSvgAnnotation: public QgsMapToolAnnotation
2424
{
25-
public:
26-
QgsMapToolSvgAnnotation( QgsMapCanvas* canvas );
27-
~QgsMapToolSvgAnnotation();
28-
protected:
29-
QgsAnnotationItem* createItem( QMouseEvent* e );
25+
public:
26+
QgsMapToolSvgAnnotation( QgsMapCanvas* canvas );
27+
~QgsMapToolSvgAnnotation();
28+
protected:
29+
QgsAnnotationItem* createItem( QMouseEvent* e );
3030
};
3131

3232
#endif // QGSMAPTOOLSVGANNOTATION_H

‎src/app/qgssvgannotationdialog.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@ class QgsAnnotationWidget;
2626
class QgsSvgAnnotationDialog: public QDialog, private Ui::QgsFormAnnotationDialogBase
2727
{
2828
Q_OBJECT
29-
public:
30-
QgsSvgAnnotationDialog( QgsSvgAnnotationItem* item, QWidget * parent = 0, Qt::WindowFlags f = 0);
31-
~QgsSvgAnnotationDialog();
29+
public:
30+
QgsSvgAnnotationDialog( QgsSvgAnnotationItem* item, QWidget * parent = 0, Qt::WindowFlags f = 0 );
31+
~QgsSvgAnnotationDialog();
3232

33-
private slots:
34-
void on_mBrowseToolButton_clicked();
35-
void applySettingsToItem();
36-
void deleteItem();
33+
private slots:
34+
void on_mBrowseToolButton_clicked();
35+
void applySettingsToItem();
36+
void deleteItem();
3737

38-
private:
39-
QgsSvgAnnotationDialog(); //forbidden
38+
private:
39+
QgsSvgAnnotationDialog(); //forbidden
4040

41-
QgsSvgAnnotationItem* mItem;
42-
QgsAnnotationWidget* mEmbeddedWidget;
41+
QgsSvgAnnotationItem* mItem;
42+
QgsAnnotationWidget* mEmbeddedWidget;
4343
};
4444

4545
#endif // QGSSVGANNOTATIONDIALOG_H

‎src/core/qgsexpression.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ static QgsExpression::Interval getInterval( const QVariant& value, QgsExpression
329329

330330
return QgsExpression::Interval::invalidInterVal();
331331
}
332-
static QgsGeometry getGeometry( const QVariant& value, QgsExpression* parent)
332+
static QgsGeometry getGeometry( const QVariant& value, QgsExpression* parent )
333333
{
334334
if ( value.canConvert<QgsGeometry>() )
335335
return value.value<QgsGeometry>();
@@ -775,7 +775,7 @@ static QVariant fcnGeometry( const QVariantList& , QgsFeature* f, QgsExpression*
775775
}
776776
static QVariant fcnGeomFromWKT( const QVariantList& values, QgsFeature*, QgsExpression* parent )
777777
{
778-
QString wkt = getStringValue( values.at( 0 ), parent );
778+
QString wkt = getStringValue( values.at( 0 ), parent );
779779
QgsGeometry* geom = QgsGeometry::fromWkt( wkt );
780780
if ( geom )
781781
return QVariant::fromValue( *geom );
@@ -786,7 +786,7 @@ static QVariant fcnGeomFromGML2( const QVariantList& values, QgsFeature*, QgsExp
786786
{
787787
QDomDocument doc;
788788
QString errorMsg;
789-
QString gml = getStringValue( values.at( 0 ), parent );
789+
QString gml = getStringValue( values.at( 0 ), parent );
790790
if ( !doc.setContent( gml, true, &errorMsg ) )
791791
return QVariant();
792792

@@ -879,7 +879,7 @@ static QVariant fcnBuffer( const QVariantList& values, QgsFeature*, QgsExpressio
879879
return QVariant();
880880

881881
QgsGeometry fGeom = getGeometry( values.at( 0 ), parent );
882-
double dist = getDoubleValue( values.at( 1 ), parent );
882+
double dist = getDoubleValue( values.at( 1 ), parent );
883883
int seg = 8;
884884
if ( values.length() == 3 )
885885
seg = getIntValue( values.at( 2 ), parent );
@@ -1033,7 +1033,7 @@ const QStringList &QgsExpression::BuiltinFunctions()
10331033
{
10341034
gmBuiltinFunctions << "sqrt"
10351035
<< "sqrt" << "cos" << "sin" << "tan"
1036-
<< "asin" << "acos" << "atan" << "atan2"
1036+
<< "asin" << "acos" << "atan" << "atan2"
10371037
<< "exp" << "ln" << "log10" << "log"
10381038
<< "round" << "toint" << "toreal" << "tostring"
10391039
<< "todatetime" << "todate" << "totime" << "tointerval"
@@ -2254,7 +2254,7 @@ void QgsExpression::NodeFunction::toOgcFilter( QDomDocument &doc, QDomElement &e
22542254
if ( fd->name() == ogcOperatorName.toLower() )
22552255
{
22562256
isSpatial = true;
2257-
QDomElement funcElem = doc.createElement( "ogc:"+ogcOperatorName );
2257+
QDomElement funcElem = doc.createElement( "ogc:" + ogcOperatorName );
22582258
QDomElement geomProperty = doc.createElement( "ogc:PropertyName" );
22592259
geomProperty.appendChild( doc.createTextNode( "geometry" ) );
22602260
funcElem.appendChild( geomProperty );
@@ -2279,14 +2279,14 @@ void QgsExpression::NodeFunction::toOgcFilter( QDomDocument &doc, QDomElement &e
22792279
{
22802280
QDomDocument geomDoc;
22812281
QString errorMsg;
2282-
QString gml = childElem.firstChildElement().text();
2282+
QString gml = childElem.firstChildElement().text();
22832283
if ( geomDoc.setContent( gml, true, &errorMsg ) )
22842284
funcElem.appendChild( doc.documentElement() );
22852285
}
22862286
}
22872287
childElem = childElem.nextSiblingElement();
22882288
}
2289-
2289+
22902290
element.appendChild( funcElem );
22912291
}
22922292
}
@@ -2329,7 +2329,7 @@ QgsExpression::Node* QgsExpression::NodeFunction::createFromOgcFilter( QDomEleme
23292329
opeIdx = j;
23302330
}
23312331

2332-
if (geomIdx == 0 || gml2Idx == 0 || opeIdx == 0 )
2332+
if ( geomIdx == 0 || gml2Idx == 0 || opeIdx == 0 )
23332333
{
23342334
errorMessage = QString( "spatial functions not find %1, got %2, %3, %4" ).arg( ogcOperatorName ).arg( geomIdx ).arg( gml2Idx ).arg( opeIdx );
23352335
return NULL;
@@ -2338,7 +2338,8 @@ QgsExpression::Node* QgsExpression::NodeFunction::createFromOgcFilter( QDomEleme
23382338
QgsExpression::NodeList *gml2Args = new QgsExpression::NodeList();
23392339
QDomElement childElem = element.firstChildElement();
23402340
QString gml2Str = "";
2341-
while ( !childElem.isNull() && gml2Str == "" ) {
2341+
while ( !childElem.isNull() && gml2Str == "" )
2342+
{
23422343
if ( childElem.tagName() != "PropertyName" )
23432344
{
23442345
QTextStream gml2Stream( &gml2Str );

‎src/core/qgsexpression.h

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -227,61 +227,61 @@ class CORE_EXPORT QgsExpression
227227
class CORE_EXPORT Function
228228
{
229229
public:
230-
Function( QString fnname, int params, QString group, QString helpText = QString(), bool usesGeometry = false )
231-
: mName( fnname ), mParams( params ), mUsesGeometry( usesGeometry ), mGroup( group ), mHelpText( helpText ) {}
232-
/** The name of the function. */
233-
QString name() { return mName; }
234-
/** The number of parameters this function takes. */
235-
int params() { return mParams; }
236-
/** Does this function use a geometry object. */
237-
bool usesgeometry() { return mUsesGeometry; }
238-
/** The group the function belongs to. */
239-
QString group() { return mGroup; }
240-
/** The help text for the function. */
241-
QString helptext() { return mHelpText; }
242-
243-
virtual QVariant func(const QVariantList& values, QgsFeature* f, QgsExpression* parent) = 0;
244-
245-
bool operator==(const Function& other) const
246-
{
247-
if ( QString::compare( mName, other.mName, Qt::CaseInsensitive ) == 0 )
248-
return true;
249-
250-
return false;
251-
}
252-
253-
private:
254-
QString mName;
255-
int mParams;
256-
bool mUsesGeometry;
257-
QString mGroup;
258-
QString mHelpText;
230+
Function( QString fnname, int params, QString group, QString helpText = QString(), bool usesGeometry = false )
231+
: mName( fnname ), mParams( params ), mUsesGeometry( usesGeometry ), mGroup( group ), mHelpText( helpText ) {}
232+
/** The name of the function. */
233+
QString name() { return mName; }
234+
/** The number of parameters this function takes. */
235+
int params() { return mParams; }
236+
/** Does this function use a geometry object. */
237+
bool usesgeometry() { return mUsesGeometry; }
238+
/** The group the function belongs to. */
239+
QString group() { return mGroup; }
240+
/** The help text for the function. */
241+
QString helptext() { return mHelpText; }
242+
243+
virtual QVariant func( const QVariantList& values, QgsFeature* f, QgsExpression* parent ) = 0;
244+
245+
bool operator==( const Function& other ) const
246+
{
247+
if ( QString::compare( mName, other.mName, Qt::CaseInsensitive ) == 0 )
248+
return true;
249+
250+
return false;
251+
}
252+
253+
private:
254+
QString mName;
255+
int mParams;
256+
bool mUsesGeometry;
257+
QString mGroup;
258+
QString mHelpText;
259259
};
260260

261261
class StaticFunction : public Function
262262
{
263263
public:
264264
StaticFunction( QString fnname, int params, FcnEval fcn, QString group, QString helpText = QString(), bool usesGeometry = false )
265-
: Function( fnname, params, group, helpText, usesGeometry), mFnc( fcn ) {}
265+
: Function( fnname, params, group, helpText, usesGeometry ), mFnc( fcn ) {}
266266

267-
virtual QVariant func(const QVariantList& values, QgsFeature* f, QgsExpression* parent)
268-
{
269-
return mFnc(values,f, parent);
270-
}
267+
virtual QVariant func( const QVariantList& values, QgsFeature* f, QgsExpression* parent )
268+
{
269+
return mFnc( values, f, parent );
270+
}
271271

272272
private:
273273
FcnEval mFnc;
274274
};
275275

276276
const static QList<Function*> &Functions();
277277
static QList<Function*> gmFunctions;
278-
278+
279279
static QStringList gmBuiltinFunctions;
280280
const static QStringList &BuiltinFunctions();
281281

282-
static bool registerFunction(Function* function);
283-
static bool unregisterFunction(QString name);
284-
282+
static bool registerFunction( Function* function );
283+
static bool unregisterFunction( QString name );
284+
285285
// tells whether the identifier is a name of existing function
286286
static bool isFunctionName( QString name );
287287

‎src/core/qgsgeometry.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2985,7 +2985,7 @@ double QgsGeometry::closestVertexWithContext( const QgsPoint& point, int& atVert
29852985

29862986
if ( !mGeos )
29872987
{
2988-
return -1;
2988+
return -1;
29892989
}
29902990

29912991
const GEOSGeometry *g = GEOSGetExteriorRing( mGeos );
@@ -3290,7 +3290,7 @@ int QgsGeometry::addRing( const QList<QgsPoint>& ring )
32903290

32913291
if ( !mGeos )
32923292
{
3293-
return 6;
3293+
return 6;
32943294
}
32953295

32963296
int type = GEOSGeomTypeId( mGeos );

‎src/core/qgsvectorfilewriter.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,19 @@ class CORE_EXPORT QgsVectorFileWriter
7070

7171
/** Write contents of vector layer to an (OGR supported) vector formt
7272
@note: this method was added in version 1.5
73-
@param layer layer to write
74-
@param fileName file name to write to
75-
@param fileEncoding encoding to use
76-
@param destCRS pointer to CRS to reproject exported geometries to
77-
@param driverName OGR driver to use
78-
@param onlySelected write only selected features of layer
79-
@param errorMessage pointer to buffer fo error message
80-
@param datasourceOptions list of OGR data source creation options
81-
@param layerOptions list of OGR layer creation options
82-
@param skipAttributeCreation only write geometries
83-
@param newFilename QString pointer which will contain the new file name created
84-
(in case it is different to fileName).
85-
*/
73+
@param layer layer to write
74+
@param fileName file name to write to
75+
@param fileEncoding encoding to use
76+
@param destCRS pointer to CRS to reproject exported geometries to
77+
@param driverName OGR driver to use
78+
@param onlySelected write only selected features of layer
79+
@param errorMessage pointer to buffer fo error message
80+
@param datasourceOptions list of OGR data source creation options
81+
@param layerOptions list of OGR layer creation options
82+
@param skipAttributeCreation only write geometries
83+
@param newFilename QString pointer which will contain the new file name created
84+
(in case it is different to fileName).
85+
*/
8686
static WriterError writeAsVectorFormat( QgsVectorLayer* layer,
8787
const QString& fileName,
8888
const QString& fileEncoding,

‎src/gui/qgsattributeeditor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed
508508
QMap<int, QWidget*>::const_iterator it = proxyWidgets.find( idx );
509509
if ( it != proxyWidgets.end() )
510510
{
511-
QObject* obj = qvariant_cast<QObject*>( (*it)->property( "QgisAttrEditProxy" ) );
511+
QObject* obj = qvariant_cast<QObject*>(( *it )->property( "QgisAttrEditProxy" ) );
512512
relay = qobject_cast<QgsStringRelay*>( obj );
513513
}
514514
else

‎src/gui/qgsattributeeditor.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,21 @@ class GUI_EXPORT QgsAttributeEditor : public QObject
8282

8383
class QgsStringRelay : public QObject
8484
{
85-
Q_OBJECT
85+
Q_OBJECT
8686

87-
public:
87+
public:
8888

89-
QgsStringRelay( QObject* parent = NULL )
90-
: QObject( parent ) {}
89+
QgsStringRelay( QObject* parent = NULL )
90+
: QObject( parent ) {}
9191

92-
public slots:
93-
void changeText( QString str )
94-
{
95-
emit textChanged( str );
96-
}
92+
public slots:
93+
void changeText( QString str )
94+
{
95+
emit textChanged( str );
96+
}
9797

98-
signals:
99-
void textChanged( QString );
98+
signals:
99+
void textChanged( QString );
100100
};
101101

102102
#endif

‎src/gui/qgscharacterselectdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
QgsCharacterSelectorDialog::QgsCharacterSelectorDialog( QWidget *parent, Qt::WFlags fl )
22-
: QDialog( parent, fl ), mChar( QChar::Null )
22+
: QDialog( parent, fl ), mChar( QChar::Null )
2323
{
2424
setupUi( this );
2525
mCharWidget = new CharacterWidget( this );

‎src/gui/qgssvgannotationitem.cpp

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -33,72 +33,72 @@ QgsSvgAnnotationItem::~QgsSvgAnnotationItem()
3333

3434
void QgsSvgAnnotationItem::writeXML( QDomDocument& doc ) const
3535
{
36-
QDomElement documentElem = doc.documentElement();
37-
if ( documentElem.isNull() )
38-
{
39-
return;
40-
}
36+
QDomElement documentElem = doc.documentElement();
37+
if ( documentElem.isNull() )
38+
{
39+
return;
40+
}
4141

42-
QDomElement svgAnnotationElem = doc.createElement( "SVGAnnotationItem" );
43-
svgAnnotationElem.setAttribute( "file", QgsProject::instance()->writePath( mFilePath ) );
44-
_writeXML( doc, svgAnnotationElem );
45-
documentElem.appendChild( svgAnnotationElem );
42+
QDomElement svgAnnotationElem = doc.createElement( "SVGAnnotationItem" );
43+
svgAnnotationElem.setAttribute( "file", QgsProject::instance()->writePath( mFilePath ) );
44+
_writeXML( doc, svgAnnotationElem );
45+
documentElem.appendChild( svgAnnotationElem );
4646
}
4747

4848
void QgsSvgAnnotationItem::readXML( const QDomDocument& doc, const QDomElement& itemElem )
4949
{
50-
QString filePath = QgsProject::instance()->readPath( itemElem.attribute( "file" ) );
51-
setFilePath( filePath );
52-
QDomElement annotationElem = itemElem.firstChildElement( "AnnotationItem" );
53-
if ( !annotationElem.isNull() )
54-
{
55-
_readXML( doc, annotationElem );
56-
}
50+
QString filePath = QgsProject::instance()->readPath( itemElem.attribute( "file" ) );
51+
setFilePath( filePath );
52+
QDomElement annotationElem = itemElem.firstChildElement( "AnnotationItem" );
53+
if ( !annotationElem.isNull() )
54+
{
55+
_readXML( doc, annotationElem );
56+
}
5757
}
5858

5959
void QgsSvgAnnotationItem::paint( QPainter* painter )
6060
{
61-
if( !painter )
62-
{
63-
return;
64-
}
61+
if ( !painter )
62+
{
63+
return;
64+
}
6565

66-
drawFrame( painter );
67-
if ( mMapPositionFixed )
68-
{
69-
drawMarkerSymbol( painter );
70-
}
66+
drawFrame( painter );
67+
if ( mMapPositionFixed )
68+
{
69+
drawMarkerSymbol( painter );
70+
}
7171

72-
//keep width/height ratio of svg
73-
QRect viewBox = mSvgRenderer.viewBox();
74-
if( viewBox.isValid() )
72+
//keep width/height ratio of svg
73+
QRect viewBox = mSvgRenderer.viewBox();
74+
if ( viewBox.isValid() )
75+
{
76+
double widthRatio = mFrameSize.width() / viewBox.width();
77+
double heightRatio = mFrameSize.height() / viewBox.height();
78+
double renderWidth = 0;
79+
double renderHeight = 0;
80+
if ( widthRatio <= heightRatio )
7581
{
76-
double widthRatio = mFrameSize.width() / viewBox.width();
77-
double heightRatio = mFrameSize.height() / viewBox.height();
78-
double renderWidth = 0;
79-
double renderHeight = 0;
80-
if( widthRatio <= heightRatio )
81-
{
82-
renderWidth = mFrameSize.width();
83-
renderHeight = viewBox.height() * mFrameSize.width() / viewBox.width() ;
84-
}
85-
else
86-
{
87-
renderHeight = mFrameSize.height();
88-
renderWidth = viewBox.width() * mFrameSize.height() /viewBox.height() ;
89-
}
90-
91-
mSvgRenderer.render( painter, QRectF( mOffsetFromReferencePoint.x(), mOffsetFromReferencePoint.y(), renderWidth,
92-
renderHeight ) );
82+
renderWidth = mFrameSize.width();
83+
renderHeight = viewBox.height() * mFrameSize.width() / viewBox.width() ;
9384
}
94-
if ( isSelected() )
85+
else
9586
{
96-
drawSelectionBoxes( painter );
87+
renderHeight = mFrameSize.height();
88+
renderWidth = viewBox.width() * mFrameSize.height() / viewBox.height() ;
9789
}
90+
91+
mSvgRenderer.render( painter, QRectF( mOffsetFromReferencePoint.x(), mOffsetFromReferencePoint.y(), renderWidth,
92+
renderHeight ) );
93+
}
94+
if ( isSelected() )
95+
{
96+
drawSelectionBoxes( painter );
97+
}
9898
}
9999

100100
void QgsSvgAnnotationItem::setFilePath( const QString& file )
101101
{
102-
mFilePath = file;
103-
mSvgRenderer.load( mFilePath );
102+
mFilePath = file;
103+
mSvgRenderer.load( mFilePath );
104104
}

‎src/gui/qgssvgannotationitem.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@
2323

2424
class GUI_EXPORT QgsSvgAnnotationItem: public QgsAnnotationItem
2525
{
26-
public:
26+
public:
2727

2828
QgsSvgAnnotationItem( QgsMapCanvas* canvas );
2929
~QgsSvgAnnotationItem();
3030

31-
void writeXML( QDomDocument& doc ) const;
32-
void readXML( const QDomDocument& doc, const QDomElement& itemElem );
31+
void writeXML( QDomDocument& doc ) const;
32+
void readXML( const QDomDocument& doc, const QDomElement& itemElem );
3333

34-
void paint( QPainter* painter );
34+
void paint( QPainter* painter );
3535

36-
void setFilePath( const QString& file );
37-
QString filePath() const { return mFilePath; }
36+
void setFilePath( const QString& file );
37+
QString filePath() const { return mFilePath; }
3838

39-
private:
40-
QSvgRenderer mSvgRenderer;
41-
QString mFilePath;
39+
private:
40+
QSvgRenderer mSvgRenderer;
41+
QString mFilePath;
4242
};
4343

4444
#endif // QGSSVGANNOTATIONITEM_H

‎src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,9 @@ void QgsCategorizedSymbolRendererV2Widget::addCategories()
600600
if ( unique_vals.size() >= 1000 )
601601
{
602602
int res = QMessageBox::warning( 0, tr( "High number of classes!" ),
603-
tr( "Classification would yield %1 entries which might not be expected. Continue?" ).arg( unique_vals.size() ),
604-
QMessageBox::Ok | QMessageBox::Cancel,
605-
QMessageBox::Cancel );
603+
tr( "Classification would yield %1 entries which might not be expected. Continue?" ).arg( unique_vals.size() ),
604+
QMessageBox::Ok | QMessageBox::Cancel,
605+
QMessageBox::Cancel );
606606
if ( res == QMessageBox::Cancel )
607607
{
608608
return;

‎src/gui/symbology-ng/qgssymbollayerv2widget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ void QgsSvgMarkerSymbolLayerV2Widget::on_mFileLineEdit_editingFinished()
799799
QUrl url( mFileLineEdit->text() );
800800
if ( !url.isValid() )
801801
{
802-
return;
802+
return;
803803
}
804804
}
805805

@@ -996,7 +996,7 @@ void QgsSVGFillSymbolLayerWidget::on_mSVGLineEdit_editingFinished()
996996
QUrl url( mSVGLineEdit->text() );
997997
if ( !url.isValid() )
998998
{
999-
return;
999+
return;
10001000
}
10011001
}
10021002

‎src/mapserver/qgsprojectparser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,7 +1746,7 @@ QList<QDomElement> QgsProjectParser::publishedComposerElements() const
17461746

17471747
void QgsProjectParser::serviceCapabilities( QDomElement& parentElement, QDomDocument& doc ) const
17481748
{
1749-
if (doc.documentElement().tagName() == "WFS_Capabilities")
1749+
if ( doc.documentElement().tagName() == "WFS_Capabilities" )
17501750
{
17511751
serviceWFSCapabilities( parentElement, doc );
17521752
return;
@@ -2010,7 +2010,7 @@ void QgsProjectParser::serviceWFSCapabilities( QDomElement& parentElement, QDomD
20102010
}
20112011

20122012
serviceElem.appendChild( onlineResourceElem );
2013-
2013+
20142014
//Fees
20152015
QDomElement feesElem = propertiesElem.firstChildElement( "WMSFees" );
20162016
if ( !feesElem.isNull() )

‎src/mapserver/qgssldparser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class QgsSLDParser: public QgsConfigParser
6060

6161
void describeFeatureType( const QString& , QDomElement& , QDomDocument& ) const {}
6262
/**Returns one or possibly several maplayers for a given type name. If no layers/style are found, an empty list is returned*/
63-
QList<QgsMapLayer*> mapLayerFromTypeName( const QString&, bool ) const { QList<QgsMapLayer*> layerList; return layerList; }
63+
QList<QgsMapLayer*> mapLayerFromTypeName( const QString&, bool ) const { QList<QgsMapLayer*> layerList; return layerList; }
6464

6565
/**Returns number of layers in configuration*/
6666
int numberOfLayers() const;

‎src/mapserver/qgswfsserver.cpp

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,8 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
469469
{
470470
fidElem = fidNodes.at( f ).toElement();
471471
fid = fidElem.attribute( "fid" );
472-
if ( fid.contains( "." ) ) {
472+
if ( fid.contains( "." ) )
473+
{
473474
if ( fid.section( ".", 0, 0 ) != mTypeName )
474475
continue;
475476
fid = fid.section( ".", 1, 1 );
@@ -491,9 +492,9 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
491492
{
492493
QDomElement bboxElem = filterElem.firstChildElement();
493494
QDomElement childElem = bboxElem.firstChildElement();
494-
while ( !childElem.isNull() )
495+
while ( !childElem.isNull() )
495496
{
496-
if ( childElem.tagName() == "Box" )
497+
if ( childElem.tagName() == "Box" )
497498
{
498499
QgsRectangle* rect = new QgsRectangle( childElem );
499500
provider->select( attrIndexes, *rect, mWithGeom, true );
@@ -518,7 +519,7 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
518519
else
519520
{
520521
QgsExpression *mFilter = QgsExpression::createFromOgcFilter( filterElem );
521-
if (mFilter->hasParserError())
522+
if ( mFilter->hasParserError() )
522523
{
523524
throw QgsMapServiceException( "RequestNotWellFormed", mFilter->parserErrorString() );
524525
}
@@ -527,7 +528,7 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
527528
while ( provider->nextFeature( feature ) && featureCounter < maxFeat )
528529
{
529530
QVariant res = mFilter->evaluate( &feature, fields );
530-
if (mFilter->hasEvalError())
531+
if ( mFilter->hasEvalError() )
531532
{
532533
throw QgsMapServiceException( "RequestNotWellFormed", mFilter->evalErrorString() );
533534
}
@@ -589,9 +590,9 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
589590
if ( feature_id_it != mParameterMap.end() )
590591
{
591592
featureIdOk = true;
592-
featureIdList = feature_id_it.value().split( ",");
593+
featureIdList = feature_id_it.value().split( "," );
593594
QStringList typeNameList;
594-
foreach (const QString &fidStr, featureIdList)
595+
foreach ( const QString &fidStr, featureIdList )
595596
{
596597
// testing typename in the WFS featureID
597598
if ( !fidStr.contains( "." ) )
@@ -625,7 +626,7 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
625626
QString errorMsg;
626627
if ( !filter.setContent( filterIt.value(), true, &errorMsg ) )
627628
{
628-
throw QgsMapServiceException( "RequestNotWellFormed", QString("error message: %1. The XML string was: %2").arg( errorMsg ).arg( filterIt.value() ) );
629+
throw QgsMapServiceException( "RequestNotWellFormed", QString( "error message: %1. The XML string was: %2" ).arg( errorMsg ).arg( filterIt.value() ) );
629630
}
630631
else
631632
{
@@ -689,7 +690,7 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
689690
}
690691

691692
mTypeNames = mTypeName.split( "," );
692-
foreach (const QString &tnStr, mTypeNames)
693+
foreach ( const QString &tnStr, mTypeNames )
693694
{
694695
mTypeName = tnStr;
695696
layerList = mConfigParser->mapLayerFromTypeName( tnStr );
@@ -769,15 +770,15 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
769770
searchRect.set( minx, miny, maxx, maxy );
770771
else
771772
searchRect.set( searchRect.xMinimum() - 0.000001
772-
, searchRect.yMinimum() - 0.000001
773-
, searchRect.xMaximum() + 0.000001
774-
, searchRect.yMaximum() + 0.000001 );
773+
, searchRect.yMinimum() - 0.000001
774+
, searchRect.xMaximum() + 0.000001
775+
, searchRect.yMaximum() + 0.000001 );
775776
QgsCoordinateReferenceSystem layerCrs = layer->crs();
776777

777778
long featCounter = 0;
778779
if ( featureIdOk )
779780
{
780-
foreach (const QString &fidStr, featureIdList)
781+
foreach ( const QString &fidStr, featureIdList )
781782
{
782783
if ( !fidStr.startsWith( tnStr ) )
783784
continue;
@@ -795,7 +796,7 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
795796
{
796797
provider->select( attrIndexes, searchRect, mWithGeom, true );
797798
QgsExpression *mFilter = new QgsExpression( expFilter );
798-
if (mFilter->hasParserError())
799+
if ( mFilter->hasParserError() )
799800
{
800801
throw QgsMapServiceException( "RequestNotWellFormed", mFilter->parserErrorString() );
801802
}
@@ -804,7 +805,7 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
804805
while ( provider->nextFeature( feature ) && featureCounter < maxFeat )
805806
{
806807
QVariant res = mFilter->evaluate( &feature, fields );
807-
if (mFilter->hasEvalError())
808+
if ( mFilter->hasEvalError() )
808809
{
809810
throw QgsMapServiceException( "RequestNotWellFormed", mFilter->evalErrorString() );
810811
}
@@ -834,7 +835,8 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
834835
{
835836
fidElem = fidNodes.at( f ).toElement();
836837
fid = fidElem.attribute( "fid" );
837-
if ( fid.contains( "." ) ) {
838+
if ( fid.contains( "." ) )
839+
{
838840
if ( fid.section( ".", 0, 0 ) != mTypeName )
839841
continue;
840842
fid = fid.section( ".", 1, 1 );
@@ -856,9 +858,9 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
856858
{
857859
QDomElement bboxElem = filterElem.firstChildElement();
858860
QDomElement childElem = bboxElem.firstChildElement();
859-
while ( !childElem.isNull() )
861+
while ( !childElem.isNull() )
860862
{
861-
if ( childElem.tagName() == "Box" )
863+
if ( childElem.tagName() == "Box" )
862864
{
863865
QgsRectangle* rect = new QgsRectangle( childElem );
864866
provider->select( attrIndexes, *rect, mWithGeom, true );
@@ -882,33 +884,33 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
882884
}
883885
else
884886
{
885-
QgsExpression *mFilter = QgsExpression::createFromOgcFilter( filterElem );
886-
if (mFilter->hasParserError())
887-
{
888-
throw QgsMapServiceException( "RequestNotWellFormed", mFilter->parserErrorString() );
889-
}
890-
if ( mFilter )
887+
QgsExpression *mFilter = QgsExpression::createFromOgcFilter( filterElem );
888+
if ( mFilter->hasParserError() )
889+
{
890+
throw QgsMapServiceException( "RequestNotWellFormed", mFilter->parserErrorString() );
891+
}
892+
if ( mFilter )
893+
{
894+
while ( provider->nextFeature( feature ) && featureCounter < maxFeat )
891895
{
892-
while ( provider->nextFeature( feature ) && featureCounter < maxFeat )
896+
QVariant res = mFilter->evaluate( &feature, fields );
897+
if ( mFilter->hasEvalError() )
893898
{
894-
QVariant res = mFilter->evaluate( &feature, fields );
895-
if (mFilter->hasEvalError())
896-
{
897-
throw QgsMapServiceException( "RequestNotWellFormed", mFilter->evalErrorString() );
898-
}
899-
if ( res.toInt() != 0 )
900-
{
901-
if ( featureCounter == 0 )
902-
startGetFeature( request, format, layerCrs, &searchRect );
899+
throw QgsMapServiceException( "RequestNotWellFormed", mFilter->evalErrorString() );
900+
}
901+
if ( res.toInt() != 0 )
902+
{
903+
if ( featureCounter == 0 )
904+
startGetFeature( request, format, layerCrs, &searchRect );
903905

904-
sendGetFeature( request, format, &feature, featureCounter, layerCrs, fields, layerExcludedAttributes );
905-
++featureCounter;
906-
++featCounter;
907-
}
906+
sendGetFeature( request, format, &feature, featureCounter, layerCrs, fields, layerExcludedAttributes );
907+
++featureCounter;
908+
++featCounter;
908909
}
909910
}
910-
delete mFilter;
911911
}
912+
delete mFilter;
913+
}
912914
}
913915
else
914916
{
@@ -1447,7 +1449,7 @@ QDomDocument QgsWFSServer::transaction( const QString& requestBody )
14471449

14481450
QDomElement mesElem = doc.createElement( "Message" );
14491451
QStringList mesErrors;
1450-
mesErrors << QString( "ERROR: %n feature(s) not added.").arg(inFeatList.size());
1452+
mesErrors << QString( "ERROR: %n feature(s) not added." ).arg( inFeatList.size() );
14511453
if ( provider->hasErrors() )
14521454
{
14531455
mesErrors << "\n Provider errors:" << provider->errors();
@@ -1461,15 +1463,15 @@ QDomDocument QgsWFSServer::transaction( const QString& requestBody )
14611463
// Get the Feature Ids of the inserted feature
14621464
for ( int j = 0; j < inFeatList.size(); j++ )
14631465
{
1464-
insertResults << mTypeName +"."+ QString::number(inFeatList[j].id() );
1466+
insertResults << mTypeName + "." + QString::number( inFeatList[j].id() );
14651467
}
14661468
}
14671469
}
14681470

14691471
// Put the Feature Ids of the inserted feature
14701472
if ( insertResults.size() > 0 )
14711473
{
1472-
foreach (const QString &fidStr, insertResults)
1474+
foreach ( const QString &fidStr, insertResults )
14731475
{
14741476
QDomElement irElem = doc.createElement( "InsertResult" );
14751477
QDomElement fiElem = doc.createElement( "ogc:FeatureId" );
@@ -1514,7 +1516,7 @@ QgsFeatureIds QgsWFSServer::getFeatureIdsFromFilter( QDomElement filterElem, Qgs
15141516
else
15151517
{
15161518
QgsExpression *mFilter = QgsExpression::createFromOgcFilter( filterElem );
1517-
if (mFilter->hasParserError())
1519+
if ( mFilter->hasParserError() )
15181520
{
15191521
throw QgsMapServiceException( "RequestNotWellFormed", mFilter->parserErrorString() );
15201522
}
@@ -1525,7 +1527,7 @@ QgsFeatureIds QgsWFSServer::getFeatureIdsFromFilter( QDomElement filterElem, Qgs
15251527
while ( provider->nextFeature( feature ) )
15261528
{
15271529
QVariant res = mFilter->evaluate( &feature, fields );
1528-
if (mFilter->hasEvalError())
1530+
if ( mFilter->hasEvalError() )
15291531
{
15301532
throw QgsMapServiceException( "RequestNotWellFormed", mFilter->evalErrorString() );
15311533
}
@@ -1545,7 +1547,7 @@ QString QgsWFSServer::createFeatureGeoJSON( QgsFeature* feat, QgsCoordinateRefer
15451547
QString fStr = "{\"type\": \"Feature\",\n";
15461548

15471549
fStr += " \"id\": ";
1548-
fStr += mTypeName +"."+ QString::number( feat->id() );
1550+
fStr += mTypeName + "." + QString::number( feat->id() );
15491551
fStr += ",\n";
15501552

15511553
QgsGeometry* geom = feat->geometry();
@@ -1607,7 +1609,7 @@ QDomElement QgsWFSServer::createFeatureGML2( QgsFeature* feat, QDomDocument& doc
16071609

16081610
//qgs:%TYPENAME%
16091611
QDomElement typeNameElement = doc.createElement( "qgs:" + mTypeName /*qgs:%TYPENAME%*/ );
1610-
typeNameElement.setAttribute( "fid", mTypeName +"."+ QString::number( feat->id() ) );
1612+
typeNameElement.setAttribute( "fid", mTypeName + "." + QString::number( feat->id() ) );
16111613
featureElement.appendChild( typeNameElement );
16121614

16131615
if ( mWithGeom )

‎src/plugins/globe/globe_plugin.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,9 @@ namespace osgEarth
203203
namespace Util
204204
{
205205
#ifdef USE_BACKPORTED_CONTROLS
206-
namespace Controls21
206+
namespace Controls21
207207
#else
208-
namespace Controls
208+
namespace Controls
209209
#endif
210210
{
211211
class NavigationControlHandler : public ControlEventHandler

‎src/providers/postgres/qgspostgresprovider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ class QgsPostgresProvider : public QgsVectorDataProvider
339339
* @param offset specifies offset to use for the pk value parameter
340340
* @param alias specifies an optional alias given to the subject table
341341
*/
342-
QString pkParamWhereClause( int offset, const char* alias=0 ) const;
342+
QString pkParamWhereClause( int offset, const char* alias = 0 ) const;
343343
QString whereClause( QgsFeatureId featureId ) const;
344344

345345
bool hasSufficientPermsAndCapabilities();

‎tests/src/core/testqgsexpression.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -561,10 +561,10 @@ class TestQgsExpression: public QObject
561561
QgsPolygon polygon;
562562
polygon << polygon_ring;
563563

564-
QTest::newRow( "geomFromWKT Point" ) << "geomFromWKT('"+QgsGeometry::fromPoint( point )->exportToWkt()+"')" << ( void* ) QgsGeometry::fromPoint( point ) << false;
565-
QTest::newRow( "geomFromWKT Line" ) << "geomFromWKT('"+QgsGeometry::fromPolyline( line )->exportToWkt()+"')" << ( void* ) QgsGeometry::fromPolyline( line ) << false;
566-
QTest::newRow( "geomFromWKT Polyline" ) << "geomFromWKT('"+QgsGeometry::fromPolyline( polyline )->exportToWkt()+"')" << ( void* ) QgsGeometry::fromPolyline( polyline ) << false;
567-
QTest::newRow( "geomFromWKT Polygon" ) << "geomFromWKT('"+QgsGeometry::fromPolygon( polygon )->exportToWkt()+"')" << ( void* ) QgsGeometry::fromPolygon( polygon ) << false;
564+
QTest::newRow( "geomFromWKT Point" ) << "geomFromWKT('" + QgsGeometry::fromPoint( point )->exportToWkt() + "')" << ( void* ) QgsGeometry::fromPoint( point ) << false;
565+
QTest::newRow( "geomFromWKT Line" ) << "geomFromWKT('" + QgsGeometry::fromPolyline( line )->exportToWkt() + "')" << ( void* ) QgsGeometry::fromPolyline( line ) << false;
566+
QTest::newRow( "geomFromWKT Polyline" ) << "geomFromWKT('" + QgsGeometry::fromPolyline( polyline )->exportToWkt() + "')" << ( void* ) QgsGeometry::fromPolyline( polyline ) << false;
567+
QTest::newRow( "geomFromWKT Polygon" ) << "geomFromWKT('" + QgsGeometry::fromPolygon( polygon )->exportToWkt() + "')" << ( void* ) QgsGeometry::fromPolygon( polygon ) << false;
568568
}
569569

570570
void eval_geometry_constructor()
@@ -668,7 +668,7 @@ class TestQgsExpression: public QObject
668668
QgsPoint point2( 30, 20 );
669669
QgsGeometry* pnt1 = QgsGeometry::fromPoint( point1 );
670670
QgsGeometry* pnt2 = QgsGeometry::fromPoint( point2 );
671-
QTest::newRow( "union" ) << "union( $geometry, geomFromWKT('"+pnt2->exportToWkt()+"') )" << ( void* ) pnt1 << false << true << ( void* ) pnt1->combine( pnt2 );
671+
QTest::newRow( "union" ) << "union( $geometry, geomFromWKT('" + pnt2->exportToWkt() + "') )" << ( void* ) pnt1 << false << true << ( void* ) pnt1->combine( pnt2 );
672672

673673
geom = QgsGeometry::fromPolygon( polygon );
674674
QTest::newRow( "intersection" ) << "intersection( $geometry, geomFromWKT('POLYGON((0 0, 0 10, 10 0, 0 0))') )" << ( void* ) geom << false << true << ( void* ) QgsGeometry::fromWkt( "POLYGON ((0 0,5 5,10 0,0 0))" );

0 commit comments

Comments
 (0)
Please sign in to comment.