Skip to content

Commit cc981cc

Browse files
author
jef
committed
automatic indentation update (r12139-r12177)
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12178 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent b9c6857 commit cc981cc

17 files changed

+557
-557
lines changed

src/app/qgsmeasuredialog.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ QgsMeasureDialog::QgsMeasureDialog( QgsMeasureTool* tool, Qt::WFlags f )
3535
: QDialog( tool->canvas()->topLevelWidget(), f ), mTool( tool )
3636
{
3737
setupUi( this );
38-
38+
3939
QPushButton *nb = new QPushButton( tr( "&New" ) );
4040
buttonBox->addButton( nb, QDialogButtonBox::ActionRole );
4141
connect( nb, SIGNAL( clicked() ), this, SLOT( restart() ) );

src/core/qgsmaplayer.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ class CORE_EXPORT QgsMapLayer : public QObject
7878
*/
7979
QString const & name() const;
8080

81-
/** This is the method that does the actual work of
81+
/** This is the method that does the actual work of
8282
* drawing the layer onto a paint device.
83-
* @param QgsRenderContext - describes the extents,
84-
* resolution etc. that should be used when rendering the
83+
* @param QgsRenderContext - describes the extents,
84+
* resolution etc. that should be used when rendering the
8585
* layer.
8686
*/
8787
virtual bool draw( QgsRenderContext& rendererContext );
@@ -291,9 +291,9 @@ class CORE_EXPORT QgsMapLayer : public QObject
291291
/** Get the QImage used for caching render operations
292292
* @note This method was added in QGIS 1.4 **/
293293
QImage * cacheImage() { return mpCacheImage; }
294-
/** Set the QImage used for caching render operations
294+
/** Set the QImage used for caching render operations
295295
* @note This method was added in QGIS 1.4 **/
296-
void setCacheImage( QImage * thepImage );
296+
void setCacheImage( QImage * thepImage );
297297

298298
public slots:
299299

src/core/qgsmaprenderer.cpp

+24-24
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ void QgsMapRenderer::adjustExtentToSize()
212212

213213
void QgsMapRenderer::render( QPainter* painter )
214214
{
215-
//flag to see if the render context has changed
215+
//flag to see if the render context has changed
216216
//since the last time we rendered. If it hasnt changed we can
217217
//take some shortcuts with rendering
218218
bool mySameAsLastFlag = true;
@@ -285,20 +285,20 @@ void QgsMapRenderer::render( QPainter* painter )
285285
mySameAsLastFlag = false;
286286
}
287287

288-
mRenderContext.setLabelingEngine(mLabelingEngine);
288+
mRenderContext.setLabelingEngine( mLabelingEngine );
289289
if ( mLabelingEngine )
290290
mLabelingEngine->init();
291291

292-
// know we know if this render is just a repeat of the last time, we
292+
// know we know if this render is just a repeat of the last time, we
293293
// can clear caches if it has changed
294294
if ( !mySameAsLastFlag )
295295
{
296-
//clear the cache pixmap if we changed resolution / extent
297-
QSettings mySettings;
298-
if ( mySettings.value ( "/qgis/enable_render_caching", false ).toBool() )
299-
{
300-
QgsMapLayerRegistry::instance()->clearAllLayerCaches();
301-
}
296+
//clear the cache pixmap if we changed resolution / extent
297+
QSettings mySettings;
298+
if ( mySettings.value( "/qgis/enable_render_caching", false ).toBool() )
299+
{
300+
QgsMapLayerRegistry::instance()->clearAllLayerCaches();
301+
}
302302
}
303303

304304
bool placeOverlays = false;
@@ -322,7 +322,7 @@ void QgsMapRenderer::render( QPainter* painter )
322322
break;
323323
}
324324

325-
// Store the painter in case we need to swap it out for the
325+
// Store the painter in case we need to swap it out for the
326326
// cache painter
327327
QPainter * mypContextPainter = mRenderContext.painter();
328328

@@ -422,31 +422,31 @@ void QgsMapRenderer::render( QPainter* painter )
422422
ml->setCacheImage( 0 );
423423
}
424424
}
425-
425+
426426
QSettings mySettings;
427427
if ( ! split )//render caching does not yet cater for split extents
428428
{
429-
if ( mySettings.value ( "/qgis/enable_render_caching", false ).toBool() )
429+
if ( mySettings.value( "/qgis/enable_render_caching", false ).toBool() )
430430
{
431-
if ( !mySameAsLastFlag || ml->cacheImage() == 0 )
431+
if ( !mySameAsLastFlag || ml->cacheImage() == 0 )
432432
{
433433
QgsDebugMsg( "\n\n\nCaching enabled but layer redraw forced by extent change or empty cache\n\n\n" );
434-
QImage * mypImage = new QImage( mRenderContext.painter()->device()->width(),
435-
mRenderContext.painter()->device()->height(), QImage::Format_ARGB32 );
434+
QImage * mypImage = new QImage( mRenderContext.painter()->device()->width(),
435+
mRenderContext.painter()->device()->height(), QImage::Format_ARGB32 );
436436
mypImage->fill( 0 );
437437
ml->setCacheImage( mypImage ); //no need to delete the old one, maplayer does it for you
438438
QPainter * mypPainter = new QPainter( ml->cacheImage() );
439439
if ( mySettings.value( "/qgis/enable_anti_aliasing", false ).toBool() )
440440
{
441441
mypPainter->setRenderHint( QPainter::Antialiasing );
442442
}
443-
mRenderContext.setPainter( mypPainter );
443+
mRenderContext.setPainter( mypPainter );
444444
}
445445
else if ( mySameAsLastFlag )
446446
{
447447
//draw from cached image
448448
QgsDebugMsg( "\n\n\nCaching enabled --- drawing layer from cached image\n\n\n" );
449-
mypContextPainter->drawImage( 0,0, *(ml->cacheImage()) );
449+
mypContextPainter->drawImage( 0, 0, *( ml->cacheImage() ) );
450450
disconnect( ml, SIGNAL( drawingProgress( int, int ) ), this, SLOT( onDrawingProgress( int, int ) ) );
451451
//short circuit as there is nothing else to do...
452452
continue;
@@ -472,7 +472,7 @@ void QgsMapRenderer::render( QPainter* painter )
472472
}
473473
else
474474
{
475-
QgsDebugMsg( "\n\n\nLayer rendered without issues\n\n\n" );
475+
QgsDebugMsg( "\n\n\nLayer rendered without issues\n\n\n" );
476476
}
477477
if ( split )
478478
{
@@ -489,24 +489,24 @@ void QgsMapRenderer::render( QPainter* painter )
489489
mRenderContext.painter()->restore();
490490
}
491491

492-
if ( mySettings.value ( "/qgis/enable_render_caching", false ).toBool() )
492+
if ( mySettings.value( "/qgis/enable_render_caching", false ).toBool() )
493493
{
494494
if ( !split )
495495
{
496496
// composite the cached image into our view and then clean up from caching
497497
// by reinstating the painter as it was swapped out for caching renders
498498
delete mRenderContext.painter();
499-
mRenderContext.setPainter( mypContextPainter );
499+
mRenderContext.setPainter( mypContextPainter );
500500
//draw from cached image that we created further up
501-
mypContextPainter->drawImage( 0,0, *(ml->cacheImage()) );
501+
mypContextPainter->drawImage( 0, 0, *( ml->cacheImage() ) );
502502
}
503503
}
504504
disconnect( ml, SIGNAL( drawingProgress( int, int ) ), this, SLOT( onDrawingProgress( int, int ) ) );
505505
}
506506
else // layer not visible due to scale
507507
{
508508
QgsDebugMsg( "Layer not rendered because it is not within the defined "
509-
"visibility scale range" );
509+
"visibility scale range" );
510510
}
511511

512512
} // while (li.hasPrevious())
@@ -1055,9 +1055,9 @@ bool QgsMapRenderer::writeXML( QDomNode & theNode, QDomDocument & theDoc )
10551055
return true;
10561056
}
10571057

1058-
void QgsMapRenderer::setLabelingEngine(QgsLabelingEngineInterface* iface)
1058+
void QgsMapRenderer::setLabelingEngine( QgsLabelingEngineInterface* iface )
10591059
{
1060-
if (mLabelingEngine)
1060+
if ( mLabelingEngine )
10611061
delete mLabelingEngine;
10621062

10631063
mLabelingEngine = iface;

src/core/qgsmaprenderer.h

+15-15
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,19 @@ class QgsFeature;
4242
*/
4343
class QgsLabelingEngineInterface
4444
{
45-
public:
46-
virtual ~QgsLabelingEngineInterface() {}
47-
48-
//! called when we're going to start with rendering
49-
virtual void init() = 0;
50-
//! called when starting rendering of a layer
51-
virtual int prepareLayer(QgsVectorLayer* layer, int& attrIndex) = 0;
52-
//! called for every feature
53-
virtual void registerFeature( QgsVectorLayer* layer, QgsFeature& feat ) = 0;
54-
//! called when the map is drawn and labels should be placed
55-
virtual void drawLabeling( QgsRenderContext& context ) = 0;
56-
//! called when we're done with rendering
57-
virtual void exit() = 0;
45+
public:
46+
virtual ~QgsLabelingEngineInterface() {}
47+
48+
//! called when we're going to start with rendering
49+
virtual void init() = 0;
50+
//! called when starting rendering of a layer
51+
virtual int prepareLayer( QgsVectorLayer* layer, int& attrIndex ) = 0;
52+
//! called for every feature
53+
virtual void registerFeature( QgsVectorLayer* layer, QgsFeature& feat ) = 0;
54+
//! called when the map is drawn and labels should be placed
55+
virtual void drawLabeling( QgsRenderContext& context ) = 0;
56+
//! called when we're done with rendering
57+
virtual void exit() = 0;
5858

5959
};
6060

@@ -178,7 +178,7 @@ class CORE_EXPORT QgsMapRenderer : public QObject
178178
//! Set labeling engine. Previous engine (if any) is deleted.
179179
//! Takes ownership of the engine.
180180
//! Added in QGIS v1.4
181-
void setLabelingEngine(QgsLabelingEngineInterface* iface);
181+
void setLabelingEngine( QgsLabelingEngineInterface* iface );
182182

183183
signals:
184184

@@ -234,7 +234,7 @@ class CORE_EXPORT QgsMapRenderer : public QObject
234234
//! current extent to be drawn
235235
QgsRectangle mExtent;
236236
//
237-
/** Last extent to we drew so we know if we can
237+
/** Last extent to we drew so we know if we can
238238
used layer render caching or not. Note there are no
239239
accessors for this as it is intended to internal
240240
use only.

src/core/qgsrendercontext.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "qgsrendercontext.h"
2020

2121
QgsRenderContext::QgsRenderContext()
22-
: mPainter( 0 ),
22+
: mPainter( 0 ),
2323
mCoordTransform( 0 ),
2424
mDrawEditingInformation( false ),
2525
mForceVectorOutput( true ),

src/core/qgsrendercontext.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class CORE_EXPORT QgsRenderContext
7676
void setRendererScale( double scale ) {mRendererScale = scale;}
7777
void setPainter( QPainter* p ) {mPainter = p;}
7878
//! Added in QGIS v1.4
79-
void setLabelingEngine(QgsLabelingEngineInterface* iface) { mLabelingEngine = iface; }
79+
void setLabelingEngine( QgsLabelingEngineInterface* iface ) { mLabelingEngine = iface; }
8080

8181
private:
8282

src/core/symbology-ng/qgsfillsymbollayerv2.cpp

+36-36
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,33 @@
66

77
#include <QPainter>
88

9-
QgsSimpleFillSymbolLayerV2::QgsSimpleFillSymbolLayerV2(QColor color, Qt::BrushStyle style, QColor borderColor, Qt::PenStyle borderStyle, double borderWidth)
10-
: mBrushStyle(style), mBorderColor(borderColor), mBorderStyle(borderStyle), mBorderWidth(borderWidth)
9+
QgsSimpleFillSymbolLayerV2::QgsSimpleFillSymbolLayerV2( QColor color, Qt::BrushStyle style, QColor borderColor, Qt::PenStyle borderStyle, double borderWidth )
10+
: mBrushStyle( style ), mBorderColor( borderColor ), mBorderStyle( borderStyle ), mBorderWidth( borderWidth )
1111
{
1212
mColor = color;
1313
}
1414

1515

16-
QgsSymbolLayerV2* QgsSimpleFillSymbolLayerV2::create(const QgsStringMap& props)
16+
QgsSymbolLayerV2* QgsSimpleFillSymbolLayerV2::create( const QgsStringMap& props )
1717
{
1818
QColor color = DEFAULT_SIMPLEFILL_COLOR;
1919
Qt::BrushStyle style = DEFAULT_SIMPLEFILL_STYLE;
2020
QColor borderColor = DEFAULT_SIMPLEFILL_BORDERCOLOR;
2121
Qt::PenStyle borderStyle = DEFAULT_SIMPLEFILL_BORDERSTYLE;
2222
double borderWidth = DEFAULT_SIMPLEFILL_BORDERWIDTH;
2323

24-
if (props.contains("color"))
25-
color = QgsSymbolLayerV2Utils::decodeColor(props["color"]);
26-
if (props.contains("style"))
27-
style = QgsSymbolLayerV2Utils::decodeBrushStyle(props["style"]);
28-
if (props.contains("color_border"))
29-
borderColor = QgsSymbolLayerV2Utils::decodeColor(props["color_border"]);
30-
if (props.contains("style_border"))
31-
borderStyle = QgsSymbolLayerV2Utils::decodePenStyle(props["style_border"]);
32-
if (props.contains("width_border"))
24+
if ( props.contains( "color" ) )
25+
color = QgsSymbolLayerV2Utils::decodeColor( props["color"] );
26+
if ( props.contains( "style" ) )
27+
style = QgsSymbolLayerV2Utils::decodeBrushStyle( props["style"] );
28+
if ( props.contains( "color_border" ) )
29+
borderColor = QgsSymbolLayerV2Utils::decodeColor( props["color_border"] );
30+
if ( props.contains( "style_border" ) )
31+
borderStyle = QgsSymbolLayerV2Utils::decodePenStyle( props["style_border"] );
32+
if ( props.contains( "width_border" ) )
3333
borderWidth = props["width_border"].toDouble();
3434

35-
return new QgsSimpleFillSymbolLayerV2(color, style, borderColor, borderStyle, borderWidth);
35+
return new QgsSimpleFillSymbolLayerV2( color, style, borderColor, borderStyle, borderWidth );
3636
}
3737

3838

@@ -41,54 +41,54 @@ QString QgsSimpleFillSymbolLayerV2::layerType() const
4141
return "SimpleFill";
4242
}
4343

44-
void QgsSimpleFillSymbolLayerV2::startRender(QgsRenderContext& context)
44+
void QgsSimpleFillSymbolLayerV2::startRender( QgsRenderContext& context )
4545
{
46-
mBrush = QBrush(mColor, mBrushStyle);
47-
mPen = QPen(mBorderColor);
48-
mPen.setStyle(mBorderStyle);
49-
mPen.setWidthF(mBorderWidth);
46+
mBrush = QBrush( mColor, mBrushStyle );
47+
mPen = QPen( mBorderColor );
48+
mPen.setStyle( mBorderStyle );
49+
mPen.setWidthF( mBorderWidth );
5050
}
5151

52-
void QgsSimpleFillSymbolLayerV2::stopRender(QgsRenderContext& context)
52+
void QgsSimpleFillSymbolLayerV2::stopRender( QgsRenderContext& context )
5353
{
5454
}
5555

56-
void QgsSimpleFillSymbolLayerV2::renderPolygon(const QPolygonF& points, QList<QPolygonF>* rings, QgsRenderContext& context)
56+
void QgsSimpleFillSymbolLayerV2::renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsRenderContext& context )
5757
{
5858
QPainter* p = context.painter();
59-
p->setBrush(mBrush);
60-
p->setPen(mPen);
61-
62-
if (rings == NULL)
59+
p->setBrush( mBrush );
60+
p->setPen( mPen );
61+
62+
if ( rings == NULL )
6363
{
6464
// simple polygon without holes
65-
p->drawPolygon(points);
65+
p->drawPolygon( points );
6666
}
6767
else
6868
{
6969
// polygon with holes must be drawn using painter path
7070
QPainterPath path;
71-
path.addPolygon(points);
71+
path.addPolygon( points );
7272
QList<QPolygonF>::iterator it;
73-
for (it = rings->begin(); it != rings->end(); ++it)
74-
path.addPolygon(*it);
75-
76-
p->drawPath(path);
73+
for ( it = rings->begin(); it != rings->end(); ++it )
74+
path.addPolygon( *it );
75+
76+
p->drawPath( path );
7777
}
7878
}
7979

8080
QgsStringMap QgsSimpleFillSymbolLayerV2::properties() const
8181
{
8282
QgsStringMap map;
83-
map["color"] = QgsSymbolLayerV2Utils::encodeColor(mColor);
84-
map["style"] = QgsSymbolLayerV2Utils::encodeBrushStyle(mBrushStyle);
85-
map["color_border"] = QgsSymbolLayerV2Utils::encodeColor(mBorderColor);
86-
map["style_border"] = QgsSymbolLayerV2Utils::encodePenStyle(mBorderStyle);
87-
map["width_border"] = QString::number(mBorderWidth);
83+
map["color"] = QgsSymbolLayerV2Utils::encodeColor( mColor );
84+
map["style"] = QgsSymbolLayerV2Utils::encodeBrushStyle( mBrushStyle );
85+
map["color_border"] = QgsSymbolLayerV2Utils::encodeColor( mBorderColor );
86+
map["style_border"] = QgsSymbolLayerV2Utils::encodePenStyle( mBorderStyle );
87+
map["width_border"] = QString::number( mBorderWidth );
8888
return map;
8989
}
9090

9191
QgsSymbolLayerV2* QgsSimpleFillSymbolLayerV2::clone() const
9292
{
93-
return new QgsSimpleFillSymbolLayerV2(mColor, mBrushStyle, mBorderColor, mBorderStyle, mBorderWidth);
93+
return new QgsSimpleFillSymbolLayerV2( mColor, mBrushStyle, mBorderColor, mBorderStyle, mBorderWidth );
9494
}

src/core/symbology-ng/qgsfillsymbollayerv2.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class CORE_EXPORT QgsSimpleFillSymbolLayerV2 : public QgsFillSymbolLayerV2
2121
QColor borderColor = DEFAULT_SIMPLEFILL_BORDERCOLOR,
2222
Qt::PenStyle borderStyle = DEFAULT_SIMPLEFILL_BORDERSTYLE,
2323
double borderWidth = DEFAULT_SIMPLEFILL_BORDERWIDTH );
24-
24+
2525
// static stuff
2626

2727
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );

src/core/symbology-ng/qgslinesymbollayerv2.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ QgsSymbolLayerV2* QgsSimpleLineSymbolLayerV2::clone() const
101101
class MyLine
102102
{
103103
public:
104-
MyLine( QPointF p1, QPointF p2 ) : mVertical(false), mIncreasing(false), mT(0.0), mLength(0.0)
104+
MyLine( QPointF p1, QPointF p2 ) : mVertical( false ), mIncreasing( false ), mT( 0.0 ), mLength( 0.0 )
105105
{
106106
if ( p1 == p2 )
107107
return; // invalid
@@ -356,7 +356,7 @@ static double _calculateAngle( double x1, double y1, double x2, double y2 )
356356
{
357357
// return angle (in radians) between two points
358358
if ( x1 == x2 )
359-
return M_PI * ( y2 >= y1 ? 1 / 2 : 3 / 2 ); // angle is 90 or 270
359+
return M_PI *( y2 >= y1 ? 1 / 2 : 3 / 2 ); // angle is 90 or 270
360360

361361
double t = ( y2 - y1 ) / ( x2 - x1 );
362362
if ( t >= 0 )

0 commit comments

Comments
 (0)