diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2011-09-27 20:21:15 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2011-09-27 20:22:03 +0200 |
commit | 6671fa81db0ecea4ada005bb79f55f08fb440ad4 (patch) | |
tree | 85ad806ece8d60736b6b01310b04b053dc2f8179 /filter | |
parent | move windows-only call into platform/win* (diff) | |
download | core-6671fa81db0ecea4ada005bb79f55f08fb440ad4.tar.gz core-6671fa81db0ecea4ada005bb79f55f08fb440ad4.zip |
Removed uses of rtl::O[U]String[Buffer]::operator sal_{char|Unicode} const *().
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/placeware/Base64Codec.cxx | 32 | ||||
-rw-r--r-- | filter/source/xsltfilter/OleHandler.cxx | 2 |
2 files changed, 16 insertions, 18 deletions
diff --git a/filter/source/placeware/Base64Codec.cxx b/filter/source/placeware/Base64Codec.cxx index 435b36cb9b7b..46c1ed7606d2 100644 --- a/filter/source/placeware/Base64Codec.cxx +++ b/filter/source/placeware/Base64Codec.cxx @@ -84,7 +84,6 @@ void ThreeByteToFourByte (const sal_uInt8* pBuffer, const sal_Int32 nStart, cons nLen = 3; if (nLen == 0) { - sBuffer.setLength(0); return; } @@ -111,23 +110,24 @@ void ThreeByteToFourByte (const sal_uInt8* pBuffer, const sal_Int32 nStart, cons break; } - sBuffer.appendAscii("===="); + sal_Unicode buf[] = { '=', '=', '=', '=' }; sal_uInt8 nIndex = static_cast< sal_uInt8 >((nBinaer & 0xFC0000) >> 18); - sBuffer.setCharAt(0, aBase64EncodeTable [nIndex]); + buf[0] = aBase64EncodeTable [nIndex]; nIndex = static_cast< sal_uInt8 >((nBinaer & 0x3F000) >> 12); - sBuffer.setCharAt(1, aBase64EncodeTable [nIndex]); - if (nLen == 1) - return; - - nIndex = static_cast< sal_uInt8 >((nBinaer & 0xFC0) >> 6); - sBuffer.setCharAt(2, aBase64EncodeTable [nIndex]); - if (nLen == 2) - return; - - nIndex = static_cast< sal_uInt8 >((nBinaer & 0x3F)); - sBuffer.setCharAt(3, aBase64EncodeTable [nIndex]); + buf[1] = aBase64EncodeTable [nIndex]; + if (nLen > 1) + { + nIndex = static_cast< sal_uInt8 >((nBinaer & 0xFC0) >> 6); + buf[2] = aBase64EncodeTable [nIndex]; + if (nLen > 2) + { + nIndex = static_cast< sal_uInt8 >((nBinaer & 0x3F)); + buf[3] = aBase64EncodeTable [nIndex]; + } + } + sBuffer.append(buf, SAL_N_ELEMENTS(buf)); } void Base64Codec::encodeBase64(rtl::OUStringBuffer& aStrBuffer, const uno::Sequence < sal_Int8 >& aPass) @@ -137,9 +137,7 @@ void Base64Codec::encodeBase64(rtl::OUStringBuffer& aStrBuffer, const uno::Seque const sal_Int8* pBuffer = aPass.getConstArray(); while (i < nBufferLength) { - rtl::OUStringBuffer sBuffer; - ThreeByteToFourByte ((const sal_uInt8*)pBuffer, i, nBufferLength, sBuffer); - aStrBuffer.append(sBuffer); + ThreeByteToFourByte ((const sal_uInt8*)pBuffer, i, nBufferLength, aStrBuffer); i += 3; } } diff --git a/filter/source/xsltfilter/OleHandler.cxx b/filter/source/xsltfilter/OleHandler.cxx index 6baa99a5e672..a26642f51a33 100644 --- a/filter/source/xsltfilter/OleHandler.cxx +++ b/filter/source/xsltfilter/OleHandler.cxx @@ -198,7 +198,7 @@ namespace XSLT { //decode the base64 string Sequence<sal_Int8> oledata; - SvXMLUnitConverter::decodeBase64(oledata, rtl::OUString::createFromAscii(content)); + SvXMLUnitConverter::decodeBase64(oledata, rtl::OStringToOUString(content, RTL_TEXTENCODING_ASCII_US)); //create a temp stream to write data to Reference<XStream> subStream = createTempFile(); Reference<XInputStream> xInput = subStream->getInputStream(); |