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

Caolán McNamara caolanm at redhat.com
Tue Jan 17 04:40:29 PST 2012


On Tue, 2012-01-17 at 11:06 +0100, Chr. Rossmanith wrote:
> Hi,
> 
> 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.

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();

C.



More information about the LibreOffice mailing list