[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: Re: Review Request: Fix KoOdfGraphicStyles::loadOdfStrokeStyle to
From: "Sebastian Sauer" <sebsauer () kdab ! com>
Date: 2010-02-24 12:42:18
Message-ID: 20100224124218.7507.56928 () localhost
[Download RAW message or body]
> On 2010-02-24 12:30:15, Thorsten Zachmann wrote:
> > As far as I can see the code only gets called if the style is stroke or dash so how will the fix \
> > help?
The issue is if the style is *not* stroke or dash, if the int the sample code above removed code within \
the if() {...} gets not executed, if the tmpPen gets therefore not set but the in the first line of the \
method set "QPen tmpPen;" gets returned without any future modification.
Just like if the method would look like;
QPen KoOdfGraphicStyles::loadOdfStrokeStyle(...) { return QPen(); }
- Sebastian
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/3048/#review4265
-----------------------------------------------------------
On 2010-02-24 11:47:38, Sebastian Sauer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/3048/
> -----------------------------------------------------------
>
> (Updated 2010-02-24 11:47:38)
>
>
> Review request for KOffice.
>
>
> Summary
> -------
>
> The code looks like;
>
> QPen KoOdfGraphicStyles::loadOdfStrokeStyle
> {
> QPen tmpPen;
> if (stroke == "solid" || stroke == "dash") {
> [...]
> }
> return tmpPen;
> }
>
> That means that a stroke of "none" will return the QPen tmpPen created with an empty ctor. Such an \
> empty QPen is != Qt::NoPen which would have been created using QPen(Qt::NoPen). This is different from \
> other behavior like QBrush or QValid which always create an invalid/none value if created with an empty \
> ctor.
> The problem is that some code in KChart does assume that a "none" stroke is a Qt::NoPen what is wrong. \
> The patch fixes such cases by doing what's expected and returning a Qt::NoPen if the stroke is neither \
> "solid" nor "dash".
>
> Diffs
> -----
>
> trunk/koffice/libs/odf/KoOdfGraphicStyles.cpp 1094359
>
> Diff: http://reviewboard.kde.org/r/3048/diff
>
>
> Testing
> -------
>
> Works fine in KChart. It may break for Apps that do expect that no pen means a black solid pen.
>
>
> Thanks,
>
> Sebastian
>
>
_______________________________________________
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