To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=96834
------- Additional comments from [email protected] Thu Apr 30 11:20:59 +0000 2009 ------- For what its worth, the attached idl.patch indeed looks wrong---but the whole code appears to be broken, anyway. The code in question is as follows: There are integers nMin (encoded as a long, it can be negative or non-negative), nMax (encoded as an ULONG, it must thus necessarily be non-negative, and is probably supposed to be no less than nMin), and N (encoded as nSign * n, where nSign is either +1 or -1, and n is an ULONG and thus non-negative). Now, what the code shall apparently do is store N in *pValue iff nMin <= N <= nMax. For this, the parentheses in the relevant sub-condition must be placed as nSign == 1 && (n >= 0x80000000 || (long)n > nMin) What the sub-condition shall apparently check is that if N is non-negative it also is no less than nMin. That means that n must either be greater than the largest possible long value (which is here, incorrectly, assumed to be 0x7FFFFFFF) or else be no less than nMin. However, there are at least three other things that also look wrong: - the 32-bit assumption that the largest possible long value is 0x7FFFFFFF; - mixing "-(long)n >= nMin" and "(long)n > Min", i.e., confusion whether N >= nMin or N > nMin must hold; - forgetting to multiply by nSign when assigning (long)n to *pValue. --------------------------------------------------------------------- Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
