[Libreoffice] [PATCH] String::CompareIngoreCaseToAscii

Caolán McNamara caolanm at redhat.com
Tue Oct 4 03:27:07 PDT 2011


On Tue, 2011-10-04 at 10:57 +0200, Jan Holesovsky wrote:
> BTW, another horror in the original code is:
> 
> > ch1 = aSym.ToUpperAscii().GetBuffer()[0];
> 
> ie. we convert the entire string to upper case, and then throw all that
> away but the first char.

[Byte]String::ToUpperAscii, see tools/source/string/strimp.cxx, modifies
the string it operates on and returns a reference to *this, i.e. 

aSym = "hello";
aSym.ToUpperAscii();;
//aSym contains "HELLO" now

I mean, it doesn't return an uppercased copy, but returns itself, which
has been uppercased.

C.



More information about the LibreOffice mailing list