summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2008-04-24 13:27:25 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2008-04-24 13:27:25 +0000
commitc022c3369ef0be8fd0fa72366a16292dc7dffd11 (patch)
tree13516e82152bf72f1fb8d7c238f23da06f8b5e7c /sax
parente93ac62f84f7d8d4d17ba2ea0fbeb8131ccc9db7 (diff)
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')
-rw-r--r--sax/source/expatwrap/saxwriter.cxx18
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();
}