Cppcheck redundantAssignment gridcell.cxx (svx module)

Julien Nabet serval2412 at yahoo.fr
Tue Feb 4 12:47:39 PST 2014


On 04/02/2014 16:37, Caolán McNamara wrote:
> On Sat, 2014-02-01 at 14:30 -0800, julien2412 wrote:
>> See
>> http://dev-builds.libreoffice.org/cppcheck_reports/master/888.html#line-2150
>>
>> I would tend to remove the last line (because GetCorrectedValue, the line
>> before, isn't used for the moment) but I wouldn't like to create some
>> regression.
>>
>> Any idea?
> I wonder if this is the implementation of the Currency Field of
> view->toolbars->form controls->more controls->currency field or
> something different ?
>
> Either way, checking with git, this seems to have come in for
> https://issues.apache.org/ooo/show_bug.cgi?id=18045 via
> 2ee88bdef436d13d9c5d6b1a5b45dcc18c18de21
>
> So, I'm tempted to remove the last sValue = ... line seeing as the
> intent from the commit seems to suggest that the result of the
> intermediate lines is the desired outcome. I suggest you have a look a
> the original bugreport and see the original bug stays fixed anyway if
> you do that.
>
Thank you Caolán for your feedback,

I downloaded https://issues.apache.org/ooo/attachment.cgi?id=54553 and 
gave a try.
Without applying the patch, it works since the rounding is ok and the 
currency appears.
With the patch, the cells contain 0 but if I click on a cell, the good 
value appears (with the rounding + the currency) on the clicked cell 
only. Then, if I click on another cell, the previous gets back to 0 and 
the new selected one is ok.
So I'd tend now to remove the 2 unused lines since it seems the needed 
format is retrieved in another way than in 2008.

What do you think?

Julien





More information about the LibreOffice mailing list