diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-02-27 21:01:27 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-02-28 10:56:58 +0000 |
commit | f7db5b2d5f9fa03b4bf5d9275998735ddf65743b (patch) | |
tree | b5782837923061a9322faaa13ca8731aecce7cba /sw | |
parent | f1857d76cb4d770fe6e0055bb14fa16e081e93f4 (diff) |
replace AllocBuffer in ww8 filter
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 89dd4067b15f..84d3752d4a8c 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -46,6 +46,7 @@ #include <svtools/sfxecode.hxx> #include <comphelper/docpasswordrequest.hxx> +#include <comphelper/string.hxx> #include <hintids.hxx> #include <editeng/tstpitem.hxx> @@ -2628,10 +2629,9 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, long nEnd, long nCpOfs) const CharSet eSrcCJKCharSet = bVer67 ? GetCurrentCJKCharSet() : RTL_TEXTENCODING_MS_1252; - // (re)alloc UniString data - String sPlainCharsBuf; - - sal_Unicode* pBuffer = sPlainCharsBuf.AllocBuffer(nStrLen); + // allocate UniString data + rtl_uString *pStr = comphelper::string::rtl_uString_alloc(nStrLen); + sal_Unicode* pBuffer = pStr->buffer; sal_Unicode* pWork = pBuffer; sal_Char* p8Bits = NULL; @@ -2666,7 +2666,7 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, long nEnd, long nCpOfs) if (pStrm->GetError()) { rPos = WW8_CP_MAX-10; // -> eof or other error - sPlainCharsBuf.ReleaseBufferAccess( 0 ); + rtl_freeMemory(pStr); delete [] p8Bits; return true; } @@ -2714,9 +2714,10 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, long nEnd, long nCpOfs) if (m_bRegardHindiDigits && bBidi && LangUsesHindiNumbers(nCTLLang)) *pBuffer = TranslateToHindiNumbers(*pBuffer); - sPlainCharsBuf.ReleaseBufferAccess( nEndUsed ); + pStr->buffer[nEndUsed] = 0; + pStr->length = nEndUsed; - emulateMSWordAddTextToParagraph(sPlainCharsBuf); + emulateMSWordAddTextToParagraph(rtl::OUString(pStr, SAL_NO_ACQUIRE)); rPos += nL2; if (!maApos.back()) //a para end in apo doesn't count bWasParaEnd = false; //kein CR |