diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-04-11 20:00:14 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-04-11 23:08:11 +0200 |
commit | e98e738a82885b6e7fb643bf407e504fe095803e (patch) | |
tree | 88cd7e8feddf736a7672a2d73349f5df07e65d68 /vcl | |
parent | add a ras import test (diff) | |
download | core-e98e738a82885b6e7fb643bf407e504fe095803e.tar.gz core-e98e738a82885b6e7fb643bf407e504fe095803e.zip |
replace some SvStream seeking with calls to remainingSize()
Change-Id: I2905e98425b9991d6138ab0adc15083d313ca445
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/dibtools.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/svgdata.cxx | 4 |
2 files changed, 2 insertions, 8 deletions
diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx index e46b7d3bf9e1..e67a7cb727f3 100644 --- a/vcl/source/gdi/dibtools.cxx +++ b/vcl/source/gdi/dibtools.cxx @@ -427,11 +427,7 @@ bool ImplReadDIBBits(SvStream& rIStm, DIBV5Header& rHeader, BitmapWriteAccess& r { if(!rHeader.nSizeImage) { - const sal_uLong nOldPos(rIStm.Tell()); - - rIStm.Seek(STREAM_SEEK_TO_END); - rHeader.nSizeImage = rIStm.Tell() - nOldPos; - rIStm.Seek(nOldPos); + rHeader.nSizeImage = rIStm.remainingSize(); } sal_uInt8* pBuffer = (sal_uInt8*)rtl_allocateMemory(rHeader.nSizeImage); diff --git a/vcl/source/gdi/svgdata.cxx b/vcl/source/gdi/svgdata.cxx index 4080f5d36d67..b844c502c689 100644 --- a/vcl/source/gdi/svgdata.cxx +++ b/vcl/source/gdi/svgdata.cxx @@ -173,12 +173,10 @@ SvgData::SvgData(const OUString& rPath): SvFileStream rIStm(rPath, STREAM_STD_READ); if(rIStm.GetError()) return; - const sal_uInt32 nStmPos(rIStm.Tell()); - const sal_uInt32 nStmLen(rIStm.Seek(STREAM_SEEK_TO_END) - nStmPos); + const sal_uInt32 nStmLen(rIStm.remainingSize()); if(nStmLen) { SvgDataArray aNewData(new sal_uInt8[nStmLen]); - rIStm.Seek(nStmPos); rIStm.Read(aNewData.get(), nStmLen); if(!rIStm.GetError()) |