To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=99900





------- Additional comments from [email protected] Wed Apr 22 15:20:04 +0000 
2009 -------
Hi Tan / Chengbiao (?), thank you, some remarks:

Both new functions lack the check for the parameter count before acting on them,
each function must have get passed exactly one argument. For this check
MustHaveParamCount( GetByte(), 1)  see other functions using it.

In ScUnicode(), the length of the string should be checked >0 before attempting
to call iterateCodePoints() on it, and push an illegal argument error otherwise.

In ScUnichar(), the double obtained as argument should be first treated with
::rtl::math::approxFloor(), then checked for valid bounds, and only after that
converted to sal_uInt32. As is, the value converted to sal_uInt32 can never be
<0 because it is already unsigned then. Didn't the compiler spit out a warning
for that?

As only one sal_uInt32 will be operated on, it isn't necessary to declare the
array of one element and cast to pointer in the call to the OUString ctor (btw,
the address of the array would be &uIVal[0] and no cast necessary). This can be
written instead as

    sal_uInt32 nCodePoint = static_cast<sal_uInt32>(the_double_value);
    rtl::OUString aStr( &nCodePoint, 1);

Two nitpicks:
In new source please don't use tabs to indent code, use 4 spaces per indentation
level instead.
Use C++ casts instead of C-style casts.

Thanks
  Eike


---------------------------------------------------------------------
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]

Reply via email to