[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kimageshop
Subject:    Re: Need a solution for this
From:       Boudewijn Rempt <boud () valdyas ! org>
Date:       2005-12-31 11:08:38
Message-ID: 200512311208.38407.boud () valdyas ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


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

[Attachment #5 (application/pgp-signature)]

_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic