Skip to content

Commit f98fd33

Browse files
committed
Fix fill ring tool used with advanced digitising crashes QGIS
(fix #13355) (cherry-picked from aa4d65d)
1 parent a1479a7 commit f98fd33

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

src/app/qgsmaptoolfillring.cpp

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -122,25 +122,14 @@ void QgsMapToolFillRing::canvasMapReleaseEvent( QgsMapMouseEvent * e )
122122
yMin = std::numeric_limits<double>::max();
123123
yMax = -std::numeric_limits<double>::max();
124124

125-
for ( QList<QgsPoint>::const_iterator it = points().constBegin(); it != points().constEnd(); ++it )
125+
Q_FOREACH ( const QgsPoint& point, points() )
126126
{
127-
if ( it->x() < xMin )
128-
{
129-
xMin = it->x();
130-
}
131-
if ( it->x() > xMax )
132-
{
133-
xMax = it->x();
134-
}
135-
if ( it->y() < yMin )
136-
{
137-
yMin = it->y();
138-
}
139-
if ( it->y() > yMax )
140-
{
141-
yMax = it->y();
142-
}
127+
xMin = qMin( xMin, point.x() );
128+
xMax = qMax( xMax, point.x() );
129+
yMin = qMin( yMin, point.y() );
130+
yMax = qMax( yMax, point.y() );
143131
}
132+
144133
bBox.setXMinimum( xMin );
145134
bBox.setYMinimum( yMin );
146135
bBox.setXMaximum( xMax );

0 commit comments

Comments
 (0)