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

List:       koffice-devel
Subject:    Re: [patch] Avoid crash in KoColorPopupAction
From:       Jaroslaw S <kexipl () gmail ! com>
Date:       2009-07-31 18:11:04
Message-ID: 56a746380907311111u338e7acfo75ef0468586cf532 () mail ! gmail ! com
[Download RAW message or body]

2009/7/31 Thomas Zander <zander@kde.org>:
> On Thursday 30 July 2009 23:46:52 ext Jarosław Staniek wrote:
>> Hi, for review:
>> When KoColorPopupAction (for whatever reason) receives invalid QColor,
>> KoColor asserts [1].
>>
>> The patch falls back to transparent black color and issues a warning.
>
> Its a short patch, which I think is good :)
> I do have some suggestions;
>  QColor(0, 0, 0, 255) is equivalent to QColor() but thats more readable. So
> maybe you can use that instead?

Not quite:
"QColor::QColor ()
Constructs an invalid color with the RGB value (0, 0, 0). An invalid
color is a color that is not properly set up for the underlying window
system. The alpha value of an invalid color is unspecified."

So I am staying with the original code in this regard.

>
> The kWarning should get an appropriate debug area.  (30004 seems applicable)
>
> I suggest putting the if () { } part in an #ifdef NDEBUG  to avoid this check
> and the printing of the warning in real packages.

You probably mean #ifndef NDEBUG.

Otherwise, OK :)

-- 
regards / pozdrawiam, Jaroslaw Staniek
 Kexi & KOffice (http://www.kexi-project.org, http://www.koffice.org)
 KDE Libraries for MS Windows (http://windows.kde.org)
 http://www.linkedin.com/in/jstaniek
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel

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

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