diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2023-08-14 19:33:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-08-15 09:36:14 +0200 |
commit | 3039737af6d6e539c652f0d4b25303c30713836e (patch) | |
tree | c57b68790a984ab677cdb5fe56af6a519d9785ab /sc/source/filter/xml | |
parent | 68c8466dd80e7a964e1377ee3e0308dc449fbf2d (diff) |
use sal_uInt64 when dealing with stream position
Change-Id: I1efda255a7ab1e90ad3a41cb36c72384743a7980
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155677
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/filter/xml')
-rw-r--r-- | sc/source/filter/xml/sheetdata.cxx | 14 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlbodyi.cxx | 6 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlexprt.cxx | 26 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlexprt.hxx | 4 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlimprt.cxx | 6 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlimprt.hxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/xmltabi.hxx | 2 |
7 files changed, 30 insertions, 30 deletions
diff --git a/sc/source/filter/xml/sheetdata.cxx b/sc/source/filter/xml/sheetdata.cxx index bfd9abe5e598..4f62181e7d73 100644 --- a/sc/source/filter/xml/sheetdata.cxx +++ b/sc/source/filter/xml/sheetdata.cxx @@ -105,7 +105,7 @@ bool ScSheetSaveData::IsSheetBlocked( SCTAB nTab ) const return false; } -void ScSheetSaveData::AddStreamPos( SCTAB nTab, sal_Int32 nStartOffset, sal_Int32 nEndOffset ) +void ScSheetSaveData::AddStreamPos( SCTAB nTab, sal_Int64 nStartOffset, sal_Int64 nEndOffset ) { if ( nTab >= static_cast<SCTAB>(maStreamEntries.size()) ) maStreamEntries.resize( nTab + 1 ); @@ -113,7 +113,7 @@ void ScSheetSaveData::AddStreamPos( SCTAB nTab, sal_Int32 nStartOffset, sal_Int3 maStreamEntries[nTab] = ScStreamEntry( nStartOffset, nEndOffset ); } -void ScSheetSaveData::StartStreamPos( SCTAB nTab, sal_Int32 nStartOffset ) +void ScSheetSaveData::StartStreamPos( SCTAB nTab, sal_Int64 nStartOffset ) { OSL_ENSURE( mnStartTab < 0, "StartStreamPos without EndStreamPos" ); @@ -121,7 +121,7 @@ void ScSheetSaveData::StartStreamPos( SCTAB nTab, sal_Int32 nStartOffset ) mnStartOffset = nStartOffset; } -void ScSheetSaveData::EndStreamPos( sal_Int32 nEndOffset ) +void ScSheetSaveData::EndStreamPos( sal_Int64 nEndOffset ) { if ( mnStartTab >= 0 ) { @@ -131,7 +131,7 @@ void ScSheetSaveData::EndStreamPos( sal_Int32 nEndOffset ) } } -void ScSheetSaveData::GetStreamPos( SCTAB nTab, sal_Int32& rStartOffset, sal_Int32& rEndOffset ) const +void ScSheetSaveData::GetStreamPos( SCTAB nTab, sal_Int64& rStartOffset, sal_Int64& rEndOffset ) const { if ( nTab < static_cast<SCTAB>(maStreamEntries.size()) ) { @@ -145,8 +145,8 @@ void ScSheetSaveData::GetStreamPos( SCTAB nTab, sal_Int32& rStartOffset, sal_Int bool ScSheetSaveData::HasStreamPos( SCTAB nTab ) const { - sal_Int32 nStartOffset = -1; - sal_Int32 nEndOffset = -1; + sal_Int64 nStartOffset = -1; + sal_Int64 nEndOffset = -1; GetStreamPos( nTab, nStartOffset, nEndOffset ); return ( nStartOffset >= 0 && nEndOffset >= 0 ); } @@ -156,7 +156,7 @@ void ScSheetSaveData::ResetSaveEntries() maSaveEntries.clear(); } -void ScSheetSaveData::AddSavePos( SCTAB nTab, sal_Int32 nStartOffset, sal_Int32 nEndOffset ) +void ScSheetSaveData::AddSavePos( SCTAB nTab, sal_Int64 nStartOffset, sal_Int64 nEndOffset ) { if ( nTab >= static_cast<SCTAB>(maSaveEntries.size()) ) maSaveEntries.resize( nTab + 1 ); diff --git a/sc/source/filter/xml/xmlbodyi.cxx b/sc/source/filter/xml/xmlbodyi.cxx index 2234f569746c..64c807dfe11e 100644 --- a/sc/source/filter/xml/xmlbodyi.cxx +++ b/sc/source/filter/xml/xmlbodyi.cxx @@ -125,7 +125,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL if ( pSheetData && pSheetData->HasStartPos() ) { // stream part to copy ends before the next child element - sal_Int32 nEndOffset = GetScImport().GetByteOffset(); + sal_Int64 nEndOffset = GetScImport().GetByteOffset(); pSheetData->EndStreamPos( nEndOffset ); } @@ -199,7 +199,7 @@ void SAL_CALL ScXMLBodyContext::characters(const OUString &) if ( pSheetData && pSheetData->HasStartPos() ) { // stream part to copy ends before any content (whitespace) within the spreadsheet element - sal_Int32 nEndOffset = GetScImport().GetByteOffset(); + sal_Int64 nEndOffset = GetScImport().GetByteOffset(); pSheetData->EndStreamPos( nEndOffset ); } // otherwise ignore @@ -211,7 +211,7 @@ void SAL_CALL ScXMLBodyContext::endFastElement(sal_Int32 nElement) if ( pSheetData && pSheetData->HasStartPos() ) { // stream part to copy ends before the closing tag of spreadsheet element - sal_Int32 nEndOffset = GetScImport().GetByteOffset(); + sal_Int64 nEndOffset = GetScImport().GetByteOffset(); pSheetData->EndStreamPos( nEndOffset ); } diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index f484c20b5710..e38ed5dcacda 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -1742,17 +1742,17 @@ void ScXMLExport::SetBodyAttributes() static bool lcl_CopyStreamElement( const uno::Reference< io::XInputStream >& xInput, const uno::Reference< io::XOutputStream >& xOutput, - sal_Int32 nCount ) + sal_Int64 nCount ) { const sal_Int32 nBufSize = 16*1024; uno::Sequence<sal_Int8> aSequence(nBufSize); - sal_Int32 nRemaining = nCount; + sal_Int64 nRemaining = nCount; bool bFirst = true; while ( nRemaining > 0 ) { - sal_Int32 nRead = xInput->readBytes( aSequence, std::min( nRemaining, nBufSize ) ); + sal_Int32 nRead = xInput->readBytes( aSequence, std::min( nRemaining, static_cast<sal_Int64>(nBufSize) ) ); if (bFirst) { // safety check: Make sure the copied part actually points to the start of an element @@ -1789,17 +1789,17 @@ static bool lcl_CopyStreamElement( const uno::Reference< io::XInputStream >& xIn return true; // successful } -static void lcl_SkipBytesInBlocks( const uno::Reference< io::XInputStream >& xInput, sal_Int32 nBytesToSkip ) +static void lcl_SkipBytesInBlocks( const uno::Reference< io::XInputStream >& xInput, sal_Int64 nBytesToSkip ) { // skipBytes in zip stream is implemented as reading. // For now, split into several calls to avoid allocating a large buffer. // Later, skipBytes should be changed. - const sal_Int32 nMaxSize = 32*1024; + const sal_Int64 nMaxSize = 32*1024; if ( nBytesToSkip > 0 ) { - sal_Int32 nRemaining = nBytesToSkip; + sal_Int64 nRemaining = nBytesToSkip; while ( nRemaining > 0 ) { sal_Int32 nSkip = std::min( nRemaining, nMaxSize ); @@ -1809,7 +1809,7 @@ static void lcl_SkipBytesInBlocks( const uno::Reference< io::XInputStream >& xIn } } -void ScXMLExport::CopySourceStream( sal_Int32 nStartOffset, sal_Int32 nEndOffset, sal_Int32& rNewStart, sal_Int32& rNewEnd ) +void ScXMLExport::CopySourceStream( sal_Int64 nStartOffset, sal_Int64 nEndOffset, sal_Int64& rNewStart, sal_Int64& rNewEnd ) { uno::Reference<xml::sax::XDocumentHandler> xHandler = GetDocHandler(); uno::Reference<io::XActiveDataSource> xDestSource( xHandler, uno::UNO_QUERY ); @@ -1831,7 +1831,7 @@ void ScXMLExport::CopySourceStream( sal_Int32 nStartOffset, sal_Int32 nEndOffset xDestStream->writeBytes( aOutSeq ); } - rNewStart = static_cast<sal_Int32>(xDestSeek->getPosition()); + rNewStart = xDestSeek->getPosition(); if ( nStartOffset > nSourceStreamPos ) lcl_SkipBytesInBlocks( xSourceStream, nStartOffset - nSourceStreamPos ); @@ -1846,7 +1846,7 @@ void ScXMLExport::CopySourceStream( sal_Int32 nStartOffset, sal_Int32 nEndOffset } nSourceStreamPos = nEndOffset; - rNewEnd = static_cast<sal_Int32>(xDestSeek->getPosition()); + rNewEnd = xDestSeek->getPosition(); } const ScXMLEditAttributeMap& ScXMLExport::GetEditAttributeMap() const @@ -1921,15 +1921,15 @@ void ScXMLExport::ExportContent_() WriteTheLabelRanges( xSpreadDoc ); for (sal_Int32 nTable = 0; nTable < nTableCount; ++nTable) { - sal_Int32 nStartOffset = -1; - sal_Int32 nEndOffset = -1; + sal_Int64 nStartOffset = -1; + sal_Int64 nEndOffset = -1; if (pSheetData && pDoc && pDoc->IsStreamValid(static_cast<SCTAB>(nTable)) && !pDoc->GetChangeTrack()) pSheetData->GetStreamPos( nTable, nStartOffset, nEndOffset ); if ( nStartOffset >= 0 && nEndOffset >= 0 && xSourceStream.is() ) { - sal_Int32 nNewStart = -1; - sal_Int32 nNewEnd = -1; + sal_Int64 nNewStart = -1; + sal_Int64 nNewEnd = -1; CopySourceStream( nStartOffset, nEndOffset, nNewStart, nNewEnd ); // store position of copied sheet in output diff --git a/sc/source/filter/xml/xmlexprt.hxx b/sc/source/filter/xml/xmlexprt.hxx index a29ab0ea45d8..2fcdd0244f16 100644 --- a/sc/source/filter/xml/xmlexprt.hxx +++ b/sc/source/filter/xml/xmlexprt.hxx @@ -76,7 +76,7 @@ class ScXMLExport : public SvXMLExport css::uno::Reference <css::sheet::XSpreadsheet> xCurrentTable; css::uno::Reference<css::io::XInputStream> xSourceStream; - sal_Int32 nSourceStreamPos; + sal_Int64 nSourceStreamPos; mutable std::unique_ptr<ScXMLEditAttributeMap> mpEditAttrMap; std::unique_ptr<ScMyNotEmptyCellsIterator> mpCellsItr; @@ -218,7 +218,7 @@ class ScXMLExport : public SvXMLExport void IncrementProgressBar(bool bFlush, sal_Int32 nInc = 1); - void CopySourceStream( sal_Int32 nStartOffset, sal_Int32 nEndOffset, sal_Int32& rNewStart, sal_Int32& rNewEnd ); + void CopySourceStream( sal_Int64 nStartOffset, sal_Int64 nEndOffset, sal_Int64& rNewStart, sal_Int64& rNewEnd ); const ScXMLEditAttributeMap& GetEditAttributeMap() const; diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index c2327e41b290..46bc0b957b67 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -1547,13 +1547,13 @@ void ScXMLImport::UnlockSolarMutex() } } -sal_Int32 ScXMLImport::GetByteOffset() const +sal_Int64 ScXMLImport::GetByteOffset() const { - sal_Int32 nOffset = -1; + sal_Int64 nOffset = -1; uno::Reference<xml::sax::XLocator> xLocator = GetLocator(); uno::Reference<io::XSeekable> xSeek( xLocator, uno::UNO_QUERY ); //! should use different interface if ( xSeek.is() ) - nOffset = static_cast<sal_Int32>(xSeek->getPosition()); + nOffset = xSeek->getPosition(); return nOffset; } diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx index 7fdd00a65065..88feb0ddb671 100644 --- a/sc/source/filter/xml/xmlimprt.hxx +++ b/sc/source/filter/xml/xmlimprt.hxx @@ -296,7 +296,7 @@ public: void LockSolarMutex(); void UnlockSolarMutex(); - sal_Int32 GetByteOffset() const; + sal_Int64 GetByteOffset() const; void SetRangeOverflowType(ErrCode nType); diff --git a/sc/source/filter/xml/xmltabi.hxx b/sc/source/filter/xml/xmltabi.hxx index 524a4e87a6f7..92f5b1956ac6 100644 --- a/sc/source/filter/xml/xmltabi.hxx +++ b/sc/source/filter/xml/xmltabi.hxx @@ -40,7 +40,7 @@ class ScXMLTableContext : public ScXMLImportContext { OUString sPrintRanges; ::std::unique_ptr<ScXMLExternalTabData> pExternalRefInfo; - sal_Int32 nStartOffset; + sal_Int64 nStartOffset; bool bStartFormPage; bool bPrintEntireSheet; |