Need a solution for this

Boudewijn Rempt boud at
Sat Dec 31 12:08:38 CET 2005

On Saturday 31 December 2005 11:59, Cyrille Berger wrote:
> >  dst = (KisPaintLayer*)img->activeLayer().data();
> weee another java developer :)

Yep. I unashamedly copied the code from the cast in

> In that case, the activeLayer is forced to be a KisPaintLayer by the
> flatten operation, but the best C++ solution is : dst =
> dynamic_cast<KisPaintLayer*>(img->activeLayer().data()); and if dst == 0
> then throw an error message.

Changed, it does look better indeed.

I still don't like having to cast, though...

Boudewijn Rempt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the kimageshop mailing list