diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2023-08-09 17:00:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-08-09 22:33:57 +0200 |
commit | d955016f31069b51761b7fe56d62aa2a44d7beda (patch) | |
tree | 283a433769bd4c5b4c326b489b95f0b9b2d6f6d8 | |
parent | 4aa3cfda7a6007867eba922a1b549471cbced425 (diff) |
use sal_uInt64 when dealing with stream position
Change-Id: I09285716b6d17d8de95af91d822966520af35605
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155526
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | filter/source/msfilter/escherex.cxx | 4 | ||||
-rw-r--r-- | include/filter/msfilter/escherex.hxx | 2 | ||||
-rw-r--r-- | sd/source/filter/eppt/eppt.cxx | 10 | ||||
-rw-r--r-- | sd/source/filter/eppt/epptso.cxx | 29 | ||||
-rw-r--r-- | sd/source/filter/eppt/escherex.cxx | 4 | ||||
-rw-r--r-- | sd/source/filter/ppt/pptin.cxx | 10 | ||||
-rw-r--r-- | sd/source/filter/ppt/propread.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/view/sdview3.cxx | 2 |
8 files changed, 36 insertions, 35 deletions
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index f4502fbdfa32..73ef01ca0504 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -5080,8 +5080,8 @@ void EscherEx::OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance ) void EscherEx::CloseContainer() { - sal_uInt32 nSize, nPos = mpOutStrm->Tell(); - nSize = ( nPos - mOffsets.back() ) - 4; + sal_uInt64 nPos = mpOutStrm->Tell(); + sal_uInt32 nSize = ( nPos - mOffsets.back() ) - 4; mpOutStrm->Seek( mOffsets.back() ); mpOutStrm->WriteUInt32( nSize ); diff --git a/include/filter/msfilter/escherex.hxx b/include/filter/msfilter/escherex.hxx index d6727bce2c12..1c313c4b5c70 100644 --- a/include/filter/msfilter/escherex.hxx +++ b/include/filter/msfilter/escherex.hxx @@ -1054,7 +1054,7 @@ class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable std::unique_ptr<SvStream> mxOwnStrm; SvStream* mpOutStrm; sal_uInt32 mnStrmStartOfs; - std::vector< sal_uInt32 > mOffsets; + std::vector< sal_uInt64 > mOffsets; std::vector< sal_uInt16 > mRecTypes; sal_uInt32 mnCurrentDg; diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index 64df662c7e68..a239eaad2ef3 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -324,7 +324,7 @@ void PPTWriter::ImplWriteSlide( sal_uInt32 nPageNum, sal_uInt32 nMasterNum, sal_ SvMemoryStream amsofbtAnimGroup; ppt::AnimationExporter aExporter( aSolverContainer, maSoundCollection ); aExporter.doexport( mXDrawPage, amsofbtAnimGroup ); - sal_uInt32 nmsofbtAnimGroupSize = amsofbtAnimGroup.Tell(); + sal_uInt64 nmsofbtAnimGroupSize = amsofbtAnimGroup.Tell(); if ( nmsofbtAnimGroupSize ) { { @@ -472,7 +472,7 @@ bool PPTWriter::ImplCreateCurrentUserStream() mpCurUserStrm->WriteUInt32( 0x14 ) // Len .WriteUInt32( 0xe391c05f ); // Magic - sal_uInt32 nEditPos = mpCurUserStrm->Tell(); + sal_uInt64 nEditPos = mpCurUserStrm->Tell(); mpCurUserStrm->WriteUInt32( 0x0 ) // OffsetToCurrentEdit; .WriteUInt16( nLenOfUserName ) .WriteUInt16( 0x3f4 ) // DocFileVersion @@ -514,7 +514,7 @@ void PPTWriter::ImplCreateDocumentSummaryInformation() SvMemoryStream aHyperBlob; ImplCreateHyperBlob( aHyperBlob ); - auto nHyperLength = static_cast<sal_Int32>(aHyperBlob.Tell()); + sal_uInt64 nHyperLength = aHyperBlob.Tell(); const sal_Int8* pBlob( static_cast<const sal_Int8*>(aHyperBlob.GetData())); auto aHyperSeq = comphelper::arrayToSequence<sal_Int8>(pBlob, nHyperLength); @@ -1219,7 +1219,7 @@ void PPTWriter::ImplWriteVBA() { if ( mpVBA ) { - sal_uInt32 nLen = mpVBA->TellEnd(); + sal_uInt64 nLen = mpVBA->TellEnd(); if ( nLen > 8 ) { nLen -= 8; @@ -1389,7 +1389,7 @@ void PPTWriter::ImplWriteAtomEnding() .ReadUInt32( n2 ); mpStrm->WriteUInt32( mnVBAOleOfs ); - sal_uInt32 nOldPos = mpStrm->Tell(); + sal_uInt64 nOldPos = mpStrm->Tell(); mpStrm->Seek( nOfs ); // Fill the VBAInfoAtom with the correct index to the persisttable mpStrm->WriteUInt32( nPersistEntrys ) .WriteUInt32( n1 ) diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 15e013713001..e794d9600e06 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -355,7 +355,7 @@ sal_uInt32 PPTWriter::ImplInsertBookmarkURL( const OUString& rBookmarkURL, const mpExEmbed->WriteUInt16( 0xf ) .WriteUInt16( EPP_ExHyperlink ) .WriteUInt32( 0 ); - sal_uInt32 nHyperSize, nHyperStart = mpExEmbed->Tell(); + sal_uInt64 nHyperStart = mpExEmbed->Tell(); mpExEmbed->WriteUInt16( 0 ) .WriteUInt16( EPP_ExHyperlinkAtom ) .WriteUInt32( 4 ) @@ -366,7 +366,7 @@ sal_uInt32 PPTWriter::ImplInsertBookmarkURL( const OUString& rBookmarkURL, const PPTWriter::WriteCString( *mpExEmbed, aStringVer2, 2 ); PPTWriter::WriteCString( *mpExEmbed, aStringVer3, 3 ); - nHyperSize = mpExEmbed->Tell() - nHyperStart; + sal_uInt32 nHyperSize = mpExEmbed->Tell() - nHyperStart; mpExEmbed->SeekRel( - ( static_cast<sal_Int32>(nHyperSize) + 4 ) ); mpExEmbed->WriteUInt32( nHyperSize ); mpExEmbed->SeekRel( nHyperSize ); @@ -1046,12 +1046,12 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u if ( pPropOpt && mType != "drawing.Table" ) ImplAdjustFirstLineLineSpacing( aTextObj, *pPropOpt ); - sal_uInt32 nSize, nPos = rOut.Tell(); + sal_uInt64 nPos = rOut.Tell(); rOut.WriteUInt32( EPP_StyleTextPropAtom << 16 ).WriteUInt32( 0 ); ImplWriteParagraphs( rOut, aTextObj ); ImplWritePortions( rOut, aTextObj ); - nSize = rOut.Tell() - nPos; + sal_uInt32 nSize = rOut.Tell() - nPos; rOut.SeekRel( - ( static_cast<sal_Int32>(nSize) - 4 ) ); rOut.WriteUInt32( nSize - 8 ); rOut.SeekRel( nSize - 8 ); @@ -1230,7 +1230,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u pRuleOut = pTextRule->pOut.get(); } - sal_uInt32 nRulePos = pRuleOut->Tell(); + sal_uInt64 nRulePos = pRuleOut->Tell(); pRuleOut->WriteUInt32( EPP_TextRulerAtom << 16 ).WriteUInt32( 0 ); pRuleOut->WriteUInt32( nTextRulerAtomFlags ); if ( nTextRulerAtomFlags & 4 ) @@ -1279,7 +1279,8 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u if ( !aTextObj.ParagraphCount() ) return; - sal_uInt32 nNumberingType = 0, nPos2 = rExtBuStr.Tell(); + sal_uInt32 nNumberingType = 0; + sal_uInt64 nPos2 = rExtBuStr.Tell(); rExtBuStr.WriteUInt32( EPP_PST_ExtendedParagraphAtom << 16 ).WriteUInt32( 0 ); @@ -1952,7 +1953,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a mpExEmbed->WriteUInt32( 0xf | ( EPP_ExControl << 16 ) ) .WriteUInt32( 0 ); // Size of this container - sal_uInt32 nSize, nOldPos = mpExEmbed->Tell(); + sal_uInt64 nOldPos = mpExEmbed->Tell(); sal_uInt32 nPageId = nPageNumber; if ( ePageType == MASTER ) @@ -2020,7 +2021,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a PPTWriter::WriteCString( *mpExEmbed, aOleIdentifier, 2 ); PPTWriter::WriteCString( *mpExEmbed, aUserName, 3 ); } - nSize = mpExEmbed->Tell() - nOldPos; + sal_uInt32 nSize = mpExEmbed->Tell() - nOldPos; mpExEmbed->Seek( nOldPos - 4 ); mpExEmbed->WriteUInt32( nSize ); mpExEmbed->Seek( STREAM_SEEK_TO_END ); @@ -2504,7 +2505,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a mpExEmbed->WriteUInt32( 0xf | ( EPP_ExEmbed << 16 ) ) .WriteUInt32( 0 ); // Size of this container - sal_uInt32 nSize, nOldPos = mpExEmbed->Tell(); + sal_uInt64 nOldPos = mpExEmbed->Tell(); mpExEmbed->WriteUInt32( EPP_ExEmbedAtom << 16 ) .WriteUInt32( 8 ) @@ -2541,7 +2542,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a .WriteUInt32( 0 ) .WriteUInt32( 0x0012b600 ); - nSize = mpExEmbed->Tell() - nOldPos; + sal_uInt32 nSize = mpExEmbed->Tell() - nOldPos; mpExEmbed->Seek( nOldPos - 4 ); mpExEmbed->WriteUInt32( nSize ); mpExEmbed->Seek( STREAM_SEEK_TO_END ); @@ -2636,7 +2637,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a mpExEmbed->WriteUInt16( 0xf ) .WriteUInt16( EPP_ExMCIMovie ) // PPT_PST_ExAviMovie .WriteUInt32( 0 ); - sal_uInt32 nSize, nStart = mpExEmbed->Tell(); + sal_uInt64 nStart = mpExEmbed->Tell(); mpExEmbed->WriteUInt16( 0 ) .WriteUInt16( EPP_ExObjRefAtom ) .WriteUInt32( 4 ) @@ -2659,7 +2660,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a sal_Unicode nChar = aMediaURL[ i ]; mpExEmbed->WriteUInt16( nChar ); } - nSize = mpExEmbed->Tell() - nStart; + sal_uInt32 nSize = mpExEmbed->Tell() - nStart; mpExEmbed->SeekRel( - ( static_cast<sal_Int32>(nSize) + 4 ) ); mpExEmbed->WriteUInt32( nSize ); // size of PPT_PST_ExMCIMovie mpExEmbed->SeekRel( 0x10 ); @@ -3321,11 +3322,11 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape > const & rXSha void TextObjBinary::Write( SvStream* pStrm ) { - sal_uInt32 nSize, nPos = pStrm->Tell(); + sal_uInt64 nPos = pStrm->Tell(); pStrm->WriteUInt32( EPP_TextCharsAtom << 16 ).WriteUInt32( 0 ); for ( sal_uInt32 i = 0; i < ParagraphCount(); ++i ) GetParagraph(i)->Write( pStrm ); - nSize = pStrm->Tell() - nPos; + sal_uInt32 nSize = pStrm->Tell() - nPos; pStrm->SeekRel( - ( static_cast<sal_Int32>(nSize) - 4 ) ); pStrm->WriteUInt32( nSize - 8 ); pStrm->SeekRel( nSize - 8 ); diff --git a/sd/source/filter/eppt/escherex.cxx b/sd/source/filter/eppt/escherex.cxx index 5032c27210b6..c1d449b735ad 100644 --- a/sd/source/filter/eppt/escherex.cxx +++ b/sd/source/filter/eppt/escherex.cxx @@ -168,8 +168,8 @@ void PptEscherEx::CloseContainer() if ( ( mRecTypes.back() == ESCHER_SpgrContainer ) && ( mnGroupLevel >= 12 ) ) return; - sal_uInt32 nSize, nPos = mpOutStrm->Tell(); - nSize = ( nPos - mOffsets.back() ) - 4; + sal_uInt64 nPos = mpOutStrm->Tell(); + sal_uInt32 nSize = ( nPos - mOffsets.back() ) - 4; mpOutStrm->Seek( mOffsets.back() ); mpOutStrm->WriteUInt32( nSize ); diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 464c934ab780..62a75a42f42f 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -788,7 +788,7 @@ bool ImplSdPPTImport::Import() bool bNewAnimationsUsed = false; ProcessData aProcessData( (*pList)[ m_nCurrentPageNum ], SdPageCapsule(pMPage) ); - sal_uInt32 nOldFPos = rStCtrl.Tell(); + sal_uInt64 nOldFPos = rStCtrl.Tell(); DffRecordHeader aPageHd; if ( SeekToCurrentPage( &aPageHd ) ) { @@ -921,7 +921,7 @@ bool ImplSdPPTImport::Import() // importing slide pages { - sal_uInt32 nOldFPos = rStCtrl.Tell(); + sal_uInt64 nOldFPos = rStCtrl.Tell(); PptPageKind ePageKind = m_eCurrentPageKind; sal_uInt16 nPageNum = m_nCurrentPageNum; @@ -1891,7 +1891,7 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const bool bNewAnimations OUString ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const { OUString aRetval; - sal_uInt32 nOldPos = rStCtrl.Tell(); + sal_uInt64 nOldPos = rStCtrl.Tell(); DffRecordHeader aDocHd; if ( SeekToDocument( &aDocHd ) ) { @@ -1908,7 +1908,7 @@ OUString ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const { sal_uInt32 nStrLen = aSoundRecHd.GetRecEndFilePos(); OUString aRefStr; - sal_uInt32 nOldPos2 = rStCtrl.Tell(); + sal_uInt64 nOldPos2 = rStCtrl.Tell(); if ( SeekToRec( rStCtrl, PPT_PST_CString, nStrLen, nullptr, 2 ) ) { if ( ReadString( aRefStr ) ) @@ -2667,7 +2667,7 @@ rtl::Reference<SdrObject> ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData break; case PPT_PST_InteractiveInfo: { - sal_uInt32 nOldFilePos2 = rSt.Tell(); + sal_uInt64 nOldFilePos2 = rSt.Tell(); OUString aMacroName; if(SeekToRec( rSt, PPT_PST_CString, nHdRecEnd ) ) diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx index c82c0d791dbd..b9fb96f988aa 100644 --- a/sd/source/filter/ppt/propread.cxx +++ b/sd/source/filter/ppt/propread.cxx @@ -310,8 +310,8 @@ void Section::GetDictionary(PropDictionary& rDict) void Section::Read( SotStorageStream *pStrm ) { - sal_uInt32 nSecOfs = pStrm->Tell(); - sal_uInt32 nStrmSize = pStrm->remainingSize(); + sal_uInt64 nSecOfs = pStrm->Tell(); + sal_uInt64 nStrmSize = pStrm->remainingSize(); mnTextEnc = RTL_TEXTENCODING_MS_1252; sal_uInt32 nSecSize(0), nPropCount(0); @@ -401,7 +401,7 @@ void Section::Read( SotStorageStream *pStrm ) { pStrm->ReadUInt32( nTemp ); // looks like these are aligned to 4 bytes - sal_uInt32 nLength = nPropOfs + nSecOfs + nPropSize + ( nTemp << 1 ) + 4; + sal_uInt64 nLength = nPropOfs + nSecOfs + nPropSize + ( nTemp << 1 ) + 4; nPropSize += ( nTemp << 1 ) + 4 + (nLength % 4); } break; @@ -504,7 +504,7 @@ void Section::Read( SotStorageStream *pStrm ) if (!checkSeek(*pStrm, nPos)) break; } - sal_uInt32 nSize = pStrm->Tell(); + sal_uInt64 nSize = pStrm->Tell(); pStrm->Seek( nPropOfs + nSecOfs ); nSize -= pStrm->Tell(); if ( nSize > nStrmSize ) @@ -585,7 +585,7 @@ void PropRead::Read() mpSvStream->ReadBytes(aSectCLSID.data(), aSectCLSID.size()); sal_uInt32 nSectionOfs(0); mpSvStream->ReadUInt32( nSectionOfs ); - sal_uInt32 nCurrent = mpSvStream->Tell(); + sal_uInt64 nCurrent = mpSvStream->Tell(); if (checkSeek(*mpSvStream, nSectionOfs)) { Section aSection(aSectCLSID.data()); diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 7065c677246b..ac95db930629 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -691,7 +691,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, Graphic aGraphic; if (vcl::ImportPDF(*xStm, aGraphic)) { - const sal_Int32 nGraphicContentSize(xStm->Tell()); + const sal_uInt64 nGraphicContentSize(xStm->Tell()); xStm->Seek(0); BinaryDataContainer aGraphicContent(*xStm, nGraphicContentSize); aGraphic.SetGfxLink(std::make_shared<GfxLink>(aGraphicContent, GfxLinkType::NativePdf)); |