[Libreoffice] [PATCH] Replace (Byte)String with O(U)String

Chr. Rossmanith ChrRossmanith at gmx.de
Tue Jan 17 05:56:18 PST 2012


Hi Caolan and Stephan,

Am 17.01.2012 13:40, schrieb Caolán McNamara:
> On Tue, 2012-01-17 at 11:06 +0100, Chr. Rossmanith wrote:
>> an excursion from vcl to unotools was necessary. Could someone please
>> review this little patch? xub_StrLen is replaced as well with sal_Int32.
> You'll have to change the callers of RecodeString
> (http://opengrok.libreoffice.org/xref/core/vcl/source/gdi/outdev3.cxx#6009) to use an rtl::OUString as well.
That is where my excursion started  :-)   i.e. the reason why I had to 
modify RecodeString()
> On this patch in isolation, you could make one stringbuffer before the
> loop, and set the returned string from that at the end, and just use one
> stringbuffer in the loop, something like...
>
> rtl::OUStringBuffer aTmpStr(rStr);
> for(; nIndex<  nLastIndex; ++nIndex )
> {
>      sal_Unicode cOrig = aTmpStr[nIndex];
> ...
>      if( cOrig != cNew )
>          aTmpStr[nIndex] = cNew;
> ...
> }
> rStr = aTmpStr.makeStringAndClear();
I'll add this to my patch and Stephan Bergmanns improvements as well.

Thank you,
Christina



More information about the LibreOffice mailing list