diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2008-04-24 13:27:25 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2008-04-24 13:27:25 +0000 |
commit | c022c3369ef0be8fd0fa72366a16292dc7dffd11 (patch) | |
tree | 13516e82152bf72f1fb8d7c238f23da06f8b5e7c /sax/source | |
parent | INTEGRATION: CWS hr50 (1.95.26); FILE MERGED (diff) | |
download | core-c022c3369ef0be8fd0fa72366a16292dc7dffd11.tar.gz core-c022c3369ef0be8fd0fa72366a16292dc7dffd11.zip |
INTEGRATION: CWS mib07 (1.19.16); FILE MERGED
2008/01/02 13:28:48 mib 1.19.16.1: #i66693#: applied patch for resolving issue with surrogates
Diffstat (limited to 'sax/source')
-rw-r--r-- | sax/source/expatwrap/saxwriter.cxx | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx index 14cfa583fc3d..fd9e15fb783d 100644 --- a/sax/source/expatwrap/saxwriter.cxx +++ b/sax/source/expatwrap/saxwriter.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: saxwriter.cxx,v $ - * $Revision: 1.20 $ + * $Revision: 1.21 $ * * This file is part of OpenOffice.org. * @@ -441,7 +441,7 @@ inline sal_Bool SaxWriterHelper::convertToXML( const sal_Unicode * pStr, sal_Int8(0x80 | ((nSurrogate >> 6) & 0x3F)), sal_Int8(0x80 | ((nSurrogate >> 0) & 0x3F)) }; if ((rPos + 4) > SEQUENCESIZE) - AddBytes(pTarget, rPos, aBytes, 3); + AddBytes(pTarget, rPos, aBytes, 4); else { pTarget[rPos] = aBytes[0]; @@ -576,22 +576,20 @@ inline void SaxWriterHelper::startDocument() throw( SAXException ) { const char pc[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; const int nLen = strlen( pc ); - if ((nCurrentPos + nLen + 1) <= SEQUENCESIZE) + if ((nCurrentPos + nLen) <= SEQUENCESIZE) { memcpy( mp_Sequence, pc , nLen ); nCurrentPos += nLen; - mp_Sequence[nCurrentPos] = LINEFEED; - nCurrentPos++; } else { AddBytes(mp_Sequence, nCurrentPos, (sal_Int8*)pc, nLen); - OSL_ENSURE(nCurrentPos <= SEQUENCESIZE, "not reset current position"); - if (nCurrentPos == SEQUENCESIZE) - nCurrentPos = writeSequence(); - mp_Sequence[nCurrentPos] = LINEFEED; - nCurrentPos++; } + OSL_ENSURE(nCurrentPos <= SEQUENCESIZE, "not reset current position"); + if (nCurrentPos == SEQUENCESIZE) + nCurrentPos = writeSequence(); + mp_Sequence[nCurrentPos] = LINEFEED; + nCurrentPos++; if (nCurrentPos == SEQUENCESIZE) nCurrentPos = writeSequence(); } |