Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On Wed, 2011-06-29 at 23:00 +0200, Chr. Rossmanith wrote:
Hi,

I've started to replace ByteString with rtl::OString. You find what I 
did so far in the attached patches. It would be nice if someone could 
review the patches and give feedback. Then I'll continue and push.

Patch 2 is good, we can go back when finished and re-implement ReadLine
at the end in terms of rtl::OStringBuffer or whatever when the rest are
all gone.

Patch 1 has
a) various original lines of...

rtl::OUString( UniString( aRequestHost, RTL_TEXTENCODING_UTF8 ) )

we need to retain the encoding information here in the conversion from
OString to OUString

so use

rtl::OStringToOUString(aRequestHost, RTL_TEXTENCODING_UTF8)
instead of
rtl::OUString::createFromAscii(aRequestHost.getStr())
e.g.

aConnectAddr = osl::SocketAddr(rtl::OStringToOUString(aRequestHost,
RTL_TEXTENCODING_UTF8), nRequestPort);

b)
- nResultId = (sal_uInt16)aLine.GetToken( 1, ' ' ).ToInt32();
+ nResultId = (sal_uInt16)aLine.getToken( (sal_Int32)1, ' ',
nIndex ).toInt32();

which is find, but nIndex is an in-out argument in rtl::OString, and
this code is in a loop, so old code always seemed to say 

"get the second (1) token starting from default 0"
new code says
"get the second (1) token starting from nIndex, where nIndex is the
position of the last token got"

so to be the same move sal_Int32 nIndex = 0; inside the loop above
getToken

C.


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.