Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi Kendy,

Yes, I give it a try.

Great, thanks a lot! :-)


Well, I said I'm interested in this cleanup, but just until it is not too
far from my tasks. :)
I used NumericBox to derive from it while implementing LimitBox and I'd
like to allow the user adding values unlimitedly, so the only limit would
be the maximum value of the used type (in this case sal_Int64). (Anyway, I
think such maximum value for a NumericBox is a rare case. Maybe that's why
this bug dont outcrop yet) So I'm interested only in NumericBox, and I
would do my changes only in it with taking care not to change others
behaviour.

Plus, as I see there are not only multiplication in ConvertDoubleValue, but
division too. Replace these simply with integer division will not result
the same. So that make this situation more difficult to solve only with
integer operations and avoid all double aritmetic. So yes, its getting
complicated, too complicated.

Otherwise in ImplNumericGetValue() the problem of overflow/underflow can be
avoid with these lines
sal_Int64 nValue = aStr.toInt64()
if( OUString::valueOf(nValue) != aStr )
{
    if( bNegative )
        rValue = SAL_MIN_INT64;
    else
        rValue = SAL_MAX_INT64;
    return sal_True;
}
With this the bevavior would be the excepted, because NumericBox and others
were made to return the maximum value (mnMax, GetMax()) when the typed one
is bigger. (mnMin just the same)

So, I try to solve the problem of NumericBox, but MetricBox remain the
same. Maybe an other day or an other man. :)

Best regards,
Tamás

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.