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



On 2013-01-10 15:55, Lubos Lunak wrote:
On Thursday 10 of January 2013, Noel Grandin wrote:
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.
That's why it said "proof of concept". Mostly, I did it to point that someone was willing to do the work :-)

- 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.
Which doesn't help with overload resolution problems.


- When more or less deprecating valueOf() this way, it has also float
overloads, so something should be created for those too.
If those also suffer from overload resolution problems, then sure.
But
     git grep "String::valueOf.*static_cast<.*double"
doesn't find anything that looks like it needs help.

- 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)?
Which would be inconsistent with the existing method names.


  I expect it won't, regular expressions can't tell what foo is in "valueOf(
foo )".
Actually, regex can. It's called capturing groups.
    http://www.regular-expressions.info/brackets.html
Doesn't work very well with complex expressions, but it can handle the simple cases.

Unless all you want to convert is only places which do the explicit
cast, this will need a (fairly simple) Clang plugin.
Sure, if you feel like writing one.


Disclaimer: http://www.peralex.com/disclaimer.html



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.