Need a solution for this

Boudewijn Rempt boud at valdyas.org
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 kis_jpeg_export.cc.

> 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 
http://www.valdyas.org/fading/index.cgi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20051231/d80f897f/attachment.pgp


More information about the kimageshop mailing list