summaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-04-11 20:00:14 +0200
committerMichael Stahl <mstahl@redhat.com>2014-04-11 23:08:11 +0200
commite98e738a82885b6e7fb643bf407e504fe095803e (patch)
tree88cd7e8feddf736a7672a2d73349f5df07e65d68 /filter
parentadd a ras import test (diff)
downloadcore-e98e738a82885b6e7fb643bf407e504fe095803e.tar.gz
core-e98e738a82885b6e7fb643bf407e504fe095803e.zip
replace some SvStream seeking with calls to remainingSize()
Change-Id: I2905e98425b9991d6138ab0adc15083d313ca445
Diffstat (limited to 'filter')
-rw-r--r--filter/source/graphicfilter/icgm/cgm.cxx3
-rw-r--r--filter/source/graphicfilter/ios2met/ios2met.cxx15
-rw-r--r--filter/source/graphicfilter/ipict/ipict.cxx10
3 files changed, 11 insertions, 17 deletions
diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx
index cc3205c527b2..0b1882f2e3c5 100644
--- a/filter/source/graphicfilter/icgm/cgm.cxx
+++ b/filter/source/graphicfilter/icgm/cgm.cxx
@@ -719,8 +719,7 @@ ImportCGM( OUString& rFileName, uno::Reference< frame::XModel > & rXModel, sal_u
if ( pIn )
{
pIn->SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
- pIn->Seek( STREAM_SEEK_TO_END );
- sal_uInt32 nInSize = pIn->Tell();
+ sal_uInt64 const nInSize = pIn->remainingSize();
pIn->Seek( 0 );
#ifdef CGM_EXPORT_IMPRESS
diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx
index e0acde9d932b..2fcfdea5b144 100644
--- a/filter/source/graphicfilter/ios2met/ios2met.cxx
+++ b/filter/source/graphicfilter/ios2met/ios2met.cxx
@@ -2521,7 +2521,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
{
sal_uInt16 nFieldSize;
sal_uInt16 nFieldType;
- sal_uLong nPos, nStartPos, nEndPos, nPercent, nLastPercent;
+ sal_uLong nPercent, nLastPercent;
sal_uInt8 nMagicByte;
ErrorCode=0;
@@ -2586,20 +2586,15 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
pOS2MET->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
- nStartPos=pOS2MET->Tell();
- nEndPos=pOS2MET->Seek(STREAM_SEEK_TO_END); pOS2MET->Seek(nStartPos);
+ sal_uInt64 const nStartPos = pOS2MET->Tell();
+ sal_uInt64 const nRemaining = pOS2MET->remainingSize();
Callback(0); nLastPercent=0;
- nPos=pOS2MET->Tell();
- if ( nStartPos == nEndPos )
- {
- nEndPos = 100;
- nStartPos = 0;
- }
+ sal_uInt64 nPos = pOS2MET->Tell();
for (;;) {
- nPercent=(nPos-nStartPos)*100/(nEndPos-nStartPos);
+ nPercent = (nPos-nStartPos)*100 / nRemaining;
if (nLastPercent+4<=nPercent) {
if (Callback((sal_uInt16)nPercent)==sal_True) break;
nLastPercent=nPercent;
diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx
index 0292f0a700d5..43386722689f 100644
--- a/filter/source/graphicfilter/ipict/ipict.cxx
+++ b/filter/source/graphicfilter/ipict/ipict.cxx
@@ -1780,7 +1780,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
{
sal_uInt16 nOpcode;
sal_uInt8 nOneByteOpcode;
- sal_uLong nSize, nPos, nStartPos, nEndPos, nPercent, nLastPercent;
+ sal_uLong nSize, nPercent, nLastPercent;
pPict = &rStreamPict;
nOrigPos = pPict->Tell();
@@ -1806,8 +1806,8 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
pPict->SetNumberFormatInt(NUMBERFORMAT_INT_BIGENDIAN);
- nStartPos=pPict->Tell();
- nEndPos=pPict->Seek(STREAM_SEEK_TO_END); pPict->Seek(nStartPos);
+ sal_uInt64 const nStartPos=pPict->Tell();
+ sal_uInt64 const nRemaining = pPict->remainingSize();
Callback(0); nLastPercent=0;
ReadHeader();
@@ -1815,11 +1815,11 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
aPenPosition=Point(-aBoundingRect.Left(),-aBoundingRect.Top());
aTextPosition=aPenPosition;
- nPos=pPict->Tell();
+ sal_uInt64 nPos=pPict->Tell();
for (;;) {
- nPercent=(nPos-nStartPos)*100/(nEndPos-nStartPos);
+ nPercent = (nPos-nStartPos) * 100 / nRemaining;
if (nLastPercent+4<=nPercent) {
if (Callback((sal_uInt16)nPercent)==sal_True) break;
nLastPercent=nPercent;