diff options
Diffstat (limited to 'filter/source/graphicfilter/ios2met/ios2met.cxx')
-rw-r--r-- | filter/source/graphicfilter/ios2met/ios2met.cxx | 15 |
1 files changed, 5 insertions, 10 deletions
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; |