View | Details | Raw Unified | Return to issue 66693
Collapse All | Expand All

(-)sax/source/expatwrap/saxwriter.cxx.old (-11 / +11 lines)
Lines 455-461 inline sal_Bool SaxWriterHelper::convert Link Here
455
		    						  sal_Int8(0x80 | ((nSurrogate >>  6) & 0x3F)),
455
		    						  sal_Int8(0x80 | ((nSurrogate >>  6) & 0x3F)),
456
			    					  sal_Int8(0x80 | ((nSurrogate >>  0) & 0x3F)) };
456
			    					  sal_Int8(0x80 | ((nSurrogate >>  0) & 0x3F)) };
457
    			if ((rPos + 4) > SEQUENCESIZE)
457
    			if ((rPos + 4) > SEQUENCESIZE)
458
	    			AddBytes(pTarget, rPos, aBytes, 3);
458
	    			AddBytes(pTarget, rPos, aBytes, 4);
459
		    	else
459
		    	else
460
			    {
460
			    {
461
				    pTarget[rPos] = aBytes[0];
461
				    pTarget[rPos] = aBytes[0];
Lines 565-570 inline void SaxWriterHelper::insertInden Link Here
565
	}
565
	}
566
	else
566
	else
567
	{
567
	{
568
		if (nCurrentPos == SEQUENCESIZE)
569
			nCurrentPos = writeSequence();
568
		mp_Sequence[nCurrentPos] = LINEFEED;
570
		mp_Sequence[nCurrentPos] = LINEFEED;
569
		nLastLineFeedPos = nCurrentPos;
571
		nLastLineFeedPos = nCurrentPos;
570
		nCurrentPos++;
572
		nCurrentPos++;
Lines 590-611 inline void SaxWriterHelper::startDocume Link Here
590
{
592
{
591
	const char pc[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
593
	const char pc[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
592
	const int nLen = strlen( pc );
594
	const int nLen = strlen( pc );
593
	if ((nCurrentPos + nLen + 1) <= SEQUENCESIZE)
595
	if ((nCurrentPos + nLen) <= SEQUENCESIZE)
594
	{
596
	{
595
		memcpy( mp_Sequence, pc , nLen );
597
		memcpy( mp_Sequence, pc , nLen );
596
		nCurrentPos += nLen;
598
		nCurrentPos += nLen;
597
		mp_Sequence[nCurrentPos] = LINEFEED;
598
		nCurrentPos++;
599
	}
599
	}
600
	else
600
	else
601
	{
602
		AddBytes(mp_Sequence, nCurrentPos, (sal_Int8*)pc, nLen);
601
		AddBytes(mp_Sequence, nCurrentPos, (sal_Int8*)pc, nLen);
603
		OSL_ENSURE(nCurrentPos <= SEQUENCESIZE, "not reset current position");
602
604
		if (nCurrentPos == SEQUENCESIZE)
603
	OSL_ENSURE(nCurrentPos <= SEQUENCESIZE, "not reset current position");
605
			nCurrentPos = writeSequence();
604
	if (nCurrentPos == SEQUENCESIZE)
606
		mp_Sequence[nCurrentPos] = LINEFEED;
605
		nCurrentPos = writeSequence();
607
		nCurrentPos++;
606
	mp_Sequence[nCurrentPos] = LINEFEED;
608
	}
607
	nCurrentPos++;
608
	
609
	if (nCurrentPos == SEQUENCESIZE)
609
	if (nCurrentPos == SEQUENCESIZE)
610
		nCurrentPos = writeSequence();
610
		nCurrentPos = writeSequence();
611
}
611
}

Return to issue 66693