<div>Hi Kendy,</div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
> Yes, I give it a try.<br>
<br>
</div>Great, thanks a lot! :-)</blockquote><div><br></div><div class="gmail_quote"><div>Well, I said I'm interested in this cleanup, but just until it is not too far from my tasks. :)</div><div>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. </div>
<div><br></div><div>Plus, as I see there are not only multiplication in <span style="background-color:rgb(255,255,255)">ConvertDoubleValue, but division too. Replace these simply with integer division will not result the same.</span><span style="background-color:rgb(255,255,255)"> So that make this situation more difficult to solve only with integer operations and avoid all double aritmetic. </span>So yes, its getting complicated, too complicated.</div>
<div><br></div><div>Otherwise in ImplNumericGetValue() the problem of overflow/underflow can be avoid with these lines</div><div>sal_Int64 nValue = aStr.toInt64()</div><div><div>if( OUString::valueOf(nValue) != aStr )</div>
<div>{</div><div>    if( bNegative )</div><div>        rValue = SAL_MIN_INT64;</div><div>    else</div><div>        rValue = SAL_MAX_INT64;</div><div>    return sal_True;</div><div>}</div></div></div>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)</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">So, I try to solve the problem of NumericBox, but MetricBox remain the same. Maybe an other day or an other man. :) <br><div><br></div><div>Best regards,</div><div>
Tamás </div></div>