Bugfix 6856

http://hub.qgis.org/issues/6856

Please check if the code is OK since I'm rather new to C++