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


On Thursday 10 of January 2013, Noel Grandin wrote:
On 2013-01-09 19:58, Michael Meeks wrote:
At least in my mind :-) but we're starting to bike-shed here... I
didn't see anyone volunteering to do the actual batch cleanup there
;-) Regards, Michael.

Created a proof-of-concept patch along with some unit tests and pushed
to gerrit:

https://gerrit.libreoffice.org/#/c/1625/

 Can we please keep the discussion still here? Gerrit may be fine for pointing 
out technical details in the code, but it's not very suitable for discussions 
about anything beyond that.

- There's no need for valueOfChar(). There is already OUString ctor from 
sal_Unicode, so the valueOf() overload for it is just making an obvious thing 
complicated. Code using it can be converted to use the ctor instead.

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

- When more or less deprecating valueOf() this way, it has also float 
overloads, so something should be created for those too.

- I'm still not sold on the naming, OUString::valueInt() doesn't say much and 
OUString::valueOfInt() feels cryptic. Can we please use something obvious 
that doesn't need decyphering, such as OUString::number() or 
OUString::fromInt() (as much as I still don't like the idea of harcoding the 
irrelevant type information in the name)?

On Thursday 10 of January 2013, Noel Grandin wrote:
On Wed, Jan 9, 2013 at 7:58 PM, Michael Meeks <michael.meeks@suse.com>wrote:
        At least in my mind :-) but we're starting to bike-shed here... I
 didn't see anyone volunteering to do the actual batch cleanup there ;-)

Doesn't sound that hard - some regular expression magic will do most of the
work.

 I expect it won't, regular expressions can't tell what foo is in "valueOf( 
foo )". Unless all you want to convert is only places which do the explicit 
cast, this will need a (fairly simple) Clang plugin.

-- 
 Lubos Lunak
 l.lunak@suse.cz

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.