Skip to content

Commit d5512a9

Browse files
committedMay 29, 2016
Change QgsRectangle::combineExtentWith(const QgsRectangle*) into QgsRectangle::combineExtentWith(const QgsRectangle&)
1 parent d5f8255 commit d5512a9

20 files changed

+33
-33
lines changed
 

‎python/core/qgsrectangle.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class QgsRectangle
7474
//! return true when rectangle contains a point
7575
bool contains( const QgsPoint &p ) const;
7676
//! expand the rectangle so that covers both the original rectangle and the given rectangle
77-
void combineExtentWith( const QgsRectangle *rect );
77+
void combineExtentWith( const QgsRectangle& rect );
7878
//! expand the rectangle so that covers both the original rectangle and the given point
7979
void combineExtentWith( double x, double y );
8080
//! test if rectangle is empty.

‎src/core/dxf/qgsdxfexport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3706,7 +3706,7 @@ QgsRectangle QgsDxfExport::dxfExtent() const
37063706
else
37073707
{
37083708
QgsRectangle layerExtent = layerIt->first->extent();
3709-
extent.combineExtentWith( &layerExtent );
3709+
extent.combineExtentWith( layerExtent );
37103710
}
37113711
}
37123712
}

‎src/core/geometry/qgscircularstringv2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ QgsRectangle QgsCircularStringV2::calculateBoundingBox() const
7878
else
7979
{
8080
QgsRectangle segmentBox = segmentBoundingBox( QgsPointV2( mX[i], mY[i] ), QgsPointV2( mX[i + 1], mY[i + 1] ), QgsPointV2( mX[i + 2], mY[i + 2] ) );
81-
bbox.combineExtentWith( &segmentBox );
81+
bbox.combineExtentWith( segmentBox );
8282
}
8383
}
8484

‎src/core/geometry/qgscompoundcurvev2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ QgsRectangle QgsCompoundCurveV2::calculateBoundingBox() const
9595
for ( int i = 1; i < mCurves.size(); ++i )
9696
{
9797
QgsRectangle curveBox = mCurves.at( i )->boundingBox();
98-
bbox.combineExtentWith( &curveBox );
98+
bbox.combineExtentWith( curveBox );
9999
}
100100
return bbox;
101101
}

‎src/core/geometry/qgsgeometrycollectionv2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ QgsRectangle QgsGeometryCollectionV2::calculateBoundingBox() const
336336
for ( int i = 1; i < mGeometries.size(); ++i )
337337
{
338338
QgsRectangle geomBox = mGeometries.at( i )->boundingBox();
339-
bbox.combineExtentWith( &geomBox );
339+
bbox.combineExtentWith( geomBox );
340340
}
341341
return bbox;
342342
}

‎src/core/qgsrectangle.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,14 @@ bool QgsRectangle::contains( const QgsPoint &p ) const
194194
ymin <= p.y() && p.y() <= ymax;
195195
}
196196

197-
void QgsRectangle::combineExtentWith( const QgsRectangle * rect )
197+
void QgsRectangle::combineExtentWith( const QgsRectangle &rect )
198198
{
199199

200-
xmin = (( xmin < rect->xMinimum() ) ? xmin : rect->xMinimum() );
201-
xmax = (( xmax > rect->xMaximum() ) ? xmax : rect->xMaximum() );
200+
xmin = (( xmin < rect.xMinimum() ) ? xmin : rect.xMinimum() );
201+
xmax = (( xmax > rect.xMaximum() ) ? xmax : rect.xMaximum() );
202202

203-
ymin = (( ymin < rect->yMinimum() ) ? ymin : rect->yMinimum() );
204-
ymax = (( ymax > rect->yMaximum() ) ? ymax : rect->yMaximum() );
203+
ymin = (( ymin < rect.yMinimum() ) ? ymin : rect.yMinimum() );
204+
ymax = (( ymax > rect.yMaximum() ) ? ymax : rect.yMaximum() );
205205

206206
}
207207

‎src/core/qgsrectangle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class CORE_EXPORT QgsRectangle
9797
//! return true when rectangle contains a point
9898
bool contains( const QgsPoint &p ) const;
9999
//! expand the rectangle so that covers both the original rectangle and the given rectangle
100-
void combineExtentWith( const QgsRectangle *rect );
100+
void combineExtentWith( const QgsRectangle& rect );
101101
//! expand the rectangle so that covers both the original rectangle and the given point
102102
void combineExtentWith( double x, double y );
103103
//! test if rectangle is empty.

‎src/core/qgsvectorlayer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ QgsRectangle QgsVectorLayer::boundingBoxOfSelected()
716716
if ( !fet.constGeometry() || fet.constGeometry()->isEmpty() )
717717
continue;
718718
r = fet.constGeometry()->boundingBox();
719-
retval.combineExtentWith( &r );
719+
retval.combineExtentWith( r );
720720
}
721721
}
722722
else
@@ -731,7 +731,7 @@ QgsRectangle QgsVectorLayer::boundingBoxOfSelected()
731731
if ( fet.constGeometry() )
732732
{
733733
r = fet.constGeometry()->boundingBox();
734-
retval.combineExtentWith( &r );
734+
retval.combineExtentWith( r );
735735
}
736736
}
737737
}
@@ -999,7 +999,7 @@ QgsRectangle QgsVectorLayer::extent()
999999
if ( mDataProvider->featureCount() != 0 )
10001000
{
10011001
QgsRectangle r = mDataProvider->extent();
1002-
rect.combineExtentWith( &r );
1002+
rect.combineExtentWith( r );
10031003
}
10041004

10051005
if ( mEditBuffer )
@@ -1009,7 +1009,7 @@ QgsRectangle QgsVectorLayer::extent()
10091009
if ( it->constGeometry() )
10101010
{
10111011
QgsRectangle r = it->constGeometry()->boundingBox();
1012-
rect.combineExtentWith( &r );
1012+
rect.combineExtentWith( r );
10131013
}
10141014
}
10151015
}
@@ -1025,7 +1025,7 @@ QgsRectangle QgsVectorLayer::extent()
10251025
if ( fet.constGeometry() && fet.constGeometry()->type() != QGis::UnknownGeometry )
10261026
{
10271027
QgsRectangle bb = fet.constGeometry()->boundingBox();
1028-
rect.combineExtentWith( &bb );
1028+
rect.combineExtentWith( bb );
10291029
}
10301030
}
10311031
}

‎src/gui/editorwidgets/qgsrelationreferencewidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ void QgsRelationReferenceWidget::highlightFeature( QgsFeature f, CanvasExtent ca
617617
QgsRectangle extent = mCanvas->extent();
618618
if ( !extent.contains( featBBox ) )
619619
{
620-
extent.combineExtentWith( &featBBox );
620+
extent.combineExtentWith( featBBox );
621621
extent.scale( 1.1 );
622622
mCanvas->setExtent( extent );
623623
mCanvas->refresh();

‎src/gui/layertree/qgslayertreeviewdefaultactions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ void QgsLayerTreeViewDefaultActions::zoomToLayers( QgsMapCanvas* canvas, const Q
242242
if ( canvas->hasCrsTransformEnabled() )
243243
layerExtent = canvas->mapSettings().layerExtentToOutputExtent( layer, layerExtent );
244244

245-
extent.combineExtentWith( &layerExtent );
245+
extent.combineExtentWith( layerExtent );
246246
}
247247

248248
if ( extent.isNull() )

‎src/gui/qgsmapcanvas.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ void QgsMapCanvas::zoomToFeatureIds( QgsVectorLayer* layer, const QgsFeatureIds&
11661166
return;
11671167
}
11681168
QgsRectangle r = mapSettings().layerExtentToOutputExtent( layer, geom->boundingBox() );
1169-
rect.combineExtentWith( &r );
1169+
rect.combineExtentWith( r );
11701170
featureCount++;
11711171
}
11721172

‎src/gui/qgsrubberband.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ void QgsRubberBand::updateRect()
558558
}
559559
else
560560
{
561-
r.combineExtentWith( &rect );
561+
r.combineExtentWith( rect );
562562
}
563563
}
564564
}

‎src/plugins/globe/globe_plugin.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ void GlobePlugin::refreshQGISMapLayer( QgsRectangle rect )
772772
rect = mLayerExtents.values().front();
773773
foreach ( const QgsRectangle& extent, mLayerExtents.values() )
774774
{
775-
rect.combineExtentWith( &extent );
775+
rect.combineExtentWith( extent );
776776
}
777777
}
778778
mOsgViewer->getDatabasePager()->clear();
@@ -903,7 +903,7 @@ void GlobePlugin::updateLayers()
903903
QgsRectangle fullExtent = mLayerExtents.isEmpty() ? QgsRectangle() : mLayerExtents.values().front();
904904
foreach ( const QgsRectangle& rect, mLayerExtents.values() )
905905
{
906-
fullExtent.combineExtentWith( &rect );
906+
fullExtent.combineExtentWith( rect );
907907
}
908908
mLayerExtents.clear();
909909

@@ -958,7 +958,7 @@ void GlobePlugin::updateLayers()
958958
}
959959
else
960960
{
961-
fullExtent.combineExtentWith( &extent );
961+
fullExtent.combineExtentWith( extent );
962962
}
963963
}
964964
}
@@ -1034,7 +1034,7 @@ void GlobePlugin::layerChanged( QgsMapLayer* mapLayer )
10341034
QgsRectangle updateExtent = layerExtent;
10351035
if ( mLayerExtents.contains( mapLayer->id() ) )
10361036
{
1037-
updateExtent.combineExtentWith( &mLayerExtents[mapLayer->id()] );
1037+
updateExtent.combineExtentWith( mLayerExtents[mapLayer->id()] );
10381038
}
10391039
mLayerExtents[mapLayer->id()] = layerExtent;
10401040
refreshQGISMapLayer( updateExtent );

‎src/plugins/interpolation/qgsinterpolationdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ QgsRectangle QgsInterpolationDialog::boundingBoxOfLayers()
458458
}
459459
else
460460
{
461-
combinedLayerExtent.combineExtentWith( &currentLayerExtent );
461+
combinedLayerExtent.combineExtentWith( currentLayerExtent );
462462
}
463463
}
464464
return combinedLayerExtent;

‎src/plugins/topology/topolTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ ErrorList topolTest::checkOverlapWithLayer( double tolerance, QgsVectorLayer* la
11711171
{
11721172
QgsRectangle r = bb;
11731173
QgsRectangle r2 = g2->boundingBox();
1174-
r.combineExtentWith( &r2 );
1174+
r.combineExtentWith( r2 );
11751175

11761176
QScopedPointer<QgsGeometry> conflictGeom( g1->intersection( g2 ) );
11771177
// could this for some reason return NULL?

‎src/providers/delimitedtext/qgsdelimitedtextprovider.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ void QgsDelimitedTextProvider::scanFile( bool buildIndexes )
474474
mNumberFeatures++;
475475
if ( geom->isMultipart() ) mWkbType = type;
476476
QgsRectangle bbox( geom->boundingBox() );
477-
mExtent.combineExtentWith( &bbox );
477+
mExtent.combineExtentWith( bbox );
478478
}
479479
if ( buildSpatialIndex )
480480
{
@@ -797,7 +797,7 @@ void QgsDelimitedTextProvider::rescanFile()
797797
else
798798
{
799799
QgsRectangle bbox( f.constGeometry()->boundingBox() );
800-
mExtent.combineExtentWith( &bbox );
800+
mExtent.combineExtentWith( bbox );
801801
}
802802
if ( buildSpatialIndex ) mSpatialIndex->insertFeature( f );
803803
}

‎src/providers/wms/qgswmsprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,7 @@ bool QgsWmsProvider::calculateExtent()
12561256
}
12571257
else
12581258
{
1259-
mLayerExtent.combineExtentWith( &extent );
1259+
mLayerExtent.combineExtentWith( extent );
12601260
}
12611261

12621262
firstLayer = false;

‎src/server/qgsserverprojectparser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ void QgsServerProjectParser::combineExtentAndCrsOfGroupChildren( QDomElement& gr
725725
}
726726
else
727727
{
728-
combinedBBox.combineExtentWith( &bbox );
728+
combinedBBox.combineExtentWith( bbox );
729729
}
730730
}
731731

‎src/server/qgswmsprojectparser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1707,7 +1707,7 @@ void QgsWMSProjectParser::addOWSLayers( QDomDocument &doc,
17071707
}
17081708
else
17091709
{
1710-
combinedBBox.combineExtentWith( &BBox );
1710+
combinedBBox.combineExtentWith( BBox );
17111711
}
17121712

17131713
addOWSLayerStyles( currentLayer, doc, layerElem );

‎src/server/qgswmsserver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2260,7 +2260,7 @@ int QgsWMSServer::featureInfoFromVectorLayer( QgsVectorLayer* layer,
22602260
}
22612261
else
22622262
{
2263-
featureBBox->combineExtentWith( &box );
2263+
featureBBox->combineExtentWith( box );
22642264
}
22652265
}
22662266
}
@@ -2600,7 +2600,7 @@ void QgsWMSServer::applyRequestedLayerFilters( const QStringList& layerList , QH
26002600
}
26012601
else
26022602
{
2603-
filterExtent.combineExtentWith( &layerExtent );
2603+
filterExtent.combineExtentWith( layerExtent );
26042604
}
26052605
}
26062606
mMapRenderer->setExtent( filterExtent );

0 commit comments

Comments
 (0)
Please sign in to comment.