summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2023-08-09 17:56:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-08-09 22:34:07 +0200
commitb321cf78808f918669139793a65a3bf4908faa46 (patch)
tree00fa1d66d3ed1ef626a872b7b503971b1b4e0372 /filter
parentd955016f31069b51761b7fe56d62aa2a44d7beda (diff)
use sal_uInt64 when dealing with stream position
Change-Id: I2c89096c306e1537622fc52644d20ae605183b35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/graphicfilter/icgm/cgm.cxx4
-rw-r--r--filter/source/msfilter/dffpropset.cxx4
-rw-r--r--filter/source/msfilter/escherex.cxx26
-rw-r--r--filter/source/msfilter/svdfppt.cxx30
4 files changed, 33 insertions, 31 deletions
diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx
index 62b3b8d67d00..e8488328356d 100644
--- a/filter/source/graphicfilter/icgm/cgm.cxx
+++ b/filter/source/graphicfilter/icgm/cgm.cxx
@@ -701,7 +701,7 @@ ImportCGM(SvStream& rIn, uno::Reference< frame::XModel > const & rXModel, css::u
sal_uInt64 const nInSize = rIn.remainingSize();
rIn.Seek(0);
- sal_uInt32 nNext = 0;
+ sal_uInt64 nNext = 0;
sal_uInt32 nAdd = nInSize / 20;
bool bProgressBar = aXStatInd.is();
if ( bProgressBar )
@@ -711,7 +711,7 @@ ImportCGM(SvStream& rIn, uno::Reference< frame::XModel > const & rXModel, css::u
{
if ( bProgressBar )
{
- sal_uInt32 nCurrentPos = rIn.Tell();
+ sal_uInt64 nCurrentPos = rIn.Tell();
if ( nCurrentPos >= nNext )
{
aXStatInd->setValue( nCurrentPos );
diff --git a/filter/source/msfilter/dffpropset.cxx b/filter/source/msfilter/dffpropset.cxx
index e6ef672b0328..15e203961f15 100644
--- a/filter/source/msfilter/dffpropset.cxx
+++ b/filter/source/msfilter/dffpropset.cxx
@@ -1108,7 +1108,7 @@ void DffPropSet::ReadPropSet( SvStream& rIn, bool bSetUninitializedOnly )
sal_uInt32 nPropCount = aHd.nRecInstance;
- sal_uInt32 nComplexDataFilePos = rIn.Tell() + ( nPropCount * 6 );
+ sal_uInt64 nComplexDataFilePos = rIn.Tell() + ( nPropCount * 6 );
const size_t nMaxPossibleRecords = rIn.remainingSize() / (sizeof(sal_uInt16) + sizeof(sal_uInt32));
if (nPropCount > nMaxPossibleRecords)
@@ -1176,7 +1176,7 @@ void DffPropSet::ReadPropSet( SvStream& rIn, bool bSetUninitializedOnly )
|| ( nRecType == DFF_Prop_textRectangles ) )
{
// now check if the current content size is possible, or 6 bytes too small
- sal_uInt32 nOldPos = rIn.Tell();
+ sal_uInt64 nOldPos = rIn.Tell();
sal_Int16 nNumElem(0), nNumElemReserved(0), nSize(0);
if (checkSeek(rIn, nComplexDataFilePos))
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 73ef01ca0504..c8115a3d3fb4 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -109,8 +109,8 @@ EscherExContainer::EscherExContainer( SvStream& rSt, const sal_uInt16 nRecType,
}
EscherExContainer::~EscherExContainer()
{
- sal_uInt32 nPos = rStrm.Tell();
- sal_uInt32 nSize= nPos - nContPos;
+ sal_uInt64 nPos = rStrm.Tell();
+ sal_uInt32 nSize = nPos - nContPos;
if ( nSize )
{
rStrm.Seek( nContPos - 4 );
@@ -127,8 +127,8 @@ EscherExAtom::EscherExAtom( SvStream& rSt, const sal_uInt16 nRecType, const sal_
}
EscherExAtom::~EscherExAtom()
{
- sal_uInt32 nPos = rStrm.Tell();
- sal_uInt32 nSize= nPos - nContPos;
+ sal_uInt64 nPos = rStrm.Tell();
+ sal_uInt32 nSize = nPos - nContPos;
if ( nSize )
{
rStrm.Seek( nContPos - 4 );
@@ -4054,7 +4054,8 @@ void EscherGraphicProvider::WriteBlibStoreContainer( SvStream& rSt, SvStream* pM
if ( pMergePicStreamBSE )
{
- sal_uInt32 nBlipSize, nOldPos = pMergePicStreamBSE->Tell();
+ sal_uInt32 nBlipSize;
+ sal_uInt64 nOldPos = pMergePicStreamBSE->Tell();
const sal_uInt32 nBuf = 0x40000; // 256KB buffer
std::unique_ptr<sal_uInt8[]> pBuf(new sal_uInt8[ nBuf ]);
@@ -4341,7 +4342,7 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, GraphicObjec
}
if ( nAtomSize )
{
- sal_uInt32 nPos = rPicOutStrm.Tell();
+ sal_uInt64 nPos = rPicOutStrm.Tell();
rPicOutStrm.Seek( nAtomSize - 4 );
rPicOutStrm.WriteUInt32( nPos - nAtomSize );
rPicOutStrm.Seek( nPos );
@@ -4921,7 +4922,8 @@ void EscherEx::Flush( SvStream* pPicStreamMergeBSE /* = NULL */ )
void EscherEx::InsertAtCurrentPos( sal_uInt32 nBytes )
{
- sal_uInt32 nSize, nType, nSource, nBufSize, nToCopy, nCurPos = mpOutStrm->Tell();
+ sal_uInt32 nSize, nType, nSource, nBufSize, nToCopy;
+ sal_uInt64 nCurPos = mpOutStrm->Tell();
// adjust persist table
for(auto const & pPtr : maPersistTable) {
@@ -4936,7 +4938,7 @@ void EscherEx::InsertAtCurrentPos( sal_uInt32 nBytes )
while ( mpOutStrm->Tell() < nCurPos )
{
mpOutStrm->ReadUInt32( nType ).ReadUInt32( nSize );
- sal_uInt32 nEndOfRecord = mpOutStrm->Tell() + nSize;
+ sal_uInt64 nEndOfRecord = mpOutStrm->Tell() + nSize;
bool bContainer = (nType & 0x0F) == 0x0F;
/* Expand the record, if the insertion position is inside, or if the
position is at the end of a container (expands always), or at the
@@ -5013,7 +5015,7 @@ bool EscherEx::SeekToPersistOffset( sal_uInt32 nKey )
void EscherEx::InsertAtPersistOffset( sal_uInt32 nKey, sal_uInt32 nValue )
{
- sal_uInt32 nOldPos = mpOutStrm->Tell();
+ sal_uInt64 nOldPos = mpOutStrm->Tell();
bool bRetValue = SeekToPersistOffset( nKey );
if ( bRetValue )
{
@@ -5124,7 +5126,7 @@ void EscherEx::BeginAtom()
void EscherEx::EndAtom( sal_uInt16 nRecType, int nRecVersion, int nRecInstance )
{
- sal_uInt32 nOldPos = mpOutStrm->Tell();
+ sal_uInt64 nOldPos = mpOutStrm->Tell();
mpOutStrm->Seek( mnCountOfs );
sal_uInt32 nSize = nOldPos - mnCountOfs;
mpOutStrm->WriteUInt16( ( nRecInstance << 4 ) | ( nRecVersion & 0xf ) ).WriteUInt16( nRecType ).WriteUInt32( nSize - 8 );
@@ -5216,7 +5218,7 @@ void EscherEx::SetGroupSnapRect( sal_uInt32 nGroupLevel, const tools::Rectangle&
{
if ( nGroupLevel )
{
- sal_uInt32 nCurrentPos = mpOutStrm->Tell();
+ sal_uInt64 nCurrentPos = mpOutStrm->Tell();
if ( DoSeek( ESCHER_Persist_Grouping_Snap | ( nGroupLevel - 1 ) ) )
{
mpOutStrm ->WriteInt32( rRect.Left() ) // Bounding box for the grouped shapes to which they will be attached
@@ -5232,7 +5234,7 @@ void EscherEx::SetGroupLogicRect( sal_uInt32 nGroupLevel, const tools::Rectangle
{
if ( nGroupLevel )
{
- sal_uInt32 nCurrentPos = mpOutStrm->Tell();
+ sal_uInt64 nCurrentPos = mpOutStrm->Tell();
if ( DoSeek( ESCHER_Persist_Grouping_Logic | ( nGroupLevel - 1 ) ) )
{
mpOutStrm->WriteInt16( rRect.Top() ).WriteInt16( rRect.Left() ).WriteInt16( rRect.Right() ).WriteInt16( rRect.Bottom() );
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 422d34e411bb..fa4c9c55d7dc 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -1782,7 +1782,7 @@ void PPTConvertOCXControls::GetDrawPage()
static bool SdrPowerPointOLEDecompress( SvStream& rOutput, SvStream& rInput, sal_uInt32 nInputSize )
{
- sal_uInt32 nOldPos = rInput.Tell();
+ sal_uInt64 nOldPos = rInput.Tell();
std::unique_ptr<char[]> pBuf(new char[ nInputSize ]);
rInput.ReadBytes(pBuf.get(), nInputSize);
ZCodec aZCodec( 0x8000, 0x8000 );
@@ -1803,7 +1803,7 @@ rtl::Reference<SdrObject> SdrPowerPointImport::ImportOLE( sal_uInt32 nOLEId,
{
rtl::Reference<SdrObject> pRet;
- sal_uInt32 nOldPos = rStCtrl.Tell();
+ sal_uInt64 nOldPos = rStCtrl.Tell();
Graphic aGraphic( rGraf );
@@ -2014,7 +2014,7 @@ void SdrPowerPointImport::SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOpt
DffRecordHeader* pHd;
- sal_uInt32 nOldPos = rStCtrl.Tell();
+ sal_uInt64 nOldPos = rStCtrl.Tell();
if ( nFilterOptions & 1 )
{
pHd = aDocRecManager.GetRecordHeader( PPT_PST_List );
@@ -2392,7 +2392,7 @@ bool SdrPowerPointImport::SeekToContentOfProgTag( sal_Int32 nVersion, SvStream&
const DffRecordHeader& rSourceHd, DffRecordHeader& rContentHd )
{
bool bRetValue = false;
- sal_uInt32 nOldPos = rSt.Tell();
+ sal_uInt64 nOldPos = rSt.Tell();
DffRecordHeader aProgTagsHd, aProgTagBinaryDataHd;
rSourceHd.SeekToContent( rSt );
@@ -2628,7 +2628,7 @@ bool SdrPowerPointImport::SeekToShape( SvStream& rSt, SvxMSDffClientData* pClien
nCurrent = pCList->nCurrent;
if ( const_cast<SdrPowerPointImport*>(this)->maShapeRecords.SeekToContent( rSt, DFF_msofbtClientData, SEEK_FROM_CURRENT_AND_RESTART ) )
{
- sal_uInt32 nStreamPos = rSt.Tell();
+ sal_uInt64 nStreamPos = rSt.Tell();
PPTTextObj aTextObj( rSt, const_cast<SdrPowerPointImport&>(*this), rPersistEntry, nullptr );
if ( aTextObj.Count() || aTextObj.GetOEPlaceHolderAtom() )
{
@@ -2755,7 +2755,7 @@ static void ImportComment10( SvxMSDffManager const & rMan, SvStream& rStCtrl, Sd
// be sure not to import masterpages with this method
void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry* pMasterPersist )
{
- sal_uInt32 nOldPos = rStCtrl.Tell();
+ sal_uInt64 nOldPos = rStCtrl.Tell();
PptSlidePersistList* pList = GetPageList( m_eCurrentPageKind );
if ( ( !pList ) || ( pList->size() <= m_nCurrentPageNum ) )
return;
@@ -2802,7 +2802,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
DffRecordHeader aPPDrawHd;
if ( SeekToRec( rStCtrl, DFF_msofbtDgContainer, aHd.GetRecEndFilePos(), &aPPDrawHd ) )
{
- sal_uInt32 nPPDrawOfs = rStCtrl.Tell();
+ sal_uInt64 nPPDrawOfs = rStCtrl.Tell();
// importing the background object before importing the page
auto nPPEndRecPos = SanitizeEndPos(rStCtrl, aPPDrawHd.GetRecEndFilePos());
@@ -2839,7 +2839,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
if ( pE->nBackgroundOffset )
{
// do not follow master colorscheme?
- sal_uInt32 nPos = rStCtrl.Tell();
+ sal_uInt64 nPos = rStCtrl.Tell();
rStCtrl.Seek( pE->nBackgroundOffset );
rSlidePersist.pBObj = ImportObj( rStCtrl, aProcessData, aPageSize, aPageSize, /*nCalledByGroup*/0, /*pShapeId*/nullptr );
rStCtrl.Seek( nPos );
@@ -3243,7 +3243,7 @@ bool PPTExtParaProv::GetGraphic( sal_uInt32 nInstance, Graphic& rGraph ) const
PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const DffRecordHeader* pHd ) :
bStyles ( false )
{
- sal_uInt32 nOldPos = rSt.Tell();
+ sal_uInt64 nOldPos = rSt.Tell();
// here we have to get the graphical bullets...
@@ -4099,7 +4099,7 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
PPTNumberFormatCreator ( std::make_unique<PPTExtParaProv>( rManager, rIn, &rSlideHd ) ),
maTxSI ( rTextSpecInfo )
{
- sal_uInt32 nOldFilePos = rIn.Tell();
+ sal_uInt64 nOldFilePos = rIn.Tell();
// default stylesheets
mpCharSheet[ TSS_Type::PageTitle ] = std::make_unique<PPTCharSheet>( TSS_Type::PageTitle );
@@ -4570,7 +4570,7 @@ PPTTextRulerInterpreter::PPTTextRulerInterpreter( sal_uInt32 nFileOfs, DffRecord
if ( nFileOfs == 0xffffffff )
return;
- sal_uInt32 nOldPos = rIn.Tell();
+ sal_uInt64 nOldPos = rIn.Tell();
DffRecordHeader rHd;
if ( nFileOfs )
{
@@ -5206,7 +5206,7 @@ void PPTStyleTextPropReader::ReadCharProps( SvStream& rIn, PPTCharPropSet& aChar
void PPTStyleTextPropReader::Init( SvStream& rIn, const DffRecordHeader& rTextHeader,
PPTTextRulerInterpreter const & rRuler, const DffRecordHeader& rExtParaHd, TSS_Type nInstance )
{
- sal_uInt32 nOldPos = rIn.Tell();
+ sal_uInt64 nOldPos = rIn.Tell();
sal_uInt32 nExtParaPos = ( rExtParaHd.nRecType == PPT_PST_ExtendedParagraphAtom ) ? rExtParaHd.nFilePos + 8 : 0;
std::vector< StyleTextProp9 > aStyleTextProp9;
@@ -6470,7 +6470,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
// ClientData
if ( rSdrPowerPointImport.maShapeRecords.SeekToContent( rIn, DFF_msofbtClientData, SEEK_FROM_CURRENT_AND_RESTART ) )
{
- sal_uInt32 nOldPos = rIn.Tell();
+ sal_uInt64 nOldPos = rIn.Tell();
DffRecordHeader& aClientDataContainerHd = *rSdrPowerPointImport.maShapeRecords.Current();
DffRecordHeader aPlaceHolderAtomHd;
if ( SvxMSDffManager::SeekToRec( rIn, PPT_PST_OEPlaceholderAtom, aClientDataContainerHd.GetRecEndFilePos(), &aPlaceHolderAtomHd ) )
@@ -6531,7 +6531,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
{
if ( !aExtParaHd.nRecType )
{
- sal_uInt32 nOldPos = rIn.Tell();
+ sal_uInt64 nOldPos = rIn.Tell();
// try to locate the referenced ExtendedParaHd
DffRecordHeader* pHd = pExtParaProv->
aExtendedPresRules.GetRecordHeader( PPT_PST_ExtendedParagraphHeaderAtom,
@@ -6636,7 +6636,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
aTextHd.SeekToEndOfRecord( rIn );
mxImplTextObj->mnInstance = nInstance;
- sal_uInt32 nFilePos = rIn.Tell();
+ sal_uInt64 nFilePos = rIn.Tell();
if ( !(rSdrPowerPointImport.SeekToRec2( PPT_PST_TextBytesAtom,
PPT_PST_TextCharsAtom,
aClientTextBoxHd.GetRecEndFilePos() )