Skip to content
Permalink
Browse files

Replace deprecated qSwap with std::swap

  • Loading branch information
nyalldawson committed Feb 7, 2017
1 parent 337dabe commit 8408777448cf473dfbcfb9808cfd3f0daf30b219
@@ -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 );
@@ -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
@@ -198,7 +198,7 @@ QString QgsStringUtils::longestCommonSubstring( const QString& string1, const QS
}
s2Char++;
}
qSwap( currentScores, previousScores );
std::swap( currentScores, previousScores );
s1Char++;
s2Char = s2Start;
}
@@ -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
@@ -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 );
}

@@ -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 )
{
@@ -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 )
{
@@ -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 );

0 comments on commit 8408777

Please sign in to comment.
You can’t perform that action at this time.