sw/source/core/layout/laycache.cxx          |    8 ++++----
 sw/source/filter/html/wrthtml.hxx           |    2 +-
 sw/source/filter/ww8/rtfattributeoutput.cxx |    4 ++--
 sw/source/filter/ww8/rtfsdrexport.cxx       |    2 +-
 sw/source/filter/ww8/wrtw8esh.cxx           |    4 ++--
 sw/source/filter/ww8/wrtww8.hxx             |    2 +-
 sw/source/filter/ww8/wrtww8gr.cxx           |    6 +++---
 sw/source/filter/ww8/ww8atr.cxx             |    4 ++--
 sw/source/filter/ww8/ww8scan.cxx            |    6 +++---
 9 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 55c0d6caec990ed2d5433251bfed9c51d1207e47
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Wed Aug 9 14:54:20 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Aug 9 20:05:43 2023 +0200

    use sal_uInt64 when dealing with stream position
    
    Change-Id: Id94c6615f857f3ad3497b1abef1e1f2bd67bd4a4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155523
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/layout/laycache.cxx 
b/sw/source/core/layout/laycache.cxx
index e5b1dc34146d..25cd970d9720 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -1061,7 +1061,7 @@ SwLayCacheIoImpl::SwLayCacheIoImpl( SvStream& rStrm, bool 
bWrtMd ) :
 
 void SwLayCacheIoImpl::OpenRec( sal_uInt8 cType )
 {
-    sal_uInt32 nPos = m_pStream->Tell();
+    sal_uInt64 nPos = m_pStream->Tell();
     if( m_bWriteMode )
     {
         m_aRecords.emplace_back(cType, nPos );
@@ -1094,7 +1094,7 @@ void SwLayCacheIoImpl::CloseRec()
     OSL_ENSURE( !m_aRecords.empty(), "CloseRec: no levels" );
     if( !m_aRecords.empty() )
     {
-        sal_uInt32 nPos = m_pStream->Tell();
+        sal_uInt64 nPos = m_pStream->Tell();
         if( m_bWriteMode )
         {
             sal_uInt32 nBgn = m_aRecords.back().size;
@@ -1132,7 +1132,7 @@ sal_uInt32 SwLayCacheIoImpl::BytesLeft()
     if( !m_bError && !m_aRecords.empty() )
     {
         sal_uInt32 nEndPos = m_aRecords.back().size;
-        sal_uInt32 nPos = m_pStream->Tell();
+        sal_uInt64 nPos = m_pStream->Tell();
         if( nEndPos > nPos )
             n = nEndPos - nPos;
     }
@@ -1144,7 +1144,7 @@ sal_uInt8 SwLayCacheIoImpl::Peek()
     sal_uInt8 c(0);
     if( !m_bError )
     {
-        sal_uInt32 nPos = m_pStream->Tell();
+        sal_uInt64 nPos = m_pStream->Tell();
         m_pStream->ReadUChar( c );
         m_pStream->Seek( nPos );
         if( m_pStream->GetErrorCode() != ERRCODE_NONE )
diff --git a/sw/source/filter/html/wrthtml.hxx 
b/sw/source/filter/html/wrthtml.hxx
index 9c11c2969c31..5dc00bbb982a 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -321,7 +321,7 @@ public:
     sal_uInt32 m_aFontHeights[7];         // font heights 1-7
 
     ErrCode m_nWarn;                      // warning code
-    sal_uInt32 m_nLastLFPos;              // last position of LF
+    sal_uInt64 m_nLastLFPos;              // last position of LF
 
     HtmlTokenId m_nLastParaToken;         // to hold paragraphs together
     sal_Int32 m_nBkmkTabPos;              // current position in bookmark table
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index fe96f5ecaffc..7a05a682e83c 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -4295,7 +4295,7 @@ void RtfAttributeOutput::FlyFrameOLEReplacement(const 
SwFlyFrameFormat* pFlyFram
     SvMemoryStream aStream;
     if (GraphicConverter::Export(aStream, *pGraphic, ConvertDataFormat::PNG) 
!= ERRCODE_NONE)
         SAL_WARN("sw.rtf", "failed to export the graphic");
-    sal_uInt32 nSize = aStream.TellEnd();
+    sal_uInt64 nSize = aStream.TellEnd();
     pGraphicAry = static_cast<sal_uInt8 const*>(aStream.GetData());
     m_aRunText->append(ExportPICT(pFlyFrameFormat, aSize, aRendered, aMapped, 
rCr, pBLIPType,
                                   pGraphicAry, nSize, m_rExport));
@@ -4599,7 +4599,7 @@ void RtfAttributeOutput::BulletDefinition(int /*nId*/, 
const Graphic& rGraphic,
     SvMemoryStream aStream;
     if (GraphicConverter::Export(aStream, rGraphic, ConvertDataFormat::PNG) != 
ERRCODE_NONE)
         SAL_WARN("sw.rtf", "failed to export the numbering picture bullet");
-    sal_uInt32 nSize = aStream.TellEnd();
+    sal_uInt64 nSize = aStream.TellEnd();
     pGraphicAry = static_cast<sal_uInt8 const*>(aStream.GetData());
     msfilter::rtfutil::WriteHex(pGraphicAry, nSize, &m_rExport.Strm());
     m_rExport.Strm().WriteOString("}}"); // pict, shppict
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx 
b/sw/source/filter/ww8/rtfsdrexport.cxx
index 42c4020db57d..d6427dd45f2c 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -509,7 +509,7 @@ void RtfSdrExport::impl_writeGraphic()
     // Export it to a stream.
     SvMemoryStream aStream;
     (void)GraphicConverter::Export(aStream, aGraphic, ConvertDataFormat::PNG);
-    sal_uInt32 nSize = aStream.TellEnd();
+    sal_uInt64 nSize = aStream.TellEnd();
     auto pGraphicAry = static_cast<sal_uInt8 const*>(aStream.GetData());
 
     Size aMapped(aGraphic.GetPrefSize());
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx 
b/sw/source/filter/ww8/wrtw8esh.cxx
index 8395ab8938a3..19ac50ccf5c9 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1484,7 +1484,7 @@ void SwEscherEx::WritePictures()
     if( SvStream* pPicStrm = static_cast< SwEscherExGlobal& >( *mxGlobal 
).GetPictureStream() )
     {
         // set the blip - entries to the correct stream pos
-        sal_Int32 nEndPos = mrWrt.Strm().Tell();
+        sal_uInt64 nEndPos = mrWrt.Strm().Tell();
         mxGlobal->SetNewBlipStreamOffset( nEndPos );
 
         pPicStrm->Seek( 0 );
@@ -2162,7 +2162,7 @@ void SwBasicEscherEx::WritePictures()
     if( SvStream* pPicStrm = static_cast< SwEscherExGlobal& >( *mxGlobal 
).GetPictureStream() )
     {
         // set the blip - entries to the correct stream pos
-        sal_Int32 nEndPos = pPicStrm->Tell();
+        sal_uInt64 nEndPos = pPicStrm->Tell();
         mxGlobal->WriteBlibStoreEntry(*mpEscherStrm, 1, nEndPos);
 
         pPicStrm->Seek(0);
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 3aa39a2994b8..c89dc02d216f 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -1397,7 +1397,7 @@ class GraphicDetails
 {
 public:
     ww8::Frame maFly;                // surrounding FlyFrames
-    sal_uLong mnPos;                // FilePos of the graphics
+    sal_uInt64 mnPos;                // FilePos of the graphics
     sal_uInt16 mnWid;               // Width of the graphics
     sal_uInt16 mnHei;               // Height of the graphics
 
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx 
b/sw/source/filter/ww8/wrtww8gr.cxx
index 6ec9cc6e8f08..824794430ee6 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -745,7 +745,7 @@ void SwWW8WrGrf::WriteGraphicNode(SvStream& rStrm, const 
GraphicDetails &rItem)
 {
     sal_uInt16 nWidth = rItem.mnWid;
     sal_uInt16 nHeight = rItem.mnHei;
-    sal_uInt32 nPos = rStrm.Tell();         // store start of graphic
+    sal_uInt64 nPos = rStrm.Tell();         // store start of graphic
 
     const ww8::Frame &rFly = rItem.maFly;
     switch (rFly.GetWriterType())
@@ -834,7 +834,7 @@ void SwWW8WrGrf::WriteGraphicNode(SvStream& rStrm, const 
GraphicDetails &rItem)
             break;
     }
 
-    sal_uInt32 nPos2 = rStrm.Tell();                    // store the end
+    sal_uInt64 nPos2 = rStrm.Tell();                    // store the end
     rStrm.Seek( nPos );
     rStrm.WriteUInt32(nPos2 - nPos); // patch graphic length in the header
     rStrm.Seek( nPos2 );                            // restore Pos
@@ -852,7 +852,7 @@ void SwWW8WrGrf::Write()
     auto aEnd = maDetails.end();
     for (auto aIter = maDetails.begin(); aIter != aEnd; ++aIter)
     {
-        sal_uInt32 nPos = rStrm.Tell();                 // align to 4 Bytes
+        sal_uInt64 nPos = rStrm.Tell();                 // align to 4 Bytes
         if( nPos & 0x3 )
             SwWW8Writer::FillCount( rStrm, 4 - ( nPos & 0x3 ) );
 
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index a794a5d05a59..e3d39a56d4a7 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1792,7 +1792,7 @@ static void InsertSpecialChar( WW8Export& rWrt, sal_uInt8 
c,
         // write hyperlink data to data stream
         SvStream& rStrm = *rWrt.m_pDataStrm;
         // position of hyperlink data
-        const sal_uInt32 nLinkPosInDataStrm = rStrm.Tell();
+        const sal_uInt64 nLinkPosInDataStrm = rStrm.Tell();
         // write empty header
         const sal_uInt16 nEmptyHdrLen = 0x44;
         sal_uInt8 aEmptyHeader[ nEmptyHdrLen ] = { 0 };
@@ -1815,7 +1815,7 @@ static void InsertSpecialChar( WW8Export& rWrt, sal_uInt8 
c,
         // write additional two NULL Bytes
         SwWW8Writer::WriteLong( rStrm, 0 );
         // write length of hyperlink data
-        const sal_uInt32 nCurrPos = rStrm.Tell();
+        const sal_uInt64 nCurrPos = rStrm.Tell();
         rStrm.Seek( nLinkPosInDataStrm );
         rStrm.WriteUInt32(nCurrPos - nLinkPosInDataStrm);
         rStrm.Seek( nCurrPos );
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 517a14a5f02d..c7b175f56e61 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -63,7 +63,7 @@ namespace
     bool TestBeltAndBraces(SvStream& rStrm)
     {
         bool bRet = false;
-        sal_uInt32 nOldPos = rStrm.Tell();
+        sal_uInt64 nOldPos = rStrm.Tell();
         sal_uInt16 nBelt(0);
         rStrm.ReadUInt16( nBelt );
         nBelt *= sizeof(sal_Unicode);
@@ -2791,7 +2791,7 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(const WW8Fib& rFib, 
SvStream* pSt,
                             pStartData = nullptr;
                         if ((IsReplaceAllSprm(nSpId) || bExpand) && pStartData)
                         {
-                            sal_uInt32 nCurr = pDataSt->Tell();
+                            sal_uInt64 nCurr = pDataSt->Tell();
                             sal_uInt32 nPos = SVBT32ToUInt32(pStartData);
                             sal_uInt16 nLen(0);
 
@@ -6012,7 +6012,7 @@ WW8Fib::WW8Fib(SvStream& rSt, sal_uInt8 nWantedVersion, 
sal_uInt32 nOffset):
         rSt.ReadUInt16( m_cfclcb );
 
         // Read cswNew to find out if nFib should be ignored.
-        sal_uInt32 nPos = rSt.Tell();
+        sal_uInt64 nPos = rSt.Tell();
         rSt.SeekRel(m_cfclcb * 8);
         if (rSt.good() && rSt.remainingSize() >= 2)
         {

Reply via email to