Use scale parameter to display concerned class

I also fix the scale to use OGC standardized scale denominator

I'm not sure about this
https://github.com/sbrunner/Quantum-GIS/compare/legend-scale?expand=1#L2L194
finally I don't understand what this loop is for ...