optimising OUString for space

Michael Stahl mstahl at redhat.com
Mon Oct 1 05:45:53 PDT 2012

On 01/10/12 14:23, Noel Grandin wrote:
> On 2012-10-01 13:58, Michael Stahl wrote:
>> On 01/10/12 13:25, Michael Meeks wrote:
>> 	The only problem with a change there is our ABI - which explicitly
>> exposes the encoding of that.
>> the right time to do it is for LO4.  sadly nobody has signed up for that
>> yet :( ... (while there are volunteers for far sillier proposals, like
>> getting rid of com.sun.star...)
> Perhaps we need to split out some preparatory tasks?
> For example
>   - fix code that directly accesses the underlying buffer
>   - create an external iterator class (which would currently be a thin 
> wrapper around int) for looping over the buffer and indexing into it
> -  fix code that indexes into an OUString to use the new external iterator

there already exists method iterateCodePoints, using a pointer to the
next code unit as the iterator (note that this interface depends on
immutability of the buffer):

>     inline sal_uInt32 iterateCodePoints(
>         sal_Int32 * indexUtf16, sal_Int32 incrementCodePoints = 1) const

problem is, nobody is using it...

guess you could comment out operator[], that should find lots of
convertible call sites :)

More information about the LibreOffice mailing list