Skip to content

Commit

Permalink
migrate old renderer ranges (followup fcfafa0)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Sep 28, 2014
1 parent fcfafa0 commit 1f1fe88
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
Expand Up @@ -34,7 +34,10 @@
#include <ctime>

QgsRendererRangeV2::QgsRendererRangeV2()
: mLowerValue( 0 ), mUpperValue( 0 ), mSymbol( 0 ), mLabel()
: mLowerValue( 0 )
, mUpperValue( 0 )
, mSymbol( 0 )
, mLabel()
{
}

Expand Down Expand Up @@ -220,12 +223,16 @@ QString QgsRendererRangeV2LabelFormat::labelForRange( double lower, double upper
if ( upperStr.contains( '.' ) ) upperStr = upperStr.replace( mReTrailingZeroes, "" );
}

return mFormat.arg(lowerStr, upperStr);
return mFormat.arg( lowerStr, upperStr );
}

void QgsRendererRangeV2LabelFormat::setFromDomElement( QDomElement &element )
{
mFormat = element.attribute( "format", " %1 - %2" );
mFormat = element.attribute( "format",
element.attribute( "prefix", " " ) + "%1" +
element.attribute( "separator", " - " ) + "%2" +
element.attribute( "suffix", " " )
);
mDecimalPlaces = element.attribute( "decimalplaces", "4" ).toInt();
mTrimTrailingZeroes = element.attribute( "trimtrailingzeroes", "false" ) == "true";
}
Expand Down

0 comments on commit 1f1fe88

Please sign in to comment.