Skip to content

Commit

Permalink
Replace deprecated qSwap with std::swap
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 7, 2017
1 parent 337dabe commit 8408777
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/core/geometry/qgsgeometryutils.cpp
Expand Up @@ -359,7 +359,7 @@ QList<QgsGeometryUtils::SelfIntersection> QgsGeometryUtils::getSelfIntersections
s.segment2 = k;
if ( s.segment1 > s.segment2 )
{
qSwap( s.segment1, s.segment2 );
std::swap( s.segment1, s.segment2 );
}
s.point = inter;
intersections.append( s );
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsstringutils.cpp
Expand Up @@ -115,8 +115,8 @@ int QgsStringUtils::levenshteinDistance( const QString& string1, const QString&
//ensure the inner loop is longer
if ( length1 > length2 )
{
qSwap( s1, s2 );
qSwap( length1, length2 );
std::swap( s1, s2 );
std::swap( length1, length2 );
}

//levenshtein algorithm begins here
Expand Down Expand Up @@ -198,7 +198,7 @@ QString QgsStringUtils::longestCommonSubstring( const QString& string1, const QS
}
s2Char++;
}
qSwap( currentScores, previousScores );
std::swap( currentScores, previousScores );
s1Char++;
s2Char = s2Start;
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/symbology-ng/qgscategorizedsymbolrenderer.cpp
Expand Up @@ -64,9 +64,9 @@ QgsRendererCategory& QgsRendererCategory::operator=( QgsRendererCategory cat )

void QgsRendererCategory::swap( QgsRendererCategory & cat )
{
qSwap( mValue, cat.mValue );
qSwap( mSymbol, cat.mSymbol );
qSwap( mLabel, cat.mLabel );
std::swap( mValue, cat.mValue );
std::swap( mSymbol, cat.mSymbol );
std::swap( mLabel, cat.mLabel );
}

QVariant QgsRendererCategory::value() const
Expand Down
6 changes: 3 additions & 3 deletions src/core/symbology-ng/qgsgraduatedsymbolrenderer.cpp
Expand Up @@ -81,9 +81,9 @@ bool QgsRendererRange::operator<( const QgsRendererRange &other ) const

void QgsRendererRange::swap( QgsRendererRange & other )
{
qSwap( mLowerValue, other.mLowerValue );
qSwap( mUpperValue, other.mUpperValue );
qSwap( mSymbol, other.mSymbol );
std::swap( mLowerValue, other.mLowerValue );
std::swap( mUpperValue, other.mUpperValue );
std::swap( mSymbol, other.mSymbol );
std::swap( mLabel, other.mLabel );
}

Expand Down
4 changes: 2 additions & 2 deletions src/gui/raster/qwt5_histogram_item.cpp
Expand Up @@ -197,7 +197,7 @@ void HistogramItem::draw( QPainter *painter, const QwtScaleMap &xMap,
int y1 = yMap.transform( iData.interval( i ).minValue() );
int y2 = yMap.transform( iData.interval( i ).maxValue() );
if ( y1 > y2 )
qSwap( y1, y2 );
std::swap( y1, y2 );

if ( i < ( int )iData.size() - 2 )
{
Expand Down Expand Up @@ -229,7 +229,7 @@ void HistogramItem::draw( QPainter *painter, const QwtScaleMap &xMap,
int x1 = xMap.transform( iData.interval( i ).minValue() );
int x2 = xMap.transform( iData.interval( i ).maxValue() );
if ( x1 > x2 )
qSwap( x1, x2 );
std::swap( x1, x2 );

if ( i < ( int )iData.size() - 2 )
{
Expand Down
Expand Up @@ -103,7 +103,7 @@ namespace QgsGeometryCheckerUtils
double lambdaq2 = QgsVector( q2.x() - p1.x(), q2.y() - p1.y() ) * d;
if ( lambdaq1 > lambdaq2 )
{
qSwap( lambdaq1, lambdaq2 );
std::swap( lambdaq1, lambdaq2 );
}
double lambda1 = qMax( lambdaq1, lambdap1 );
double lambda2 = qMin( lambdaq2, lambdap2 );
Expand Down

0 comments on commit 8408777

Please sign in to comment.