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


On 07/29/2013 11:43 PM, Norbert Thiebaud wrote:
so... I starting to hit the uno wall trying to convert String to OUString...

for instance: XTextComponent has a getMaxTextLen() api that return a
sal_Int16... that was already borked since the underlying data was
sal_uInt16... but going to sal_In32 would be a ABI break wouldn't it ?
so how are we to proceed with these cases ?

OMG, who wrote such crap?

One solution for css.awt.XTextComponent.getMaxTextLen would be to throw some RuntimeException when it can't return the true length.

Another solution would be to change this (and likely some similar mistakes across css.awt, too?) incompatibly to use long instead of short. For our typical C++ ABI, old clients of both get- and setMaxTextLen should likely continue to work just fine, and for Basic and Python anyway. Only problem would be old Java clients, which would result in some IncompatibleWhatnotError. (And, as a datapoint to extrapolate external usage from, I see at least two such Java calls to setMaxTextLen in the LO code base, wizards/com/sun/star/wizards/table/{FieldFormatter,Finalizer}.java.)

So which one is better depends on whether there is any likelihood at all that such a max text length should ever be substantially large.

Stephan

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.