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:
You are correct, we are indeed talking past each other.
If you go back to the very first message in this thread, the patch
mentioned there will perhaps help to establish come context.

But I will try to explain again.

The constructors and existing methods don't help because the specific
problem we are trying to solve is that the C++ overload resolution rules
will sometimes pick a non-intuitive method or constructor to apply.

This leads to code that looks like:

aStyleName.Append( OUString::valueOf( static_cast<sal_Int32>( nDepth ) ) );

which is the integer case. Similar problems apply to the char and bool
cases.

The purpose of these methods is purely to reduce this boilerplate coding
and increase readability, so that we have:

aStyleName.Append( OUString::valueOfInt( nDepth ) );

Given that our string classes are used pretty much everywhere, having a
wide API that increases readability can only be a good thing.

While you might not like the names of the new methods, I don't see how
making the names of the new methods dramatically different from the names
of the existing "valueOf" methods can be an improvement to the API.
Sometimes, we have to work with what we have.

 That is not what I meant. What I wrote in my previous mail is that if these 
valueOf() issues are to be fixed, it's better to fix it completely rather 
than just slightly reduce the problem. And for that it would be better to 
remove the original valueOf() completely, and that results in all the 
follow-up issues that I raised.

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