Skip to content
Permalink
Browse files

always cast to string first

  • Loading branch information
3nids committed Jan 4, 2021
1 parent e97927f commit 849fae32042dbd2050afee3183f2364bf533d6df
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/core/symbology/qgssymbollayerutils.cpp
@@ -4577,14 +4577,14 @@ void QgsSymbolLayerUtils::applyScaleDependency( QDomDocument &doc, QDomElement &
if ( !props.value( QStringLiteral( "scaleMinDenom" ), QString() ).toString().isEmpty() )
{
QDomElement scaleMinDenomElem = doc.createElement( QStringLiteral( "se:MinScaleDenominator" ) );
scaleMinDenomElem.appendChild( doc.createTextNode( qgsDoubleToString( props.value( QStringLiteral( "scaleMinDenom" ) ).toDouble() ) ) );
scaleMinDenomElem.appendChild( doc.createTextNode( qgsDoubleToString( props.value( QStringLiteral( "scaleMinDenom" ) ).toString().toDouble() ) ) );
ruleElem.appendChild( scaleMinDenomElem );
}

if ( !props.value( QStringLiteral( "scaleMaxDenom" ), QString() ).toString().isEmpty() )
{
QDomElement scaleMaxDenomElem = doc.createElement( QStringLiteral( "se:MaxScaleDenominator" ) );
scaleMaxDenomElem.appendChild( doc.createTextNode( qgsDoubleToString( props.value( QStringLiteral( "scaleMaxDenom" ) ).toDouble() ) ) );
scaleMaxDenomElem.appendChild( doc.createTextNode( qgsDoubleToString( props.value( QStringLiteral( "scaleMaxDenom" ) ).toString().toDouble() ) ) );
ruleElem.appendChild( scaleMaxDenomElem );
}
}
@@ -4594,7 +4594,7 @@ void QgsSymbolLayerUtils::mergeScaleDependencies( double mScaleMinDenom, double
if ( !qgsDoubleNear( mScaleMinDenom, 0 ) )
{
bool ok;
double parentScaleMinDenom = props.value( QStringLiteral( "scaleMinDenom" ), QStringLiteral( "0" ) ).toDouble( &ok );
double parentScaleMinDenom = props.value( QStringLiteral( "scaleMinDenom" ), QStringLiteral( "0" ) ).toString().toDouble( &ok );
if ( !ok || parentScaleMinDenom <= 0 )
props[ QStringLiteral( "scaleMinDenom" )] = QString::number( mScaleMinDenom );
else
@@ -4604,7 +4604,7 @@ void QgsSymbolLayerUtils::mergeScaleDependencies( double mScaleMinDenom, double
if ( !qgsDoubleNear( mScaleMaxDenom, 0 ) )
{
bool ok;
double parentScaleMaxDenom = props.value( QStringLiteral( "scaleMaxDenom" ), QStringLiteral( "0" ) ).toDouble( &ok );
double parentScaleMaxDenom = props.value( QStringLiteral( "scaleMaxDenom" ), QStringLiteral( "0" ) ).toString().toDouble( &ok );
if ( !ok || parentScaleMaxDenom <= 0 )
props[ QStringLiteral( "scaleMaxDenom" )] = QString::number( mScaleMaxDenom );
else

0 comments on commit 849fae3

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