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


On 01/08/12 19:05, Eike Rathke wrote:
Hi Stephan,

On Wednesday, 2012-08-01 18:17:12 +0200, Stephan Bergmann wrote:

make rtl::OUString::copy(beginIndex, count) clip to [0..length)?
yeah, why not  (then again, -1's sentinel nature, cf. indexOf, might
mean that silent clipping of beginIndex=-1 to beginIndex=0 is
unfortunate)

We may step into more of these traps in transitions from String to
OUString, so clipping IMHO is good.

I think beginIndex<0 or count<=0 should always return an empty string
and output a SAL_WARN, maybe also SAL_WARN if clipping occurred as that
may indicate a logic error.

no, it should assert().  passing in invalid indexes is clearly a bug
that must be fixed.



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.