diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-08-07 09:13:47 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-08-07 16:14:45 +0100 |
commit | aac04652fda01b0299e17087b151f07d6115e894 (patch) | |
tree | 26a71ba651eb138d81f538b0d43b66f8da8e305d /sw/source/filter/ascii/parasc.cxx | |
parent | db95e0b75903a34a1b88a3701334e154f32eeceb (diff) |
String::AllocBuffer replacements
Change-Id: I278cd66fb4819721bb473796c28598aaf04eb123
Diffstat (limited to 'sw/source/filter/ascii/parasc.cxx')
-rw-r--r-- | sw/source/filter/ascii/parasc.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx index 1dea0d1b18f1..ec68e011f138 100644 --- a/sw/source/filter/ascii/parasc.cxx +++ b/sw/source/filter/ascii/parasc.cxx @@ -26,7 +26,7 @@ * ************************************************************************/ - +#include <boost/scoped_array.hpp> #include <tools/stream.hxx> #include <hintids.hxx> #include <rtl/tencinfo.h> @@ -303,7 +303,7 @@ sal_uLong SwASCIIParser::ReadChars() bSwapUnicode = rInput.IsEndianSwap(); } - String sWork; + boost::scoped_array<sal_Unicode> aWork; sal_uLong nArrOffset = 0; do { @@ -331,7 +331,8 @@ sal_uLong SwASCIIParser::ReadChars() { sal_uInt32 nInfo; sal_Size nNewLen = lGCount, nCntBytes; - sal_Unicode* pBuf = sWork.AllocBuffer( static_cast< xub_StrLen >(nNewLen) ); + aWork.reset(new sal_Unicode[nNewLen]); + sal_Unicode* pBuf = aWork.get(); nNewLen = rtl_convertTextToUnicode( hConverter, hContext, pArr, lGCount, pBuf, nNewLen, @@ -345,9 +346,8 @@ sal_uLong SwASCIIParser::ReadChars() &nCntBytes ); if( 0 != ( nArrOffset = lGCount - nCntBytes ) ) memmove( pArr, pArr + nCntBytes, nArrOffset ); - sWork.ReleaseBufferAccess( static_cast< xub_StrLen >(nNewLen) ); - pStt = pLastStt = sWork.GetBufferAccess(); + pStt = pLastStt = aWork.get(); pEnd = pStt + nNewLen; } else |