diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-12-17 15:53:11 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-12-21 10:10:58 +0000 |
commit | 92f396733ebc518bcb7a9eae2dd3169d333b82b9 (patch) | |
tree | 55cf13dea05f06d4eea95c8382f771090a3bac4b /svtools/source/urlobj | |
parent | b57eceb231b61abc7121686d70df8d7c0dfacb75 (diff) |
convert ReadByteString/WriteByteString from ByteString to OString
Nobody ever used the return values anyway, so for reading just
return the string and for writing the number of bytes written
Doesn't need to be members, make standalone functions
Rename to
read_lenPrefixed_uInt8s_ToO[U]String and
write_lenPrefixed_uInt8s_FromO[U]String, lengthy,
but much less unambiguous, seeing as a lot of users of it don't
seem to be aware that they read/write pascal-style length
prefixed strings, which isn't surprising given the
apparent simplicity of their original name.
added a unit test
Diffstat (limited to 'svtools/source/urlobj')
-rw-r--r-- | svtools/source/urlobj/inetimg.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/svtools/source/urlobj/inetimg.cxx b/svtools/source/urlobj/inetimg.cxx index fff9d170399a..8ed7996c16d0 100644 --- a/svtools/source/urlobj/inetimg.cxx +++ b/svtools/source/urlobj/inetimg.cxx @@ -73,7 +73,7 @@ sal_Bool INetImage::Read( SvStream& rIStm, sal_uLong nFormat ) { case SOT_FORMATSTR_ID_INET_IMAGE: { - String sINetImg = read_zeroTerminated_uInt8s_AsOUString(rIStm, RTL_TEXTENCODING_UTF8); + String sINetImg = read_zeroTerminated_uInt8s_ToOUString(rIStm, RTL_TEXTENCODING_UTF8); xub_StrLen nStart = 0; aImageURL = sINetImg.GetToken( 0, TOKEN_SEPARATOR, nStart ); aTargetURL = sINetImg.GetToken( 0, TOKEN_SEPARATOR, nStart ); @@ -119,11 +119,11 @@ sal_Bool INetImage::Read( SvStream& rIStm, sal_uLong nFormat ) // skip over iExtraHTML_Offset rIStm.SeekRel( sizeof( int ) ); - aImageURL = read_zeroTerminated_uInt8s_AsOUString(rIStm, eSysCSet); + aImageURL = read_zeroTerminated_uInt8s_ToOUString(rIStm, eSysCSet); if( nAltOffset ) { rIStm.Seek( nFilePos + nAltOffset ); - aAlternateText = read_zeroTerminated_uInt8s_AsOUString(rIStm, eSysCSet); + aAlternateText = read_zeroTerminated_uInt8s_ToOUString(rIStm, eSysCSet); } else if( aAlternateText.Len() ) aAlternateText.Erase(); @@ -131,7 +131,7 @@ sal_Bool INetImage::Read( SvStream& rIStm, sal_uLong nFormat ) if( nAnchorOffset ) { rIStm.Seek( nFilePos + nAnchorOffset ); - aTargetURL = read_zeroTerminated_uInt8s_AsOUString(rIStm, eSysCSet); + aTargetURL = read_zeroTerminated_uInt8s_ToOUString(rIStm, eSysCSet); } else if( aTargetURL.Len() ) aTargetURL.Erase(); |