Kaydet (Commit) 5326c563 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: fdo#78040 nAryLen is traditionally 32bit not 16bit

30bb1edd originally incorrectly
changed some different 16bit numbers to 32bit, then
02abb559 reverted those 16bit->32bit
changes but accidentally changed the 32bit nAryLen to 16bit but
that was 32bit before 30bb1edd

Change-Id: I36863b62418d7a3b5ccce51aef86c63c523f9598
üst c26ba0d3
...@@ -1094,7 +1094,7 @@ MetaTextArrayAction::MetaTextArrayAction( const MetaTextArrayAction& rAction ) : ...@@ -1094,7 +1094,7 @@ MetaTextArrayAction::MetaTextArrayAction( const MetaTextArrayAction& rAction ) :
{ {
if( rAction.mpDXAry ) if( rAction.mpDXAry )
{ {
const sal_uLong nAryLen = mnLen; const sal_Int32 nAryLen = mnLen;
mpDXAry = new sal_Int32[ nAryLen ]; mpDXAry = new sal_Int32[ nAryLen ];
memcpy( mpDXAry, rAction.mpDXAry, nAryLen * sizeof( sal_Int32 ) ); memcpy( mpDXAry, rAction.mpDXAry, nAryLen * sizeof( sal_Int32 ) );
...@@ -1114,7 +1114,7 @@ MetaTextArrayAction::MetaTextArrayAction( const Point& rStartPt, ...@@ -1114,7 +1114,7 @@ MetaTextArrayAction::MetaTextArrayAction( const Point& rStartPt,
mnIndex ( nIndex ), mnIndex ( nIndex ),
mnLen ( nLen ) mnLen ( nLen )
{ {
const sal_uLong nAryLen = pDXAry ? mnLen : 0; const sal_Int32 nAryLen = pDXAry ? mnLen : 0;
if( nAryLen ) if( nAryLen )
{ {
...@@ -1177,7 +1177,7 @@ void MetaTextArrayAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) ...@@ -1177,7 +1177,7 @@ void MetaTextArrayAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
rOStm.WriteUniOrByteString( maStr, pData->meActualCharSet ); rOStm.WriteUniOrByteString( maStr, pData->meActualCharSet );
rOStm.WriteUInt16(mnIndex); rOStm.WriteUInt16(mnIndex);
rOStm.WriteUInt16(mnLen); rOStm.WriteUInt16(mnLen);
rOStm.WriteUInt16(nAryLen); rOStm.WriteInt32(nAryLen);
for (sal_Int32 i = 0; i < nAryLen; ++i) for (sal_Int32 i = 0; i < nAryLen; ++i)
rOStm.WriteInt32( mpDXAry[ i ] ); rOStm.WriteInt32( mpDXAry[ i ] );
...@@ -1187,8 +1187,6 @@ void MetaTextArrayAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) ...@@ -1187,8 +1187,6 @@ void MetaTextArrayAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData ) void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
{ {
sal_Int32 nAryLen;
delete[] mpDXAry; delete[] mpDXAry;
VersionCompat aCompat(rIStm, STREAM_READ); VersionCompat aCompat(rIStm, STREAM_READ);
...@@ -1200,9 +1198,8 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData ) ...@@ -1200,9 +1198,8 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
sal_uInt16 nTmpLen(0); sal_uInt16 nTmpLen(0);
rIStm.ReadUInt16(nTmpLen); rIStm.ReadUInt16(nTmpLen);
mnLen = nTmpLen; mnLen = nTmpLen;
sal_uInt16 nTmpAryLen(0); sal_Int32 nAryLen(0);
rIStm.ReadUInt16(nTmpAryLen); rIStm.ReadInt32(nAryLen);
nAryLen = nTmpAryLen;
if ( mnIndex + mnLen > maStr.getLength() ) if ( mnIndex + mnLen > maStr.getLength() )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment