Question about sc/source/core/data/colorscale.cxx

Markus Mohrhard markus.mohrhard at googlemail.com
Sat Dec 15 12:43:41 PST 2012


Hey Mat,


>>
>>
>> Implemented a correct version with
>> 4f901a2f451a552853c1dd38309dd55b22616fdd.
>
>
> Sorry but what I see in 4f901a2f45 is the same thing as Julien pasted in his
> mail.
> It rollback the good version:

I don't understand your question. I changed the code to use OR in one
place and removed the cppcheck warning. Compared to Julien's version I
did not use the OR in the second place as this is result in
unnecessary update calls.

>
> $ git diff
> 4f901a2f451a552853c1dd38309dd55b22616fdd..4f901a2f451a552853c1dd38309dd55b22616fdd^
> diff --git a/sc/source/core/data/colorscale.cxx
> b/sc/source/core/data/colorscale.cxx
> index f5d23c1..2adf507 100644
> --- a/sc/source/core/data/colorscale.cxx
> +++ b/sc/source/core/data/colorscale.cxx
> @@ -636,8 +636,10 @@ bool NeedUpdate(ScColorScaleEntry* pEntry)
>
>
>  void ScDataBarFormat::DataChanged(const ScRange& rRange)
>  {
> -    bool bNeedUpdate = NeedUpdate(mpFormatData->mpUpperLimit.get());
> -    bNeedUpdate |= NeedUpdate(mpFormatData->mpLowerLimit.get());
> +    bool bNeedUpdate = false;
> +
> +    bNeedUpdate = NeedUpdate(mpFormatData->mpUpperLimit.get());
> +    bNeedUpdate &= NeedUpdate(mpFormatData->mpLowerLimit.get());
>
>      bNeedUpdate &= GetRange().Intersects(rRange);
>
> Could you check if I missed something ?
>

Maybe your confusion comes from using ^ at the wrong place. Try git
diff 4f901a2f451a552853c1dd38309dd55b22616fdd^..4f901a2f451a552853c1dd38309dd55b22616fdd

Regards,
Markus


More information about the LibreOffice mailing list