diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-04-05 17:38:01 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-04-05 21:37:46 +0100 |
commit | 211833e0ff7b8d3387e793b8c56d8fed99af40e8 (patch) | |
tree | 9c0379c553b8cd11a0007e910f1c32c21b054bd7 /sw | |
parent | 4443d7be61a9ae45630183d856a566cecd06ad95 (diff) |
ofz: convert to unicode may fail, so only advance insertion on success
Change-Id: I3ab25a9075a559f7a3eb51488e243a4302ad87fe
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 1c843489449a..dab0c4e5474d 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -3074,7 +3074,7 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, sal_Int32 nEnd, sal_Int32 nCp nCTLLang = static_cast<const SvxLanguageItem *>(pItem)->GetLanguage(); sal_Int32 nL2; - for( nL2 = 0; nL2 < nStrLen; ++nL2, ++pWork ) + for (nL2 = 0; nL2 < nStrLen; ++nL2) { if (m_bIsUnicode) m_pStrm->ReadUInt16( nUCode ); // unicode --> read 2 bytes @@ -3101,7 +3101,7 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, sal_Int32 nEnd, sal_Int32 nCp if (m_bIsUnicode) { if (!m_bVer67) - *pWork = nUCode; + *pWork++ = nUCode; else { if (nUCode >= 0x3000) //0x8000 ? @@ -3111,12 +3111,12 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, sal_Int32 nEnd, sal_Int32 nCp aTest[1] = static_cast< sal_Char >(nUCode & 0x00FF); OUString aTemp(aTest, 2, eSrcCJKCharSet); OSL_ENSURE(aTemp.getLength() == 1, "so much for that theory"); - *pWork = aTemp[0]; + *pWork++ = aTemp[0]; } else { sal_Char cTest = static_cast< sal_Char >(nUCode & 0x00FF); - Custom8BitToUnicode(hConverter, &cTest, 1, pWork, 1); + pWork += Custom8BitToUnicode(hConverter, &cTest, 1, pWork, 1); } } } @@ -3128,7 +3128,7 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, sal_Int32 nEnd, sal_Int32 nCp { const sal_Int32 nEndUsed = !m_bIsUnicode ? Custom8BitToUnicode(hConverter, p8Bits, nL2, pBuffer, nStrLen) - : nL2; + : pWork - pBuffer; if (m_bRegardHindiDigits && m_bBidi && LangUsesHindiNumbers(nCTLLang)) { |