STRING * n support in StarBasic

Norbert Thiebaud nthiebaud at gmail.com
Thu Oct 25 05:47:26 PDT 2012


On Thu, Oct 25, 2012 at 10:56 AM, Michael Stahl <mstahl at redhat.com> wrote:
>
> if we simply replace the existing String uses with OUString we don't
> have to worry about that any more :)

Well, you do need to worry, if you want to enforce the language spec
(although these are pretty weak and fuzzy)
Right know we seems to care about padding of fixed-length String on
Init only (Dim)... I have not stumbled upon code that cares about that
on assign and other manipulations...

iow

Dim foo as STRING*10 = ""
dim bar as STRING "hello"

foo = bar

what should be foo? "hello" or "hello     "

This is probably not a 'generaly' solvable problem as this notion of
fixed-size has been dropped post VB6.0, and now everything is var-len
with a max at 2GB. iow old and new spec conflict.

So I guess my question is: while migrating to OUString, should we care
about the corner-case and other oddities associated with 'fixed'
String.

Norbert

>
> no leak because OUString::operator= should decrement the ref-count of

ahhh the infamous c++ operator overload... and hidden behind a layer
of good old C macros to boot :-)

Thanks for the answer.


More information about the LibreOffice mailing list