summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorKeith McRae <keithcoder@gmail.com>2012-01-18 16:18:30 +0000
committerKohei Yoshida <kohei.yoshida@suse.com>2012-01-18 22:56:14 -0500
commit33e318faeac6f2895952ec69a6e338e07fe5ff39 (patch)
treea8efe3dd413174fc13d6018417f41d04751cd4a5 /svtools
parentc6f2e3e46db30e0d7e4f53270ceda6d4b9c8f955 (diff)
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)
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/filter/wmf/enhwmf.cxx6
-rw-r--r--svtools/source/filter/wmf/winwmf.cxx8
-rw-r--r--svtools/source/graphic/grfattr.cxx14
-rw-r--r--svtools/source/misc/transfer.cxx24
4 files changed, 39 insertions, 13 deletions
diff --git a/svtools/source/filter/wmf/enhwmf.cxx b/svtools/source/filter/wmf/enhwmf.cxx
index db6a27118e04..9664b092927b 100644
--- a/svtools/source/filter/wmf/enhwmf.cxx
+++ b/svtools/source/filter/wmf/enhwmf.cxx
@@ -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() );
diff --git a/svtools/source/filter/wmf/winwmf.cxx b/svtools/source/filter/wmf/winwmf.cxx
index 3b53cbaf5a22..c6e76d724625 100644
--- a/svtools/source/filter/wmf/winwmf.cxx
+++ b/svtools/source/filter/wmf/winwmf.cxx
@@ -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() ) )
{
diff --git a/svtools/source/graphic/grfattr.cxx b/svtools/source/graphic/grfattr.cxx
index 67495cfdb412..c079f4831a99 100644
--- a/svtools/source/graphic/grfattr.cxx
+++ b/svtools/source/graphic/grfattr.cxx
@@ -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;
}
diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx
index 5fa1e5b0d9fe..87b31647a3f4 100644
--- a/svtools/source/misc/transfer.cxx
+++ b/svtools/source/misc/transfer.cxx
@@ -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;