rework this in terms of read_uInt8s_AsOString
This commit is contained in:
@@ -674,16 +674,13 @@ void ONDXNode::Read(SvStream &rStream, ODbaseIndex& rIndex)
|
||||
}
|
||||
else
|
||||
{
|
||||
ByteString aBuf;
|
||||
sal_uInt16 nLen = rIndex.getHeader().db_keylen;
|
||||
char* pStr = aBuf.AllocBuffer(nLen+1);
|
||||
|
||||
rStream.Read(pStr,nLen);
|
||||
pStr[nLen] = 0;
|
||||
aBuf.ReleaseBufferAccess();
|
||||
aBuf.EraseTrailingChars();
|
||||
|
||||
aKey = ONDXKey(::rtl::OUString(aBuf.GetBuffer(),aBuf.Len(),rIndex.m_pTable->getConnection()->getTextEncoding()) ,aKey.nRecord);
|
||||
rtl::OString aBuf = read_uInt8s_AsOString(rStream, nLen);
|
||||
//get length minus trailing whitespace
|
||||
sal_Int32 nContentLen = aBuf.getLength();
|
||||
while (nContentLen && aBuf[nContentLen-1] == ' ')
|
||||
--nContentLen;
|
||||
aKey = ONDXKey(::rtl::OUString(aBuf.getStr(), nContentLen, rIndex.m_pTable->getConnection()->getTextEncoding()) ,aKey.nRecord);
|
||||
}
|
||||
rStream >> aChild;
|
||||
}
|
||||
|
@@ -277,11 +277,9 @@ sal_Bool SfxHTMLParser::FinishFileDownload( String& rStr )
|
||||
? (xub_StrLen)aStream.Tell()
|
||||
: STRING_MAXLEN;
|
||||
|
||||
ByteString sBuffer;
|
||||
sal_Char* pBuffer = sBuffer.AllocBuffer(nLen);
|
||||
aStream.Seek( 0 );
|
||||
aStream.Read((void*)pBuffer, nLen);
|
||||
rStr = String( S2U(pBuffer) );
|
||||
rtl::OString sBuffer = read_uInt8s_AsOString(aStream, nLen);
|
||||
rStr = S2U(sBuffer);
|
||||
}
|
||||
|
||||
delete pDLMedium;
|
||||
|
@@ -259,15 +259,12 @@ sal_Bool GIFReader::ReadExtension()
|
||||
// Appl.-Extension hat Laenge 11
|
||||
if ( cSize == 0x0b )
|
||||
{
|
||||
ByteString aAppId;
|
||||
ByteString aAppCode;
|
||||
|
||||
rIStm.Read( aAppId.AllocBuffer( 8 ), 8 );
|
||||
rIStm.Read( aAppCode.AllocBuffer( 3 ), 3 );
|
||||
rtl::OString aAppId = read_uInt8s_AsOString(rIStm, 8);
|
||||
rtl::OString aAppCode = read_uInt8s_AsOString(rIStm, 3);
|
||||
rIStm >> cSize;
|
||||
|
||||
// NetScape-Extension
|
||||
if( aAppId == "NETSCAPE" && aAppCode == "2.0" && cSize == 3 )
|
||||
if( aAppId.equalsL(RTL_CONSTASCII_STRINGPARAM("NETSCAPE")) && aAppCode.equalsL(RTL_CONSTASCII_STRINGPARAM("2.0")) && cSize == 3 )
|
||||
{
|
||||
rIStm >> cByte;
|
||||
|
||||
@@ -294,7 +291,7 @@ sal_Bool GIFReader::ReadExtension()
|
||||
else
|
||||
rIStm.SeekRel( -1 );
|
||||
}
|
||||
else if ( aAppId == "STARDIV " && aAppCode == "5.0" && cSize == 9 )
|
||||
else if ( aAppId.equalsL(RTL_CONSTASCII_STRINGPARAM("STARDIV ")) && aAppCode.equalsL(RTL_CONSTASCII_STRINGPARAM("5.0")) && cSize == 9 )
|
||||
{
|
||||
rIStm >> cByte;
|
||||
|
||||
|
@@ -882,33 +882,39 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
|
||||
|
||||
case( GDI_TEXT_ACTION ):
|
||||
{
|
||||
ByteString aByteStr;
|
||||
sal_Int32 nIndex, nLen;
|
||||
|
||||
rIStm >> aPt >> nIndex >> nLen >> nTmp;
|
||||
if ( nTmp && ( static_cast< sal_uInt32 >( nTmp ) < ( SAL_MAX_UINT16 - 1 ) ) )
|
||||
{
|
||||
rIStm.Read( aByteStr.AllocBuffer( (sal_uInt16)nTmp ), nTmp + 1 );
|
||||
UniString aStr( aByteStr, eActualCharSet );
|
||||
{
|
||||
rtl::OString aByteStr = read_uInt8s_AsOString(rIStm, nTmp);
|
||||
sal_uInt8 nTerminator = 0;
|
||||
rIStm >> nTerminator;
|
||||
DBG_ASSERT( nTerminator == 0, "expected string to be NULL terminated" );
|
||||
|
||||
UniString aStr(rtl::OStringToOUString(aByteStr, eActualCharSet));
|
||||
if ( nUnicodeCommentActionNumber == i )
|
||||
ImplReadUnicodeComment( nUnicodeCommentStreamPos, rIStm, aStr );
|
||||
rMtf.AddAction( new MetaTextAction( aPt, aStr, (sal_uInt16) nIndex, (sal_uInt16) nLen ) );
|
||||
}
|
||||
rIStm.Seek( nActBegin + nActionSize );
|
||||
rIStm.Seek( nActBegin + nActionSize );
|
||||
}
|
||||
break;
|
||||
|
||||
case( GDI_TEXTARRAY_ACTION ):
|
||||
{
|
||||
ByteString aByteStr;
|
||||
sal_Int32* pDXAry = NULL;
|
||||
sal_Int32 nIndex, nLen, nAryLen;
|
||||
|
||||
rIStm >> aPt >> nIndex >> nLen >> nTmp >> nAryLen;
|
||||
if ( nTmp && ( static_cast< sal_uInt32 >( nTmp ) < ( SAL_MAX_UINT16 - 1 ) ) )
|
||||
{
|
||||
rIStm.Read( aByteStr.AllocBuffer( (sal_uInt16)nTmp ), nTmp + 1 );
|
||||
UniString aStr( aByteStr, eActualCharSet );
|
||||
rtl::OString aByteStr = read_uInt8s_AsOString(rIStm, nTmp);
|
||||
sal_uInt8 nTerminator = 0;
|
||||
rIStm >> nTerminator;
|
||||
DBG_ASSERT( nTerminator == 0, "expected string to be NULL terminated" );
|
||||
|
||||
UniString aStr(rtl::OStringToOUString(aByteStr, eActualCharSet));
|
||||
|
||||
if( nAryLen > 0L )
|
||||
{
|
||||
@@ -955,25 +961,28 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
|
||||
if( pDXAry )
|
||||
delete[] pDXAry;
|
||||
}
|
||||
rIStm.Seek( nActBegin + nActionSize );
|
||||
rIStm.Seek( nActBegin + nActionSize );
|
||||
}
|
||||
break;
|
||||
|
||||
case( GDI_STRETCHTEXT_ACTION ):
|
||||
{
|
||||
ByteString aByteStr;
|
||||
sal_Int32 nIndex, nLen, nWidth;
|
||||
|
||||
rIStm >> aPt >> nIndex >> nLen >> nTmp >> nWidth;
|
||||
if ( nTmp && ( static_cast< sal_uInt32 >( nTmp ) < ( SAL_MAX_INT16 - 1 ) ) )
|
||||
{
|
||||
rIStm.Read( aByteStr.AllocBuffer( (sal_uInt16)nTmp ), nTmp + 1 );
|
||||
UniString aStr( aByteStr, eActualCharSet );
|
||||
rtl::OString aByteStr = read_uInt8s_AsOString(rIStm, nTmp);
|
||||
sal_uInt8 nTerminator = 0;
|
||||
rIStm >> nTerminator;
|
||||
DBG_ASSERT( nTerminator == 0, "expected string to be NULL terminated" );
|
||||
|
||||
UniString aStr(rtl::OStringToOUString(aByteStr, eActualCharSet));
|
||||
if ( nUnicodeCommentActionNumber == i )
|
||||
ImplReadUnicodeComment( nUnicodeCommentStreamPos, rIStm, aStr );
|
||||
rMtf.AddAction( new MetaStretchTextAction( aPt, nWidth, aStr, (sal_uInt16) nIndex, (sal_uInt16) nLen ) );
|
||||
}
|
||||
rIStm.Seek( nActBegin + nActionSize );
|
||||
rIStm.Seek( nActBegin + nActionSize );
|
||||
}
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user