replacing OUString::valueOf(static_cast<sal_Int32>) ??

Stephan Bergmann sbergman at redhat.com
Fri Jan 11 04:51:17 PST 2013


On 01/11/2013 01:02 PM, Jan Holesovsky wrote:
>>> - It's a question if we really need 'OUString::valueOfBool( foo )' instead of
>>> simply 'foo ? OUString( "true" ) : OUString( "false" )' (such a pity the
>>> string literals handling doesn't allow "foo ? "true" : "false"' ). I wonder
>>> how many places in the code really need to convert a boolean to the hardcoded
>>> english string representation.
>> I have no idea how to count call sites automatically.
>> But at least 10 places need to use a cast to access the method, so there
>> is definitely code using it.
>
> I've counted exactly 5 - seeing the trouble we have un-publishing
> something that we have published, I'd really prefer not to introduce a
> method in our core API that would satisfy only 5 callers ;-)

As I wrote, we have rtl_ustr_valueOfBoolean anyway.  And eventually 
getting rid of inline-online functions in the URE interface isn't that 
controversial either.  So I see no reason not to keep offering such a 
function.

Stephan


More information about the LibreOffice mailing list