len() string function in calc - basic/64k limit code pointers
Norbert Thiebaud
nthiebaud at gmail.com
Thu Nov 1 03:56:31 PDT 2012
On Thu, Nov 1, 2012 at 5:40 AM, Michael Meeks <michael.meeks at suse.com> wrote:
> RTLFUNC(Len)
> {
> (void)pBasic;
> (void)bWrite;
>
> if ( rPar.Count() != 2 )
> StarBASIC::Error( SbERR_BAD_ARGUMENT );
> else
> {
> const String& rStr = rPar.Get(1)->GetString();
> rPar.Get(0)->PutLong( (sal_Int32)rStr.Len() );
> }
> }
>
> You can see that the problematic 'String' type is used (which truncates
> to 64k lengths). I suspect you'd want to poke at:
>
> basic/inc/basic/sbxvar.hxx
>
> particularly the SbxValue and it's implementation inside:
>
> basic/source/sbx/sbxvalue.cxx
>
> To use rtl::OUString instead of String - that shouldn't be too hard,
> it's easy to convert between the two for compatibility as you push the
> perimiter of that wider.
FYI... I have a feature branch to convert String to OUString in
basic... (among other places)
I've been working on it last week while 'offline' so it is not pushed
yet.. but I should be able to push it for review soon.
Norbert
More information about the LibreOffice
mailing list