Kaydet (Commit) 33e318fa authored tarafından Keith McRae's avatar Keith McRae Kaydeden (comit) Kohei Yoshida

fdo#39428 Remove/audit SvStream operator>>/<<(long)

Replaced calls to operator<<(long) with sal::static_int_cast<sal_Int32>
Replaced calls to operator>>(long) with operator>>(sal_Int32)
üst c6f2e3e4
......@@ -698,8 +698,12 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
LineInfo aLineInfo;
sal_uInt32 nStyle;
Size aSize;
//#fdo39428 Remove SvStream operator>>(long&)
sal_Int32 nTmpW(0), nTmpH(0);
*pWMF >> nStyle >> aSize.Width() >> aSize.Height();
*pWMF >> nStyle >> nTmpW >> nTmpH;
aSize.Width() = nTmpW;
aSize.Height() = nTmpH;
if ( aSize.Width() )
aLineInfo.SetWidth( aSize.Width() );
......
......@@ -908,9 +908,13 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
SvMemoryStream aMemoryStream( nEscLen );
aMemoryStream.Write( pData, nEscLen );
aMemoryStream.Seek( STREAM_SEEK_TO_BEGIN );
aMemoryStream >> aPt.X()
>> aPt.Y()
//#fdo39428 SvStream no longer supports operator>>(long&)
sal_Int32 nTmpX(0), nTmpY(0);
aMemoryStream >> nTmpX
>> nTmpY
>> nStringLen;
aPt.X() = nTmpX;
aPt.Y() = nTmpY;
if ( ( static_cast< sal_uInt64 >( nStringLen ) * sizeof( sal_Unicode ) ) < ( nEscLen - aMemoryStream.Tell() ) )
{
......
......@@ -95,7 +95,13 @@ SvStream& operator>>( SvStream& rIStm, GraphicAttr& rAttr )
if( aCompat.GetVersion() >= 2 )
{
rIStm >> rAttr.mnLeftCrop >> rAttr.mnTopCrop >> rAttr.mnRightCrop >> rAttr.mnBottomCrop;
//#fdo39428 SvStream no longer supports operator>>(long&)
sal_Int32 nTmpL(0), nTmpT(0), nTmpR(0), nTmpB(0);
rIStm >> nTmpL >> nTmpT >> nTmpR >> nTmpB;
rAttr.mnLeftCrop = nTmpL;
rAttr.mnTopCrop = nTmpT;
rAttr.mnRightCrop = nTmpR;
rAttr.mnBottomCrop = nTmpB;
}
return rIStm;
......@@ -111,7 +117,11 @@ SvStream& operator<<( SvStream& rOStm, const GraphicAttr& rAttr )
rOStm << nTmp32 << nTmp32 << rAttr.mfGamma << rAttr.mnMirrFlags << rAttr.mnRotate10;
rOStm << rAttr.mnContPercent << rAttr.mnLumPercent << rAttr.mnRPercent << rAttr.mnGPercent << rAttr.mnBPercent;
rOStm << rAttr.mbInvert << rAttr.mcTransparency << (sal_uInt16) rAttr.meDrawMode;
rOStm << rAttr.mnLeftCrop << rAttr.mnTopCrop << rAttr.mnRightCrop << rAttr.mnBottomCrop;
//#fdo39428 SvStream no longer supports operator<<(long)
rOStm << sal::static_int_cast<sal_Int32>(rAttr.mnLeftCrop)
<< sal::static_int_cast<sal_Int32>(rAttr.mnTopCrop)
<< sal::static_int_cast<sal_Int32>(rAttr.mnRightCrop)
<< sal::static_int_cast<sal_Int32>(rAttr.mnBottomCrop);
return rOStm;
}
......
......@@ -88,16 +88,23 @@ using namespace ::com::sun::star::datatransfer::dnd;
SvStream& operator>>( SvStream& rIStm, TransferableObjectDescriptor& rObjDesc )
{
sal_uInt32 nSize, nViewAspect, nSig1, nSig2;
//#fdo39428 Remove SvStream operator>>(long&)
sal_Int32 nTmp(0);
rIStm >> nSize;
rIStm >> rObjDesc.maClassName;
rIStm >> nViewAspect;
rIStm >> rObjDesc.maSize.Width();
rIStm >> rObjDesc.maSize.Height();
rIStm >> rObjDesc.maDragStartPos.X();
rIStm >> rObjDesc.maDragStartPos.Y();
rIStm >> nTmp;
rObjDesc.maSize.Width() = nTmp;
rIStm >> nTmp;
rObjDesc.maSize.Height() = nTmp;
rIStm >> nTmp;
rObjDesc.maDragStartPos.X() = nTmp;
rIStm >> nTmp;
rObjDesc.maDragStartPos.Y() = nTmp;
rObjDesc.maTypeName = rIStm.ReadUniOrByteString(osl_getThreadTextEncoding());
rObjDesc.maDisplayName = rIStm.ReadUniOrByteString(osl_getThreadTextEncoding());
rIStm >> nSig1 >> nSig2;
rObjDesc.mnViewAspect = static_cast< sal_uInt16 >( nViewAspect );
......@@ -122,10 +129,11 @@ SvStream& operator<<( SvStream& rOStm, const TransferableObjectDescriptor& rObjD
rOStm.SeekRel( 4 );
rOStm << rObjDesc.maClassName;
rOStm << nViewAspect;
rOStm << rObjDesc.maSize.Width();
rOStm << rObjDesc.maSize.Height();
rOStm << rObjDesc.maDragStartPos.X();
rOStm << rObjDesc.maDragStartPos.Y();
//#fdo39428 Remove SvStream operator<<(long)
rOStm << sal::static_int_cast<sal_Int32>(rObjDesc.maSize.Width());
rOStm << sal::static_int_cast<sal_Int32>(rObjDesc.maSize.Height());
rOStm << sal::static_int_cast<sal_Int32>(rObjDesc.maDragStartPos.X());
rOStm << sal::static_int_cast<sal_Int32>(rObjDesc.maDragStartPos.Y());
rOStm.WriteUniOrByteString( rObjDesc.maTypeName, osl_getThreadTextEncoding() );
rOStm.WriteUniOrByteString( rObjDesc.maDisplayName, osl_getThreadTextEncoding() );
rOStm << nSig1 << nSig2;
......
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