diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-09-14 17:01:50 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-09-15 12:01:11 +0200 |
commit | b647996a9babbee7b33cf45192e57df6a124628b (patch) | |
tree | ddc6dfe8a62ec53fbacc4eeccfeb20019f3ef4f0 | |
parent | sd: loplugin:staticmethods (diff) | |
download | core-b647996a9babbee7b33cf45192e57df6a124628b.tar.gz core-b647996a9babbee7b33cf45192e57df6a124628b.zip |
replace sal_Size with std::size_t (or sal_uInt64 for SvStream pos)
... except in include/rtl, include/sal, include/uno, where sal_Size is
retained for compatibility, and where callers of rtl functions pass in
pointers that are incompatible on MSVC.
Change-Id: I8344453780689f5120ba0870e44965b6d292450c
214 files changed, 1099 insertions, 1093 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index e511f74ad77a..1c31380cb296 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -101,7 +101,7 @@ OUString getTextEngineText (ExtTextEngine& rEngine) aMemStream.SetStreamCharSet( RTL_TEXTENCODING_UTF8 ); aMemStream.SetLineDelimiter( LINEEND_LF ); rEngine.Write( aMemStream ); - sal_Size nSize = aMemStream.Tell(); + std::size_t nSize = aMemStream.Tell(); OUString aText( static_cast<const sal_Char*>(aMemStream.GetData()), nSize, RTL_TEXTENCODING_UTF8 ); return aText; diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index cfbcd5613f11..55ccad287424 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -987,7 +987,7 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora bool BasicManager::ImplEncryptStream( SvStream& rStrm ) { - sal_Size nPos = rStrm.Tell(); + sal_uInt64 const nPos = rStrm.Tell(); sal_uInt32 nCreator; rStrm.ReadUInt32( nCreator ); rStrm.Seek( nPos ); @@ -1832,7 +1832,8 @@ uno::Sequence< sal_Int8 > implGetDialogData( SbxObject* pDialog ) { SvMemoryStream aMemStream; pDialog->Store( aMemStream ); - sal_Size nLen = aMemStream.Tell(); + sal_Int32 nLen = aMemStream.Tell(); + if (nLen < 0) { abort(); } uno::Sequence< sal_Int8 > aData( nLen ); sal_Int8* pDestData = aData.getArray(); const sal_Int8* pSrcData = static_cast<const sal_Int8*>(aMemStream.GetData()); diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx index fa68d4d4f4d7..05020f6082ce 100644 --- a/basic/source/runtime/iosys.cxx +++ b/basic/source/runtime/iosys.cxx @@ -213,8 +213,8 @@ class OslStream : public SvStream public: OslStream( const OUString& rName, StreamMode nStrmMode ); virtual ~OslStream() override; - virtual sal_Size GetData( void* pData, sal_Size nSize ) override; - virtual sal_Size PutData( const void* pData, sal_Size nSize ) override; + virtual std::size_t GetData(void* pData, std::size_t nSize) override; + virtual std::size_t PutData(const void* pData, std::size_t nSize) override; virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) override; virtual void FlushData() override; virtual void SetSize( sal_uInt64 nSize) override; @@ -257,14 +257,14 @@ OslStream::~OslStream() maFile.close(); } -sal_Size OslStream::GetData(void* pData, sal_Size nSize) +std::size_t OslStream::GetData(void* pData, std::size_t nSize) { sal_uInt64 nBytesRead = nSize; maFile.read( pData, nBytesRead, nBytesRead ); return nBytesRead; } -sal_Size OslStream::PutData(const void* pData, sal_Size nSize) +std::size_t OslStream::PutData(const void* pData, std::size_t nSize) { sal_uInt64 nBytesWritten; maFile.write( pData, nSize, nBytesWritten ); @@ -309,8 +309,8 @@ public: explicit UCBStream( Reference< XInputStream > & xIS ); explicit UCBStream( Reference< XStream > & xS ); virtual ~UCBStream() override; - virtual sal_Size GetData( void* pData, sal_Size nSize ) override; - virtual sal_Size PutData( const void* pData, sal_Size nSize ) override; + virtual std::size_t GetData( void* pData, std::size_t nSize ) override; + virtual std::size_t PutData( const void* pData, std::size_t nSize ) override; virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) override; virtual void FlushData() override; virtual void SetSize( sal_uInt64 nSize ) override; @@ -352,7 +352,7 @@ UCBStream::~UCBStream() } } -sal_Size UCBStream::GetData(void* pData, sal_Size nSize) +std::size_t UCBStream::GetData(void* pData, std::size_t nSize) { try { @@ -383,7 +383,7 @@ sal_Size UCBStream::GetData(void* pData, sal_Size nSize) return 0; } -sal_Size UCBStream::PutData(const void* pData, sal_Size nSize) +std::size_t UCBStream::PutData(const void* pData, std::size_t nSize) { try { diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 8671417131c0..5d0da4276806 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -905,7 +905,7 @@ RTLFUNC(InStr) (void)pBasic; (void)bWrite; - sal_Size nArgCount = rPar.Count()-1; + std::size_t nArgCount = rPar.Count()-1; if ( nArgCount < 2 ) StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); else @@ -978,7 +978,7 @@ RTLFUNC(InStrRev) (void)pBasic; (void)bWrite; - sal_Size nArgCount = rPar.Count()-1; + std::size_t nArgCount = rPar.Count()-1; if ( nArgCount < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -1340,7 +1340,7 @@ RTLFUNC(Replace) (void)pBasic; (void)bWrite; - sal_Size nArgCount = rPar.Count()-1; + std::size_t nArgCount = rPar.Count()-1; if ( nArgCount < 3 || nArgCount > 6 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -3388,7 +3388,7 @@ RTLFUNC(Loc) return; } SvStream* pSvStrm = pSbStrm->GetStrm(); - sal_Size nPos; + std::size_t nPos; if( pSbStrm->IsRandom()) { short nBlockLen = pSbStrm->GetBlockLen(); @@ -3436,8 +3436,8 @@ RTLFUNC(Lof) return; } SvStream* pSvStrm = pSbStrm->GetStrm(); - sal_Size nOldPos = pSvStrm->Tell(); - sal_Size nLen = pSvStrm->Seek( STREAM_SEEK_TO_END ); + sal_uInt64 const nOldPos = pSvStrm->Tell(); + sal_uInt64 const nLen = pSvStrm->Seek( STREAM_SEEK_TO_END ); pSvStrm->Seek( nOldPos ); rPar.Get(0)->PutLong( (sal_Int32)nLen ); } @@ -3468,7 +3468,7 @@ RTLFUNC(Seek) if ( nArgs == 2 ) // Seek-Function { - sal_Size nPos = pStrm->Tell(); + sal_uInt64 nPos = pStrm->Tell(); if( pSbStrm->IsRandom() ) { nPos = nPos / pSbStrm->GetBlockLen(); @@ -3490,7 +3490,7 @@ RTLFUNC(Seek) { nPos *= pSbStrm->GetBlockLen(); } - pStrm->Seek( (sal_Size)nPos ); + pStrm->Seek( static_cast<sal_uInt64>(nPos) ); pSbStrm->SetExpandOnWriteTo( nPos ); } } @@ -3602,7 +3602,7 @@ RTLFUNC(Shell) (void)pBasic; (void)bWrite; - sal_Size nArgCount = rPar.Count(); + std::size_t nArgCount = rPar.Count(); if ( nArgCount < 2 || nArgCount > 5 ) { rPar.Get(0)->PutLong(0); @@ -4247,7 +4247,7 @@ RTLFUNC(StrConv) (void)pBasic; (void)bWrite; - sal_Size nArgCount = rPar.Count()-1; + std::size_t nArgCount = rPar.Count()-1; if( nArgCount < 2 || nArgCount > 3 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 93183d289e17..a60b16d1c79d 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -984,7 +984,7 @@ RTLFUNC(FindPropertyObject) static bool lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm, bool bBinary, short nBlockLen, bool bIsArray ) { - sal_Size nFPos = pStrm->Tell(); + sal_uInt64 const nFPos = pStrm->Tell(); bool bIsVariant = !rVar.IsFixed(); SbxDataType eType = rVar.GetType(); @@ -1091,7 +1091,7 @@ static bool lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm, double aDouble; - sal_Size nFPos = pStrm->Tell(); + sal_uInt64 const nFPos = pStrm->Tell(); bool bIsVariant = !rVar.IsFixed(); SbxDataType eVarType = rVar.GetType(); @@ -1261,7 +1261,9 @@ void PutGet( SbxArray& rPar, bool bPut ) if( bHasRecordNo ) { - sal_Size nFilePos = bRandom ? (sal_Size)(nBlockLen * nRecordNo) : (sal_Size)nRecordNo; + sal_uInt64 const nFilePos = bRandom + ? static_cast<sal_uInt64>(nBlockLen * nRecordNo) + : static_cast<sal_uInt64>(nRecordNo); pStrm->Seek( nFilePos ); } @@ -1277,7 +1279,7 @@ void PutGet( SbxArray& rPar, bool bPut ) if( pArr ) { - sal_Size nFPos = pStrm->Tell(); + sal_uInt64 const nFPos = pStrm->Tell(); short nDims = pArr->GetDims(); std::unique_ptr<short[]> pDims(new short[ nDims ]); bRet = lcl_WriteReadSbxArray(*pArr,pStrm,!bRandom,nDims,pDims.get(),bPut); diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx index d0296fcf4c5f..1204e9ff7fb5 100644 --- a/basic/source/sbx/sbxbase.cxx +++ b/basic/source/sbx/sbxbase.cxx @@ -198,7 +198,7 @@ SbxBase* SbxBase::Load( SvStream& rStrm ) if( nFlags & SbxFlagBits::Reserved ) nFlags = ( nFlags & ~SbxFlagBits::Reserved ) | SbxFlagBits::GlobalSearch; - sal_Size nOldPos = rStrm.Tell(); + sal_uInt64 nOldPos = rStrm.Tell(); rStrm.ReadUInt32( nSize ); SbxBase* p = Create( nSbxId, nCreator ); if( p ) @@ -206,7 +206,7 @@ SbxBase* SbxBase::Load( SvStream& rStrm ) p->nFlags = nFlags; if( p->LoadData( rStrm, nVer ) ) { - sal_Size nNewPos = rStrm.Tell(); + sal_uInt64 const nNewPos = rStrm.Tell(); nOldPos += nSize; DBG_ASSERT( nOldPos >= nNewPos, "SBX: Too much data loaded" ); if( nOldPos != nNewPos ) @@ -239,10 +239,10 @@ bool SbxBase::Store( SvStream& rStrm ) .WriteUInt16( GetSbxId() ) .WriteUInt16( static_cast<sal_uInt16>(GetFlags()) ) .WriteUInt16( GetVersion() ); - sal_Size nOldPos = rStrm.Tell(); + sal_uInt64 const nOldPos = rStrm.Tell(); rStrm.WriteUInt32( 0 ); bool bRes = StoreData( rStrm ); - sal_Size nNewPos = rStrm.Tell(); + sal_uInt64 const nNewPos = rStrm.Tell(); rStrm.Seek( nOldPos ); rStrm.WriteUInt32( nNewPos - nOldPos ); rStrm.Seek( nNewPos ); diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx index d1b4ad92899d..5382b499cc18 100644 --- a/basic/source/sbx/sbxobj.cxx +++ b/basic/source/sbx/sbxobj.cxx @@ -603,9 +603,9 @@ bool SbxObject::LoadData( SvStream& rStrm, sal_uInt16 nVer ) OUString aDfltProp; aClassName = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm, RTL_TEXTENCODING_ASCII_US); aDfltProp = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm, RTL_TEXTENCODING_ASCII_US); - sal_Size nPos = rStrm.Tell(); + sal_uInt64 nPos = rStrm.Tell(); rStrm.ReadUInt32( nSize ); - sal_Size nNewPos = rStrm.Tell(); + sal_uInt64 const nNewPos = rStrm.Tell(); nPos += nSize; DBG_ASSERT( nPos >= nNewPos, "SBX: Loaded too much data" ); if( nPos != nNewPos ) @@ -640,9 +640,9 @@ bool SbxObject::StoreData( SvStream& rStrm ) const } write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, aClassName, RTL_TEXTENCODING_ASCII_US); write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, aDfltProp, RTL_TEXTENCODING_ASCII_US); - sal_Size nPos = rStrm.Tell(); + sal_uInt64 const nPos = rStrm.Tell(); rStrm.WriteUInt32( 0 ); - sal_Size nNew = rStrm.Tell(); + sal_uInt64 const nNew = rStrm.Tell(); rStrm.Seek( nPos ); rStrm.WriteUInt32( nNew - nPos ); rStrm.Seek( nNew ); diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index ff1b567b22f1..29ace2433bfd 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -634,7 +634,8 @@ bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, cons SvMemoryStream aMemStream; /*sal_Bool bStore = */pMod->StoreBinaryData( aMemStream, B_CURVERSION ); - sal_Size nSize = aMemStream.Tell(); + sal_Int32 const nSize = aMemStream.Tell(); + if (nSize < 0) { abort(); } Sequence< sal_Int8 > aBinSeq( nSize ); sal_Int8* pData = aBinSeq.getArray(); memcpy( pData, aMemStream.GetData(), nSize ); @@ -775,7 +776,8 @@ bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, cons SvMemoryStream aMemStream; /*sal_Bool bStore = */pMod->StoreBinaryData( aMemStream, B_CURVERSION ); - sal_Size nSize = aMemStream.Tell(); + sal_Int32 const nSize = aMemStream.Tell(); + if (nSize < 0) { abort(); } Sequence< sal_Int8 > aBinSeq( nSize ); sal_Int8* pData = aBinSeq.getArray(); memcpy( pData, aMemStream.GetData(), nSize ); diff --git a/bridges/inc/vtablefactory.hxx b/bridges/inc/vtablefactory.hxx index 7e8566e72ec4..3d431efc4409 100644 --- a/bridges/inc/vtablefactory.hxx +++ b/bridges/inc/vtablefactory.hxx @@ -143,7 +143,7 @@ private: by slotCount) @return the size of the raw vtable block, in bytes */ - static sal_Size getBlockSize(sal_Int32 slotCount); + static std::size_t getBlockSize(sal_Int32 slotCount); // This function is not defined in the generic part, but instead has to be // defined individually for each CPP--UNO bridge: diff --git a/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx index 35dff67c18b6..2e6fdd11a820 100644 --- a/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx @@ -579,7 +579,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm.cxx b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm.cxx index e81c17f86a63..0a8a7bd04bbf 100644 --- a/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm.cxx +++ b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm.cxx @@ -501,7 +501,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot); diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm64.cxx b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm64.cxx index 92b053cb328f..64ac9ed38b2b 100644 --- a/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm64.cxx +++ b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm64.cxx @@ -492,7 +492,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot); diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-i386.cxx b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-i386.cxx index addf41403bc3..ae6619035fba 100644 --- a/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-i386.cxx +++ b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-i386.cxx @@ -462,7 +462,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot); diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx index e700aa8fd86a..3d8eea4503e9 100644 --- a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx @@ -396,7 +396,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) { return static_cast<Slot *>(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx index 7425acdcc66d..bd0be3981d7c 100644 --- a/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx @@ -593,7 +593,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx index 1dbf12f92f60..5a53fb038e5e 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx @@ -493,7 +493,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx index 97377d760430..ed30fc078d94 100644 --- a/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx @@ -638,7 +638,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx index 7874de3dab51..a9222c00ee52 100644 --- a/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx @@ -601,7 +601,7 @@ bridges::cpp_uno::shared::VtableFactory::Slot * bridges::cpp_uno::shared::Vtable } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx index f888ab49a0ba..31d03151c7ad 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx @@ -445,7 +445,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) { return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx index 53851c25be97..cbb6f33b601f 100644 --- a/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx @@ -450,7 +450,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx index aeb07301d18f..8caba36ab7fb 100644 --- a/bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx @@ -731,7 +731,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_linux_mips64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_mips64/cpp2uno.cxx index fba5df3a3457..13f67594c981 100644 --- a/bridges/source/cpp_uno/gcc3_linux_mips64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_mips64/cpp2uno.cxx @@ -628,7 +628,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx index f3327f9d7ce3..8cb99c3831ea 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx @@ -710,7 +710,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx index f9384a5ec057..5499b506d3aa 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx @@ -672,7 +672,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx index a9d386f98dc5..539e5011fbce 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx @@ -610,7 +610,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx index 7db6d13422c1..aa86340447a5 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx @@ -573,7 +573,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx index b47f81f94a56..af4bd5f61506 100644 --- a/bridges/source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx @@ -485,7 +485,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_linux_sparc64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_sparc64/cpp2uno.cxx index 746281d75387..d8bc9a2e8221 100644 --- a/bridges/source/cpp_uno/gcc3_linux_sparc64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_sparc64/cpp2uno.cxx @@ -658,7 +658,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx index c389edefbca8..af1d83909f69 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx @@ -444,7 +444,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx index 6786c9530150..dccb9da696f5 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx @@ -440,7 +440,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_solaris_intel/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_solaris_intel/cpp2uno.cxx index 21c5722d76be..5609bd6dc839 100644 --- a/bridges/source/cpp_uno/gcc3_solaris_intel/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_solaris_intel/cpp2uno.cxx @@ -439,7 +439,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_solaris_sparc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_solaris_sparc/cpp2uno.cxx index 5d534051dbe7..4e2efc3ef497 100644 --- a/bridges/source/cpp_uno/gcc3_solaris_sparc/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_solaris_sparc/cpp2uno.cxx @@ -483,7 +483,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/mingw_intel/cpp2uno.cxx b/bridges/source/cpp_uno/mingw_intel/cpp2uno.cxx index d69366938b18..33d5590a5b90 100644 --- a/bridges/source/cpp_uno/mingw_intel/cpp2uno.cxx +++ b/bridges/source/cpp_uno/mingw_intel/cpp2uno.cxx @@ -435,7 +435,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/mingw_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/mingw_x86-64/cpp2uno.cxx index d64252008ae1..c0b8dfa286dd 100644 --- a/bridges/source/cpp_uno/mingw_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/mingw_x86-64/cpp2uno.cxx @@ -439,7 +439,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 2; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx b/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx index 62480db64929..28bdfd0fe1ec 100644 --- a/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx +++ b/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx @@ -431,7 +431,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) return static_cast< Slot * >(block) + 1; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { return (slotCount + 1) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx index c1a650bbc81f..dfa18c4992b7 100644 --- a/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx @@ -450,7 +450,7 @@ bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable( return static_cast< Slot * >(block) + 1; } -sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( +std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount ) { return (slotCount + 1) * sizeof (Slot) + slotCount * codeSnippetSize; diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx b/bridges/source/cpp_uno/shared/vtablefactory.cxx index c2c6b8e93ecb..15e24178a442 100644 --- a/bridges/source/cpp_uno/shared/vtablefactory.cxx +++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx @@ -67,7 +67,7 @@ namespace { extern "C" void * SAL_CALL allocExec( SAL_UNUSED_PARAMETER rtl_arena_type *, sal_Size * size) { - sal_Size pagesize; + std::size_t pagesize; #if defined SAL_UNX #if defined FREEBSD || defined NETBSD || defined OPENBSD || defined DRAGONFLY pagesize = getpagesize(); @@ -81,7 +81,7 @@ extern "C" void * SAL_CALL allocExec( #else #error Unsupported platform #endif - sal_Size n = (*size + (pagesize - 1)) & ~(pagesize - 1); + std::size_t n = (*size + (pagesize - 1)) & ~(pagesize - 1); void * p; #if defined SAL_UNX p = mmap( @@ -228,8 +228,8 @@ VtableFactory::Vtables VtableFactory::getVtables( #ifdef USE_DOUBLE_MMAP bool VtableFactory::createBlock(Block &block, sal_Int32 slotCount) const { - sal_Size size = getBlockSize(slotCount); - sal_Size pagesize = sysconf(_SC_PAGESIZE); + std::size_t size = getBlockSize(slotCount); + std::size_t pagesize = sysconf(_SC_PAGESIZE); block.size = (size + (pagesize - 1)) & ~(pagesize - 1); block.fd = -1; diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx index c5e341951279..77a693d6be68 100644 --- a/canvas/source/cairo/cairo_canvashelper.cxx +++ b/canvas/source/cairo/cairo_canvashelper.cxx @@ -1629,14 +1629,14 @@ namespace cairocanvas virtual uno::Sequence< rendering::RGBColor > SAL_CALL convertToRGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const double* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::RGBColor > aRes(nLen/4); rendering::RGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { const double fAlpha(pIn[3]); if( fAlpha == 0.0 ) @@ -1650,14 +1650,14 @@ namespace cairocanvas virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertToARGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const double* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { const double fAlpha(pIn[3]); if( fAlpha == 0.0 ) @@ -1671,14 +1671,14 @@ namespace cairocanvas virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertToPARGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const double* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::ARGBColor(pIn[3],pIn[2],pIn[1],pIn[1]); pIn += 4; @@ -1688,11 +1688,11 @@ namespace cairocanvas virtual uno::Sequence< double > SAL_CALL convertFromRGB( const uno::Sequence< rendering::RGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::RGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< double > aRes(nLen*4); double* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = pIn->Blue; *pColors++ = pIn->Green; @@ -1705,11 +1705,11 @@ namespace cairocanvas virtual uno::Sequence< double > SAL_CALL convertFromARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< double > aRes(nLen*4); double* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = pIn->Alpha*pIn->Blue; *pColors++ = pIn->Alpha*pIn->Green; @@ -1722,11 +1722,11 @@ namespace cairocanvas virtual uno::Sequence< double > SAL_CALL convertFromPARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< double > aRes(nLen*4); double* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = pIn->Blue; *pColors++ = pIn->Green; @@ -1757,14 +1757,14 @@ namespace cairocanvas if( dynamic_cast<CairoColorSpace*>(targetColorSpace.get()) ) { const sal_Int8* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence<double> aRes(nLen); double* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = vcl::unotools::toDoubleColor(*pIn++); *pOut++ = vcl::unotools::toDoubleColor(*pIn++); @@ -1804,14 +1804,14 @@ namespace cairocanvas throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const sal_Int8* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::RGBColor > aRes(nLen/4); rendering::RGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { const double fAlpha((sal_uInt8)pIn[3]); if( fAlpha ) @@ -1830,14 +1830,14 @@ namespace cairocanvas throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const sal_Int8* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { const double fAlpha((sal_uInt8)pIn[3]); if( fAlpha ) @@ -1856,14 +1856,14 @@ namespace cairocanvas throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const sal_Int8* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::ARGBColor( vcl::unotools::toDoubleColor(pIn[3]), @@ -1879,11 +1879,11 @@ namespace cairocanvas throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::RGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< sal_Int8 > aRes(nLen*4); sal_Int8* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = vcl::unotools::toByteColor(pIn->Blue); *pColors++ = vcl::unotools::toByteColor(pIn->Green); @@ -1898,11 +1898,11 @@ namespace cairocanvas throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< sal_Int8 > aRes(nLen*4); sal_Int8* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { const double fAlpha(pIn->Alpha); *pColors++ = vcl::unotools::toByteColor(fAlpha*pIn->Blue); @@ -1917,11 +1917,11 @@ namespace cairocanvas throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< sal_Int8 > aRes(nLen*4); sal_Int8* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = vcl::unotools::toByteColor(pIn->Blue); *pColors++ = vcl::unotools::toByteColor(pIn->Green); @@ -1986,14 +1986,14 @@ namespace cairocanvas virtual uno::Sequence< rendering::RGBColor > SAL_CALL convertToRGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const double* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::RGBColor > aRes(nLen/4); rendering::RGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::RGBColor(pIn[2], pIn[1], pIn[0]); pIn += 4; @@ -2003,14 +2003,14 @@ namespace cairocanvas uno::Sequence< rendering::ARGBColor > impl_convertToARGB( const uno::Sequence< double >& deviceColor ) { const double* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::ARGBColor(1.0, pIn[2], pIn[1], pIn[0]); pIn += 4; @@ -2028,11 +2028,11 @@ namespace cairocanvas virtual uno::Sequence< double > SAL_CALL convertFromRGB( const uno::Sequence< rendering::RGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::RGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< double > aRes(nLen*4); double* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = pIn->Blue; *pColors++ = pIn->Green; @@ -2045,11 +2045,11 @@ namespace cairocanvas uno::Sequence< double > impl_convertFromARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< double > aRes(nLen*4); double* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = pIn->Blue; *pColors++ = pIn->Green; @@ -2088,14 +2088,14 @@ namespace cairocanvas if( dynamic_cast<CairoColorSpace*>(targetColorSpace.get()) ) { const sal_Int8* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence<double> aRes(nLen); double* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = vcl::unotools::toDoubleColor(*pIn++); *pOut++ = vcl::unotools::toDoubleColor(*pIn++); @@ -2135,14 +2135,14 @@ namespace cairocanvas throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const sal_Int8* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::RGBColor > aRes(nLen/4); rendering::RGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::RGBColor( pIn[2], pIn[1], pIn[0] ); pIn += 4; @@ -2163,14 +2163,14 @@ namespace cairocanvas uno::Sequence< rendering::ARGBColor > impl_convertIntegerToARGB( const uno::Sequence< ::sal_Int8 >& deviceColor ) { const sal_Int8* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::ARGBColor( 1.0, @@ -2186,11 +2186,11 @@ namespace cairocanvas throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::RGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< sal_Int8 > aRes(nLen*4); sal_Int8* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = vcl::unotools::toByteColor(pIn->Blue); *pColors++ = vcl::unotools::toByteColor(pIn->Green); @@ -2214,11 +2214,11 @@ namespace cairocanvas uno::Sequence< ::sal_Int8 > impl_convertIntegerFromARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< sal_Int8 > aRes(nLen*4); sal_Int8* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = vcl::unotools::toByteColor(pIn->Blue); *pColors++ = vcl::unotools::toByteColor(pIn->Green); diff --git a/canvas/source/tools/canvastools.cxx b/canvas/source/tools/canvastools.cxx index 02b81a462ad7..0b874e518e2e 100644 --- a/canvas/source/tools/canvastools.cxx +++ b/canvas/source/tools/canvastools.cxx @@ -213,14 +213,14 @@ namespace canvas virtual uno::Sequence< rendering::RGBColor > SAL_CALL convertToRGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const double* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::RGBColor > aRes(nLen/4); rendering::RGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::RGBColor(pIn[0],pIn[1],pIn[2]); pIn += 4; @@ -231,14 +231,14 @@ namespace canvas { SAL_WARN_IF(deviceColor.getLength() == 0, "canvas", "empty deviceColor argument"); const double* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::ARGBColor(pIn[3],pIn[0],pIn[1],pIn[2]); pIn += 4; @@ -248,14 +248,14 @@ namespace canvas virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertToPARGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const double* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::ARGBColor(pIn[3],pIn[3]*pIn[0],pIn[3]*pIn[1],pIn[3]*pIn[2]); pIn += 4; @@ -265,11 +265,11 @@ namespace canvas virtual uno::Sequence< double > SAL_CALL convertFromRGB( const uno::Sequence< rendering::RGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::RGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< double > aRes(nLen*4); double* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = pIn->Red; *pColors++ = pIn->Green; @@ -282,11 +282,11 @@ namespace canvas virtual uno::Sequence< double > SAL_CALL convertFromARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< double > aRes(nLen*4); double* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = pIn->Red; *pColors++ = pIn->Green; @@ -299,11 +299,11 @@ namespace canvas virtual uno::Sequence< double > SAL_CALL convertFromPARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< double > aRes(nLen*4); double* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = pIn->Red/pIn->Alpha; *pColors++ = pIn->Green/pIn->Alpha; @@ -334,14 +334,14 @@ namespace canvas if( dynamic_cast<StandardColorSpace*>(targetColorSpace.get()) ) { const sal_Int8* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence<double> aRes(nLen); double* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = vcl::unotools::toDoubleColor(*pIn++); *pOut++ = vcl::unotools::toDoubleColor(*pIn++); @@ -380,14 +380,14 @@ namespace canvas virtual uno::Sequence< rendering::RGBColor > SAL_CALL convertIntegerToRGB( const uno::Sequence< ::sal_Int8 >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const sal_Int8* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::RGBColor > aRes(nLen/4); rendering::RGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::RGBColor( vcl::unotools::toDoubleColor(pIn[0]), @@ -401,14 +401,14 @@ namespace canvas virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertIntegerToARGB( const uno::Sequence< ::sal_Int8 >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const sal_Int8* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::ARGBColor( vcl::unotools::toDoubleColor(pIn[3]), @@ -423,14 +423,14 @@ namespace canvas virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertIntegerToPARGB( const uno::Sequence< ::sal_Int8 >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const sal_Int8* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { const sal_Int8 nAlpha( pIn[3] ); *pOut++ = rendering::ARGBColor( @@ -446,11 +446,11 @@ namespace canvas virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromRGB( const uno::Sequence< rendering::RGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::RGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< sal_Int8 > aRes(nLen*4); sal_Int8* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = vcl::unotools::toByteColor(pIn->Red); *pColors++ = vcl::unotools::toByteColor(pIn->Green); @@ -464,11 +464,11 @@ namespace canvas virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< sal_Int8 > aRes(nLen*4); sal_Int8* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = vcl::unotools::toByteColor(pIn->Red); *pColors++ = vcl::unotools::toByteColor(pIn->Green); @@ -482,11 +482,11 @@ namespace canvas virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromPARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< sal_Int8 > aRes(nLen*4); sal_Int8* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = vcl::unotools::toByteColor(pIn->Red/pIn->Alpha); *pColors++ = vcl::unotools::toByteColor(pIn->Green/pIn->Alpha); @@ -551,14 +551,14 @@ namespace canvas virtual uno::Sequence< rendering::RGBColor > SAL_CALL convertToRGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const double* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::RGBColor > aRes(nLen/4); rendering::RGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::RGBColor(pIn[0],pIn[1],pIn[2]); pIn += 4; @@ -568,14 +568,14 @@ namespace canvas virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertToARGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const double* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::ARGBColor(1.0,pIn[0],pIn[1],pIn[2]); pIn += 4; @@ -585,14 +585,14 @@ namespace canvas virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertToPARGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const double* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::ARGBColor(1.0,pIn[0],pIn[1],pIn[2]); pIn += 4; @@ -602,11 +602,11 @@ namespace canvas virtual uno::Sequence< double > SAL_CALL convertFromRGB( const uno::Sequence< rendering::RGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::RGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< double > aRes(nLen*4); double* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = pIn->Red; *pColors++ = pIn->Green; @@ -619,11 +619,11 @@ namespace canvas virtual uno::Sequence< double > SAL_CALL convertFromARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< double > aRes(nLen*4); double* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = pIn->Red; *pColors++ = pIn->Green; @@ -636,11 +636,11 @@ namespace canvas virtual uno::Sequence< double > SAL_CALL convertFromPARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< double > aRes(nLen*4); double* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = pIn->Red/pIn->Alpha; *pColors++ = pIn->Green/pIn->Alpha; @@ -671,14 +671,14 @@ namespace canvas if( dynamic_cast<StandardNoAlphaColorSpace*>(targetColorSpace.get()) ) { const sal_Int8* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence<double> aRes(nLen); double* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = vcl::unotools::toDoubleColor(*pIn++); *pOut++ = vcl::unotools::toDoubleColor(*pIn++); @@ -717,14 +717,14 @@ namespace canvas virtual uno::Sequence< rendering::RGBColor > SAL_CALL convertIntegerToRGB( const uno::Sequence< ::sal_Int8 >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const sal_Int8* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::RGBColor > aRes(nLen/4); rendering::RGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::RGBColor( vcl::unotools::toDoubleColor(pIn[0]), @@ -738,14 +738,14 @@ namespace canvas virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertIntegerToARGB( const uno::Sequence< ::sal_Int8 >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const sal_Int8* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::ARGBColor( 1.0, @@ -760,14 +760,14 @@ namespace canvas virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertIntegerToPARGB( const uno::Sequence< ::sal_Int8 >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const sal_Int8* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::ARGBColor( 1.0, @@ -782,11 +782,11 @@ namespace canvas virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromRGB( const uno::Sequence< rendering::RGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::RGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< sal_Int8 > aRes(nLen*4); sal_Int8* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = vcl::unotools::toByteColor(pIn->Red); *pColors++ = vcl::unotools::toByteColor(pIn->Green); @@ -800,11 +800,11 @@ namespace canvas virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< sal_Int8 > aRes(nLen*4); sal_Int8* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = vcl::unotools::toByteColor(pIn->Red); *pColors++ = vcl::unotools::toByteColor(pIn->Green); @@ -818,11 +818,11 @@ namespace canvas virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromPARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< sal_Int8 > aRes(nLen*4); sal_Int8* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = vcl::unotools::toByteColor(pIn->Red/pIn->Alpha); *pColors++ = vcl::unotools::toByteColor(pIn->Green/pIn->Alpha); diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 4e9b60a75bff..d5d210181394 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -77,9 +77,9 @@ using namespace ::com::sun::star::i18n; namespace { -sal_Size lcl_getFileSize(SvStream& _rStream) +std::size_t lcl_getFileSize(SvStream& _rStream) { - sal_Size nFileSize = 0; + std::size_t nFileSize = 0; _rStream.Seek(STREAM_SEEK_TO_END); _rStream.SeekRel(-1); char cEOL; @@ -538,13 +538,13 @@ void ODbaseTable::construct() } fillColumns(); - sal_Size nFileSize = lcl_getFileSize(*m_pFileStream); + std::size_t nFileSize = lcl_getFileSize(*m_pFileStream); m_pFileStream->Seek(STREAM_SEEK_TO_BEGIN); // seems to be empty or someone wrote bullshit into the dbase file // try and recover if m_aHeader.db_slng is sane if (m_aHeader.db_anz == 0 && m_aHeader.db_slng) { - sal_Size nRecords = (nFileSize-m_aHeader.db_kopf)/m_aHeader.db_slng; + std::size_t nRecords = (nFileSize-m_aHeader.db_kopf)/m_aHeader.db_slng; if (nRecords > 0) m_aHeader.db_anz = nRecords; } @@ -804,12 +804,12 @@ bool ODbaseTable::fetchRow(OValueRefRow& _rRow, const OSQLColumns & _rCols, bool if (!bRetrieveData) return true; - sal_Size nByteOffset = 1; + std::size_t nByteOffset = 1; // Fields: OSQLColumns::Vector::const_iterator aIter = _rCols.get().begin(); OSQLColumns::Vector::const_iterator aEnd = _rCols.get().end(); - const sal_Size nCount = _rRow->get().size(); - for (sal_Size i = 1; aIter != aEnd && nByteOffset <= m_nBufferSize && i < nCount;++aIter, i++) + const std::size_t nCount = _rRow->get().size(); + for (std::size_t i = 1; aIter != aEnd && nByteOffset <= m_nBufferSize && i < nCount;++aIter, i++) { // Lengths depending on data type: sal_Int32 nLen = 0; @@ -1509,13 +1509,13 @@ bool ODbaseTable::InsertRow(OValueRefVector& rRow, const Reference<XIndexAccess> // Copy new row completely: // ... and add at the end as new Record: - sal_Size nTempPos = m_nFilePos; + std::size_t nTempPos = m_nFilePos; - m_nFilePos = (sal_Size)m_aHeader.db_anz + 1; + m_nFilePos = (std::size_t)m_aHeader.db_anz + 1; bool bInsertRow = UpdateBuffer( rRow, nullptr, _xCols, true ); if ( bInsertRow ) { - sal_Size nFileSize = 0, nMemoFileSize = 0; + std::size_t nFileSize = 0, nMemoFileSize = 0; nFileSize = lcl_getFileSize(*m_pFileStream); @@ -1562,11 +1562,11 @@ bool ODbaseTable::UpdateRow(OValueRefVector& rRow, OValueRefRow& pOrgRow, const return false; // position on desired record: - sal_Size nPos = m_aHeader.db_kopf + (long)(m_nFilePos-1) * m_aHeader.db_slng; + std::size_t nPos = m_aHeader.db_kopf + (long)(m_nFilePos-1) * m_aHeader.db_slng; m_pFileStream->Seek(nPos); m_pFileStream->ReadBytes(m_pBuffer, m_aHeader.db_slng); - sal_Size nMemoFileSize( 0 ); + std::size_t nMemoFileSize( 0 ); if (HasMemoFields() && m_pMemoStream) { m_pMemoStream->Seek(STREAM_SEEK_TO_END); @@ -1589,7 +1589,7 @@ bool ODbaseTable::DeleteRow(const OSQLColumns& _rCols) { // Set the Delete-Flag (be it set or not): // Position on desired record: - sal_Size nFilePos = m_aHeader.db_kopf + (long)(m_nFilePos-1) * m_aHeader.db_slng; + std::size_t nFilePos = m_aHeader.db_kopf + (long)(m_nFilePos-1) * m_aHeader.db_slng; m_pFileStream->Seek(nFilePos); OValueRefRow aRow = new OValueRefVector(_rCols.get().size()); @@ -1958,7 +1958,7 @@ bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, const OValueRefRow& pOrgRo char cNext = pData[nLen]; // Mark's scratch and replaced by 0 pData[nLen] = '\0'; // This is because the buffer is always a sign of greater ... - sal_Size nBlockNo = strtol(pData,nullptr,10); // Block number read + std::size_t nBlockNo = strtol(pData,nullptr,10); // Block number read // Next initial character restore again: pData[nLen] = cNext; @@ -2015,10 +2015,10 @@ bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, const OValueRefRow& pOrgRo } -bool ODbaseTable::WriteMemo(const ORowSetValue& aVariable, sal_Size& rBlockNr) +bool ODbaseTable::WriteMemo(const ORowSetValue& aVariable, std::size_t& rBlockNr) { // if the BlockNo 0 is given, the block will be appended at the end - sal_Size nSize = 0; + std::size_t nSize = 0; OString aStr; css::uno::Sequence<sal_Int8> aValue; sal_uInt8 nHeader[4]; @@ -2051,7 +2051,7 @@ bool ODbaseTable::WriteMemo(const ORowSetValue& aVariable, sal_Size& rBlockNr) m_pMemoStream->SeekRel(4L); m_pMemoStream->ReadBytes(sHeader, 4); - sal_Size nOldSize; + std::size_t nOldSize; if (m_aMemoHeader.db_typ == MemoFoxPro) nOldSize = ((((unsigned char)sHeader[0]) * 256 + (unsigned char)sHeader[1]) * 256 + @@ -2064,7 +2064,7 @@ bool ODbaseTable::WriteMemo(const ORowSetValue& aVariable, sal_Size& rBlockNr) (unsigned char)sHeader[0] - 8; // fits the new length in the used blocks - sal_Size nUsedBlocks = ((nSize + 8) / m_aMemoHeader.db_size) + (((nSize + 8) % m_aMemoHeader.db_size > 0) ? 1 : 0), + std::size_t nUsedBlocks = ((nSize + 8) / m_aMemoHeader.db_size) + (((nSize + 8) % m_aMemoHeader.db_size > 0) ? 1 : 0), nOldUsedBlocks = ((nOldSize + 8) / m_aMemoHeader.db_size) + (((nOldSize + 8) % m_aMemoHeader.db_size > 0) ? 1 : 0); bAppend = nUsedBlocks > nOldUsedBlocks; } @@ -2073,7 +2073,7 @@ bool ODbaseTable::WriteMemo(const ORowSetValue& aVariable, sal_Size& rBlockNr) if (bAppend) { - sal_Size nStreamSize = m_pMemoStream->Seek(STREAM_SEEK_TO_END); + sal_uInt64 const nStreamSize = m_pMemoStream->Seek(STREAM_SEEK_TO_END); // fill last block rBlockNr = (nStreamSize / m_aMemoHeader.db_size) + ((nStreamSize % m_aMemoHeader.db_size) > 0 ? 1 : 0); @@ -2137,7 +2137,7 @@ bool ODbaseTable::WriteMemo(const ORowSetValue& aVariable, sal_Size& rBlockNr) // Write the new block number if (bAppend) { - sal_Size nStreamSize = m_pMemoStream->Seek(STREAM_SEEK_TO_END); + sal_uInt64 const nStreamSize = m_pMemoStream->Seek(STREAM_SEEK_TO_END); m_aMemoHeader.db_next = (nStreamSize / m_aMemoHeader.db_size) + ((nStreamSize % m_aMemoHeader.db_size) > 0 ? 1 : 0); // Write the new block number @@ -2629,16 +2629,16 @@ bool ODbaseTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 goto Error; else { - sal_Size nEntryLen = m_aHeader.db_slng; + std::size_t nEntryLen = m_aHeader.db_slng; OSL_ENSURE(m_nFilePos >= 1,"SdbDBFCursor::FileFetchRow: ungueltige Record-Position"); - sal_Size nPos = m_aHeader.db_kopf + (sal_Size)(m_nFilePos-1) * nEntryLen; + std::size_t nPos = m_aHeader.db_kopf + (std::size_t)(m_nFilePos-1) * nEntryLen; m_pFileStream->Seek(nPos); if (m_pFileStream->GetError() != ERRCODE_NONE) goto Error; - sal_Size nRead = m_pFileStream->ReadBytes(m_pBuffer, nEntryLen); + std::size_t nRead = m_pFileStream->ReadBytes(m_pBuffer, nEntryLen); if (nRead != nEntryLen) { SAL_WARN("connectivity.drivers", "ODbaseTable::seekRow: short read!"); @@ -2675,7 +2675,7 @@ End: return true; } -bool ODbaseTable::ReadMemo(sal_Size nBlockNo, ORowSetValue& aVariable) +bool ODbaseTable::ReadMemo(std::size_t nBlockNo, ORowSetValue& aVariable) { m_pMemoStream->Seek(nBlockNo * m_aMemoHeader.db_size); switch (m_aMemoHeader.db_typ) @@ -2776,7 +2776,7 @@ bool ODbaseTable::WriteBuffer() OSL_ENSURE(m_nFilePos >= 1,"SdbDBFCursor::FileFetchRow: ungueltige Record-Position"); // position on desired record: - sal_Size nPos = m_aHeader.db_kopf + (long)(m_nFilePos-1) * m_aHeader.db_slng; + std::size_t nPos = m_aHeader.db_kopf + (long)(m_nFilePos-1) * m_aHeader.db_slng; m_pFileStream->Seek(nPos); return m_pFileStream->WriteBytes(m_pBuffer, m_aHeader.db_slng) > 0; } diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx index 44d90cdc61ac..60521a069b2b 100644 --- a/connectivity/source/drivers/dbase/dindexnode.cxx +++ b/connectivity/source/drivers/dbase/dindexnode.cxx @@ -862,7 +862,7 @@ SvStream& connectivity::dbase::operator >> (SvStream &rStream, ONDXPage& rPage) SvStream& connectivity::dbase::WriteONDXPage(SvStream &rStream, const ONDXPage& rPage) { // Page doesn't exist yet - sal_Size nSize = rPage.GetPagePos() + 1; + std::size_t nSize = rPage.GetPagePos() + 1; nSize *= DINDEX_PAGE_SIZE; if (nSize > rStream.Seek(STREAM_SEEK_TO_END)) { @@ -886,9 +886,9 @@ SvStream& connectivity::dbase::WriteONDXPage(SvStream &rStream, const ONDXPage& // check if we have to fill the stream with '\0' if(i < rPage.rIndex.getHeader().db_maxkeys) { - sal_Size nTell = rStream.Tell() % DINDEX_PAGE_SIZE; + std::size_t nTell = rStream.Tell() % DINDEX_PAGE_SIZE; sal_uInt16 nBufferSize = rStream.GetBufferSize(); - sal_Size nRemainSize = nBufferSize - nTell; + std::size_t nRemainSize = nBufferSize - nTell; if ( nRemainSize <= nBufferSize ) { std::unique_ptr<char[]> pEmptyData( new char[nRemainSize] ); diff --git a/connectivity/source/inc/dbase/DTable.hxx b/connectivity/source/inc/dbase/DTable.hxx index de0b6d2cab2c..24492cecb995 100644 --- a/connectivity/source/inc/dbase/DTable.hxx +++ b/connectivity/source/inc/dbase/DTable.hxx @@ -106,9 +106,9 @@ namespace connectivity bool CreateMemoFile(const INetURLObject& aFile); bool HasMemoFields() const { return m_aHeader.db_typ > dBaseIV;} bool ReadMemoHeader(); - bool ReadMemo(sal_Size nBlockNo, ORowSetValue& aVariable); + bool ReadMemo(std::size_t nBlockNo, ORowSetValue& aVariable); - bool WriteMemo(const ORowSetValue& aVariable, sal_Size& rBlockNr); + bool WriteMemo(const ORowSetValue& aVariable, std::size_t& rBlockNr); bool WriteBuffer(); bool UpdateBuffer(OValueRefVector& rRow, const OValueRefRow& pOrgRow, const css::uno::Reference< css::container::XIndexAccess>& _xCols, bool bForceAllFields); css::uno::Reference< css::beans::XPropertySet> isUniqueByColumnName(sal_Int32 _nColumnPos); diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index 3fda67848ee6..e16fe7c2217d 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -584,7 +584,7 @@ namespace cppcanvas s.ReadInt32( pathLength ); SAL_INFO("cppcanvas.emf", "EMF+\tpath length: " << pathLength); - sal_Size pos = s.Tell (); + sal_uInt64 const pos = s.Tell (); sal_uInt32 pathHeader; sal_Int32 pathPoints, pathFlags; @@ -1068,7 +1068,7 @@ namespace cppcanvas { s.ReadInt32( customStartCapLen ); SAL_INFO("cppcanvas.emf", "EMF+\t\tcustomStartCapLen: " << customStartCapLen); - sal_Size pos = s.Tell(); + sal_uInt64 const pos = s.Tell(); customStartCap = new EMFPCustomLineCap(); customStartCap->Read(s, rR); @@ -1083,7 +1083,7 @@ namespace cppcanvas { s.ReadInt32( customEndCapLen ); SAL_INFO("cppcanvas.emf", "EMF+\t\tcustomEndCapLen: " << customEndCapLen); - sal_Size pos = s.Tell(); + sal_uInt64 const pos = s.Tell(); customEndCap = new EMFPCustomLineCap(); customEndCap->Read(s, rR); @@ -1822,7 +1822,7 @@ namespace cppcanvas while (length >= 12) { sal_uInt16 type, flags; sal_uInt32 size, dataSize; - sal_Size next; + sal_uInt64 next; rMF.ReadUInt16( type ).ReadUInt16( flags ).ReadUInt32( size ).ReadUInt32( dataSize ); diff --git a/cppu/source/threadpool/threadpool.cxx b/cppu/source/threadpool/threadpool.cxx index 0f3199fd378a..8f1304a5990e 100644 --- a/cppu/source/threadpool/threadpool.cxx +++ b/cppu/source/threadpool/threadpool.cxx @@ -361,9 +361,9 @@ struct uno_ThreadPool_Equal struct uno_ThreadPool_Hash { - sal_Size operator () ( const uno_ThreadPool &a ) const + std::size_t operator () ( const uno_ThreadPool &a ) const { - return reinterpret_cast<sal_Size>( a ); + return reinterpret_cast<std::size_t>( a ); } }; diff --git a/cppu/source/uno/sequence.cxx b/cppu/source/uno/sequence.cxx index 28828b16b1ba..e7a6465b12e9 100644 --- a/cppu/source/uno/sequence.cxx +++ b/cppu/source/uno/sequence.cxx @@ -42,7 +42,7 @@ namespace cppu static inline uno_Sequence * reallocSeq( - uno_Sequence * pReallocate, sal_Size nElementSize, sal_Int32 nElements ) + uno_Sequence * pReallocate, std::size_t nElementSize, sal_Int32 nElements ) { OSL_ASSERT( nElements >= 0 ); uno_Sequence * pNew = nullptr; diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx index e36bd7bee673..ade33d9dbef2 100644 --- a/dbaccess/source/ui/misc/HtmlReader.cxx +++ b/dbaccess/source/ui/misc/HtmlReader.cxx @@ -148,7 +148,7 @@ void OHTMLReader::NextToken( int nToken ) case HTML_THEAD_ON: case HTML_TBODY_ON: { - sal_Size nTell = rInput.Tell(); // perhaps alters position of the stream + sal_uInt64 const nTell = rInput.Tell(); // perhaps alters position of the stream if ( !m_xTable.is() ) {// use first line as header m_bError = !CreateTable(nToken); diff --git a/dbaccess/source/ui/misc/RtfReader.cxx b/dbaccess/source/ui/misc/RtfReader.cxx index 5386ef879706..4adee9797122 100644 --- a/dbaccess/source/ui/misc/RtfReader.cxx +++ b/dbaccess/source/ui/misc/RtfReader.cxx @@ -140,7 +140,7 @@ void ORTFReader::NextToken( int nToken ) bool bInsertRow = true; if ( !m_xTable.is() ) // use first line as header { - sal_Size nTell = rInput.Tell(); // perhaps alters position of the stream + sal_uInt64 const nTell = rInput.Tell(); // perhaps alters position of the stream m_bError = !CreateTable(nToken); bInsertRow = m_bAppendFirstLine; diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index 054dff335d22..204a33610e46 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -482,7 +482,7 @@ void OWizTypeSelect::fillColumnList(sal_uInt32 nRows) { if(m_pParserStream) { - sal_Size nTell = m_pParserStream->Tell(); // might change seek position of stream + sal_uInt64 const nTell = m_pParserStream->Tell(); // might change seek position of stream SvParser *pReader = createReader(nRows); if(pReader) diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx index ccf8e964d135..3bb4ec041a40 100644 --- a/desktop/source/deployment/misc/dp_misc.cxx +++ b/desktop/source/deployment/misc/dp_misc.cxx @@ -108,7 +108,7 @@ const OUString OfficePipeId::operator () () sal_uInt8 const * data = reinterpret_cast<sal_uInt8 const *>(userPath.getStr()); - sal_Size size = (userPath.getLength() * sizeof (sal_Unicode)); + std::size_t size = (userPath.getLength() * sizeof (sal_Unicode)); sal_uInt32 md5_key_len = rtl_digest_queryLength( digest ); std::unique_ptr<sal_uInt8[]> md5_buf( new sal_uInt8 [ md5_key_len ] ); diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index 6ffbc2569ea6..81ef9588b334 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -602,7 +602,7 @@ OUString replaceOrigin( OString origin; sal_Char const * pBytes = reinterpret_cast<sal_Char const *>( bytes.data()); - sal_Size nBytes = bytes.size(); + std::size_t nBytes = bytes.size(); size_t write_pos = 0; while (nBytes > 0) { diff --git a/desktop/source/migration/services/wordbookmigration.cxx b/desktop/source/migration/services/wordbookmigration.cxx index a7a023223f39..f74b719a4ad4 100644 --- a/desktop/source/migration/services/wordbookmigration.cxx +++ b/desktop/source/migration/services/wordbookmigration.cxx @@ -119,8 +119,8 @@ bool IsUserWordbook( const OUString& rFile ) if ( pStream && !pStream->GetError() ) { static const sal_Char* pVerOOo7 = "OOoUserDict1"; - sal_Size nSniffPos = pStream->Tell(); - static sal_Size nVerOOo7Len = sal::static_int_cast< sal_Size >(strlen( pVerOOo7 )); + sal_uInt64 const nSniffPos = pStream->Tell(); + static std::size_t nVerOOo7Len = sal::static_int_cast< std::size_t >(strlen( pVerOOo7 )); sal_Char pMagicHeader[MAX_HEADER_LENGTH]; pMagicHeader[ nVerOOo7Len ] = '\0'; if ((pStream->ReadBytes(static_cast<void *>(pMagicHeader), nVerOOo7Len) == nVerOOo7Len)) diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 18dd3a4ac579..45ec5957a330 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -371,7 +371,7 @@ void EditTextObject::Store( SvStream& rOStream ) const if ( rOStream.GetError() ) return; - sal_Size nStartPos = rOStream.Tell(); + sal_uInt64 const nStartPos = rOStream.Tell(); sal_uInt16 nWhich = static_cast<sal_uInt16>(EE_FORMAT_BIN); rOStream.WriteUInt16( nWhich ); @@ -381,7 +381,7 @@ void EditTextObject::Store( SvStream& rOStream ) const StoreData( rOStream ); - sal_Size nEndPos = rOStream.Tell(); + sal_uInt64 const nEndPos = rOStream.Tell(); nStructSz = nEndPos - nStartPos - sizeof( nWhich ) - sizeof( nStructSz ); rOStream.Seek( nStartPos + sizeof( nWhich ) ); rOStream.WriteUInt32( nStructSz ); @@ -390,7 +390,7 @@ void EditTextObject::Store( SvStream& rOStream ) const EditTextObject* EditTextObject::Create( SvStream& rIStream ) { - sal_Size nStartPos = rIStream.Tell(); + sal_uInt64 const nStartPos = rIStream.Tell(); // First check what type of Object... sal_uInt16 nWhich; @@ -413,7 +413,7 @@ EditTextObject* EditTextObject::Create( SvStream& rIStream ) pTxtObj->CreateData(rIStream); // Make sure that the stream is left at the correct place. - sal_Size nFullSz = sizeof( nWhich ) + sizeof( nStructSz ) + nStructSz; + std::size_t nFullSz = sizeof( nWhich ) + sizeof( nStructSz ) + nStructSz; rIStream.Seek( nStartPos + nFullSz ); return pTxtObj; } diff --git a/editeng/source/editeng/eeobj.cxx b/editeng/source/editeng/eeobj.cxx index 40839aa17b09..7347fa3f9ca8 100644 --- a/editeng/source/editeng/eeobj.cxx +++ b/editeng/source/editeng/eeobj.cxx @@ -65,7 +65,8 @@ uno::Any EditDataObject::getTransferData( const datatransfer::DataFlavor& rFlavo SvMemoryStream* pStream = ( nT == SotClipboardFormatId::EDITENGINE ) ? &GetStream() : &GetRTFStream(); pStream->Seek( STREAM_SEEK_TO_END ); - sal_Size nLen = pStream->Tell(); + sal_Int32 nLen = pStream->Tell(); + if (nLen < 0) { abort(); } pStream->Seek(0); uno::Sequence< sal_Int8 > aSeq( nLen ); diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx index e2a68daaf513..5e2b91911357 100644 --- a/editeng/source/items/bulitem.cxx +++ b/editeng/source/items/bulitem.cxx @@ -116,7 +116,7 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich ) { // Safe Load with Test on empty Bitmap Bitmap aBmp; - const sal_Size nOldPos = rStrm.Tell(); + sal_uInt64 const nOldPos = rStrm.Tell(); // Ignore Errorcode when reading Bitmap, // see comment in SvxBulletItem::Store() bool bOldError = rStrm.GetError() != 0; @@ -288,7 +288,7 @@ SvStream& SvxBulletItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) c StoreFont( rStrm, aFont ); else { - sal_Size _nStart = rStrm.Tell(); + sal_uInt64 const _nStart = rStrm.Tell(); // Small preliminary estimate of the size ... sal_uInt16 nFac = ( rStrm.GetCompressMode() != SvStreamCompressFlags::NONE ) ? 3 : 1; @@ -299,7 +299,7 @@ SvStream& SvxBulletItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) c WriteDIB(aBmp, rStrm, false, true); } - sal_Size nEnd = rStrm.Tell(); + sal_uInt64 const nEnd = rStrm.Tell(); // Item can not write with an overhead more than 64K or SfxMultiRecord // will crash. Then prefer to forego on the bitmap, it is only // important for the outliner and only for <= 5.0. diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 6af4e4918d17..ed7906d57bf5 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -745,7 +745,7 @@ SfxPoolItem* SvxLRSpaceItem::Create( SvStream& rStrm, sal_uInt16 nVersion ) cons { rStrm.ReadUInt16( left ).ReadUInt16( prpleft ).ReadUInt16( right ).ReadUInt16( prpright ).ReadInt16( firstline ). ReadUInt16( prpfirstline ).ReadUInt16( txtleft ).ReadSChar( autofirst ); - sal_Size nPos = rStrm.Tell(); + sal_uInt64 const nPos = rStrm.Tell(); sal_uInt32 nMarker; rStrm.ReadUInt32( nMarker ); if ( nMarker == BULLETLR_MARKER ) diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index ae857c8706db..9c1c339e323a 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -400,7 +400,7 @@ SfxPoolItem* SvxFontItem::Create(SvStream& rStrm, sal_uInt16) const eFontTextEncoding = RTL_TEXTENCODING_SYMBOL; // Check if we have stored unicode - sal_Size nStreamPos = rStrm.Tell(); + sal_uInt64 const nStreamPos = rStrm.Tell(); sal_uInt32 nMagic = STORE_UNICODE_MAGIC_MARKER; rStrm.ReadUInt32( nMagic ); if ( nMagic == STORE_UNICODE_MAGIC_MARKER ) diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index 79eaaf15ae50..61906c89bfc7 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -316,7 +316,7 @@ static bool RenderAsBMPThroughHelper(const sal_uInt8* pBuf, sal_uInt32 nBytesRea oslFileError eFileErr = osl_readFile(pOut, aBuf, 32000, &nCount); while (eFileErr == osl_File_E_None && nCount) { - aMemStm.WriteBytes(aBuf, sal::static_int_cast< sal_Size >(nCount)); + aMemStm.WriteBytes(aBuf, sal::static_int_cast<std::size_t>(nCount)); eFileErr = osl_readFile(pOut, aBuf, 32000, &nCount); } diff --git a/filter/source/msfilter/dffpropset.cxx b/filter/source/msfilter/dffpropset.cxx index dae799b7de84..214eb4808e88 100644 --- a/filter/source/msfilter/dffpropset.cxx +++ b/filter/source/msfilter/dffpropset.cxx @@ -1297,7 +1297,7 @@ bool DffPropSet::GetPropertyBool( sal_uInt32 nId ) const OUString DffPropSet::GetPropertyString( sal_uInt32 nId, SvStream& rStrm ) const { - sal_Size nOldPos = rStrm.Tell(); + sal_uInt64 const nOldPos = rStrm.Tell(); OUStringBuffer aBuffer; sal_uInt32 nBufferSize = GetPropertyValue( nId, 0 ); if( (nBufferSize > 0) && SeekToContent( nId, rStrm ) ) diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index f204391cf1bb..f46aa331fc1a 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -4946,8 +4946,8 @@ SvStream* EscherExGlobal::ImplQueryPictureStream() class SvNullStream : public SvStream { protected: - virtual sal_Size GetData( void* pData, sal_Size nSize ) override { memset( pData, 0, nSize ); return nSize; } - virtual sal_Size PutData( const void*, sal_Size nSize ) override { return nSize; } + virtual std::size_t GetData( void* pData, std::size_t nSize ) override { memset( pData, 0, nSize ); return nSize; } + virtual std::size_t PutData( const void*, std::size_t nSize ) override { return nSize; } virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) override { return nPos; } virtual void SetSize( sal_uInt64 ) override {} virtual void FlushData() override {} diff --git a/filter/source/msfilter/mscodec.cxx b/filter/source/msfilter/mscodec.cxx index b6ac16949c88..39f4defec22f 100644 --- a/filter/source/msfilter/mscodec.cxx +++ b/filter/source/msfilter/mscodec.cxx @@ -60,23 +60,23 @@ inline void lclRotateLeft( Type& rnValue, sal_uInt8 nBits, sal_uInt8 nWidth ) ((rnValue << nBits) | ((rnValue & nMask) >> (nWidth - nBits))) & nMask ); } -sal_Size lclGetLen( const sal_uInt8* pnPassData, sal_Size nBufferSize ) +std::size_t lclGetLen( const sal_uInt8* pnPassData, std::size_t nBufferSize ) { - sal_Size nLen = 0; + std::size_t nLen = 0; while( (nLen < nBufferSize) && pnPassData[ nLen ] ) ++nLen; return nLen; } -sal_uInt16 lclGetKey( const sal_uInt8* pnPassData, sal_Size nBufferSize ) +sal_uInt16 lclGetKey( const sal_uInt8* pnPassData, std::size_t nBufferSize ) { - sal_Size nLen = lclGetLen( pnPassData, nBufferSize ); + std::size_t nLen = lclGetLen( pnPassData, nBufferSize ); if( !nLen ) return 0; sal_uInt16 nKey = 0; sal_uInt16 nKeyBase = 0x8000; sal_uInt16 nKeyEnd = 0xFFFF; const sal_uInt8* pnChar = pnPassData + nLen - 1; - for( sal_Size nIndex = 0; nIndex < nLen; ++nIndex, --pnChar ) + for( std::size_t nIndex = 0; nIndex < nLen; ++nIndex, --pnChar ) { sal_uInt8 cChar = *pnChar & 0x7F; for( sal_uInt8 nBit = 0; nBit < 8; ++nBit ) @@ -92,16 +92,16 @@ sal_uInt16 lclGetKey( const sal_uInt8* pnPassData, sal_Size nBufferSize ) return nKey ^ nKeyEnd; } -sal_uInt16 lclGetHash( const sal_uInt8* pnPassData, sal_Size nBufferSize ) +sal_uInt16 lclGetHash( const sal_uInt8* pnPassData, std::size_t nBufferSize ) { - sal_Size nLen = lclGetLen( pnPassData, nBufferSize ); + std::size_t nLen = lclGetLen( pnPassData, nBufferSize ); sal_uInt16 nHash = static_cast< sal_uInt16 >( nLen ); if( nLen ) nHash ^= 0xCE4B; const sal_uInt8* pnChar = pnPassData; - for( sal_Size nIndex = 0; nIndex < nLen; ++nIndex, ++pnChar ) + for( std::size_t nIndex = 0; nIndex < nLen; ++nIndex, ++pnChar ) { sal_uInt16 cChar = *pnChar; sal_uInt8 nRot = static_cast< sal_uInt8 >( (nIndex + 1) % 15 ); @@ -145,8 +145,8 @@ void MSCodec_Xor95::InitKey( const sal_uInt8 pnPassData[ 16 ] ) 0xBF, 0x0F, 0x00, 0x00 }; - sal_Size nIndex; - sal_Size nLen = lclGetLen( pnPassData, 16 ); + std::size_t nIndex; + std::size_t nLen = lclGetLen( pnPassData, 16 ); const sal_uInt8* pnFillChar = spnFillChars; for( nIndex = nLen; nIndex < sizeof( mpnKey ); ++nIndex, ++pnFillChar ) mpnKey[ nIndex ] = *pnFillChar; @@ -202,7 +202,7 @@ void MSCodec_Xor95::InitCipher() mnOffset = 0; } -void MSCodec_XorXLS95::Decode( sal_uInt8* pnData, sal_Size nBytes ) +void MSCodec_XorXLS95::Decode( sal_uInt8* pnData, std::size_t nBytes ) { const sal_uInt8* pnCurrKey = mpnKey + mnOffset; const sal_uInt8* pnKeyLast = mpnKey + 0x0F; @@ -218,7 +218,7 @@ void MSCodec_XorXLS95::Decode( sal_uInt8* pnData, sal_Size nBytes ) Skip( nBytes ); } -void MSCodec_XorWord95::Decode( sal_uInt8* pnData, sal_Size nBytes ) +void MSCodec_XorWord95::Decode( sal_uInt8* pnData, std::size_t nBytes ) { const sal_uInt8* pnCurrKey = mpnKey + mnOffset; const sal_uInt8* pnKeyLast = mpnKey + 0x0F; @@ -240,7 +240,7 @@ void MSCodec_XorWord95::Decode( sal_uInt8* pnData, sal_Size nBytes ) } -void MSCodec_Xor95::Skip( sal_Size nBytes ) +void MSCodec_Xor95::Skip( std::size_t nBytes ) { mnOffset = (mnOffset + nBytes) & 0x0F; } @@ -432,8 +432,8 @@ void MSCodec_Std97::CreateSaltDigest( const sal_uInt8 nSaltData[16], sal_uInt8 n } bool MSCodec_Std97::Encode ( - const void *pData, sal_Size nDatLen, - sal_uInt8 *pBuffer, sal_Size nBufLen) + const void *pData, std::size_t nDatLen, + sal_uInt8 *pBuffer, std::size_t nBufLen) { rtlCipherError result; @@ -444,8 +444,8 @@ bool MSCodec_Std97::Encode ( } bool MSCodec_Std97::Decode ( - const void *pData, sal_Size nDatLen, - sal_uInt8 *pBuffer, sal_Size nBufLen) + const void *pData, std::size_t nDatLen, + sal_uInt8 *pBuffer, std::size_t nBufLen) { rtlCipherError result; @@ -455,15 +455,15 @@ bool MSCodec_Std97::Decode ( return (result == rtl_Cipher_E_None); } -bool MSCodec_Std97::Skip( sal_Size nDatLen ) +bool MSCodec_Std97::Skip( std::size_t nDatLen ) { sal_uInt8 pnDummy[ 1024 ]; - sal_Size nDatLeft = nDatLen; + std::size_t nDatLeft = nDatLen; bool bResult = true; while (bResult && nDatLeft) { - sal_Size nBlockLen = ::std::min< sal_Size >( nDatLeft, sizeof(pnDummy) ); + std::size_t nBlockLen = ::std::min< std::size_t >( nDatLeft, sizeof(pnDummy) ); bResult = Decode( pnDummy, nBlockLen, pnDummy, nBlockLen ); nDatLeft -= nBlockLen; } diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 5e8b22ad563f..eccd42a6e42b 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -2215,7 +2215,7 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt sal_uInt16 nElemSizeSeg = 2; rIn.ReadUInt16( nNumElemSeg ).ReadUInt16( nNumElemMemSeg ).ReadUInt16( nElemSizeSeg ); } - sal_Size nMaxEntriesPossible = rIn.remainingSize() / sizeof(sal_uInt16); + std::size_t nMaxEntriesPossible = rIn.remainingSize() / sizeof(sal_uInt16); if (nNumElemSeg > nMaxEntriesPossible) { SAL_WARN("filter.ms", "NumElem list is longer than remaining bytes, ppt or parser is wrong"); @@ -5724,13 +5724,13 @@ void SvxMSDffManager::GetFidclData( sal_uInt32 nOffsDggL ) if ( mnIdClusters-- > 2 ) { - const sal_Size nFIDCLsize = sizeof(sal_uInt32) * 2; + const std::size_t nFIDCLsize = sizeof(sal_uInt32) * 2; if ( aDggAtomHd.nRecLen == ( mnIdClusters * nFIDCLsize + 16 ) ) { - sal_Size nMaxEntriesPossible = rStCtrl.remainingSize() / nFIDCLsize; + std::size_t nMaxEntriesPossible = rStCtrl.remainingSize() / nFIDCLsize; SAL_WARN_IF(nMaxEntriesPossible < mnIdClusters, "filter.ms", "FIDCL list longer than remaining bytes, ppt or parser is wrong"); - mnIdClusters = std::min(nMaxEntriesPossible, static_cast<sal_Size>(mnIdClusters)); + mnIdClusters = std::min(nMaxEntriesPossible, static_cast<std::size_t>(mnIdClusters)); maFidcls.resize(mnIdClusters); for (sal_uInt32 i = 0; i < mnIdClusters; ++i) diff --git a/filter/source/svg/gfxtypes.hxx b/filter/source/svg/gfxtypes.hxx index 9f9d38024fb0..33b195a076e2 100644 --- a/filter/source/svg/gfxtypes.hxx +++ b/filter/source/svg/gfxtypes.hxx @@ -55,7 +55,7 @@ struct GradientStop struct Gradient { enum GradientType { LINEAR, RADIAL}; - std::vector<sal_Size> maStops; + std::vector<std::size_t> maStops; basegfx::B2DHomMatrix maTransform; GradientType meType; union diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index 79c9636d6e08..7efe1323531c 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -151,7 +151,7 @@ bool PolyPolygonIsMixedOpenAndClosed( const basegfx::B2DPolyPolygon& rPoly ) return bRetval; } -typedef std::map<OUString,sal_Size> ElementRefMapType; +typedef std::map<OUString,std::size_t> ElementRefMapType; struct AnnotatingVisitor { @@ -499,7 +499,7 @@ struct AnnotatingVisitor mrStopVec(rStopVec) {} - bool operator()( sal_Size rLHS, sal_Size rRHS ) + bool operator()( std::size_t rLHS, std::size_t rRHS ) { return mrStopVec[rLHS].mnStopPosition < mrStopVec[rRHS].mnStopPosition; } @@ -517,8 +517,8 @@ struct AnnotatingVisitor return; //easy! :-) // join similar colors - std::vector<sal_Size> aNewStops { rGradient.maStops.front() }; - for( sal_Size i=1; i<rGradient.maStops.size(); ++i ) + std::vector<std::size_t> aNewStops { rGradient.maStops.front() }; + for( std::size_t i=1; i<rGradient.maStops.size(); ++i ) { if( maGradientStopVector[rGradient.maStops[i]].maStopColor != maGradientStopVector[aNewStops.back()].maStopColor ) @@ -545,9 +545,9 @@ struct AnnotatingVisitor // those two stops around this border (metric is // super-simplistic: take euclidean distance of colors, weigh // with stop distance) - sal_Size nMaxIndex=0; + std::size_t nMaxIndex=0; double fMaxDistance=0.0; - for( sal_Size i=1; i<rGradient.maStops.size(); ++i ) + for( std::size_t i=1; i<rGradient.maStops.size(); ++i ) { const double fCurrDistance( colorDiffSquared( diff --git a/filter/source/textfilterdetect/filterdetect.cxx b/filter/source/textfilterdetect/filterdetect.cxx index 4b6ec600bad0..3368af1e79aa 100644 --- a/filter/source/textfilterdetect/filterdetect.cxx +++ b/filter/source/textfilterdetect/filterdetect.cxx @@ -46,7 +46,7 @@ bool IsHTMLStream( const uno::Reference<io::XInputStream>& xInStream ) // Read the stream header pInStream->StartReadingUnicodeText( RTL_TEXTENCODING_DONTKNOW ); - const sal_Size nUniPos = pInStream->Tell(); + const sal_uInt64 nUniPos = pInStream->Tell(); const sal_uInt16 nSize = 4096; OString sHeader; diff --git a/filter/source/xmlfilterdetect/filterdetect.cxx b/filter/source/xmlfilterdetect/filterdetect.cxx index 8cce08fc2d76..8ce2522dfb2c 100644 --- a/filter/source/xmlfilterdetect/filterdetect.cxx +++ b/filter/source/xmlfilterdetect/filterdetect.cxx @@ -95,7 +95,7 @@ OUString SAL_CALL FilterDetect::detect( css::uno::Sequence< css::beans::Property std::unique_ptr< SvStream > pInStream( ::utl::UcbStreamHelper::CreateStream( xInStream ) ); pInStream->StartReadingUnicodeText( RTL_TEXTENCODING_DONTKNOW ); - sal_Size nUniPos = pInStream->Tell(); + sal_uInt64 const nUniPos = pInStream->Tell(); const sal_uInt16 nSize = 4000; bool bTryUtf16 = false; diff --git a/forms/source/component/imgprod.cxx b/forms/source/component/imgprod.cxx index b40d892bdcc8..dab9b8f45574 100644 --- a/forms/source/component/imgprod.cxx +++ b/forms/source/component/imgprod.cxx @@ -44,8 +44,8 @@ public: explicit ImgProdLockBytes( css::uno::Reference< css::io::XInputStream > & rStreamRef ); virtual ~ImgProdLockBytes() override; - virtual ErrCode ReadAt( sal_uInt64 nPos, void* pBuffer, sal_Size nCount, sal_Size * pRead ) const override; - virtual ErrCode WriteAt( sal_uInt64 nPos, const void* pBuffer, sal_Size nCount, sal_Size * pWritten ) override; + virtual ErrCode ReadAt( sal_uInt64 nPos, void* pBuffer, std::size_t nCount, std::size_t * pRead ) const override; + virtual ErrCode WriteAt( sal_uInt64 nPos, const void* pBuffer, std::size_t nCount, std::size_t * pWritten ) override; virtual ErrCode Flush() const override; virtual ErrCode SetSize( sal_uInt64 nSize ) override; virtual ErrCode Stat( SvLockBytesStat*, SvLockBytesStatFlag ) const override; @@ -90,7 +90,7 @@ ImgProdLockBytes::~ImgProdLockBytes() ErrCode ImgProdLockBytes::ReadAt(sal_uInt64 const nPos, - void* pBuffer, sal_Size nCount, sal_Size * pRead) const + void* pBuffer, std::size_t nCount, std::size_t * pRead) const { if( GetStream() ) { @@ -101,7 +101,7 @@ ErrCode ImgProdLockBytes::ReadAt(sal_uInt64 const nPos, } else { - const sal_Size nSeqLen = maSeq.getLength(); + const std::size_t nSeqLen = maSeq.getLength(); ErrCode nErr = ERRCODE_NONE; if( nPos < nSeqLen ) @@ -121,7 +121,7 @@ ErrCode ImgProdLockBytes::ReadAt(sal_uInt64 const nPos, ErrCode ImgProdLockBytes::WriteAt(sal_uInt64 const nPos, - const void* pBuffer, sal_Size nCount, sal_Size * pWritten) + const void* pBuffer, std::size_t nCount, std::size_t * pWritten) { if( GetStream() ) return SvLockBytes::WriteAt( nPos, pBuffer, nCount, pWritten ); diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index 9ab0179e6cc5..3e8cf81a2969 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -124,7 +124,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportHWP(const OUString &rURL SvFileStream aFileStream(rURL, StreamMode::READ); std::unique_ptr<HStream> stream(new HStream); byte aData[32768]; - sal_Size nRead, nBlock = 32768; + std::size_t nRead, nBlock = 32768; while (true) { diff --git a/include/filter/msfilter/dffrecordheader.hxx b/include/filter/msfilter/dffrecordheader.hxx index ade236c4ab8e..3ad5c4837055 100644 --- a/include/filter/msfilter/dffrecordheader.hxx +++ b/include/filter/msfilter/dffrecordheader.hxx @@ -44,12 +44,12 @@ public: { return nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen; } bool SeekToEndOfRecord(SvStream& rIn) const { - sal_Size nPos = nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen; + sal_uInt64 const nPos = nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen; return nPos == rIn.Seek(nPos); } bool SeekToContent(SvStream& rIn) const { - sal_Size nPos = nFilePos + DFF_COMMON_RECORD_HEADER_SIZE; + sal_uInt64 const nPos = nFilePos + DFF_COMMON_RECORD_HEADER_SIZE; return nPos == rIn.Seek(nPos); } bool SeekToBegOfRecord(SvStream& rIn) const diff --git a/include/filter/msfilter/mscodec.hxx b/include/filter/msfilter/mscodec.hxx index 4e0e67aea79b..1b91df68b33d 100644 --- a/include/filter/msfilter/mscodec.hxx +++ b/include/filter/msfilter/mscodec.hxx @@ -103,7 +103,7 @@ public: @param nBytes Size of the passed data block. */ - virtual void Decode( sal_uInt8* pnData, sal_Size nBytes )=0; + virtual void Decode( sal_uInt8* pnData, std::size_t nBytes )=0; /** Lets the cipher skip a specific amount of bytes. @@ -117,11 +117,11 @@ public: @param nBytes Number of bytes to be skipped (cipher "seeks" forward). */ - void Skip( sal_Size nBytes ); + void Skip( std::size_t nBytes ); protected: sal_uInt8 mpnKey[ 16 ]; /// Encryption key. - sal_Size mnOffset; /// Key offset. + std::size_t mnOffset; /// Key offset. private: MSCodec_Xor95( const MSCodec_Xor95& ) = delete; @@ -150,7 +150,7 @@ public: @param nBytes Size of the passed data block. */ - virtual void Decode( sal_uInt8* pnData, sal_Size nBytes ) override; + virtual void Decode( sal_uInt8* pnData, std::size_t nBytes ) override; }; /** Encodes and decodes data from protected MSO Word 95- documents. @@ -171,7 +171,7 @@ public: @param nBytes Size of the passed data block. */ - virtual void Decode( sal_uInt8* pnData, sal_Size nBytes ) override; + virtual void Decode( sal_uInt8* pnData, std::size_t nBytes ) override; }; @@ -278,8 +278,8 @@ public: true = Encoding was successful (no error occurred). */ bool Encode( - const void* pData, sal_Size nDatLen, - sal_uInt8* pBuffer, sal_Size nBufLen ); + const void* pData, std::size_t nDatLen, + sal_uInt8* pBuffer, std::size_t nBufLen ); /** Decodes a block of memory. @@ -304,8 +304,8 @@ public: true = Decoding was successful (no error occurred). */ bool Decode( - const void* pData, sal_Size nDatLen, - sal_uInt8* pBuffer, sal_Size nBufLen ); + const void* pData, std::size_t nDatLen, + sal_uInt8* pBuffer, std::size_t nBufLen ); /** Lets the cipher skip a specific amount of bytes. @@ -319,7 +319,7 @@ public: @param nDatLen Number of bytes to be skipped (cipher "seeks" forward). */ - bool Skip( sal_Size nDatLen ); + bool Skip( std::size_t nDatLen ); /** Gets salt data and salt digest. diff --git a/include/oox/dump/dumperbase.hxx b/include/oox/dump/dumperbase.hxx index c8927d6cb3d7..f1358c6e9cf1 100644 --- a/include/oox/dump/dumperbase.hxx +++ b/include/oox/dump/dumperbase.hxx @@ -961,7 +961,7 @@ public: void writeChar( sal_Unicode cChar, sal_Int32 nCount = 1 ); void writeAscii( const sal_Char* pcStr ); void writeString( const OUString& rStr ); - void writeArray( const sal_uInt8* pnData, sal_Size nSize, sal_Unicode cSep = OOX_DUMP_LISTSEP ); + void writeArray( const sal_uInt8* pnData, std::size_t nSize, sal_Unicode cSep = OOX_DUMP_LISTSEP ); void writeBool( bool bData ); void writeDateTime( const css::util::DateTime& rDateTime ); @@ -1217,7 +1217,7 @@ protected: void writeInfoItem( const String& rName, const String& rData ); void writeCharItem( const String& rName, sal_Unicode cData ); void writeStringItem( const String& rName, const OUString& rData ); - void writeArrayItem( const String& rName, const sal_uInt8* pnData, sal_Size nSize, sal_Unicode cSep = OOX_DUMP_LISTSEP ); + void writeArrayItem( const String& rName, const sal_uInt8* pnData, std::size_t nSize, sal_Unicode cSep = OOX_DUMP_LISTSEP ); void writeDateTimeItem( const String& rName, const css::util::DateTime& rDateTime ); void writeGuidItem( const String& rName, const OUString& rGuid ); diff --git a/include/oox/ole/vbaexport.hxx b/include/oox/ole/vbaexport.hxx index 071b23bccf27..fed4b797c7a7 100644 --- a/include/oox/ole/vbaexport.hxx +++ b/include/oox/ole/vbaexport.hxx @@ -53,7 +53,7 @@ class VBACompressionChunk { public: - VBACompressionChunk(SvStream& rCompressedStream, const sal_uInt8* pData, sal_Size nChunkSize); + VBACompressionChunk(SvStream& rCompressedStream, const sal_uInt8* pData, std::size_t nChunkSize); void write(); @@ -63,7 +63,7 @@ private: sal_uInt8* mpCompressedChunkStream; // same as DecompressedChunkEnd in the spec - sal_Size mnChunkSize; + std::size_t mnChunkSize; // CompressedCurrent according to the spec sal_uInt64 mnCompressedCurrent; diff --git a/include/sot/storage.hxx b/include/sot/storage.hxx index 92134c20f821..fc0d4240fc1b 100644 --- a/include/sot/storage.hxx +++ b/include/sot/storage.hxx @@ -38,8 +38,8 @@ class SOT_DLLPUBLIC SotStorageStream : virtual public SotObject, public SvStream friend class SotStorage; BaseStorageStream * pOwnStm; // pointer to the own stream protected: - virtual sal_uLong GetData( void* pData, sal_uLong nSize ) override; - virtual sal_uLong PutData( const void* pData, sal_uLong nSize ) override; + virtual std::size_t GetData(void* pData, std::size_t nSize) override; + virtual std::size_t PutData(const void* pData, std::size_t nSize) override; virtual sal_uInt64 SeekPos(sal_uInt64 nPos) override; virtual void FlushData() override; virtual ~SotStorageStream() override; diff --git a/include/svl/instrm.hxx b/include/svl/instrm.hxx index 65d24f37d169..c8c914546e45 100644 --- a/include/svl/instrm.hxx +++ b/include/svl/instrm.hxx @@ -41,9 +41,9 @@ class SVL_DLLPUBLIC SvInputStream: public SvStream SVL_DLLPRIVATE bool open(); - SVL_DLLPRIVATE virtual sal_uLong GetData(void * pData, sal_uLong nSize) override; + SVL_DLLPRIVATE virtual std::size_t GetData(void * pData, std::size_t nSize) override; - SVL_DLLPRIVATE virtual sal_uLong PutData(void const *, sal_uLong) override; + SVL_DLLPRIVATE virtual std::size_t PutData(void const *, std::size_t) override; SVL_DLLPRIVATE virtual sal_uInt64 SeekPos(sal_uInt64 nPos) override; diff --git a/include/svl/outstrm.hxx b/include/svl/outstrm.hxx index d512d46ba51d..d212bfba3ccd 100644 --- a/include/svl/outstrm.hxx +++ b/include/svl/outstrm.hxx @@ -33,9 +33,9 @@ class SVL_DLLPUBLIC SvOutputStream: public SvStream { css::uno::Reference< css::io::XOutputStream > m_xStream; - SVL_DLLPRIVATE virtual sal_uLong GetData(void *, sal_uLong) override; + SVL_DLLPRIVATE virtual std::size_t GetData(void *, std::size_t) override; - SVL_DLLPRIVATE virtual sal_uLong PutData(void const * pData, sal_uLong nSize) override; + SVL_DLLPRIVATE virtual std::size_t PutData(void const * pData, std::size_t nSize) override; SVL_DLLPRIVATE virtual sal_uInt64 SeekPos(sal_uInt64) override; diff --git a/include/tools/pstm.hxx b/include/tools/pstm.hxx index b0cbd3b9f445..ec82cf59aa1f 100644 --- a/include/tools/pstm.hxx +++ b/include/tools/pstm.hxx @@ -139,8 +139,8 @@ private: Index nStartIdx; const SvPersistStream * pRefStm; - virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize ) override; - virtual sal_uIntPtr PutData( const void* pData, sal_uIntPtr nSize ) override; + virtual std::size_t GetData(void* pData, std::size_t nSize) override; + virtual std::size_t PutData(const void* pData, std::size_t nSize) override; virtual sal_uInt64 SeekPos(sal_uInt64 nPos) override; virtual void FlushData() override; diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx index 5f8b9388dba5..6a37b265a03a 100644 --- a/include/tools/stream.hxx +++ b/include/tools/stream.hxx @@ -93,7 +93,7 @@ enum LockType {}; struct SvLockBytesStat { - sal_Size nSize; + std::size_t nSize; SvLockBytesStat() : nSize(0) {} }; @@ -123,10 +123,10 @@ public: void SetSynchronMode(bool bTheSync = true) { m_bSync = bTheSync; } bool IsSynchronMode() const { return m_bSync; } - virtual ErrCode ReadAt(sal_uInt64 nPos, void * pBuffer, sal_Size nCount, - sal_Size * pRead) const; - virtual ErrCode WriteAt(sal_uInt64 nPos, const void * pBuffer, sal_Size nCount, - sal_Size * pWritten); + virtual ErrCode ReadAt(sal_uInt64 nPos, void * pBuffer, std::size_t nCount, + std::size_t * pRead) const; + virtual ErrCode WriteAt(sal_uInt64 nPos, const void * pBuffer, std::size_t nCount, + std::size_t * pWritten); virtual ErrCode Flush() const; @@ -188,8 +188,8 @@ protected: StreamMode m_eStreamMode; bool m_isWritable; - virtual sal_Size GetData( void* pData, sal_Size nSize ); - virtual sal_Size PutData( const void* pData, sal_Size nSize ); + virtual std::size_t GetData( void* pData, std::size_t nSize ); + virtual std::size_t PutData( const void* pData, std::size_t nSize ); virtual sal_uInt64 SeekPos( sal_uInt64 nPos ); virtual void FlushData(); virtual void SetSize(sal_uInt64 nSize); @@ -198,10 +198,10 @@ protected: void ClearBuffer(); // encrypt and write in blocks - sal_Size CryptAndWriteBuffer( const void* pStart, sal_Size nLen ); - bool EncryptBuffer( void* pStart, sal_Size nLen ); + std::size_t CryptAndWriteBuffer( const void* pStart, std::size_t nLen ); + bool EncryptBuffer( void* pStart, std::size_t nLen ); - void SyncSvStream( sal_Size nNewStreamPos ); ///< SvStream <- Medium + void SyncSvStream( std::size_t nNewStreamPos ); ///< SvStream <- Medium void SyncSysStream(); ///< SvStream -> Medium public: @@ -275,8 +275,8 @@ public: SvStream& WriteUInt32AsString( sal_uInt32 nUInt32 ); SvStream& WriteInt32AsString( sal_Int32 nInt32 ); - sal_Size ReadBytes( void* pData, sal_Size nSize ); - sal_Size WriteBytes( const void* pData, sal_Size nSize ); + std::size_t ReadBytes( void* pData, std::size_t nSize ); + std::size_t WriteBytes( const void* pData, std::size_t nSize ); sal_uInt64 Seek( sal_uInt64 nPos ); sal_uInt64 SeekRel( sal_Int64 nPos ); sal_uInt64 Tell() const { return m_nBufFilePos + m_nBufActualPos; } @@ -435,11 +435,11 @@ TOOLS_DLLPUBLIC SvStream& endlub( SvStream& rStr ); /// Attempt to read nUnits 8bit units to an OString, returned OString's /// length is number of units successfully read TOOLS_DLLPUBLIC OString read_uInt8s_ToOString(SvStream& rStrm, - sal_Size nUnits); + std::size_t nUnits); /// Attempt to read nUnits 8bit units to an OUString inline OUString read_uInt8s_ToOUString(SvStream& rStrm, - sal_Size nUnits, rtl_TextEncoding eEnc) + std::size_t nUnits, rtl_TextEncoding eEnc) { return OStringToOUString(read_uInt8s_ToOString(rStrm, nUnits), eEnc); } @@ -447,7 +447,7 @@ inline OUString read_uInt8s_ToOUString(SvStream& rStrm, /// Attempt to read nUnits 16bit units to an OUString, returned /// OUString's length is number of units successfully read TOOLS_DLLPUBLIC OUString read_uInt16s_ToOUString(SvStream& rStrm, - sal_Size nUnits); + std::size_t nUnits); /// Attempt to read a pascal-style length (of type prefix) prefixed sequence of /// 16bit units to an OUString, returned OString's length is number of @@ -468,10 +468,10 @@ inline OUString read_uInt32_lenPrefixed_uInt16s_ToOUString(SvStream& rStrm) /// Attempt to write a prefixed sequence of nUnits 16bit units from an OUString, /// returned value is number of bytes written -TOOLS_DLLPUBLIC sal_Size write_uInt16s_FromOUString(SvStream& rStrm, - const OUString& rStr, sal_Size nUnits); +TOOLS_DLLPUBLIC std::size_t write_uInt16s_FromOUString(SvStream& rStrm, + const OUString& rStr, std::size_t nUnits); -inline sal_Size write_uInt16s_FromOUString(SvStream& rStrm, +inline std::size_t write_uInt16s_FromOUString(SvStream& rStrm, const OUString& rStr) { return write_uInt16s_FromOUString(rStrm, rStr, rStr.getLength()); @@ -480,13 +480,13 @@ inline sal_Size write_uInt16s_FromOUString(SvStream& rStrm, /// Attempt to write a pascal-style length (of type prefix) prefixed sequence /// of 16bit units from an OUString, returned value is number of bytes written /// (including byte-count of prefix) -TOOLS_DLLPUBLIC sal_Size write_uInt32_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm, +TOOLS_DLLPUBLIC std::size_t write_uInt32_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm, const OUString &rStr); /// Attempt to write a pascal-style length (of type prefix) prefixed sequence /// of 16bit units from an OUString, returned value is number of bytes written /// (including byte-count of prefix) -TOOLS_DLLPUBLIC sal_Size write_uInt16_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm, +TOOLS_DLLPUBLIC std::size_t write_uInt16_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm, const OUString &rStr); /// Attempt to read 8bit units to an OString until a zero terminator is @@ -533,13 +533,13 @@ inline OUString read_uInt8_lenPrefixed_uInt8s_ToOUString(SvStream& rStrm, /// Attempt to write a prefixed sequence of nUnits 8bit units from an OString, /// returned value is number of bytes written -inline sal_Size write_uInt8s_FromOString(SvStream& rStrm, const OString& rStr, - sal_Size nUnits) +inline std::size_t write_uInt8s_FromOString(SvStream& rStrm, const OString& rStr, + std::size_t nUnits) { return rStrm.WriteBytes(rStr.getStr(), nUnits); } -inline sal_Size write_uInt8s_FromOString(SvStream& rStrm, const OString& rStr) +inline std::size_t write_uInt8s_FromOString(SvStream& rStrm, const OString& rStr) { return write_uInt8s_FromOString(rStrm, rStr, rStr.getLength()); } @@ -547,13 +547,13 @@ inline sal_Size write_uInt8s_FromOString(SvStream& rStrm, const OString& rStr) /// Attempt to write a pascal-style length (of type prefix) prefixed /// sequence of units from a string-type, returned value is number of bytes /// written (including byte-count of prefix) -TOOLS_DLLPUBLIC sal_Size write_uInt16_lenPrefixed_uInt8s_FromOString(SvStream& rStrm, +TOOLS_DLLPUBLIC std::size_t write_uInt16_lenPrefixed_uInt8s_FromOString(SvStream& rStrm, const OString &rStr); /// Attempt to write a pascal-style length (of type prefix) prefixed sequence /// of 8bit units from an OUString, returned value is number of bytes written /// (including byte-count of prefix) -inline sal_Size write_uInt16_lenPrefixed_uInt8s_FromOUString(SvStream& rStrm, +inline std::size_t write_uInt16_lenPrefixed_uInt8s_FromOUString(SvStream& rStrm, const OUString &rStr, rtl_TextEncoding eEnc) { @@ -573,14 +573,14 @@ private: SvFileStream (const SvFileStream&) = delete; SvFileStream & operator= (const SvFileStream&) = delete; - bool LockRange( sal_Size nByteOffset, sal_Size nBytes ); - bool UnlockRange( sal_Size nByteOffset, sal_Size nBytes ); + bool LockRange( std::size_t nByteOffset, std::size_t nBytes ); + bool UnlockRange( std::size_t nByteOffset, std::size_t nBytes ); bool LockFile(); void UnlockFile(); protected: - virtual sal_Size GetData( void* pData, sal_Size nSize ) override; - virtual sal_Size PutData( const void* pData, sal_Size nSize ) override; + virtual std::size_t GetData( void* pData, std::size_t nSize ) override; + virtual std::size_t PutData( const void* pData, std::size_t nSize ) override; virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) override; virtual void SetSize( sal_uInt64 nSize ) override; virtual void FlushData() override; @@ -608,22 +608,22 @@ class TOOLS_DLLPUBLIC SvMemoryStream : public SvStream SvMemoryStream & operator= (const SvMemoryStream&) = delete; protected: - sal_Size nSize; - sal_Size nResize; - sal_Size nPos; - sal_Size nEndOfData; + std::size_t nSize; + std::size_t nResize; + std::size_t nPos; + std::size_t nEndOfData; sal_uInt8* pBuf; bool bOwnsData; - virtual sal_Size GetData( void* pData, sal_Size nSize ) override; - virtual sal_Size PutData( const void* pData, sal_Size nSize ) override; + virtual std::size_t GetData( void* pData, std::size_t nSize ) override; + virtual std::size_t PutData( const void* pData, std::size_t nSize ) override; virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) override; virtual void SetSize( sal_uInt64 nSize ) override; virtual void FlushData() override; /// AllocateMemory must update pBuf accordingly /// - pBuf: Address of new block - bool AllocateMemory( sal_Size nSize ); + bool AllocateMemory( std::size_t nSize ); /// ReAllocateMemory must update the following variables: /// - pBuf: Address of new block @@ -638,23 +638,23 @@ protected: void FreeMemory(); public: - SvMemoryStream( void* pBuf, sal_Size nSize, StreamMode eMode); - SvMemoryStream( sal_Size nInitSize=512, sal_Size nResize=64 ); + SvMemoryStream( void* pBuf, std::size_t nSize, StreamMode eMode); + SvMemoryStream( std::size_t nInitSize=512, std::size_t nResize=64 ); virtual ~SvMemoryStream() override; virtual void ResetError() override; const void* GetBuffer(); sal_uInt64 GetSize(); - sal_Size GetEndOfData() const { return nEndOfData; } + std::size_t GetEndOfData() const { return nEndOfData; } const void* GetData() { Flush(); return pBuf; } void* SwitchBuffer(); // the buffer is not owned by this class - void SetBuffer( void* pBuf, sal_Size nSize, sal_Size nEOF ); + void SetBuffer( void* pBuf, std::size_t nSize, std::size_t nEOF ); void ObjectOwnsMemory( bool bOwn ) { bOwnsData = bOwn; } - void SetResizeOffset( sal_Size nNewResize ) { nResize = nNewResize; } + void SetResizeOffset( std::size_t nNewResize ) { nResize = nNewResize; } virtual sal_uInt64 remainingSize() override { return GetEndOfData() - Tell(); } }; diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index 0b9fdce21925..eac56461579c 100644 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -94,8 +94,8 @@ sal_Int16 ReadDicVersion( SvStreamPtr &rpStream, sal_uInt16 &nLng, bool &bNeg ) if (!rpStream.get() || rpStream->GetError()) return -1; - sal_Size nSniffPos = rpStream->Tell(); - static sal_Size nVerOOo7Len = sal::static_int_cast< sal_Size >(strlen( pVerOOo7 )); + sal_uInt64 const nSniffPos = rpStream->Tell(); + static std::size_t nVerOOo7Len = sal::static_int_cast< std::size_t >(strlen( pVerOOo7 )); pMagicHeader[ nVerOOo7Len ] = '\0'; if ((rpStream->ReadBytes(static_cast<void *>(pMagicHeader), nVerOOo7Len) == nVerOOo7Len) && !strcmp(pMagicHeader, pVerOOo7)) diff --git a/lotuswordpro/source/filter/bento.hxx b/lotuswordpro/source/filter/bento.hxx index 382ca0967b7f..1870c97af679 100644 --- a/lotuswordpro/source/filter/bento.hxx +++ b/lotuswordpro/source/filter/bento.hxx @@ -181,8 +181,8 @@ public: // Overridden methods sal_uLong GetSize() { return m_ulValueLength; }; protected: // Overridden methods - virtual sal_uLong GetData( void* pData, sal_uLong nSize ) override; - virtual sal_uLong PutData( const void* pData, sal_uLong nSize ) override; + virtual std::size_t GetData(void* pData, std::size_t nSize) override; + virtual std::size_t PutData(const void* pData, std::size_t nSize) override; virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) override; virtual void SetSize( sal_uInt64 nSize ) override; virtual void FlushData() override; diff --git a/lotuswordpro/source/filter/utbenvs.cxx b/lotuswordpro/source/filter/utbenvs.cxx index 393e479a9fa1..c2faa3bdb716 100644 --- a/lotuswordpro/source/filter/utbenvs.cxx +++ b/lotuswordpro/source/filter/utbenvs.cxx @@ -63,7 +63,7 @@ namespace OpenStormBento * @param number of bytes to be read * @return number of bytes read */ -sal_uLong LtcUtBenValueStream::GetData( void* pData, sal_uLong nSize ) +std::size_t LtcUtBenValueStream::GetData(void* pData, std::size_t nSize) { //unsigned long AmtLeft; unsigned long AmtRead; @@ -82,7 +82,7 @@ sal_uLong LtcUtBenValueStream::GetData( void* pData, sal_uLong nSize ) * @param size of buffer to be written * @return number of bytes written into value stream */ -sal_uLong LtcUtBenValueStream::PutData( const void* /*pData*/, sal_uLong nSize ) +std::size_t LtcUtBenValueStream::PutData(const void* /*pData*/, std::size_t nSize) { /* Because we only support IMPORT filter, PutData implementation is ignored It won't bring negative influence to read-only stream object */ diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx index e992d89b2a04..42c718adbb70 100644 --- a/oox/source/dump/dumperbase.cxx +++ b/oox/source/dump/dumperbase.cxx @@ -1665,7 +1665,7 @@ void Output::writeString( const OUString& rStr ) StringHelper::appendEncString( maLine, rStr ); } -void Output::writeArray( const sal_uInt8* pnData, sal_Size nSize, sal_Unicode cSep ) +void Output::writeArray( const sal_uInt8* pnData, std::size_t nSize, sal_Unicode cSep ) { const sal_uInt8* pnEnd = pnData ? (pnData + nSize) : nullptr; for( const sal_uInt8* pnByte = pnData; pnByte < pnEnd; ++pnByte ) @@ -1991,7 +1991,7 @@ void OutputObjectBase::writeStringItem( const String& rName, const OUString& rDa mxOut->writeAscii( ",cut" ); } -void OutputObjectBase::writeArrayItem( const String& rName, const sal_uInt8* pnData, sal_Size nSize, sal_Unicode cSep ) +void OutputObjectBase::writeArrayItem( const String& rName, const sal_uInt8* pnData, std::size_t nSize, sal_Unicode cSep ) { ItemGuard aItem( mxOut, rName ); mxOut->writeArray( pnData, nSize, cSep ); @@ -2169,7 +2169,7 @@ OUString InputObjectBase::dumpCharArray( const String& rName, sal_Int32 nLen, rt OUString aString; if( nDumpSize > 0 ) { - ::std::vector< sal_Char > aBuffer( static_cast< sal_Size >( nLen ) + 1 ); + ::std::vector< sal_Char > aBuffer( static_cast< std::size_t >( nLen ) + 1 ); sal_Int32 nCharsRead = mxStrm->readMemory( &aBuffer.front(), nLen ); aBuffer[ nCharsRead ] = 0; aString = OStringToOUString( OString( &aBuffer.front() ), eTextEnc ); diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 41b0eea28cca..3670664d7aac 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -839,7 +839,7 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic , bool bRelPathToMedia ) SvMemoryStream aStream; const void* aData = aLink.GetData(); - sal_Size nDataSize = aLink.GetDataSize(); + std::size_t nDataSize = aLink.GetDataSize(); switch ( aLink.GetType() ) { diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx index 80e135362119..0215a6772a8f 100644 --- a/oox/source/ole/vbaexport.cxx +++ b/oox/source/ole/vbaexport.cxx @@ -112,7 +112,7 @@ OUString generateGUIDString() } -VBACompressionChunk::VBACompressionChunk(SvStream& rCompressedStream, const sal_uInt8* pData, sal_Size nChunkSize) +VBACompressionChunk::VBACompressionChunk(SvStream& rCompressedStream, const sal_uInt8* pData, std::size_t nChunkSize) : mrCompressedStream(rCompressedStream) , mpUncompressedData(pData) , mpCompressedChunkStream(nullptr) @@ -357,7 +357,7 @@ void VBACompressionChunk::writeRawChunk() // we need to use up to 4096 bytes of the original stream // and fill the rest with padding mrCompressedStream.WriteBytes(mpUncompressedData, mnChunkSize); - sal_Size nPadding = 4096 - mnChunkSize; + std::size_t nPadding = 4096 - mnChunkSize; for (size_t i = 0; i < nPadding; ++i) { mrCompressedStream.WriteUInt8(0); @@ -378,11 +378,11 @@ void VBACompression::write() mrCompressedStream.WriteUInt8(0x01); // signature byte of a compressed container bool bStreamNotEnded = true; const sal_uInt8* pData = static_cast<const sal_uInt8*>(mrUncompressedStream.GetData()); - sal_Size nSize = mrUncompressedStream.GetEndOfData(); - sal_Size nRemainingSize = nSize; + std::size_t nSize = mrUncompressedStream.GetEndOfData(); + std::size_t nRemainingSize = nSize; while(bStreamNotEnded) { - sal_Size nChunkSize = nRemainingSize > 4096 ? 4096 : nRemainingSize; + std::size_t nChunkSize = nRemainingSize > 4096 ? 4096 : nRemainingSize; VBACompressionChunk aChunk(mrCompressedStream, &pData[nSize - nRemainingSize], nChunkSize); aChunk.write(); diff --git a/opencl/inc/opencl_device_selection.h b/opencl/inc/opencl_device_selection.h index c878a5bc4213..3ed1bd8f3b33 100644 --- a/opencl/inc/opencl_device_selection.h +++ b/opencl/inc/opencl_device_selection.h @@ -347,7 +347,7 @@ public: bool open(SvStream* pStream) { - sal_Size nSize = pStream->remainingSize(); + std::size_t nSize = pStream->remainingSize(); std::vector<sal_uInt8> aBuffer(nSize + 1); pStream->ReadBytes(aBuffer.data(), nSize); aBuffer[nSize] = 0; diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index 6e3004500db5..6598a3cd31c7 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -1660,7 +1660,7 @@ OUString GeometryHandler::impl_ConvertUIToMimeType_nothrow(const OUString& _sUIN ::std::vector< OUString >::const_iterator aFind = ::std::find(aList.begin(),aList.end(),_sUIName); if ( aFind != aList.end() ) { - const sal_Size nPos = aFind - aList.begin(); + const std::size_t nPos = aFind - aList.begin(); const uno::Reference< report::XReportDefinition> xReportDefinition(m_xReportComponent,uno::UNO_QUERY); if ( xReportDefinition.is() ) { diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx index a26084b16e3a..049d1b70f510 100644 --- a/rsc/source/rsc/rsc.cxx +++ b/rsc/source/rsc/rsc.cxx @@ -867,7 +867,7 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile, if (aLine.indexOf(';') == -1) { - const sal_Size nImgListStartPos = aIStm.Tell(); + const sal_uInt64 nImgListStartPos = aIStm.Tell(); do { @@ -913,7 +913,7 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile, } } - const sal_Size nImgListEndPos = aIStm.Tell(); + const sal_uInt64 nImgListEndPos = aIStm.Tell(); aIStm.Seek( nImgListStartPos ); while( aIStm.Tell() < nImgListEndPos ) { diff --git a/rsc/source/tools/rscchar.cxx b/rsc/source/tools/rscchar.cxx index dbe096e24a4c..a41310af27ac 100644 --- a/rsc/source/tools/rscchar.cxx +++ b/rsc/source/tools/rscchar.cxx @@ -30,7 +30,7 @@ char * RscChar::MakeUTF8( char * pStr, sal_uInt16 nTextEncoding ) { - sal_Size nMaxUniCodeBuf = strlen( pStr ) + 1; + std::size_t nMaxUniCodeBuf = strlen( pStr ) + 1; if( nMaxUniCodeBuf * 6 > 0x0FFFFF ) RscExit( 10 ); diff --git a/sc/inc/autoform.hxx b/sc/inc/autoform.hxx index f451f2ea8273..69dd61fc46da 100644 --- a/sc/inc/autoform.hxx +++ b/sc/inc/autoform.hxx @@ -74,7 +74,7 @@ blobs to avoid needlessly complicating the Calc logic. struct AutoFormatSwBlob { sal_uInt8 *pData; - sal_Size size; + std::size_t size; AutoFormatSwBlob() : pData(nullptr), size(0) { diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx index f2f81e7b6222..4966475d3180 100644 --- a/sc/source/core/tool/autoform.cxx +++ b/sc/source/core/tool/autoform.cxx @@ -96,7 +96,7 @@ namespace if (blobSize) { blob.pData = new sal_uInt8[blobSize]; - blob.size = static_cast<sal_Size>(blobSize); + blob.size = static_cast<std::size_t>(blobSize); stream.ReadBytes(blob.pData, blob.size); } diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx index eac2a9c23328..0b03feb10721 100644 --- a/sc/source/filter/excel/excform.cxx +++ b/sc/source/filter/excel/excform.cxx @@ -202,7 +202,7 @@ void ExcelToSc::GetDummy( const ScTokenArray*& pErgebnis ) // if bAllowArrays is false stream seeks to first byte after <nFormulaLen> // otherwise it will seek to the first byte after the additional content (eg // inline arrays) following <nFormulaLen> -ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, sal_Size nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT ) +ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, std::size_t nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT ) { RootData& rR = GetOldRoot(); sal_uInt8 nOp, nLen; @@ -232,7 +232,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s return ConvOK; } - sal_Size nEndPos = aIn.GetRecPos() + nFormulaLen; + std::size_t nEndPos = aIn.GetRecPos() + nFormulaLen; while( (aIn.GetRecPos() < nEndPos) && !bError ) { @@ -396,7 +396,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s { // nFakt -> skip bytes or words AttrChoose ++nData; - aIn.Ignore(static_cast<sal_Size>(nData) * nFakt); + aIn.Ignore(static_cast<std::size_t>(nData) * nFakt); } else if( nOpt & 0x10 ) // AttrSum DoMulArgs( ocSum, 1 ); @@ -896,12 +896,12 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s } // stream seeks to first byte after <nFormulaLen> -ConvErr ExcelToSc::Convert( ScRangeListTabs& rRangeList, XclImpStream& aIn, sal_Size nFormulaLen, +ConvErr ExcelToSc::Convert( ScRangeListTabs& rRangeList, XclImpStream& aIn, std::size_t nFormulaLen, SCsTAB nTab, const FORMULA_TYPE eFT ) { RootData& rR = GetOldRoot(); sal_uInt8 nOp, nLen; - sal_Size nIgnore; + std::size_t nIgnore; bool bError = false; const bool bRangeName = eFT == FT_RangeName; const bool bSharedFormula = eFT == FT_SharedFormula; @@ -921,7 +921,7 @@ ConvErr ExcelToSc::Convert( ScRangeListTabs& rRangeList, XclImpStream& aIn, sal_ if( nFormulaLen == 0 ) return ConvOK; - sal_Size nEndPos = aIn.GetRecPos() + nFormulaLen; + std::size_t nEndPos = aIn.GetRecPos() + nFormulaLen; while( (aIn.GetRecPos() < nEndPos) && !bError ) { @@ -988,7 +988,7 @@ ConvErr ExcelToSc::Convert( ScRangeListTabs& rRangeList, XclImpStream& aIn, sal_ { // nFakt -> skip bytes or words AttrChoose ++nData; - aIn.Ignore(static_cast<sal_Size>(nData) * nFakt); + aIn.Ignore(static_cast<std::size_t>(nData) * nFakt); } } break; @@ -1323,12 +1323,12 @@ ConvErr ExcelToSc::Convert( ScRangeListTabs& rRangeList, XclImpStream& aIn, sal_ return eRet; } -void ExcelToSc::ConvertExternName( const ScTokenArray*& /*rpArray*/, XclImpStream& /*rStrm*/, sal_Size /*nFormulaLen*/, +void ExcelToSc::ConvertExternName( const ScTokenArray*& /*rpArray*/, XclImpStream& /*rStrm*/, std::size_t /*nFormulaLen*/, const OUString& /*rUrl*/, const vector<OUString>& /*rTabNames*/ ) { } -void ExcelToSc::GetAbsRefs( ScRangeList& rRangeList, XclImpStream& rStrm, sal_Size nLen ) +void ExcelToSc::GetAbsRefs( ScRangeList& rRangeList, XclImpStream& rStrm, std::size_t nLen ) { OSL_ENSURE_BIFF( GetBiff() == EXC_BIFF5 ); if( GetBiff() != EXC_BIFF5 ) @@ -1341,8 +1341,8 @@ void ExcelToSc::GetAbsRefs( ScRangeList& rRangeList, XclImpStream& rStrm, sal_Si sal_uInt16 nTabFirst, nTabLast; sal_Int16 nRefIdx; - sal_Size nSeek; - sal_Size nEndPos = rStrm.GetRecPos() + nLen; + std::size_t nSeek; + std::size_t nEndPos = rStrm.GetRecPos() + nLen; while( rStrm.IsValid() && (rStrm.GetRecPos() < nEndPos) ) { @@ -1901,7 +1901,7 @@ void ExcelToSc::ReadExtensionMemArea( XclImpStream& aIn ) sal_uInt16 nCount(0); nCount = aIn.ReaduInt16(); - aIn.Ignore( static_cast<sal_Size>(nCount) * ((GetBiff() == EXC_BIFF8) ? 8 : 6) ); // drop the ranges + aIn.Ignore( static_cast<std::size_t>(nCount) * ((GetBiff() == EXC_BIFF8) ? 8 : 6) ); // drop the ranges } void ExcelToSc::ReadExtensions( const ExtensionTypeVec& rExtensions, diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx index 65007527c71a..ef3d09ae1c8b 100644 --- a/sc/source/filter/excel/excform8.cxx +++ b/sc/source/filter/excel/excform8.cxx @@ -135,7 +135,7 @@ bool ExcelToSc8::HandleOleLink(sal_uInt16 nXtiIndex, const XclImpExtName& rExtNa // if bAllowArrays is false stream seeks to first byte after <nFormulaLen> // otherwise it will seek to the first byte past additional content after <nFormulaLen> -ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, sal_Size nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT ) +ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, std::size_t nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT ) { bool bError = false; bool bArrayFormula = false; @@ -164,7 +164,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, return ConvOK; } - sal_Size nEndPos = aIn.GetRecPos() + nFormulaLen; + std::size_t nEndPos = aIn.GetRecPos() + nFormulaLen; while( (aIn.GetRecPos() < nEndPos) && !bError ) { @@ -386,7 +386,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, { // nFakt -> skip bytes or words AttrChoose nData++; - aIn.Ignore(static_cast<sal_Size>(nData) * nFakt); + aIn.Ignore(static_cast<std::size_t>(nData) * nFakt); } else if( nOpt & 0x10 ) // AttrSum DoMulArgs( ocSum, 1 ); @@ -953,7 +953,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, } // stream seeks to first byte after <nFormulaLen> -ConvErr ExcelToSc8::Convert( ScRangeListTabs& rRangeList, XclImpStream& aIn, sal_Size nFormulaLen, +ConvErr ExcelToSc8::Convert( ScRangeListTabs& rRangeList, XclImpStream& aIn, std::size_t nFormulaLen, SCsTAB nTab, const FORMULA_TYPE eFT ) { sal_uInt8 nOp, nLen; @@ -975,7 +975,7 @@ ConvErr ExcelToSc8::Convert( ScRangeListTabs& rRangeList, XclImpStream& aIn, sal if( nFormulaLen == 0 ) return ConvOK; - sal_Size nEndPos = aIn.GetRecPos() + nFormulaLen; + std::size_t nEndPos = aIn.GetRecPos() + nFormulaLen; while( (aIn.GetRecPos() < nEndPos) && !bError ) { @@ -1033,7 +1033,7 @@ ConvErr ExcelToSc8::Convert( ScRangeListTabs& rRangeList, XclImpStream& aIn, sal { // nFakt -> skip bytes or words AttrChoose ++nData; - aIn.Ignore(static_cast<sal_Size>(nData) * nFakt); + aIn.Ignore(static_cast<std::size_t>(nData) * nFakt); } } break; @@ -1296,7 +1296,7 @@ ConvErr ExcelToSc8::Convert( ScRangeListTabs& rRangeList, XclImpStream& aIn, sal return eRet; } -void ExcelToSc8::ConvertExternName( const ScTokenArray*& rpArray, XclImpStream& rStrm, sal_Size nFormulaLen, +void ExcelToSc8::ConvertExternName( const ScTokenArray*& rpArray, XclImpStream& rStrm, std::size_t nFormulaLen, const OUString& rUrl, const vector<OUString>& rTabNames ) { if( !GetDocShell() ) @@ -1328,7 +1328,7 @@ void ExcelToSc8::ConvertExternName( const ScTokenArray*& rpArray, XclImpStream& sal_uInt16 nFileId = pRefMgr->getExternalFileId(aFileUrl); sal_uInt16 nTabCount = static_cast< sal_uInt16 >( rTabNames.size() ); - sal_Size nEndPos = rStrm.GetRecPos() + nFormulaLen; + std::size_t nEndPos = rStrm.GetRecPos() + nFormulaLen; while( (rStrm.GetRecPos() < nEndPos) && !bError ) { @@ -1500,16 +1500,16 @@ void ExcelToSc8::ExcRelToScRel8( sal_uInt16 nRow, sal_uInt16 nC, ScSingleRefData } // stream seeks to first byte after <nLen> -void ExcelToSc8::GetAbsRefs( ScRangeList& r, XclImpStream& aIn, sal_Size nLen ) +void ExcelToSc8::GetAbsRefs( ScRangeList& r, XclImpStream& aIn, std::size_t nLen ) { sal_uInt8 nOp; sal_uInt16 nRow1, nRow2, nCol1, nCol2; SCTAB nTab1, nTab2; sal_uInt16 nIxti; - sal_Size nSeek; + std::size_t nSeek; - sal_Size nEndPos = aIn.GetRecPos() + nLen; + std::size_t nEndPos = aIn.GetRecPos() + nLen; while( aIn.IsValid() && (aIn.GetRecPos() < nEndPos) ) { diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index 87c478ee93dc..7649c17674a1 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -352,7 +352,7 @@ void ImportExcel8::Feat() sal_uInt32 nCbSD = aIn.ReaduInt32(); // TODO: could here be some sanity check applied to not allocate 4GB? aProt.maSecurityDescriptor.resize( nCbSD); - sal_Size nRead = aIn.Read( &aProt.maSecurityDescriptor.front(), nCbSD); + std::size_t nRead = aIn.Read( &aProt.maSecurityDescriptor.front(), nCbSD); if (nRead < nCbSD) aProt.maSecurityDescriptor.resize( nRead); } diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index a1e3acd228f1..b4650298447a 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -91,20 +91,20 @@ const sal_uInt8 ExcDummy_00::pMyData[] = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }; -const sal_Size ExcDummy_00::nMyLen = sizeof( ExcDummy_00::pMyData ); +const std::size_t ExcDummy_00::nMyLen = sizeof( ExcDummy_00::pMyData ); //-------------------------------------------------------- class ExcDummy_04x - const sal_uInt8 ExcDummy_040::pMyData[] = { 0x40, 0x00, 0x02, 0x00, 0x00, 0x00, // BACKUP 0x8d, 0x00, 0x02, 0x00, 0x00, 0x00, // HIDEOBJ }; -const sal_Size ExcDummy_040::nMyLen = sizeof( ExcDummy_040::pMyData ); +const std::size_t ExcDummy_040::nMyLen = sizeof( ExcDummy_040::pMyData ); const sal_uInt8 ExcDummy_041::pMyData[] = { 0x0e, 0x00, 0x02, 0x00, 0x01, 0x00, // PRECISION 0xda, 0x00, 0x02, 0x00, 0x00, 0x00 // BOOKBOOL }; -const sal_Size ExcDummy_041::nMyLen = sizeof( ExcDummy_041::pMyData ); +const std::size_t ExcDummy_041::nMyLen = sizeof( ExcDummy_041::pMyData ); //-------------------------------------------------------- class ExcDummy_02a - const sal_uInt8 ExcDummy_02a::pMyData[] = { @@ -116,7 +116,7 @@ const sal_uInt8 ExcDummy_02a::pMyData[] = { 0x62, 0x50, 0x3f, 0x5f, 0x00, 0x02, 0x00, 0x01, 0x00 // SAVERECALC }; -const sal_Size ExcDummy_02a::nMyLen = sizeof( ExcDummy_02a::pMyData ); +const std::size_t ExcDummy_02a::nMyLen = sizeof( ExcDummy_02a::pMyData ); //----------------------------------------------------------- class ExcRecord - @@ -150,7 +150,7 @@ sal_uInt16 ExcEmptyRec::GetNum() const return 0; } -sal_Size ExcEmptyRec::GetLen() const +std::size_t ExcEmptyRec::GetLen() const { return 0; } @@ -174,7 +174,7 @@ void ExcBoolRecord::SaveCont( XclExpStream& rStrm ) rStrm << (sal_uInt16)(bVal ? 0x0001 : 0x0000); } -sal_Size ExcBoolRecord::GetLen() const +std::size_t ExcBoolRecord::GetLen() const { return 2; } @@ -207,7 +207,7 @@ sal_uInt16 ExcBof::GetNum() const return 0x0809; } -sal_Size ExcBof::GetLen() const +std::size_t ExcBof::GetLen() const { return 8; } @@ -230,7 +230,7 @@ sal_uInt16 ExcBofW::GetNum() const return 0x0809; } -sal_Size ExcBofW::GetLen() const +std::size_t ExcBofW::GetLen() const { return 8; } @@ -242,14 +242,14 @@ sal_uInt16 ExcEof::GetNum() const return 0x000A; } -sal_Size ExcEof::GetLen() const +std::size_t ExcEof::GetLen() const { return 0; } //--------------------------------------------------------- class ExcDummy_00 - -sal_Size ExcDummy_00::GetLen() const +std::size_t ExcDummy_00::GetLen() const { return nMyLen; } @@ -261,7 +261,7 @@ const sal_uInt8* ExcDummy_00::GetData() const //-------------------------------------------------------- class ExcDummy_04x - -sal_Size ExcDummy_040::GetLen() const +std::size_t ExcDummy_040::GetLen() const { return nMyLen; } @@ -271,7 +271,7 @@ const sal_uInt8* ExcDummy_040::GetData() const return pMyData; } -sal_Size ExcDummy_041::GetLen() const +std::size_t ExcDummy_041::GetLen() const { return nMyLen; } @@ -361,14 +361,14 @@ void ExcBundlesheet::SaveCont( XclExpStream& rStrm ) rStrm.WriteByteString(aName); // 8 bit length, max 255 chars } -sal_Size ExcBundlesheet::GetLen() const +std::size_t ExcBundlesheet::GetLen() const { return 7 + std::min( aName.getLength(), (sal_Int32) 255 ); } //--------------------------------------------------------- class ExcDummy_02 - -sal_Size ExcDummy_02a::GetLen() const +std::size_t ExcDummy_02a::GetLen() const { return nMyLen; } @@ -571,7 +571,7 @@ ExcFilterCondition::~ExcFilterCondition() delete pText; } -sal_Size ExcFilterCondition::GetTextBytes() const +std::size_t ExcFilterCondition::GetTextBytes() const { return pText ? (1 + pText->GetBufferSize()) : 0; } diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx index 6d27232ffd61..510df2141119 100644 --- a/sc/source/filter/excel/impop.cxx +++ b/sc/source/filter/excel/impop.cxx @@ -501,7 +501,7 @@ void ImportExcel::Columndefault() nColMic = aIn.ReaduInt16(); nColMac = aIn.ReaduInt16(); - OSL_ENSURE( aIn.GetRecLeft() == (sal_Size)(nColMac - nColMic) * 3 + 2, + OSL_ENSURE( aIn.GetRecLeft() == (std::size_t)(nColMac - nColMic) * 3 + 2, "ImportExcel::Columndefault - wrong record size" ); nColMac--; diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx index 1231d8072c03..70fc840974df 100644 --- a/sc/source/filter/excel/read.cxx +++ b/sc/source/filter/excel/read.cxx @@ -43,7 +43,7 @@ namespace { - bool TryStartNextRecord(XclImpStream& rIn, sal_Size nProgressBasePos) + bool TryStartNextRecord(XclImpStream& rIn, std::size_t nProgressBasePos) { bool bValid = true; // i#115255 fdo#40304 BOUNDSHEET doesn't point to a valid @@ -106,8 +106,8 @@ FltError ImportExcel::Read() /* #i104057# Need to track a base position for progress bar calculation, because sheet substreams may not be in order of sheets. */ - sal_Size nProgressBasePos = 0; - sal_Size nProgressBaseSize = 0; + std::size_t nProgressBasePos = 0; + std::size_t nProgressBaseSize = 0; for (; eAkt != Z_Ende; mnLastRecId = nOpcode) { @@ -841,8 +841,8 @@ FltError ImportExcel8::Read() /* #i104057# Need to track a base position for progress bar calculation, because sheet substreams may not be in order of sheets. */ - sal_Size nProgressBasePos = 0; - sal_Size nProgressBaseSize = 0; + std::size_t nProgressBasePos = 0; + std::size_t nProgressBaseSize = 0; bool bSheetHasCodeName = false; diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx index 4e4c4a9ccb8c..1c03ccec29d6 100644 --- a/sc/source/filter/excel/xechart.cxx +++ b/sc/source/filter/excel/xechart.cxx @@ -423,7 +423,7 @@ void XclExpChRoot::FinalizeFutureRecBlock( XclExpStream& rStrm ) } XclExpChGroupBase::XclExpChGroupBase( const XclExpChRoot& rRoot, - sal_uInt16 nFrType, sal_uInt16 nRecId, sal_Size nRecSize ) : + sal_uInt16 nFrType, sal_uInt16 nRecId, std::size_t nRecSize ) : XclExpRecord( nRecId, nRecSize ), XclExpChRoot( rRoot ), maFrBlock( nFrType ) @@ -467,7 +467,7 @@ void XclExpChGroupBase::SetFutureRecordContext( sal_uInt16 nFrContext, sal_uInt1 } XclExpChFutureRecordBase::XclExpChFutureRecordBase( const XclExpChRoot& rRoot, - XclFutureRecType eRecType, sal_uInt16 nRecId, sal_Size nRecSize ) : + XclFutureRecType eRecType, sal_uInt16 nRecId, std::size_t nRecSize ) : XclExpFutureRecord( eRecType, nRecId, nRecSize ), XclExpChRoot( rRoot ) { @@ -1061,7 +1061,7 @@ void XclExpChSourceLink::Save( XclExpStream& rStrm ) // CHFORMATRUNS record if( mxString && mxString->IsRich() ) { - sal_Size nRecSize = (1 + mxString->GetFormatsCount()) * ((GetBiff() == EXC_BIFF8) ? 2 : 1); + std::size_t nRecSize = (1 + mxString->GetFormatsCount()) * ((GetBiff() == EXC_BIFF8) ? 2 : 1); rStrm.StartRecord( EXC_ID_CHFORMATRUNS, nRecSize ); mxString->WriteFormats( rStrm, true ); rStrm.EndRecord(); diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 3a3c11ca881d..fa5a429a7b98 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -87,7 +87,7 @@ void XclExpProgressBar::Initialize() SCCOL nLastUsedScCol; SCROW nLastUsedScRow; rDoc.GetTableArea( nScTab, nLastUsedScCol, nLastUsedScRow ); - sal_Size nSegSize = static_cast< sal_Size >( nLastUsedScRow + 1 ); + std::size_t nSegSize = static_cast< std::size_t >( nLastUsedScRow + 1 ); maSubSegRowCreate[ nScTab ] = mpSubRowCreate->AddSegment( nSegSize ); } } @@ -996,7 +996,7 @@ void XclExpCachedMatrix::GetDimensions( SCSIZE & nCols, SCSIZE & nRows ) const OSL_ENSURE( nCols <= 256, "XclExpCachedMatrix::GetDimensions - too many columns" ); } -sal_Size XclExpCachedMatrix::GetSize() const +std::size_t XclExpCachedMatrix::GetSize() const { SCSIZE nCols, nRows; diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx index de36642a9e7a..928a55eb0a21 100644 --- a/sc/source/filter/excel/xepivot.cxx +++ b/sc/source/filter/excel/xepivot.cxx @@ -274,7 +274,7 @@ sal_uInt16 XclExpPCField::GetItemIndex( const OUString& rItemName ) const return EXC_PC_NOITEM; } -sal_Size XclExpPCField::GetIndexSize() const +std::size_t XclExpPCField::GetIndexSize() const { return Has16BitIndexes() ? 2 : 1; } @@ -844,7 +844,7 @@ void XclExpPivotCache::WriteSxindexlistList( XclExpStream& rStrm ) const { if( HasItemIndexList() ) { - sal_Size nRecSize = 0; + std::size_t nRecSize = 0; size_t nPos, nSize = maFieldList.GetSize(); for( nPos = 0; nPos < nSize; ++nPos ) nRecSize += maFieldList.GetRecord( nPos )->GetIndexSize(); @@ -1491,7 +1491,7 @@ void XclExpPivotTable::WriteSxli( XclExpStream& rStrm, sal_uInt16 nLineCount, sa { if( nLineCount > 0 ) { - sal_Size nLineSize = 8 + 2 * nIndexCount; + std::size_t nLineSize = 8 + 2 * nIndexCount; rStrm.StartRecord( EXC_ID_SXLI, nLineSize * nLineCount ); /* Excel expects the records to be filled completely, do not diff --git a/sc/source/filter/excel/xerecord.cxx b/sc/source/filter/excel/xerecord.cxx index 22eef61d8023..d0e35ed8735b 100644 --- a/sc/source/filter/excel/xerecord.cxx +++ b/sc/source/filter/excel/xerecord.cxx @@ -124,7 +124,7 @@ void XclExpXmlEndSingleElementRecord::SaveXml( XclExpXmlStream& rStrm ) rStrm.GetCurrentStream()->write( "/>" ); } -XclExpRecord::XclExpRecord( sal_uInt16 nRecId, sal_Size nRecSize ) : +XclExpRecord::XclExpRecord( sal_uInt16 nRecId, std::size_t nRecSize ) : mnRecSize( nRecSize ), mnRecId( nRecId ) { @@ -134,7 +134,7 @@ XclExpRecord::~XclExpRecord() { } -void XclExpRecord::SetRecHeader( sal_uInt16 nRecId, sal_Size nRecSize ) +void XclExpRecord::SetRecHeader( sal_uInt16 nRecId, std::size_t nRecSize ) { SetRecId( nRecId ); SetRecSize( nRecSize ); @@ -178,13 +178,13 @@ void XclExpBoolRecord::SaveXml( XclExpXmlStream& rStrm ) FSEND ); } -XclExpDummyRecord::XclExpDummyRecord( sal_uInt16 nRecId, const void* pRecData, sal_Size nRecSize ) : +XclExpDummyRecord::XclExpDummyRecord( sal_uInt16 nRecId, const void* pRecData, std::size_t nRecSize ) : XclExpRecord( nRecId ) { SetData( pRecData, nRecSize ); } -void XclExpDummyRecord::SetData( const void* pRecData, sal_Size nRecSize ) +void XclExpDummyRecord::SetData( const void* pRecData, std::size_t nRecSize ) { mpData = pRecData; SetRecSize( pRecData ? nRecSize : 0 ); @@ -197,7 +197,7 @@ void XclExpDummyRecord::WriteBody( XclExpStream& rStrm ) // Future records ============================================================= -XclExpFutureRecord::XclExpFutureRecord( XclFutureRecType eRecType, sal_uInt16 nRecId, sal_Size nRecSize ) : +XclExpFutureRecord::XclExpFutureRecord( XclFutureRecType eRecType, sal_uInt16 nRecId, std::size_t nRecSize ) : XclExpRecord( nRecId, nRecSize ), meRecType( eRecType ) { diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index 9c4d1c22fc76..7d08fb84ec70 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -99,7 +99,7 @@ XclExpStream::~XclExpStream() mrStrm.Flush(); } -void XclExpStream::StartRecord( sal_uInt16 nRecId, sal_Size nRecSize ) +void XclExpStream::StartRecord( sal_uInt16 nRecId, std::size_t nRecSize ) { OSL_ENSURE( !mbInRec, "XclExpStream::StartRecord - another record still open" ); DisableEncryption(); @@ -206,21 +206,21 @@ XclExpStream& XclExpStream::operator<<( double fValue ) return *this; } -sal_Size XclExpStream::Write( const void* pData, sal_Size nBytes ) +std::size_t XclExpStream::Write( const void* pData, std::size_t nBytes ) { - sal_Size nRet = 0; + std::size_t nRet = 0; if( pData && (nBytes > 0) ) { if( mbInRec ) { const sal_uInt8* pBuffer = static_cast< const sal_uInt8* >( pData ); - sal_Size nBytesLeft = nBytes; + std::size_t nBytesLeft = nBytes; bool bValid = true; while( bValid && (nBytesLeft > 0) ) { - sal_Size nWriteLen = ::std::min< sal_Size >( PrepareWrite(), nBytesLeft ); - sal_Size nWriteRet = nWriteLen; + std::size_t nWriteLen = ::std::min< std::size_t >( PrepareWrite(), nBytesLeft ); + std::size_t nWriteRet = nWriteLen; if (mbUseEncrypter && HasValidEncrypter()) { OSL_ENSURE(nWriteLen > 0, "XclExpStream::Write: write length is 0!"); @@ -247,14 +247,14 @@ sal_Size XclExpStream::Write( const void* pData, sal_Size nBytes ) return nRet; } -void XclExpStream::WriteZeroBytes( sal_Size nBytes ) +void XclExpStream::WriteZeroBytes( std::size_t nBytes ) { if( mbInRec ) { - sal_Size nBytesLeft = nBytes; + std::size_t nBytesLeft = nBytes; while( nBytesLeft > 0 ) { - sal_Size nWriteLen = ::std::min< sal_Size >( PrepareWrite(), nBytesLeft ); + std::size_t nWriteLen = ::std::min< std::size_t >( PrepareWrite(), nBytesLeft ); WriteRawZeroBytes( nWriteLen ); nBytesLeft -= nWriteLen; UpdateSizeVars( nWriteLen ); @@ -264,14 +264,14 @@ void XclExpStream::WriteZeroBytes( sal_Size nBytes ) WriteRawZeroBytes( nBytes ); } -void XclExpStream::WriteZeroBytesToRecord( sal_Size nBytes ) +void XclExpStream::WriteZeroBytesToRecord( std::size_t nBytes ) { if (!mbInRec) // not in record. return; sal_uInt8 nZero = 0; - for (sal_Size i = 0; i < nBytes; ++i) + for (std::size_t i = 0; i < nBytes; ++i) *this << nZero; } @@ -281,16 +281,16 @@ void XclExpStream::CopyFromStream(SvStream& rInStrm, sal_uInt64 const nBytes) sal_uInt64 nBytesLeft = ::std::min(nBytes, nRemaining); if( nBytesLeft > 0 ) { - const sal_Size nMaxBuffer = 4096; + const std::size_t nMaxBuffer = 4096; std::unique_ptr<sal_uInt8[]> pBuffer( - new sal_uInt8[ ::std::min<sal_Size>(nBytesLeft, nMaxBuffer) ]); + new sal_uInt8[ ::std::min<std::size_t>(nBytesLeft, nMaxBuffer) ]); bool bValid = true; while( bValid && (nBytesLeft > 0) ) { - sal_Size nWriteLen = ::std::min<sal_Size>(nBytesLeft, nMaxBuffer); + std::size_t nWriteLen = ::std::min<std::size_t>(nBytesLeft, nMaxBuffer); rInStrm.ReadBytes(pBuffer.get(), nWriteLen); - sal_Size nWriteRet = Write( pBuffer.get(), nWriteLen ); + std::size_t nWriteRet = Write( pBuffer.get(), nWriteLen ); bValid = (nWriteLen == nWriteRet); nBytesLeft -= nWriteRet; } @@ -324,8 +324,8 @@ void XclExpStream::WriteUnicodeBuffer( const ScfUInt16Vec& rBuffer, sal_uInt8 nF void XclExpStream::WriteByteString( const OString& rString ) { SetSliceSize( 0 ); - sal_Size nLen = ::std::min< sal_Size >( rString.getLength(), 0x00FF ); - nLen = ::std::min< sal_Size >( nLen, 0xFF ); + std::size_t nLen = ::std::min< std::size_t >( rString.getLength(), 0x00FF ); + nLen = ::std::min< std::size_t >( nLen, 0xFF ); sal_uInt16 nLeft = PrepareWrite(); if( mbInRec && (nLeft <= 1) ) @@ -375,7 +375,7 @@ void XclExpStream::InitRecord( sal_uInt16 nRecId ) mrStrm.WriteUInt16( nRecId ); mnLastSizePos = mrStrm.Tell(); - mnHeaderSize = static_cast< sal_uInt16 >( ::std::min< sal_Size >( mnPredictSize, mnCurrMaxSize ) ); + mnHeaderSize = static_cast< sal_uInt16 >( ::std::min< std::size_t >( mnPredictSize, mnCurrMaxSize ) ); mrStrm.WriteUInt16( mnHeaderSize ); mnCurrSize = mnSliceSize = 0; } @@ -389,7 +389,7 @@ void XclExpStream::UpdateRecSize() } } -void XclExpStream::UpdateSizeVars( sal_Size nSize ) +void XclExpStream::UpdateSizeVars( std::size_t nSize ) { OSL_ENSURE( mnCurrSize + nSize <= mnCurrMaxSize, "XclExpStream::UpdateSizeVars - record overwritten" ); mnCurrSize = mnCurrSize + static_cast< sal_uInt16 >( nSize ); @@ -437,10 +437,10 @@ sal_uInt16 XclExpStream::PrepareWrite() return nRet; } -void XclExpStream::WriteRawZeroBytes( sal_Size nBytes ) +void XclExpStream::WriteRawZeroBytes( std::size_t nBytes ) { const sal_uInt32 nData = 0; - sal_Size nBytesLeft = nBytes; + std::size_t nBytesLeft = nBytes; while( nBytesLeft >= sizeof( nData ) ) { mrStrm.WriteUInt32( nData ); @@ -565,12 +565,12 @@ void XclExpBiff8Encrypter::Init( const Sequence< NamedValue >& rEncryptionData ) } } -sal_uInt32 XclExpBiff8Encrypter::GetBlockPos( sal_Size nStrmPos ) +sal_uInt32 XclExpBiff8Encrypter::GetBlockPos( std::size_t nStrmPos ) { return static_cast< sal_uInt32 >( nStrmPos / EXC_ENCR_BLOCKSIZE ); } -sal_uInt16 XclExpBiff8Encrypter::GetOffsetInBlock( sal_Size nStrmPos ) +sal_uInt16 XclExpBiff8Encrypter::GetOffsetInBlock( std::size_t nStrmPos ) { return static_cast< sal_uInt16 >( nStrmPos % EXC_ENCR_BLOCKSIZE ); } @@ -623,7 +623,7 @@ void XclExpBiff8Encrypter::EncryptBytes( SvStream& rStrm, vector<sal_uInt8>& aBy OSL_ENSURE(bRet, "XclExpBiff8Encrypter::EncryptBytes: encryption failed!!"); (void) bRet; // to remove a silly compiler warning. - sal_Size nRet = rStrm.WriteBytes(&aBytes[nPos], nEncBytes); + std::size_t nRet = rStrm.WriteBytes(&aBytes[nPos], nEncBytes); OSL_ENSURE(nRet == nEncBytes, "XclExpBiff8Encrypter::EncryptBytes: fail to write to stream!!"); (void) nRet; // to remove a silly compiler warning. diff --git a/sc/source/filter/excel/xestring.cxx b/sc/source/filter/excel/xestring.cxx index cdb1601bb30f..7a388d805500 100644 --- a/sc/source/filter/excel/xestring.cxx +++ b/sc/source/filter/excel/xestring.cxx @@ -240,12 +240,12 @@ sal_uInt16 XclExpString::GetHeaderSize() const (IsWriteFormats() ? 2 : 0); // richtext formattting count } -sal_Size XclExpString::GetBufferSize() const +std::size_t XclExpString::GetBufferSize() const { - return static_cast<sal_Size>(mnLen) * (mbIsUnicode ? 2 : 1); + return static_cast<std::size_t>(mnLen) * (mbIsUnicode ? 2 : 1); } -sal_Size XclExpString::GetSize() const +std::size_t XclExpString::GetSize() const { return GetHeaderSize() + // header diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 8be5f2bedfff..bed5e720b746 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -535,7 +535,7 @@ XclExpTableopRef XclExpTableopBuffer::TryCreate( const ScAddress& rScPos, const // Cell records XclExpCellBase::XclExpCellBase( - sal_uInt16 nRecId, sal_Size nContSize, const XclAddress& rXclPos ) : + sal_uInt16 nRecId, std::size_t nContSize, const XclAddress& rXclPos ) : XclExpRecord( nRecId, nContSize + 4 ), maXclPos( rXclPos ) { @@ -564,7 +564,7 @@ void XclExpCellBase::RemoveUnusedBlankCells( const ScfUInt16Vec& /*rXFIndexes*/ // Single cell records ======================================================== XclExpSingleCellBase::XclExpSingleCellBase( - sal_uInt16 nRecId, sal_Size nContSize, const XclAddress& rXclPos, sal_uInt32 nXFId ) : + sal_uInt16 nRecId, std::size_t nContSize, const XclAddress& rXclPos, sal_uInt32 nXFId ) : XclExpCellBase( nRecId, 2, rXclPos ), maXFId( nXFId ), mnContSize( nContSize ) @@ -572,7 +572,7 @@ XclExpSingleCellBase::XclExpSingleCellBase( } XclExpSingleCellBase::XclExpSingleCellBase( const XclExpRoot& rRoot, - sal_uInt16 nRecId, sal_Size nContSize, const XclAddress& rXclPos, + sal_uInt16 nRecId, std::size_t nContSize, const XclAddress& rXclPos, const ScPatternAttr* pPattern, sal_Int16 nScript, sal_uInt32 nForcedXFId ) : XclExpCellBase( nRecId, 2, rXclPos ), maXFId( nForcedXFId ), @@ -1103,7 +1103,7 @@ void XclExpFormulaCell::WriteContents( XclExpStream& rStrm ) // Multiple cell records ====================================================== XclExpMultiCellBase::XclExpMultiCellBase( - sal_uInt16 nRecId, sal_uInt16 nMulRecId, sal_Size nContSize, const XclAddress& rXclPos ) : + sal_uInt16 nRecId, sal_uInt16 nMulRecId, std::size_t nContSize, const XclAddress& rXclPos ) : XclExpCellBase( nRecId, 0, rXclPos ), mnMulRecId( nMulRecId ), mnContSize( nContSize ) @@ -1165,7 +1165,7 @@ void XclExpMultiCellBase::Save( XclExpStream& rStrm ) { sal_uInt16 nCount = nEndXclCol - nBegXclCol; bool bIsMulti = nCount > 1; - sal_Size nTotalSize = GetRecSize() + (2 + mnContSize) * nCount; + std::size_t nTotalSize = GetRecSize() + (2 + mnContSize) * nCount; if( bIsMulti ) nTotalSize += 2; rStrm.StartRecord( bIsMulti ? mnMulRecId : GetRecId(), nTotalSize ); diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index f160e2b2e490..8739a44d73a1 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -4320,7 +4320,7 @@ void XclImpChart::UpdateObjFrame( const XclObjLineData& rLineData, const XclObjF mxChartData->UpdateObjFrame( rLineData, rFillData ); } -sal_Size XclImpChart::GetProgressSize() const +std::size_t XclImpChart::GetProgressSize() const { return (mxChartData ? XclImpChChart::GetProgressSize() : 0) + diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index bec74d6084d6..27e84eb56000 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -113,7 +113,7 @@ void lclAppendString32( OUString& rString, XclImpStream& rStrm, sal_uInt32 nChar sal_uInt16 nReadChars = ulimit_cast< sal_uInt16 >( nChars ); rString += rStrm.ReadRawUniString( nReadChars, b16Bit ); // ignore remaining chars - sal_Size nIgnore = nChars - nReadChars; + std::size_t nIgnore = nChars - nReadChars; if( b16Bit ) nIgnore *= 2; rStrm.Ignore( nIgnore ); diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 11a46f47565c..0ae25f02a302 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -410,7 +410,7 @@ ScRange XclImpDrawObjBase::GetUsedArea( SCTAB nScTab ) const return aScUsedArea; } -sal_Size XclImpDrawObjBase::GetProgressSize() const +std::size_t XclImpDrawObjBase::GetProgressSize() const { return DoGetProgressSize(); } @@ -790,7 +790,7 @@ void XclImpDrawObjBase::DoReadObj8SubRec( XclImpStream&, sal_uInt16, sal_uInt16 { } -sal_Size XclImpDrawObjBase::DoGetProgressSize() const +std::size_t XclImpDrawObjBase::DoGetProgressSize() const { return 1; } @@ -886,7 +886,7 @@ void XclImpDrawObjBase::ImplReadObj8( XclImpStream& rStrm ) nSubRecSize = rStrm.ReaduInt16(); rStrm.PushPosition(); // sometimes the last subrecord has an invalid length (OBJLBSDATA) -> min() - nSubRecSize = static_cast< sal_uInt16 >( ::std::min< sal_Size >( nSubRecSize, rStrm.GetRecLeft() ) ); + nSubRecSize = static_cast< sal_uInt16 >( ::std::min< std::size_t >( nSubRecSize, rStrm.GetRecLeft() ) ); switch( nSubRecId ) { @@ -952,9 +952,9 @@ void XclImpDrawObjVector::InsertGrouped( XclImpDrawObjRef const & xDrawObj ) mObjs.push_back( xDrawObj ); } -sal_Size XclImpDrawObjVector::GetProgressSize() const +std::size_t XclImpDrawObjVector::GetProgressSize() const { - sal_Size nProgressSize = 0; + std::size_t nProgressSize = 0; for( ::std::vector< XclImpDrawObjRef >::const_iterator aIt = mObjs.begin(), aEnd = mObjs.end(); aIt != aEnd; ++aIt ) nProgressSize += (*aIt)->GetProgressSize(); return nProgressSize; @@ -1006,7 +1006,7 @@ void XclImpGroupObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_u ReadMacro5( rStrm, nMacroSize ); } -sal_Size XclImpGroupObj::DoGetProgressSize() const +std::size_t XclImpGroupObj::DoGetProgressSize() const { return XclImpDrawObjBase::DoGetProgressSize() + maChildren.GetProgressSize(); } @@ -1681,7 +1681,7 @@ void XclImpChartObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId } } -sal_Size XclImpChartObj::DoGetProgressSize() const +std::size_t XclImpChartObj::DoGetProgressSize() const { return mxChart ? mxChart->GetProgressSize() : 1; } @@ -2657,9 +2657,9 @@ XclImpListBoxObj::XclImpListBoxObj( const XclImpRoot& rRoot ) : { } -void XclImpListBoxObj::ReadFullLbsData( XclImpStream& rStrm, sal_Size nRecLeft ) +void XclImpListBoxObj::ReadFullLbsData( XclImpStream& rStrm, std::size_t nRecLeft ) { - sal_Size nRecEnd = rStrm.GetRecPos() + nRecLeft; + std::size_t nRecEnd = rStrm.GetRecPos() + nRecLeft; ReadLbsData( rStrm ); OSL_ENSURE( (rStrm.GetRecPos() == nRecEnd) || (rStrm.GetRecPos() + mnEntryCount == nRecEnd), "XclImpListBoxObj::ReadFullLbsData - invalid size of OBJLBSDATA record" ); @@ -3037,7 +3037,7 @@ void XclImpPictureObj::ReadFlags8( XclImpStream& rStrm ) void XclImpPictureObj::ReadPictFmla( XclImpStream& rStrm, sal_uInt16 nLinkSize ) { - sal_Size nLinkEnd = rStrm.GetRecPos() + nLinkSize; + std::size_t nLinkEnd = rStrm.GetRecPos() + nLinkSize; if( nLinkSize >= 6 ) { sal_uInt16 nFmlaSize; @@ -3120,8 +3120,8 @@ void XclImpPictureObj::ReadPictFmla( XclImpStream& rStrm, sal_uInt16 nLinkSize ) if( rStrm.GetRecLeft() <= 8 ) return; // position and size of control data in 'Ctls' stream - mnCtlsStrmPos = static_cast< sal_Size >( rStrm.ReaduInt32() ); - mnCtlsStrmSize = static_cast< sal_Size >( rStrm.ReaduInt32() ); + mnCtlsStrmPos = static_cast< std::size_t >( rStrm.ReaduInt32() ); + mnCtlsStrmSize = static_cast< std::size_t >( rStrm.ReaduInt32() ); if( rStrm.GetRecLeft() <= 8 ) return; @@ -3285,14 +3285,14 @@ OUString XclImpObjectManager::GetOleNameOverride( SCTAB nTab, sal_uInt16 nObjId return sOleName; } -void XclImpDffConverter::StartProgressBar( sal_Size nProgressSize ) +void XclImpDffConverter::StartProgressBar( std::size_t nProgressSize ) { mxProgress.reset( new ScfProgressBar( GetDocShell(), STR_PROGRESS_CALCULATING ) ); mxProgress->AddSegment( nProgressSize ); mxProgress->Activate(); } -void XclImpDffConverter::Progress( sal_Size nDelta ) +void XclImpDffConverter::Progress( std::size_t nDelta ) { OSL_ENSURE( mxProgress, "XclImpDffConverter::Progress - invalid call, no progress bar" ); mxProgress->Progress( nDelta ); @@ -3689,7 +3689,7 @@ OUString XclImpDffConverter::ReadHlinkProperty( SvStream& rDffStrm ) const void XclImpDffConverter::ProcessDgContainer( SvStream& rDffStrm, const DffRecordHeader& rDgHeader ) { - sal_Size nEndPos = rDgHeader.GetRecEndFilePos(); + std::size_t nEndPos = rDgHeader.GetRecEndFilePos(); while( rDffStrm.Tell() < nEndPos ) { DffRecordHeader aHeader; @@ -3718,7 +3718,7 @@ void XclImpDffConverter::ProcessDgContainer( SvStream& rDffStrm, const DffRecord void XclImpDffConverter::ProcessShGrContainer( SvStream& rDffStrm, const DffRecordHeader& rShGrHeader ) { - sal_Size nEndPos = rShGrHeader.GetRecEndFilePos(); + std::size_t nEndPos = rShGrHeader.GetRecEndFilePos(); while( rDffStrm.Tell() < nEndPos ) { DffRecordHeader aHeader; @@ -3951,9 +3951,9 @@ void XclImpDrawing::SetSkipObj( sal_uInt16 nObjId ) maSkipObjs.push_back( nObjId ); } -sal_Size XclImpDrawing::GetProgressSize() const +std::size_t XclImpDrawing::GetProgressSize() const { - sal_Size nProgressSize = maRawObjs.GetProgressSize(); + std::size_t nProgressSize = maRawObjs.GetProgressSize(); for( XclImpObjMap::const_iterator aIt = maObjMap.begin(), aEnd = maObjMap.end(); aIt != aEnd; ++aIt ) nProgressSize += aIt->second->GetProgressSize(); return nProgressSize; @@ -4251,7 +4251,7 @@ void XclImpObjectManager::ConvertObjects() return; // get total progress bar size for all sheet drawing managers - sal_Size nProgressSize = 0; + std::size_t nProgressSize = 0; for( XclImpSheetDrawingMap::iterator aIt = maSheetDrawings.begin(), aEnd = maSheetDrawings.end(); aIt != aEnd; ++aIt ) nProgressSize += aIt->second->GetProgressSize(); // nothing to do if progress bar is zero (no objects present) diff --git a/sc/source/filter/excel/xilink.cxx b/sc/source/filter/excel/xilink.cxx index 6a5c2bf334f5..38cdc4ceffdc 100644 --- a/sc/source/filter/excel/xilink.cxx +++ b/sc/source/filter/excel/xilink.cxx @@ -243,11 +243,11 @@ void XclImpTabInfo::ReadTabid( XclImpStream& rStrm ) if( rStrm.GetRoot().GetBiff() == EXC_BIFF8 ) { rStrm.EnableDecryption(); - sal_Size nReadCount = rStrm.GetRecLeft() / 2; + std::size_t nReadCount = rStrm.GetRecLeft() / 2; OSL_ENSURE( nReadCount <= 0xFFFF, "XclImpTabInfo::ReadTabid - record too long" ); maTabIdVec.clear(); maTabIdVec.reserve( nReadCount ); - for( sal_Size nIndex = 0; rStrm.IsValid() && (nIndex < nReadCount); ++nIndex ) + for( std::size_t nIndex = 0; rStrm.IsValid() && (nIndex < nReadCount); ++nIndex ) // zero index is not allowed in BIFF8, but it seems that it occurs in real life maTabIdVec.push_back( rStrm.ReaduInt16() ); } @@ -774,8 +774,8 @@ void XclImpLinkManagerImpl::ReadExternsheet( XclImpStream& rStrm ) { sal_uInt16 nXtiCount; nXtiCount = rStrm.ReaduInt16(); - OSL_ENSURE( static_cast< sal_Size >( nXtiCount * 6 ) == rStrm.GetRecLeft(), "XclImpLinkManagerImpl::ReadExternsheet - invalid count" ); - nXtiCount = static_cast< sal_uInt16 >( ::std::min< sal_Size >( nXtiCount, rStrm.GetRecLeft() / 6 ) ); + OSL_ENSURE( static_cast< std::size_t >( nXtiCount * 6 ) == rStrm.GetRecLeft(), "XclImpLinkManagerImpl::ReadExternsheet - invalid count" ); + nXtiCount = static_cast< sal_uInt16 >( ::std::min< std::size_t >( nXtiCount, rStrm.GetRecLeft() / 6 ) ); /* #i104057# A weird external XLS generator writes multiple EXTERNSHEET records instead of only one as expected. Surprisingly, Excel seems to diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx index a2be5dadf7c4..31cf3d5ced08 100644 --- a/sc/source/filter/excel/xistream.cxx +++ b/sc/source/filter/excel/xistream.cxx @@ -179,7 +179,7 @@ bool XclImpBiff5Decrypter::OnVerifyEncryptionData( const uno::Sequence< beans::N return maEncryptionData.getLength(); } -void XclImpBiff5Decrypter::OnUpdate( sal_Size /*nOldStrmPos*/, sal_Size nNewStrmPos, sal_uInt16 nRecSize ) +void XclImpBiff5Decrypter::OnUpdate( std::size_t /*nOldStrmPos*/, std::size_t nNewStrmPos, sal_uInt16 nRecSize ) { maCodec.InitCipher(); maCodec.Skip( (nNewStrmPos + nRecSize) & 0x0F ); @@ -256,7 +256,7 @@ bool XclImpBiff8Decrypter::OnVerifyEncryptionData( const uno::Sequence< beans::N return maEncryptionData.getLength(); } -void XclImpBiff8Decrypter::OnUpdate( sal_Size nOldStrmPos, sal_Size nNewStrmPos, sal_uInt16 /*nRecSize*/ ) +void XclImpBiff8Decrypter::OnUpdate( std::size_t nOldStrmPos, std::size_t nNewStrmPos, sal_uInt16 /*nRecSize*/ ) { if( nNewStrmPos != nOldStrmPos ) { @@ -304,12 +304,12 @@ sal_uInt16 XclImpBiff8Decrypter::OnRead( SvStream& rStrm, sal_uInt8* pnData, sal return nRet; } -sal_uInt32 XclImpBiff8Decrypter::GetBlock( sal_Size nStrmPos ) +sal_uInt32 XclImpBiff8Decrypter::GetBlock( std::size_t nStrmPos ) { return static_cast< sal_uInt32 >( nStrmPos / EXC_ENCR_BLOCKSIZE ); } -sal_uInt16 XclImpBiff8Decrypter::GetOffset( sal_Size nStrmPos ) +sal_uInt16 XclImpBiff8Decrypter::GetOffset( std::size_t nStrmPos ) { return static_cast< sal_uInt16 >( nStrmPos % EXC_ENCR_BLOCKSIZE ); } @@ -327,7 +327,7 @@ XclImpStreamPos::XclImpStreamPos() : } void XclImpStreamPos::Set( - const SvStream& rStrm, sal_Size nNextPos, sal_Size nCurrSize, + const SvStream& rStrm, std::size_t nNextPos, std::size_t nCurrSize, sal_uInt16 nRawRecId, sal_uInt16 nRawRecSize, sal_uInt16 nRawRecLeft, bool bValid ) { @@ -341,7 +341,7 @@ void XclImpStreamPos::Set( } void XclImpStreamPos::Get( - SvStream& rStrm, sal_Size& rnNextPos, sal_Size& rnCurrSize, + SvStream& rStrm, std::size_t& rnNextPos, std::size_t& rnCurrSize, sal_uInt16& rnRawRecId, sal_uInt16& rnRawRecSize, sal_uInt16& rnRawRecLeft, bool& rbValid ) const { @@ -430,7 +430,7 @@ bool XclImpStream::StartNextRecord() /* #i4266# Counter to ignore zero records (id==len==0) (i.e. the application "Crystal Report" writes zero records between other records) */ - sal_Size nZeroRecCount = 5; + std::size_t nZeroRecCount = 5; bool bIsZeroRec = false; do @@ -449,7 +449,7 @@ bool XclImpStream::StartNextRecord() return mbValidRec; } -bool XclImpStream::StartNextRecord( sal_Size nNextRecPos ) +bool XclImpStream::StartNextRecord( std::size_t nNextRecPos ) { mnNextRecPos = nNextRecPos; return StartNextRecord(); @@ -537,12 +537,12 @@ void XclImpStream::SeekGlobalPosition() } } -sal_Size XclImpStream::GetRecPos() const +std::size_t XclImpStream::GetRecPos() const { return mbValid ? (mnCurrRecSize - mnRawRecLeft) : EXC_REC_SEEK_TO_END; } -sal_Size XclImpStream::GetRecSize() +std::size_t XclImpStream::GetRecSize() { if( !mbHasComplRec ) { @@ -555,7 +555,7 @@ sal_Size XclImpStream::GetRecSize() return mnComplRecSize; } -sal_Size XclImpStream::GetRecLeft() +std::size_t XclImpStream::GetRecLeft() { return mbValid ? (GetRecSize() - GetRecPos()) : 0; } @@ -577,12 +577,12 @@ sal_uInt16 XclImpStream::GetNextRecId() return nRecId; } -sal_uInt16 XclImpStream::PeekRecId( sal_Size nPos ) +sal_uInt16 XclImpStream::PeekRecId( std::size_t nPos ) { sal_uInt16 nRecId = EXC_ID_UNKNOWN; if (mbValidRec && nPos < mnStreamSize) { - sal_Size nCurPos = mrStrm.Tell(); + sal_uInt64 const nCurPos = mrStrm.Tell(); mrStrm.Seek(nPos); mrStrm.ReadUInt16( nRecId ); mrStrm.Seek(nCurPos); @@ -694,13 +694,13 @@ double XclImpStream::ReadDouble() return nValue; } -sal_Size XclImpStream::Read( void* pData, sal_Size nBytes ) +std::size_t XclImpStream::Read( void* pData, std::size_t nBytes ) { - sal_Size nRet = 0; + std::size_t nRet = 0; if( mbValid && pData && (nBytes > 0) ) { sal_uInt8* pnBuffer = static_cast< sal_uInt8* >( pData ); - sal_Size nBytesLeft = nBytes; + std::size_t nBytesLeft = nBytes; while( mbValid && (nBytesLeft > 0) ) { @@ -719,18 +719,18 @@ sal_Size XclImpStream::Read( void* pData, sal_Size nBytes ) return nRet; } -sal_Size XclImpStream::CopyToStream( SvStream& rOutStrm, sal_Size nBytes ) +std::size_t XclImpStream::CopyToStream( SvStream& rOutStrm, std::size_t nBytes ) { - sal_Size nRet = 0; + std::size_t nRet = 0; if( mbValid && (nBytes > 0) ) { - const sal_Size nMaxBuffer = 4096; + const std::size_t nMaxBuffer = 4096; std::unique_ptr<sal_uInt8[]> pnBuffer(new sal_uInt8[ ::std::min( nBytes, nMaxBuffer ) ]); - sal_Size nBytesLeft = nBytes; + std::size_t nBytesLeft = nBytes; while( mbValid && (nBytesLeft > 0) ) { - sal_Size nReadSize = ::std::min( nBytesLeft, nMaxBuffer ); + std::size_t nReadSize = ::std::min( nBytesLeft, nMaxBuffer ); nRet += Read( pnBuffer.get(), nReadSize ); // writing more bytes than read results in invalid memory access SAL_WARN_IF(nRet != nReadSize, "sc", "read less bytes than requested"); @@ -752,11 +752,11 @@ void XclImpStream::CopyRecordToStream( SvStream& rOutStrm ) } } -void XclImpStream::Seek( sal_Size nPos ) +void XclImpStream::Seek( std::size_t nPos ) { if( mbValidRec ) { - sal_Size nCurrPos = GetRecPos(); + std::size_t nCurrPos = GetRecPos(); if( !mbValid || (nPos < nCurrPos) ) // from invalid state or backward { RestorePosition( maFirstRec ); @@ -769,10 +769,10 @@ void XclImpStream::Seek( sal_Size nPos ) } } -void XclImpStream::Ignore( sal_Size nBytes ) +void XclImpStream::Ignore( std::size_t nBytes ) { // implementation similar to Read(), but without really reading anything - sal_Size nBytesLeft = nBytes; + std::size_t nBytesLeft = nBytes; while( mbValid && (nBytesLeft > 0) ) { sal_uInt16 nReadSize = GetMaxRawReadSize( nBytesLeft ); @@ -785,7 +785,7 @@ void XclImpStream::Ignore( sal_Size nBytes ) } } -sal_Size XclImpStream::ReadUniStringExtHeader( +std::size_t XclImpStream::ReadUniStringExtHeader( bool& rb16Bit, bool& rbRich, bool& rbFareast, sal_uInt16& rnFormatRuns, sal_uInt32& rnExtInf, sal_uInt8 nFlags ) { @@ -798,7 +798,7 @@ sal_Size XclImpStream::ReadUniStringExtHeader( return rnExtInf + 4 * rnFormatRuns; } -sal_Size XclImpStream::ReadUniStringExtHeader( bool& rb16Bit, sal_uInt8 nFlags ) +std::size_t XclImpStream::ReadUniStringExtHeader( bool& rb16Bit, sal_uInt8 nFlags ) { bool bRich, bFareast; sal_uInt16 nCrun; @@ -861,7 +861,7 @@ OUString XclImpStream::ReadRawUniString( sal_uInt16 nChars, bool b16Bit ) OUString XclImpStream::ReadUniString( sal_uInt16 nChars, sal_uInt8 nFlags ) { bool b16Bit; - sal_Size nExtSize = ReadUniStringExtHeader( b16Bit, nFlags ); + std::size_t nExtSize = ReadUniStringExtHeader( b16Bit, nFlags ); OUString aRet( ReadRawUniString( nChars, b16Bit ) ); Ignore( nExtSize ); return aRet; @@ -906,7 +906,7 @@ void XclImpStream::IgnoreRawUniString( sal_uInt16 nChars, bool b16Bit ) void XclImpStream::IgnoreUniString( sal_uInt16 nChars, sal_uInt8 nFlags ) { bool b16Bit; - sal_Size nExtSize = ReadUniStringExtHeader( b16Bit, nFlags ); + std::size_t nExtSize = ReadUniStringExtHeader( b16Bit, nFlags ); IgnoreRawUniString( nChars, b16Bit ); Ignore( nExtSize ); } @@ -946,7 +946,7 @@ void XclImpStream::RestorePosition( const XclImpStreamPos& rPos ) bool XclImpStream::ReadNextRawRecHeader() { - sal_Size nSeekedPos = mrStrm.Seek( mnNextRecPos ); + std::size_t nSeekedPos = mrStrm.Seek( mnNextRecPos ); bool bRet = (nSeekedPos == mnNextRecPos) && (mnNextRecPos + 4 <= mnStreamSize); if( bRet ) { @@ -1035,9 +1035,9 @@ bool XclImpStream::EnsureRawReadSize( sal_uInt16 nBytes ) return mbValid; } -sal_uInt16 XclImpStream::GetMaxRawReadSize( sal_Size nBytes ) const +sal_uInt16 XclImpStream::GetMaxRawReadSize( std::size_t nBytes ) const { - return static_cast< sal_uInt16 >( ::std::min< sal_Size >( nBytes, mnRawRecLeft ) ); + return static_cast< sal_uInt16 >( ::std::min< std::size_t >( nBytes, mnRawRecLeft ) ); } sal_uInt16 XclImpStream::ReadRawData( void* pData, sal_uInt16 nBytes ) diff --git a/sc/source/filter/ftools/fprogressbar.cxx b/sc/source/filter/ftools/fprogressbar.cxx index 170d5e51ec46..a958629e288f 100644 --- a/sc/source/filter/ftools/fprogressbar.cxx +++ b/sc/source/filter/ftools/fprogressbar.cxx @@ -23,7 +23,7 @@ #include <osl/diagnose.h> #include <o3tl/make_unique.hxx> -ScfProgressBar::ScfProgressSegment::ScfProgressSegment( sal_Size nSize ) : +ScfProgressBar::ScfProgressSegment::ScfProgressSegment( std::size_t nSize ) : mnSize( nSize ), mnPos( 0 ) { @@ -105,15 +105,15 @@ void ScfProgressBar::SetCurrSegment( ScfProgressSegment* pSegment ) } } -void ScfProgressBar::IncreaseProgressBar( sal_Size nDelta ) +void ScfProgressBar::IncreaseProgressBar( std::size_t nDelta ) { - sal_Size nNewPos = mnTotalPos + nDelta; + std::size_t nNewPos = mnTotalPos + nDelta; // call back to parent progress bar if( mpParentProgress && mpParentSegment ) { // calculate new position of parent progress bar - sal_Size nParentPos = static_cast< sal_Size >( + std::size_t nParentPos = static_cast< std::size_t >( static_cast< double >( nNewPos ) * mpParentSegment->mnSize / mnTotalSize ); mpParentProgress->ProgressAbs( nParentPos ); } @@ -134,7 +134,7 @@ void ScfProgressBar::IncreaseProgressBar( sal_Size nDelta ) mnTotalPos = nNewPos; } -sal_Int32 ScfProgressBar::AddSegment( sal_Size nSize ) +sal_Int32 ScfProgressBar::AddSegment( std::size_t nSize ) { OSL_ENSURE( !mbInProgress, "ScfProgressBar::AddSegment - already in progress mode" ); if( nSize == 0 ) @@ -171,7 +171,7 @@ void ScfProgressBar::ActivateSegment( sal_Int32 nSegment ) SetCurrSegment( GetSegment( nSegment ) ); } -void ScfProgressBar::ProgressAbs( sal_Size nPos ) +void ScfProgressBar::ProgressAbs( std::size_t nPos ) { OSL_ENSURE( mbInProgress && mpCurrSegment, "ScfProgressBar::ProgressAbs - no segment started" ); if( mpCurrSegment ) @@ -186,24 +186,24 @@ void ScfProgressBar::ProgressAbs( sal_Size nPos ) } } -void ScfProgressBar::Progress( sal_Size nDelta ) +void ScfProgressBar::Progress( std::size_t nDelta ) { ProgressAbs( mpCurrSegment ? (mpCurrSegment->mnPos + nDelta) : 0 ); } -ScfSimpleProgressBar::ScfSimpleProgressBar( sal_Size nSize, SfxObjectShell* pDocShell, const OUString& rText ) : +ScfSimpleProgressBar::ScfSimpleProgressBar( std::size_t nSize, SfxObjectShell* pDocShell, const OUString& rText ) : maProgress( pDocShell, rText ) { Init( nSize ); } -ScfSimpleProgressBar::ScfSimpleProgressBar( sal_Size nSize, SfxObjectShell* pDocShell, sal_uInt16 nResId ) : +ScfSimpleProgressBar::ScfSimpleProgressBar( std::size_t nSize, SfxObjectShell* pDocShell, sal_uInt16 nResId ) : maProgress( pDocShell, nResId ) { Init( nSize ); } -void ScfSimpleProgressBar::Init( sal_Size nSize ) +void ScfSimpleProgressBar::Init( std::size_t nSize ) { sal_Int32 nSegment = maProgress.AddSegment( nSize ); if( nSegment >= 0 ) @@ -223,9 +223,9 @@ void ScfStreamProgressBar::Progress() void ScfStreamProgressBar::Init( SfxObjectShell* pDocShell, const OUString& rText ) { - sal_Size nPos = mrStrm.Tell(); + sal_uInt64 const nPos = mrStrm.Tell(); mrStrm.Seek( STREAM_SEEK_TO_END ); - sal_Size nSize = mrStrm.Tell(); + sal_uInt64 const nSize = mrStrm.Tell(); mrStrm.Seek( nPos ); mxProgress.reset( new ScfSimpleProgressBar( nSize, pDocShell, rText ) ); diff --git a/sc/source/filter/inc/XclExpChangeTrack.hxx b/sc/source/filter/inc/XclExpChangeTrack.hxx index 6da99a5969d9..eedb6fc64560 100644 --- a/sc/source/filter/inc/XclExpChangeTrack.hxx +++ b/sc/source/filter/inc/XclExpChangeTrack.hxx @@ -32,7 +32,7 @@ class ExcXmlRecord : public ExcRecord { public: - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; virtual sal_uInt16 GetNum() const override; virtual void Save( XclExpStream& rStrm ) override; }; @@ -53,7 +53,7 @@ public: inline const sal_uInt8* GetGUID() const { return aGUID; } virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; // XclExpUserBViewList - list of UserBView records @@ -90,7 +90,7 @@ private: public: XclExpUsersViewBegin( const sal_uInt8* pGUID, sal_uInt32 nTab ); virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; // XclExpUsersViewEnd - end of view block (one per sheet) @@ -102,7 +102,7 @@ private: public: virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; // dummy record for "User Names" stream @@ -114,7 +114,7 @@ private: public: virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; // dummy record for "User Names" stream @@ -126,7 +126,7 @@ private: public: virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; // dummy record for "User Names" stream @@ -138,7 +138,7 @@ private: public: virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; // dummy record for "User Names" stream @@ -150,7 +150,7 @@ private: public: virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; // dummy record without content @@ -165,7 +165,7 @@ public: virtual ~XclExpChTrEmpty() override; virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; // dummy record for "Revision Log" stream @@ -179,7 +179,7 @@ public: virtual ~XclExpChTr0x0195() override; virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; // dummy record for "Revision Log" stream @@ -197,7 +197,7 @@ public: virtual ~XclExpChTr0x0194() override; virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; inline XclExpChTr0x0194::XclExpChTr0x0194( const ScChangeTrack& rChangeTrack ) : @@ -224,7 +224,7 @@ public: inline void SetCount( sal_uInt32 nNew ) { nCount = nNew; } virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; virtual void SaveXml( XclExpXmlStream& rStrm ) override; }; @@ -281,7 +281,7 @@ public: virtual ~XclExpChTrInfo() override; virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; // XclExpChTrTabIdBuffer - buffer for tab id's @@ -332,7 +332,7 @@ public: void Copy( const XclExpChTrTabIdBuffer& rBuffer ); virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; // XclExpChTrAction - base class for action records @@ -368,12 +368,12 @@ protected: // save header data, call SaveActionData() virtual void SaveCont( XclExpStream& rStrm ) override; - static inline sal_Size GetHeaderByteCount() { return 12; } + static inline std::size_t GetHeaderByteCount() { return 12; } // override to save action data without header, called by SaveCont() virtual void SaveActionData( XclExpStream& rStrm ) const = 0; // override to get action size without header, called by GetLen() - virtual sal_Size GetActionByteCount() const = 0; + virtual std::size_t GetActionByteCount() const = 0; // do something before writing the record virtual void PrepareSaveAction( XclExpStream& rStrm ) const; @@ -400,7 +400,7 @@ public: void SetIndex( sal_uInt32& rIndex ); virtual void Save( XclExpStream& rStrm ) override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; inline XclExpChTrAction* GetAddAction() { return pAddAction; } inline sal_uInt32 GetActionNumber() const { return nIndex; } @@ -442,7 +442,7 @@ struct XclExpChTrData double fValue; sal_Int32 nRKValue; sal_uInt16 nType; - sal_Size nSize; + std::size_t nSize; XclExpChTrData(); ~XclExpChTrData(); @@ -484,7 +484,7 @@ public: virtual ~XclExpChTrCellContent() override; virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetActionByteCount() const override; + virtual std::size_t GetActionByteCount() const override; virtual void SaveXml( XclExpXmlStream& rStrm ) override; }; @@ -513,7 +513,7 @@ public: virtual ~XclExpChTrInsert() override; virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetActionByteCount() const override; + virtual std::size_t GetActionByteCount() const override; virtual void SaveXml( XclExpXmlStream& rStrm ) override; }; @@ -536,7 +536,7 @@ public: virtual ~XclExpChTrInsertTab() override; virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetActionByteCount() const override; + virtual std::size_t GetActionByteCount() const override; virtual void SaveXml( XclExpXmlStream& rStrm ) override; }; @@ -562,7 +562,7 @@ public: virtual ~XclExpChTrMoveRange() override; virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetActionByteCount() const override; + virtual std::size_t GetActionByteCount() const override; virtual void SaveXml( XclExpXmlStream& rStrm ) override; }; @@ -579,7 +579,7 @@ public: virtual ~XclExpChTr0x014A() override; virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetActionByteCount() const override; + virtual std::size_t GetActionByteCount() const override; virtual void SaveXml( XclExpXmlStream& rStrm ) override; }; diff --git a/sc/source/filter/inc/excform.hxx b/sc/source/filter/inc/excform.hxx index 05bed91bbef8..9a64b40afec0 100644 --- a/sc/source/filter/inc/excform.hxx +++ b/sc/source/filter/inc/excform.hxx @@ -47,15 +47,15 @@ protected: public: ExcelToSc( XclImpRoot& rRoot ); virtual ~ExcelToSc() override; - virtual ConvErr Convert( const ScTokenArray*&, XclImpStream& rStrm, sal_Size nFormulaLen, + virtual ConvErr Convert( const ScTokenArray*&, XclImpStream& rStrm, std::size_t nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula ) override; - virtual ConvErr Convert( ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, SCsTAB nTab, const FORMULA_TYPE eFT = FT_CellFormula ) override; + virtual ConvErr Convert( ScRangeListTabs&, XclImpStream& rStrm, std::size_t nFormulaLen, SCsTAB nTab, const FORMULA_TYPE eFT = FT_CellFormula ) override; - virtual void ConvertExternName( const ScTokenArray*& rpArray, XclImpStream& rStrm, sal_Size nFormulaLen, + virtual void ConvertExternName( const ScTokenArray*& rpArray, XclImpStream& rStrm, std::size_t nFormulaLen, const OUString& rUrl, const ::std::vector<OUString>& rTabNames ); - virtual void GetAbsRefs( ScRangeList& rRangeList, XclImpStream& rStrm, sal_Size nLen ); + virtual void GetAbsRefs( ScRangeList& rRangeList, XclImpStream& rStrm, std::size_t nLen ); void GetDummy( const ScTokenArray*& ); const ScTokenArray* GetBoolErr( XclBoolError ); @@ -121,16 +121,16 @@ public: ExcelToSc8( XclImpRoot& rRoot ); virtual ~ExcelToSc8() override; - virtual ConvErr Convert( const ScTokenArray*& rpTokArray, XclImpStream& rStrm, sal_Size nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula ) override; + virtual ConvErr Convert( const ScTokenArray*& rpTokArray, XclImpStream& rStrm, std::size_t nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula ) override; - virtual ConvErr Convert( ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, SCsTAB nTab, const FORMULA_TYPE eFT = FT_CellFormula ) override; + virtual ConvErr Convert( ScRangeListTabs&, XclImpStream& rStrm, std::size_t nFormulaLen, SCsTAB nTab, const FORMULA_TYPE eFT = FT_CellFormula ) override; - virtual void ConvertExternName( const ScTokenArray*& rpArray, XclImpStream& rStrm, sal_Size nFormulaLen, + virtual void ConvertExternName( const ScTokenArray*& rpArray, XclImpStream& rStrm, std::size_t nFormulaLen, const OUString& rUrl, const ::std::vector<OUString>& rTabNames ) override; static inline bool IsComplRowRange( const sal_uInt16 nRow1, const sal_uInt16 nRow2 ); - virtual void GetAbsRefs( ScRangeList& rRangeList, XclImpStream& rStrm, sal_Size nLen ) override; + virtual void GetAbsRefs( ScRangeList& rRangeList, XclImpStream& rStrm, std::size_t nLen ) override; }; inline bool ExcelToSc8::IsComplRowRange( const sal_uInt16 nRow1, const sal_uInt16 nRow2 ) diff --git a/sc/source/filter/inc/excrecds.hxx b/sc/source/filter/inc/excrecds.hxx index 4223adcea0d5..514310075cac 100644 --- a/sc/source/filter/inc/excrecds.hxx +++ b/sc/source/filter/inc/excrecds.hxx @@ -53,7 +53,7 @@ public: virtual void SaveXml( XclExpXmlStream& rStrm ) override; virtual sal_uInt16 GetNum() const = 0; - virtual sal_Size GetLen() const = 0; + virtual std::size_t GetLen() const = 0; protected: virtual void SaveCont( XclExpStream& rStrm ); @@ -72,7 +72,7 @@ protected: public: virtual void Save( XclExpStream& rStrm ) override; virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; //--------------------------------------------------------- class ExcDummyRec - @@ -100,7 +100,7 @@ protected: inline ExcBoolRecord() : bVal( false ) {} public: - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; //--------------------------------------------------------- class ExcBof_Base - @@ -128,7 +128,7 @@ public: ExcBof(); virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; //------------------------------------------------------------- class ExcBofW - @@ -142,7 +142,7 @@ public: ExcBofW(); virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; //-------------------------------------------------------------- class ExcEof - @@ -152,7 +152,7 @@ class ExcEof : public ExcRecord private: public: virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; //--------------------------------------------------------- class ExcDummy_00 - @@ -162,9 +162,9 @@ class ExcDummy_00 : public ExcDummyRec { private: static const sal_uInt8 pMyData[]; - static const sal_Size nMyLen; + static const std::size_t nMyLen; public: - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; virtual const sal_uInt8* GetData() const override; }; @@ -212,9 +212,9 @@ class ExcDummy_040 : public ExcDummyRec { private: static const sal_uInt8 pMyData[]; - static const sal_Size nMyLen; + static const std::size_t nMyLen; public: - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; virtual const sal_uInt8* GetData() const override; }; @@ -222,9 +222,9 @@ class ExcDummy_041 : public ExcDummyRec { private: static const sal_uInt8 pMyData[]; - static const sal_Size nMyLen; + static const std::size_t nMyLen; public: - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; virtual const sal_uInt8* GetData() const override; }; @@ -271,7 +271,7 @@ private: public: ExcBundlesheet( RootData& rRootData, SCTAB nTab ); - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; //--------------------------------------------------------- class ExcDummy_02 - @@ -281,9 +281,9 @@ class ExcDummy_02a : public ExcDummyRec { private: static const sal_uInt8 pMyData[]; - static const sal_Size nMyLen; + static const std::size_t nMyLen; public: - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; virtual const sal_uInt8* GetData() const override; }; @@ -359,7 +359,7 @@ public: ~ExcFilterCondition(); inline bool IsEmpty() const { return (nType == EXC_AFTYPE_NOTUSED); } - sal_uLong GetTextBytes() const; + std::size_t GetTextBytes() const; void SetCondition( sal_uInt8 nTp, sal_uInt8 nOp, double fV, OUString* pT ); diff --git a/sc/source/filter/inc/formel.hxx b/sc/source/filter/inc/formel.hxx index 4a63dbdf0d45..494cd0a164ca 100644 --- a/sc/source/filter/inc/formel.hxx +++ b/sc/source/filter/inc/formel.hxx @@ -104,9 +104,9 @@ public: void Reset(); void Reset( const ScAddress& rEingPos ); - virtual ConvErr Convert( const ScTokenArray*& rpErg, XclImpStream& rStrm, sal_Size nFormulaLen, + virtual ConvErr Convert( const ScTokenArray*& rpErg, XclImpStream& rStrm, std::size_t nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula ) = 0; - virtual ConvErr Convert( ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, SCsTAB nTab, + virtual ConvErr Convert( ScRangeListTabs&, XclImpStream& rStrm, std::size_t nFormulaLen, SCsTAB nTab, const FORMULA_TYPE eFT = FT_CellFormula ) = 0; }; diff --git a/sc/source/filter/inc/fprogressbar.hxx b/sc/source/filter/inc/fprogressbar.hxx index 8df4e74ac492..dc2fd81a6a3d 100644 --- a/sc/source/filter/inc/fprogressbar.hxx +++ b/sc/source/filter/inc/fprogressbar.hxx @@ -112,7 +112,7 @@ public: /** Adds a new segment to the progress bar. @return the identifier of the segment. */ - sal_Int32 AddSegment( sal_Size nSize ); + sal_Int32 AddSegment( std::size_t nSize ); /** Returns a complete progress bar for the specified segment. @descr The progress bar can be used to create sub segments inside of the segment. Do not delete it (done by root progress bar)! @@ -127,9 +127,9 @@ public: /** Starts the progress bar (with first segment). */ inline void Activate() { ActivateSegment( 0 ); } /** Set current segment to the specified absolute position. */ - void ProgressAbs( sal_Size nPos ); + void ProgressAbs( std::size_t nPos ); /** Increase current segment by the passed value. */ - void Progress( sal_Size nDelta = 1 ); + void Progress( std::size_t nDelta = 1 ); private: struct ScfProgressSegment; @@ -147,7 +147,7 @@ private: /** Activates progress bar and sets current segment. */ void SetCurrSegment( ScfProgressSegment* pSegment ); /** Increases mnTotalPos and calls the system progress bar. */ - void IncreaseProgressBar( sal_Size nDelta ); + void IncreaseProgressBar( std::size_t nDelta ); private: /** Contains all data of a segment of the progress bar. */ @@ -156,10 +156,10 @@ private: typedef ::std::unique_ptr< ScfProgressBar > ScfProgressBarPtr; ScfProgressBarPtr mxProgress; /// Pointer to sub progress bar for this segment. - sal_Size mnSize; /// Size of this segment. - sal_Size mnPos; /// Current position of this segment. + std::size_t mnSize; /// Size of this segment. + std::size_t mnPos; /// Current position of this segment. - explicit ScfProgressSegment( sal_Size nSize ); + explicit ScfProgressSegment( std::size_t nSize ); ~ScfProgressSegment(); }; @@ -175,11 +175,11 @@ private: ScfProgressSegment* mpParentSegment; /// Parent segment, if this is a segment progress bar. ScfProgressSegment* mpCurrSegment; /// Current segment for progress. - sal_Size mnTotalSize; /// Total size of all segments. - sal_Size mnTotalPos; /// Sum of positions of all segments. - sal_Size mnUnitSize; /// Size between two calls of system progress. - sal_Size mnNextUnitPos; /// Limit for next system progress call. - sal_Size mnSysProgressScale; /// Additionally scaling factor for system progress. + std::size_t mnTotalSize; /// Total size of all segments. + std::size_t mnTotalPos; /// Sum of positions of all segments. + std::size_t mnUnitSize; /// Size between two calls of system progress. + std::size_t mnNextUnitPos; /// Limit for next system progress call. + std::size_t mnSysProgressScale; /// Additionally scaling factor for system progress. bool mbInProgress; /// true = progress bar started. }; @@ -187,15 +187,15 @@ private: class ScfSimpleProgressBar { public: - explicit ScfSimpleProgressBar( sal_Size nSize, SfxObjectShell* pDocShell, const OUString& rText ); - explicit ScfSimpleProgressBar( sal_Size nSize, SfxObjectShell* pDocShell, sal_uInt16 nResId ); + explicit ScfSimpleProgressBar( std::size_t nSize, SfxObjectShell* pDocShell, const OUString& rText ); + explicit ScfSimpleProgressBar( std::size_t nSize, SfxObjectShell* pDocShell, sal_uInt16 nResId ); /** Set progress bar to the specified position. */ - inline void ProgressAbs( sal_Size nPos ) { maProgress.ProgressAbs( nPos ); } + inline void ProgressAbs( std::size_t nPos ) { maProgress.ProgressAbs( nPos ); } private: /** Initializes and starts the progress bar. */ - void Init( sal_Size nSize ); + void Init( std::size_t nSize ); private: ScfProgressBar maProgress; /// The used progress bar. diff --git a/sc/source/filter/inc/xcl97rec.hxx b/sc/source/filter/inc/xcl97rec.hxx index 51f9fcd572d4..0c8dc964af2e 100644 --- a/sc/source/filter/inc/xcl97rec.hxx +++ b/sc/source/filter/inc/xcl97rec.hxx @@ -209,7 +209,7 @@ public: virtual void Save( XclExpStream& rStrm ) override; virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; private: virtual void SaveCont( XclExpStream& rStrm ) override; @@ -279,7 +279,7 @@ public: ExcBof8_Base(); virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; // --- class ExcBofW8 ------------------------------------------------ @@ -314,7 +314,7 @@ public: ExcBundlesheet8( RootData& rRootData, SCTAB nTab ); ExcBundlesheet8( const OUString& rString ); - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; virtual void SaveXml( XclExpXmlStream& rStrm ) override; }; @@ -325,7 +325,7 @@ class XclObproj : public ExcRecord { public: virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; // ---- class XclCodename -------------------------------------------- @@ -339,7 +339,7 @@ public: XclCodename( const OUString& ); virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; // ---- Scenarios ---------------------------------------------------- @@ -358,7 +358,7 @@ protected: public: ExcEScenarioCell( sal_uInt16 nC, sal_uInt16 nR, const OUString& rTxt ); - inline sal_Size GetStringBytes() const + inline std::size_t GetStringBytes() const { return sText.GetSize(); } void WriteAddress( XclExpStream& rStrm ) const ; @@ -370,7 +370,7 @@ public: class ExcEScenario : public ExcRecord { private: - sal_Size nRecLen; + std::size_t nRecLen; XclExpString sName; XclExpString sComment; XclExpString sUserName; @@ -388,7 +388,7 @@ public: virtual ~ExcEScenario() override; virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; virtual void SaveXml( XclExpXmlStream& rStrm ) override; }; @@ -410,7 +410,7 @@ public: virtual void SaveXml( XclExpXmlStream& rStrm ) override; virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; }; /** Represents a FEATHDR (SHEETPROTECTION) record that stores sheet protection @@ -453,7 +453,7 @@ public: XclCalccount( const ScDocument& ); virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; virtual void SaveXml( XclExpXmlStream& rStrm ) override; }; @@ -468,7 +468,7 @@ public: XclIteration( const ScDocument& ); virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; virtual void SaveXml( XclExpXmlStream& rStrm ) override; }; @@ -483,7 +483,7 @@ public: XclDelta( const ScDocument& ); virtual sal_uInt16 GetNum() const override; - virtual sal_Size GetLen() const override; + virtual std::size_t GetLen() const override; virtual void SaveXml( XclExpXmlStream& rStrm ) override; }; diff --git a/sc/source/filter/inc/xechart.hxx b/sc/source/filter/inc/xechart.hxx index 7fc0d18c1502..365256cb00c9 100644 --- a/sc/source/filter/inc/xechart.hxx +++ b/sc/source/filter/inc/xechart.hxx @@ -164,7 +164,7 @@ class XclExpChGroupBase : public XclExpRecord, protected XclExpChRoot public: explicit XclExpChGroupBase( const XclExpChRoot& rRoot, sal_uInt16 nFrType, - sal_uInt16 nRecId, sal_Size nRecSize = 0 ); + sal_uInt16 nRecId, std::size_t nRecSize = 0 ); virtual ~XclExpChGroupBase() override; /** Saves the header record. Calls WriteSubRecords() to let derived classes write sub records. */ @@ -190,7 +190,7 @@ class XclExpChFutureRecordBase : public XclExpFutureRecord, protected XclExpChRo { public: explicit XclExpChFutureRecordBase( const XclExpChRoot& rRoot, - XclFutureRecType eRecType, sal_uInt16 nRecId, sal_Size nRecSize = 0 ); + XclFutureRecType eRecType, sal_uInt16 nRecId, std::size_t nRecSize = 0 ); /** Writes missing CHFRBLOCKBEGIN records and this record. */ virtual void Save( XclExpStream& rStrm ) override; diff --git a/sc/source/filter/inc/xehelper.hxx b/sc/source/filter/inc/xehelper.hxx index 81f89463c40e..477adc9218c0 100644 --- a/sc/source/filter/inc/xehelper.hxx +++ b/sc/source/filter/inc/xehelper.hxx @@ -69,7 +69,7 @@ private: ScfProgressBar* mpSubRowFinal; /// Sub progress bar for finalizing ROW records. sal_Int32 mnSegRowFinal; /// Progress segment for finalizing ROW records. - sal_Size mnRowCount; /// Number of created ROW records. + std::size_t mnRowCount; /// Number of created ROW records. }; // Calc->Excel cell address/range conversion ================================== @@ -426,7 +426,7 @@ public: ~XclExpCachedMatrix(); /** Returns the byte count of all contained data. */ - sal_Size GetSize() const; + std::size_t GetSize() const; /** Writes the complete matrix to stream. */ void Save( XclExpStream& rStrm ) const; diff --git a/sc/source/filter/inc/xepivot.hxx b/sc/source/filter/inc/xepivot.hxx index dd94d57ccd95..c8c1fbbf02dc 100644 --- a/sc/source/filter/inc/xepivot.hxx +++ b/sc/source/filter/inc/xepivot.hxx @@ -89,7 +89,7 @@ public: sal_uInt16 GetItemIndex( const OUString& rItemName ) const; /** Returns the size an item index needs to write out. */ - sal_Size GetIndexSize() const; + std::size_t GetIndexSize() const; /** Writes the item index at the passed source row position as part of the SXINDEXLIST record. */ void WriteIndex( XclExpStream& rStrm, sal_uInt32 nSrcRow ) const; diff --git a/sc/source/filter/inc/xerecord.hxx b/sc/source/filter/inc/xerecord.hxx index 8cf66e174dd7..69b7bbf4c171 100644 --- a/sc/source/filter/inc/xerecord.hxx +++ b/sc/source/filter/inc/xerecord.hxx @@ -120,23 +120,23 @@ public: @param nRecSize The predicted record size. May be set later with SetRecSize(). */ explicit XclExpRecord( sal_uInt16 nRecId = EXC_ID_UNKNOWN, - sal_Size nRecSize = 0 ); + std::size_t nRecSize = 0 ); virtual ~XclExpRecord() override; /** Returns the current record ID. */ inline sal_uInt16 GetRecId() const { return mnRecId; } /** Returns the current record size prediction. */ - inline sal_Size GetRecSize() const { return mnRecSize; } + inline std::size_t GetRecSize() const { return mnRecSize; } /** Sets a new record ID. */ inline void SetRecId( sal_uInt16 nRecId ) { mnRecId = nRecId; } /** Sets a new record size prediction. */ - inline void SetRecSize( sal_Size nRecSize ) { mnRecSize = nRecSize; } + inline void SetRecSize( std::size_t nRecSize ) { mnRecSize = nRecSize; } /** Adds a size value to the record size prediction. */ - inline void AddRecSize( sal_Size nRecSize ) { mnRecSize += nRecSize; } + inline void AddRecSize( std::size_t nRecSize ) { mnRecSize += nRecSize; } /** Sets record ID and size with one call. */ - void SetRecHeader( sal_uInt16 nRecId, sal_Size nRecSize ); + void SetRecHeader( sal_uInt16 nRecId, std::size_t nRecSize ); /** Writes the record header and calls WriteBody(). */ virtual void Save( XclExpStream& rStrm ) override; @@ -147,7 +147,7 @@ protected: virtual void WriteBody( XclExpStream& rStrm ); private: - sal_Size mnRecSize; /// The predicted record size. + std::size_t mnRecSize; /// The predicted record size. sal_uInt16 mnRecId; /// The record ID. }; @@ -173,7 +173,7 @@ public: /** @param nRecId The record ID of this record. @param rValue The value for the record body. @param nSize Record size. Uses sizeof( Type ), if this parameter is omitted. */ - inline explicit XclExpValueRecord( sal_uInt16 nRecId, const Type& rValue, sal_Size nSize = sizeof( Type ) ) : + inline explicit XclExpValueRecord( sal_uInt16 nRecId, const Type& rValue, std::size_t nSize = sizeof( Type ) ) : XclExpRecord( nRecId, nSize ), maValue( rValue ), mnAttribute( -1 ) {} /** Returns the value of the record. */ @@ -255,10 +255,10 @@ public: @param pRecData Pointer to the data array representing the record body. @param nRecSize Size of the data array. */ explicit XclExpDummyRecord( - sal_uInt16 nRecId, const void* pRecData, sal_Size nRecSize ); + sal_uInt16 nRecId, const void* pRecData, std::size_t nRecSize ); /** Sets a data array. */ - void SetData( const void* pRecData, sal_Size nRecSize ); + void SetData( const void* pRecData, std::size_t nRecSize ); private: /** Writes the body of the record. */ @@ -274,7 +274,7 @@ class XclExpFutureRecord : public XclExpRecord { public: explicit XclExpFutureRecord( XclFutureRecType eRecType, - sal_uInt16 nRecId, sal_Size nRecSize = 0 ); + sal_uInt16 nRecId, std::size_t nRecSize = 0 ); /** Writes the extended record header and calls WriteBody(). */ virtual void Save( XclExpStream& rStrm ) override; diff --git a/sc/source/filter/inc/xestream.hxx b/sc/source/filter/inc/xestream.hxx index 25193d8cab2f..81c3f43c2f3a 100644 --- a/sc/source/filter/inc/xestream.hxx +++ b/sc/source/filter/inc/xestream.hxx @@ -87,7 +87,7 @@ public: inline const XclExpRoot& GetRoot() const { return mrRoot; } /** Starts a new record: writes header data, stores calculated record size. */ - void StartRecord( sal_uInt16 nRecId, sal_Size nRecSize ); + void StartRecord( sal_uInt16 nRecId, std::size_t nRecSize ); /** Checks and corrects real record length. Must be called every time a record is finished. */ void EndRecord(); @@ -107,11 +107,11 @@ public: XclExpStream& operator<<( double fValue ); /** Writes nBytes bytes from memory. */ - sal_Size Write( const void* pData, sal_Size nBytes ); + std::size_t Write( const void* pData, std::size_t nBytes ); /** Writes a sequence of nBytes zero bytes (respects slice setting). */ - void WriteZeroBytes( sal_Size nBytes ); + void WriteZeroBytes( std::size_t nBytes ); - void WriteZeroBytesToRecord( sal_Size nBytes ); + void WriteZeroBytesToRecord( std::size_t nBytes ); /** Copies nBytes bytes from current position of the stream rInStrm. @descr Omitting the second parameter means: read to end of stream. */ @@ -153,7 +153,7 @@ private: /** Rewrites correct record length, if different from calculated. */ void UpdateRecSize(); /** Recalculates mnCurrSize and mnSliceSize. */ - void UpdateSizeVars( sal_Size nSize ); + void UpdateSizeVars( std::size_t nSize ); /** Writes CONTINUE header, internal setup. */ void StartContinue(); /** Refreshes counter vars, creates CONTINUE records. */ @@ -163,7 +163,7 @@ private: sal_uInt16 PrepareWrite(); /** Writes a raw sequence of zero bytes. */ - void WriteRawZeroBytes( sal_Size nBytes ); + void WriteRawZeroBytes( std::size_t nBytes ); private: SvStream& mrStrm; /// Reference to the system output stream. @@ -180,10 +180,10 @@ private: sal_uInt16 mnHeaderSize; /// Record size written in last record header. sal_uInt16 mnCurrSize; /// Count of bytes already written in current record. sal_uInt16 mnSliceSize; /// Count of bytes already written in current slice. - sal_Size mnPredictSize; /// Predicted size received from calling function. + std::size_t mnPredictSize; /// Predicted size received from calling function. // stream position data - sal_Size mnLastSizePos; /// Stream position of size field in current header. + std::size_t mnLastSizePos; /// Stream position of size field in current header. bool mbInRec; /// true = currently writing inside of a record. }; @@ -215,8 +215,8 @@ public: private: void Init( const css::uno::Sequence< css::beans::NamedValue >& aEncryptionData ); - static sal_uInt32 GetBlockPos( sal_Size nStrmPos ); - static sal_uInt16 GetOffsetInBlock( sal_Size nStrmPos ); + static sal_uInt32 GetBlockPos( std::size_t nStrmPos ); + static sal_uInt16 GetOffsetInBlock( std::size_t nStrmPos ); private: ::msfilter::MSCodec_Std97 maCodec; /// Crypto algorithm implementation. diff --git a/sc/source/filter/inc/xestring.hxx b/sc/source/filter/inc/xestring.hxx index 60956b6014c3..570a3f0e25a7 100644 --- a/sc/source/filter/inc/xestring.hxx +++ b/sc/source/filter/inc/xestring.hxx @@ -133,9 +133,9 @@ public: /** Returns the byte count the header will take on export. */ sal_uInt16 GetHeaderSize() const; /** Returns the byte count the character buffer will take on export. */ - sal_Size GetBufferSize() const; + std::size_t GetBufferSize() const; /** Returns the byte count the whole string will take on export. */ - sal_Size GetSize() const; + std::size_t GetSize() const; /** Returns the specified character from the (already encoded) string. */ sal_uInt16 GetChar( sal_uInt16 nCharIdx ) const; diff --git a/sc/source/filter/inc/xetable.hxx b/sc/source/filter/inc/xetable.hxx index 5137de6eca27..4eaea1511b78 100644 --- a/sc/source/filter/inc/xetable.hxx +++ b/sc/source/filter/inc/xetable.hxx @@ -305,7 +305,7 @@ public: protected: explicit XclExpCellBase( - sal_uInt16 nRecId, sal_Size nContSize, const XclAddress& rXclPos ); + sal_uInt16 nRecId, std::size_t nContSize, const XclAddress& rXclPos ); /** Sets this record to a new column position. */ inline void SetXclCol( sal_uInt16 nXclCol ) { maXclPos.mnCol = nXclCol; } @@ -334,15 +334,15 @@ public: virtual void Save( XclExpStream& rStrm ) override; protected: - explicit XclExpSingleCellBase( sal_uInt16 nRecId, sal_Size nContSize, + explicit XclExpSingleCellBase( sal_uInt16 nRecId, std::size_t nContSize, const XclAddress& rXclPos, sal_uInt32 nXFId ); explicit XclExpSingleCellBase( const XclExpRoot& rRoot, - sal_uInt16 nRecId, sal_Size nContSize, const XclAddress& rXclPos, + sal_uInt16 nRecId, std::size_t nContSize, const XclAddress& rXclPos, const ScPatternAttr* pPattern, sal_Int16 nScript, sal_uInt32 nForcedXFId ); - inline void SetContSize( sal_Size nContSize ) { mnContSize = nContSize; } - inline sal_Size GetContSize() const { return mnContSize; } + inline void SetContSize( std::size_t nContSize ) { mnContSize = nContSize; } + inline std::size_t GetContSize() const { return mnContSize; } inline void SetXFId( sal_uInt32 nXFId ) { maXFId.mnXFId = nXFId; } inline sal_uInt32 GetXFId() const { return maXFId.mnXFId; } @@ -355,7 +355,7 @@ private: private: XclExpXFId maXFId; /// The XF identifier of the cell formatting. - sal_Size mnContSize; /// The size of the cell contents. + std::size_t mnContSize; /// The size of the cell contents. }; /** Represents a NUMBER record that describes a cell with a double value. */ @@ -494,7 +494,7 @@ public: protected: explicit XclExpMultiCellBase( sal_uInt16 nRecId, sal_uInt16 nMulRecId, - sal_Size nContSize, const XclAddress& rXclPos ); + std::size_t nContSize, const XclAddress& rXclPos ); /** Returns the number of cells this record represents. */ sal_uInt16 GetCellCount() const; @@ -525,7 +525,7 @@ private: typedef ::std::vector< XclExpMultiXFId > XclExpMultiXFIdDeq; sal_uInt16 mnMulRecId; /// Record ID for multiple record variant. - sal_Size mnContSize; /// Data size of contents for one cell + std::size_t mnContSize; /// Data size of contents for one cell XclExpMultiXFIdDeq maXFIds; /// The XF identifiers of the cell formatting. }; diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx index 6d26ed2bdb46..d97c722d387a 100644 --- a/sc/source/filter/inc/xichart.hxx +++ b/sc/source/filter/inc/xichart.hxx @@ -1301,7 +1301,7 @@ public: /** Returns true, if the plot area has benn moved and/or resized manually. */ bool IsManualPlotArea() const; /** Returns the number of units on the progress bar needed for the chart. */ - static inline sal_Size GetProgressSize() { return 2 * EXC_CHART_PROGRESS_SIZE; } + static inline std::size_t GetProgressSize() { return 2 * EXC_CHART_PROGRESS_SIZE; } /** Converts and writes all properties to the passed chart. */ void Convert( @@ -1391,7 +1391,7 @@ public: void UpdateObjFrame( const XclObjLineData& rLineData, const XclObjFillData& rFillData ); /** Returns the number of units on the progress bar needed for the chart. */ - sal_Size GetProgressSize() const; + std::size_t GetProgressSize() const; /** Returns true, if the chart is based on a pivot table. */ inline bool IsPivotChart() const { return mbIsPivotChart; } diff --git a/sc/source/filter/inc/xiescher.hxx b/sc/source/filter/inc/xiescher.hxx index f69770332cfe..6c0552d31677 100644 --- a/sc/source/filter/inc/xiescher.hxx +++ b/sc/source/filter/inc/xiescher.hxx @@ -125,7 +125,7 @@ public: inline bool IsInsertSdrObj() const { return mbInsertSdr; } /** Returns the needed size on the progress bar (calls virtual DoGetProgressSize() function). */ - sal_Size GetProgressSize() const; + std::size_t GetProgressSize() const; /** Creates and returns an SdrObject from the contained data. Caller takes ownership! */ SdrObjectPtr CreateSdrObject( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect, bool bIsDff ) const; /** Additional processing for the passed SdrObject before insertion into @@ -170,7 +170,7 @@ protected: virtual void DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize ); /** Derived classes may return a progress bar size different from 1. */ - virtual sal_Size DoGetProgressSize() const; + virtual std::size_t DoGetProgressSize() const; /** Derived classes create and return a new SdrObject from the contained data. Caller takes ownership! */ virtual SdrObjectPtr DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const; /** Derived classes may perform additional processing for the passed SdrObject before insertion. */ @@ -225,7 +225,7 @@ public: void InsertGrouped( XclImpDrawObjRef const & xDrawObj ); /** Returns the needed size on the progress bar for all contained objects. */ - sal_Size GetProgressSize() const; + std::size_t GetProgressSize() const; }; /** A placeholder object for unknown object types. */ @@ -252,7 +252,7 @@ protected: /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */ virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize ) override; /** Returns a progress bar size that takes all group children into account. */ - virtual sal_Size DoGetProgressSize() const override; + virtual std::size_t DoGetProgressSize() const override; /** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */ virtual SdrObjectPtr DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const override; @@ -424,7 +424,7 @@ protected: /** Reads the contents of the specified subrecord of a BIFF8 OBJ record from stream. */ virtual void DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize ) override; /** Returns the needed size on the progress bar. */ - virtual sal_Size DoGetProgressSize() const override; + virtual std::size_t DoGetProgressSize() const override; /** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */ virtual SdrObjectPtr DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const override; /** Converts the chart document. */ @@ -761,7 +761,7 @@ public: protected: /** Reads listbox settings and selection. */ - void ReadFullLbsData( XclImpStream& rStrm, sal_Size nRecLeft ); + void ReadFullLbsData( XclImpStream& rStrm, std::size_t nRecLeft ); /** Reads the contents of the a BIFF5 OBJ record from the passed stream. */ virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize ) override; @@ -833,9 +833,9 @@ public: /** Returns true, if this object is an OCX form control. */ inline bool IsOcxControl() const { return mbEmbedded && mbControl && mbUseCtlsStrm; } /** Returns the position in the 'Ctls' stream for additional form control data. */ - inline sal_Size GetCtlsStreamPos() const { return mnCtlsStrmPos; } + inline std::size_t GetCtlsStreamPos() const { return mnCtlsStrmPos; } /** Returns the size in the 'Ctls' stream for additional form control data. */ - inline sal_Size GetCtlsStreamSize() const { return mnCtlsStrmSize; } + inline std::size_t GetCtlsStreamSize() const { return mnCtlsStrmSize; } protected: /** Reads the contents of the a BIFF3 OBJ record from the passed stream. */ @@ -864,8 +864,8 @@ private: Rectangle maVisArea; /// Size of graphic. OUString maClassName; /// Class name of embedded OLE object. sal_uInt32 mnStorageId; /// Identifier of the storage for this object. - sal_Size mnCtlsStrmPos; /// Position in 'Ctls' stream for this control. - sal_Size mnCtlsStrmSize; /// Size in 'Ctls' stream for this control. + std::size_t mnCtlsStrmPos; /// Position in 'Ctls' stream for this control. + std::size_t mnCtlsStrmSize; /// Size in 'Ctls' stream for this control. bool mbEmbedded; /// true = Embedded OLE object. bool mbLinked; /// true = Linked OLE object. bool mbSymbol; /// true = Show as symbol. @@ -939,9 +939,9 @@ public: virtual ~XclImpDffConverter() override; /** Initializes the internal progress bar with the passed size and starts it. */ - void StartProgressBar( sal_Size nProgressSize ); + void StartProgressBar( std::size_t nProgressSize ); /** Increase the progress bar by the passed value. */ - void Progress( sal_Size nDelta = 1 ); + void Progress( std::size_t nDelta = 1 ); /** Initially called before the objects of the passed drawing manager are converted. */ void InitializeDrawing( XclImpDrawing& rDrawing, SdrModel& rSdrModel, SdrPage& rSdrPage ); @@ -1079,7 +1079,7 @@ public: /** Sets the object with the passed identification to be skipped on import. */ void SetSkipObj( sal_uInt16 nObjId ); /** Returns the size of the progress bar shown while processing all objects. */ - sal_Size GetProgressSize() const; + std::size_t GetProgressSize() const; /** Derived classes calculate the resulting rectangle of the passed anchor. */ virtual Rectangle CalcAnchorRect( const XclObjAnchor& rAnchor, bool bDffAnchor ) const = 0; @@ -1106,10 +1106,10 @@ private: void ReadTxo( XclImpStream& rStrm ); private: - typedef std::map< sal_Size, XclImpDrawObjRef > XclImpObjMap; + typedef std::map< std::size_t, XclImpDrawObjRef > XclImpObjMap; typedef std::map< sal_uInt16, XclImpDrawObjRef > XclImpObjMapById; typedef std::shared_ptr< XclImpObjTextData > XclImpObjTextRef; - typedef std::map< sal_Size, XclImpObjTextRef > XclImpObjTextMap; + typedef std::map< std::size_t, XclImpObjTextRef > XclImpObjTextMap; XclImpDrawObjVector maRawObjs; /// BIFF5 objects without DFF data. SvMemoryStream maDffStrm; /// Copy of the DFF page stream in memory. diff --git a/sc/source/filter/inc/xiname.hxx b/sc/source/filter/inc/xiname.hxx index 969fdae70520..a7e686c5556d 100644 --- a/sc/source/filter/inc/xiname.hxx +++ b/sc/source/filter/inc/xiname.hxx @@ -39,8 +39,8 @@ class XclImpName : protected XclImpRoot { XclImpStream& mrStrm; XclImpStreamPos maStrmPos; - sal_Size mnStrmPos; - sal_Size mnStrmSize; + std::size_t mnStrmPos; + std::size_t mnStrmSize; TokenStrmData( XclImpStream& rStrm ); }; diff --git a/sc/source/filter/inc/xistream.hxx b/sc/source/filter/inc/xistream.hxx index c0bc09bf36b4..4e0e63bd84e5 100644 --- a/sc/source/filter/inc/xistream.hxx +++ b/sc/source/filter/inc/xistream.hxx @@ -78,7 +78,7 @@ private: virtual bool OnVerifyEncryptionData( const css::uno::Sequence< css::beans::NamedValue >& rEncryptionData ) = 0; /** Implementation of updating the decrypter. */ - virtual void OnUpdate( sal_Size nOldStrmPos, sal_Size nNewStrmPos, sal_uInt16 nRecSize ) = 0; + virtual void OnUpdate( std::size_t nOldStrmPos, std::size_t nNewStrmPos, sal_uInt16 nRecSize ) = 0; /** Implementation of the decryption. */ virtual sal_uInt16 OnRead( SvStream& rStrm, sal_uInt8* pnData, sal_uInt16 nBytes ) = 0; @@ -105,7 +105,7 @@ private: OnVerifyPassword( const OUString& rPassword ) override; virtual bool OnVerifyEncryptionData( const css::uno::Sequence< css::beans::NamedValue >& rEncryptionData ) override; /** Implementation of updating the decrypter. */ - virtual void OnUpdate( sal_Size nOldStrmPos, sal_Size nNewStrmPos, sal_uInt16 nRecSize ) override; + virtual void OnUpdate( std::size_t nOldStrmPos, std::size_t nNewStrmPos, sal_uInt16 nRecSize ) override; /** Implementation of the decryption. */ virtual sal_uInt16 OnRead( SvStream& rStrm, sal_uInt8* pnData, sal_uInt16 nBytes ) override; @@ -134,14 +134,14 @@ private: OnVerifyPassword( const OUString& rPassword ) override; virtual bool OnVerifyEncryptionData( const css::uno::Sequence< css::beans::NamedValue >& rEncryptionData ) override; /** Implementation of updating the decrypter. */ - virtual void OnUpdate( sal_Size nOldStrmPos, sal_Size nNewStrmPos, sal_uInt16 nRecSize ) override; + virtual void OnUpdate( std::size_t nOldStrmPos, std::size_t nNewStrmPos, sal_uInt16 nRecSize ) override; /** Implementation of the decryption. */ virtual sal_uInt16 OnRead( SvStream& rStrm, sal_uInt8* pnData, sal_uInt16 nBytes ) override; /** Returns the block number corresponding to the passed stream position. */ - static sal_uInt32 GetBlock( sal_Size nStrmPos ); + static sal_uInt32 GetBlock( std::size_t nStrmPos ); /** Returns the block offset corresponding to the passed stream position. */ - static sal_uInt16 GetOffset( sal_Size nStrmPos ); + static sal_uInt16 GetOffset( std::size_t nStrmPos ); private: ::msfilter::MSCodec_Std97 maCodec; /// Crypto algorithm implementation. @@ -163,22 +163,22 @@ public: explicit XclImpStreamPos(); /** Sets the stream position data to the passed values. */ - void Set( const SvStream& rStrm, sal_Size nNextPos, sal_Size nCurrSize, + void Set( const SvStream& rStrm, std::size_t nNextPos, std::size_t nCurrSize, sal_uInt16 nRawRecId, sal_uInt16 nRawRecSize, sal_uInt16 nRawRecLeft, bool bValid ); /** Writes the contained stream position data to the given variables. */ - void Get( SvStream& rStrm, sal_Size& rnNextPos, sal_Size& rnCurrSize, + void Get( SvStream& rStrm, std::size_t& rnNextPos, std::size_t& rnCurrSize, sal_uInt16& rnRawRecId, sal_uInt16& rnRawRecSize, sal_uInt16& rnRawRecLeft, bool& rbValid ) const; /** Returns the stored stream position. */ - inline sal_Size GetPos() const { return mnPos; } + inline std::size_t GetPos() const { return mnPos; } private: - sal_Size mnPos; /// Absolute position of the stream. - sal_Size mnNextPos; /// Absolute position of next record. - sal_Size mnCurrSize; /// Current calculated size of the record. + std::size_t mnPos; /// Absolute position of the stream. + std::size_t mnNextPos; /// Absolute position of next record. + std::size_t mnCurrSize; /// Current calculated size of the record. sal_uInt16 mnRawRecId; /// Current raw record ID (including CONTINUEs). sal_uInt16 mnRawRecSize; /// Current raw record size (without following CONTINUEs). sal_uInt16 mnRawRecLeft; /// Bytes left in current raw record (without following CONTINUEs). @@ -258,7 +258,7 @@ public: /** Sets stream pointer to the start of the record content for the record at the passed absolute stream position. @return false = no record found (end of stream). */ - bool StartNextRecord( sal_Size nNextRecPos ); + bool StartNextRecord( std::size_t nNextRecPos ); /** Sets stream pointer to begin of record content. @param bContLookup Automatic CONTINUE lookup on/off. In difference to other stream settings, this setting is persistent until next call of @@ -312,15 +312,15 @@ public: /** Returns the current record ID. */ inline sal_uInt16 GetRecId() const { return mnRecId; } /** Returns the position inside of the whole record content. */ - sal_Size GetRecPos() const; + std::size_t GetRecPos() const; /** Returns the data size of the whole record without record headers. */ - sal_Size GetRecSize(); + std::size_t GetRecSize(); /** Returns remaining data size of the whole record without record headers. */ - sal_Size GetRecLeft(); + std::size_t GetRecLeft(); /** Returns the record ID of the following record. */ sal_uInt16 GetNextRecId(); - sal_uInt16 PeekRecId( sal_Size nPos ); + sal_uInt16 PeekRecId( std::size_t nPos ); SAL_WARN_UNUSED_RESULT sal_uInt8 ReaduInt8(); @@ -337,19 +337,19 @@ public: /** Reads nBytes bytes to the existing(!) buffer pData. @return Count of bytes really read. */ - sal_Size Read( void* pData, sal_Size nBytes ); + std::size_t Read( void* pData, std::size_t nBytes ); /** Copies nBytes bytes to rOutStrm. @return Count of bytes really written. */ - sal_Size CopyToStream( SvStream& rOutStrm, sal_Size nBytes ); + std::size_t CopyToStream( SvStream& rOutStrm, std::size_t nBytes ); /** Copies the entire record to rOutStrm. The current record position keeps unchanged. */ void CopyRecordToStream( SvStream& rOutStrm ); /** Seeks absolute in record content to the specified position. @descr The value 0 means start of record, independent from physical stream position. */ - void Seek( sal_Size nPos ); + void Seek( std::size_t nPos ); /** Seeks forward inside the current record. */ - void Ignore( sal_Size nBytes ); + void Ignore( std::size_t nBytes ); // *** special string functions *** --------------------------------------- @@ -373,12 +373,12 @@ public: /** Reads ext. header, detects 8/16 bit mode, sets all ext. info. @return Total size of ext. data. */ - sal_Size ReadUniStringExtHeader( + std::size_t ReadUniStringExtHeader( bool& rb16Bit, bool& rbRich, bool& rbFareast, sal_uInt16& rnFormatRuns, sal_uInt32& rnExtInf, sal_uInt8 nFlags ); /** Seeks to begin of character array, detects 8/16 bit mode. @return Total size of ext. data. */ - sal_Size ReadUniStringExtHeader( bool& rb16Bit, sal_uInt8 nFlags ); + std::size_t ReadUniStringExtHeader( bool& rb16Bit, sal_uInt8 nFlags ); /** Sets a replacement character for NUL characters. @descr NUL characters must be replaced, because Tools strings cannot @@ -416,9 +416,9 @@ public: // *** SvStream functions *** --------------------------------------------- /** Returns the absolute stream position. */ - inline sal_Size GetSvStreamPos() const { return mrStrm.Tell(); } + inline std::size_t GetSvStreamPos() const { return mrStrm.Tell(); } /** Returns the stream size. */ - inline sal_Size GetSvStreamSize() const { return mnStreamSize; } + inline std::size_t GetSvStreamSize() const { return mnStreamSize; } /** Stores current stream position into rPos. */ void StorePosition( XclImpStreamPos& rPos ); @@ -463,7 +463,7 @@ private: @return Copy of mbValid. */ bool EnsureRawReadSize( sal_uInt16 nBytes ); /** Returns the maximum size of raw data possible to read in one block. */ - sal_uInt16 GetMaxRawReadSize( sal_Size nBytes ) const; + sal_uInt16 GetMaxRawReadSize( std::size_t nBytes ) const; /** Reads and decrypts nBytes bytes to the existing(!) buffer pData. @return Count of bytes really read. */ @@ -489,10 +489,10 @@ private: bool mbGlobValidRec; /// Was user position a valid record? bool mbHasGlobPos; /// Is user position defined? - sal_Size mnStreamSize; /// Size of system stream. - sal_Size mnNextRecPos; /// Start of next record header. - sal_Size mnCurrRecSize; /// Helper for record position. - sal_Size mnComplRecSize; /// Size of complete record data (with CONTINUEs). + std::size_t mnStreamSize; /// Size of system stream. + std::size_t mnNextRecPos; /// Start of next record header. + std::size_t mnCurrRecSize; /// Helper for record position. + std::size_t mnComplRecSize; /// Size of complete record data (with CONTINUEs). bool mbHasComplRec; /// true = mnComplRecSize is valid. sal_uInt16 mnRecId; /// Current record ID (not the CONTINUE ID). diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx index 152d876c76ac..b47d4080d935 100644 --- a/sc/source/filter/inc/xlchart.hxx +++ b/sc/source/filter/inc/xlchart.hxx @@ -147,7 +147,7 @@ class XclRoot; // Constants and Enumerations ================================================= -const sal_Size EXC_CHART_PROGRESS_SIZE = 10; +const std::size_t EXC_CHART_PROGRESS_SIZE = 10; const sal_uInt16 EXC_CHART_AUTOROTATION = 0xFFFF; /// Automatic rotation, e.g. axis labels (internal use only). const sal_Int32 EXC_CHART_AXIS_NONE = -1; /// For internal use only. diff --git a/sc/source/filter/inc/xlstream.hxx b/sc/source/filter/inc/xlstream.hxx index 0f63f3251afe..0c45575199ed 100644 --- a/sc/source/filter/inc/xlstream.hxx +++ b/sc/source/filter/inc/xlstream.hxx @@ -25,8 +25,8 @@ // Constants ================================================================== -const sal_Size EXC_REC_SEEK_TO_BEGIN = 0; -const sal_Size EXC_REC_SEEK_TO_END = static_cast< sal_Size >( -1 ); +const std::size_t EXC_REC_SEEK_TO_BEGIN = 0; +const std::size_t EXC_REC_SEEK_TO_END = static_cast<std::size_t>( -1 ); const sal_uInt16 EXC_MAXRECSIZE_BIFF5 = 2080; const sal_uInt16 EXC_MAXRECSIZE_BIFF8 = 8224; diff --git a/sc/source/filter/lotus/filter.cxx b/sc/source/filter/lotus/filter.cxx index 6a7bf213ef38..eca690eb3b81 100644 --- a/sc/source/filter/lotus/filter.cxx +++ b/sc/source/filter/lotus/filter.cxx @@ -61,7 +61,7 @@ generate_Opcodes(LotusContext &rContext, SvStream& aStream, // #i76299# seems that SvStream::IsEof() does not work correctly aStream.Seek( STREAM_SEEK_TO_END ); - sal_Size nStrmSize = aStream.Tell(); + sal_uInt64 const nStrmSize = aStream.Tell(); aStream.Seek( STREAM_SEEK_TO_BEGIN ); while( !rContext.bEOF && !aStream.IsEof() && (aStream.Tell() < nStrmSize) ) { diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx index 2d2e675ad008..82d0f78f2c7a 100644 --- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx @@ -69,9 +69,9 @@ static void lcl_WriteDateTime( XclExpStream& rStrm, const DateTime& rDateTime ) // write string and fill rest of <nLength> with zero bytes // <nLength> is without string header -static void lcl_WriteFixedString( XclExpStream& rStrm, const XclExpString& rString, sal_Size nLength ) +static void lcl_WriteFixedString( XclExpStream& rStrm, const XclExpString& rString, std::size_t nLength ) { - sal_Size nStrBytes = rString.GetBufferSize(); + std::size_t nStrBytes = rString.GetBufferSize(); OSL_ENSURE( nLength >= nStrBytes, "lcl_WriteFixedString - String too long" ); if( rString.Len() > 0 ) rStrm << rString; @@ -88,7 +88,7 @@ static inline void lcl_GenerateGUID( sal_uInt8* pGUID, bool& rValidGUID ) static inline void lcl_WriteGUID( XclExpStream& rStrm, const sal_uInt8* pGUID ) { rStrm.SetSliceSize( 16 ); - for( sal_Size nIndex = 0; nIndex < 16; nIndex++ ) + for( std::size_t nIndex = 0; nIndex < 16; nIndex++ ) rStrm << pGUID[ nIndex ]; rStrm.SetSliceSize( 0 ); } @@ -121,7 +121,7 @@ sal_uInt16 XclExpUserBView::GetNum() const return 0x01A9; } -sal_Size XclExpUserBView::GetLen() const +std::size_t XclExpUserBView::GetLen() const { return 50 + ((sUsername.Len() > 0) ? sUsername.GetSize() : 0); } @@ -181,7 +181,7 @@ sal_uInt16 XclExpUsersViewBegin::GetNum() const return 0x01AA; } -sal_Size XclExpUsersViewBegin::GetLen() const +std::size_t XclExpUsersViewBegin::GetLen() const { return 64; } @@ -196,7 +196,7 @@ sal_uInt16 XclExpUsersViewEnd::GetNum() const return 0x01AB; } -sal_Size XclExpUsersViewEnd::GetLen() const +std::size_t XclExpUsersViewEnd::GetLen() const { return 2; } @@ -211,7 +211,7 @@ sal_uInt16 XclExpChTr0x0191::GetNum() const return 0x0191; } -sal_Size XclExpChTr0x0191::GetLen() const +std::size_t XclExpChTr0x0191::GetLen() const { return 2; } @@ -227,7 +227,7 @@ sal_uInt16 XclExpChTr0x0198::GetNum() const return 0x0198; } -sal_Size XclExpChTr0x0198::GetLen() const +std::size_t XclExpChTr0x0198::GetLen() const { return 4; } @@ -243,7 +243,7 @@ sal_uInt16 XclExpChTr0x0192::GetNum() const return 0x0192; } -sal_Size XclExpChTr0x0192::GetLen() const +std::size_t XclExpChTr0x0192::GetLen() const { return 512; } @@ -258,7 +258,7 @@ sal_uInt16 XclExpChTr0x0197::GetNum() const return 0x0197; } -sal_Size XclExpChTr0x0197::GetLen() const +std::size_t XclExpChTr0x0197::GetLen() const { return 2; } @@ -272,7 +272,7 @@ sal_uInt16 XclExpChTrEmpty::GetNum() const return nRecNum; } -sal_Size XclExpChTrEmpty::GetLen() const +std::size_t XclExpChTrEmpty::GetLen() const { return 0; } @@ -291,7 +291,7 @@ sal_uInt16 XclExpChTr0x0195::GetNum() const return 0x0195; } -sal_Size XclExpChTr0x0195::GetLen() const +std::size_t XclExpChTr0x0195::GetLen() const { return 162; } @@ -313,7 +313,7 @@ sal_uInt16 XclExpChTr0x0194::GetNum() const return 0x0194; } -sal_Size XclExpChTr0x0194::GetLen() const +std::size_t XclExpChTr0x0194::GetLen() const { return 162; } @@ -340,7 +340,7 @@ sal_uInt16 XclExpChTrHeader::GetNum() const return 0x0196; } -sal_Size XclExpChTrHeader::GetLen() const +std::size_t XclExpChTrHeader::GetLen() const { return 50; } @@ -531,7 +531,7 @@ sal_uInt16 XclExpChTrInfo::GetNum() const return 0x0138; } -sal_Size XclExpChTrInfo::GetLen() const +std::size_t XclExpChTrInfo::GetLen() const { return 158; } @@ -642,7 +642,7 @@ sal_uInt16 XclExpChTrTabId::GetNum() const return 0x013D; } -sal_Size XclExpChTrTabId::GetLen() const +std::size_t XclExpChTrTabId::GetLen() const { return nTabCount << 1; } @@ -743,7 +743,7 @@ void XclExpChTrAction::Save( XclExpStream& rStrm ) CompleteSaveAction( rStrm ); } -sal_Size XclExpChTrAction::GetLen() const +std::size_t XclExpChTrAction::GetLen() const { return GetHeaderByteCount() + GetActionByteCount(); } @@ -932,7 +932,7 @@ void XclExpChTrCellContent::GetCellData( rpData->mxTokArr = GetFormulaCompiler().CreateFormula( EXC_FMLATYPE_CELL, *pTokenArray, &pFmlCell->aPos, &rRefLog ); rpData->nType = EXC_CHTR_TYPE_FORMULA; - sal_Size nSize = rpData->mxTokArr->GetSize() + 3; + std::size_t nSize = rpData->mxTokArr->GetSize() + 3; for( XclExpRefLog::const_iterator aIt = rRefLog.begin(), aEnd = rRefLog.end(); aIt != aEnd; ++aIt ) { @@ -941,7 +941,7 @@ void XclExpChTrCellContent::GetCellData( else nSize += (aIt->mnFirstXclTab == aIt->mnLastXclTab) ? 6 : 8; } - rpData->nSize = ::std::min< sal_Size >( nSize, 0xFFFF ); + rpData->nSize = ::std::min< std::size_t >( nSize, 0xFFFF ); rXclLength1 = 0x00000052; rXclLength2 = 0x0018; } @@ -970,9 +970,9 @@ sal_uInt16 XclExpChTrCellContent::GetNum() const return 0x013B; } -sal_Size XclExpChTrCellContent::GetActionByteCount() const +std::size_t XclExpChTrCellContent::GetActionByteCount() const { - sal_Size nLen = 16; + std::size_t nLen = 16; if( pOldData ) nLen += pOldData->nSize; if( pNewData ) @@ -1166,7 +1166,7 @@ sal_uInt16 XclExpChTrInsert::GetNum() const return 0x0137; } -sal_Size XclExpChTrInsert::GetActionByteCount() const +std::size_t XclExpChTrInsert::GetActionByteCount() const { return 16; } @@ -1237,7 +1237,7 @@ sal_uInt16 XclExpChTrInsertTab::GetNum() const return 0x014D; } -sal_Size XclExpChTrInsertTab::GetActionByteCount() const +std::size_t XclExpChTrInsertTab::GetActionByteCount() const { return 276; } @@ -1304,7 +1304,7 @@ sal_uInt16 XclExpChTrMoveRange::GetNum() const return 0x0140; } -sal_Size XclExpChTrMoveRange::GetActionByteCount() const +std::size_t XclExpChTrMoveRange::GetActionByteCount() const { return 24; } @@ -1356,7 +1356,7 @@ sal_uInt16 XclExpChTr0x014A::GetNum() const return 0x014A; } -sal_Size XclExpChTr0x014A::GetActionByteCount() const +std::size_t XclExpChTr0x014A::GetActionByteCount() const { return 14; } @@ -1378,7 +1378,7 @@ void XclExpChTr0x014A::SaveXml( XclExpXmlStream& rStrm ) pStream->endElement( XML_rfmt ); } -sal_Size ExcXmlRecord::GetLen() const +std::size_t ExcXmlRecord::GetLen() const { return 0; } diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index daac9e2d20c4..8017afe57c08 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -864,7 +864,7 @@ sal_uInt16 XclTxo::GetNum() const return EXC_ID_TXO; } -sal_Size XclTxo::GetLen() const +std::size_t XclTxo::GetLen() const { return 18; } @@ -1194,7 +1194,7 @@ sal_uInt16 ExcBof8_Base::GetNum() const return 0x0809; } -sal_Size ExcBof8_Base::GetLen() const +std::size_t ExcBof8_Base::GetLen() const { return 16; } @@ -1237,7 +1237,7 @@ void ExcBundlesheet8::SaveCont( XclExpStream& rStrm ) rStrm << nGrbit << GetName(); } -sal_Size ExcBundlesheet8::GetLen() const +std::size_t ExcBundlesheet8::GetLen() const { // Text max 255 chars return 8 + GetName().GetBufferSize(); } @@ -1268,7 +1268,7 @@ sal_uInt16 XclObproj::GetNum() const return 0x00D3; } -sal_Size XclObproj::GetLen() const +std::size_t XclObproj::GetLen() const { return 0; } @@ -1289,7 +1289,7 @@ sal_uInt16 XclCodename::GetNum() const return 0x01BA; } -sal_Size XclCodename::GetLen() const +std::size_t XclCodename::GetLen() const { return aName.GetSize(); } @@ -1428,7 +1428,7 @@ sal_uInt16 ExcEScenario::GetNum() const return 0x00AF; } -sal_Size ExcEScenario::GetLen() const +std::size_t ExcEScenario::GetLen() const { return nRecLen; } @@ -1521,7 +1521,7 @@ sal_uInt16 ExcEScenarioManager::GetNum() const return 0x00AE; } -sal_Size ExcEScenarioManager::GetLen() const +std::size_t ExcEScenarioManager::GetLen() const { return 8; } @@ -1646,7 +1646,7 @@ sal_uInt16 XclCalccount::GetNum() const return 0x000C; } -sal_Size XclCalccount::GetLen() const +std::size_t XclCalccount::GetLen() const { return 2; } @@ -1673,7 +1673,7 @@ sal_uInt16 XclIteration::GetNum() const return 0x0011; } -sal_Size XclIteration::GetLen() const +std::size_t XclIteration::GetLen() const { return 2; } @@ -1700,7 +1700,7 @@ sal_uInt16 XclDelta::GetNum() const return 0x0010; } -sal_Size XclDelta::GetLen() const +std::size_t XclDelta::GetLen() const { return 8; } @@ -1797,8 +1797,8 @@ void XclExpWriteAccess::WriteBody( XclExpStream& rStrm ) 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }; - sal_Size nDataSize = sizeof(aData); - for (sal_Size i = 0; i < nDataSize; ++i) + std::size_t nDataSize = sizeof(aData); + for (std::size_t i = 0; i < nDataSize; ++i) rStrm << aData[i]; } diff --git a/sc/source/ui/unoobj/exceldetect.cxx b/sc/source/ui/unoobj/exceldetect.cxx index ae8f2e657af0..027febb19876 100644 --- a/sc/source/ui/unoobj/exceldetect.cxx +++ b/sc/source/ui/unoobj/exceldetect.cxx @@ -55,7 +55,7 @@ bool hasStream(const uno::Reference<io::XInputStream>& xInStream, const OUString return false; pStream->Seek(STREAM_SEEK_TO_END); - sal_Size nSize = pStream->Tell(); + sal_uInt64 const nSize = pStream->Tell(); pStream->Seek(0); if (!nSize) @@ -93,7 +93,7 @@ bool isExcel40(const uno::Reference<io::XInputStream>& xInStream) return false; pStream->Seek(STREAM_SEEK_TO_END); - sal_Size nSize = pStream->Tell(); + sal_uInt64 const nSize = pStream->Tell(); pStream->Seek(0); if (nSize < 4) @@ -117,7 +117,7 @@ bool isExcel40(const uno::Reference<io::XInputStream>& xInStream) // BOF record must be sized between 4 and 16 for BIFF 2, 3 and 4. return false; - sal_Size nPos = pStream->Tell(); + sal_uInt64 const nPos = pStream->Tell(); if (nSize - nPos < nBofSize) // BOF record doesn't have required bytes. return false; diff --git a/sd/source/filter/eppt/pptexanimations.cxx b/sd/source/filter/eppt/pptexanimations.cxx index adf8661a4125..30bb1a7276c4 100644 --- a/sd/source/filter/eppt/pptexanimations.cxx +++ b/sd/source/filter/eppt/pptexanimations.cxx @@ -876,7 +876,7 @@ void AnimationExporter::exportAnimNode( SvStream& rStrm, const Reference< XAnima WriteAnimationNode( rStrm, aAnim ); } -void AnimationExporter::GetUserData( const Sequence< NamedValue >& rUserData, const Any ** pAny, sal_Size nLen ) +void AnimationExporter::GetUserData( const Sequence< NamedValue >& rUserData, const Any ** pAny, std::size_t nLen ) { // storing user data into pAny, to allow direct access later memset( pAny, 0, nLen ); diff --git a/sd/source/filter/eppt/pptexanimations.hxx b/sd/source/filter/eppt/pptexanimations.hxx index 441264a523fa..81eace5c933c 100644 --- a/sd/source/filter/eppt/pptexanimations.hxx +++ b/sd/source/filter/eppt/pptexanimations.hxx @@ -122,7 +122,7 @@ public: static css::uno::Any convertAnimateValue( const css::uno::Any& rSource, const OUString& rAttributeName ); static bool GetNodeType( const css::uno::Reference< css::animations::XAnimationNode >& xNode, sal_Int16& nType ); static sal_Int16 GetFillMode( const css::uno::Reference< css::animations::XAnimationNode >& xNode, const sal_Int16 nFillDefault ); - static void GetUserData( const css::uno::Sequence< css::beans::NamedValue >& rUserData, const css::uno::Any ** pAny, sal_Size nLen ); + static void GetUserData( const css::uno::Sequence< css::beans::NamedValue >& rUserData, const css::uno::Any ** pAny, std::size_t nLen ); static sal_uInt32 TranslatePresetSubType( const sal_uInt32 nPresetClass, const sal_uInt32 nPresetId, const OUString& rPresetSubType ); static sal_uInt32 GetPresetID( const OUString& rPreset, sal_uInt32 nAPIPresetClass, bool& bPresetId ); static sal_uInt32 GetValueTypeForAttributeName( const OUString& rAttributeName ); diff --git a/sd/source/filter/ppt/pptatom.cxx b/sd/source/filter/ppt/pptatom.cxx index 5536d2a55d4a..786ba6d1ad78 100644 --- a/sd/source/filter/ppt/pptatom.cxx +++ b/sd/source/filter/ppt/pptatom.cxx @@ -37,9 +37,9 @@ Atom::Atom( const DffRecordHeader& rRecordHeader, SvStream& rStream ) Atom* pLastAtom = nullptr; // retrieve file size (to allow sanity checks) - const sal_Size nStreamPos = mrStream.Tell(); + sal_uInt64 const nStreamPos = mrStream.Tell(); mrStream.Seek( STREAM_SEEK_TO_END ); - const sal_Size nStreamSize = mrStream.Tell(); + sal_uInt64 const nStreamSize = mrStream.Tell(); mrStream.Seek( nStreamPos ); while( (mrStream.GetError() == 0 ) diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index d658a1a81656..b8872e307452 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -770,7 +770,7 @@ OutlineToImpressFinalizer::OutlineToImpressFinalizer ( // Create a memory stream and prepare to fill it with the content of // the original stream. mpStream.reset(new SvMemoryStream()); - static const sal_Size nBufferSize = 4096; + static const std::size_t nBufferSize = 4096; ::std::unique_ptr<sal_Int8[]> pBuffer (new sal_Int8[nBufferSize]); sal_uInt64 nReadPosition(0); @@ -778,7 +778,7 @@ OutlineToImpressFinalizer::OutlineToImpressFinalizer ( while (bLoop) { // Read the next part of the original stream. - sal_Size nReadByteCount (0); + std::size_t nReadByteCount (0); const ErrCode nErrorCode ( rBytes.ReadAt( nReadPosition, diff --git a/sfx2/source/bastyp/mieclip.cxx b/sfx2/source/bastyp/mieclip.cxx index 00d1e52f1bae..65c2fee624a1 100644 --- a/sfx2/source/bastyp/mieclip.cxx +++ b/sfx2/source/bastyp/mieclip.cxx @@ -66,7 +66,7 @@ SvStream* MSE40HTMLClipFormatObj::IsValid( SvStream& rStream ) sBaseURL = OStringToOUString( sLine.copy(nIndex), RTL_TEXTENCODING_UTF8 ); if (nEnd >= 0 && nStt >= 0 && - (!sBaseURL.isEmpty() || rStream.Tell() >= static_cast<sal_Size>(nStt))) + (!sBaseURL.isEmpty() || rStream.Tell() >= static_cast<sal_uInt64>(nStt))) { bRet = true; break; diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx index d994d7e4ff2b..ac5dd5affeb0 100644 --- a/sfx2/source/bastyp/sfxhtml.cxx +++ b/sfx2/source/bastyp/sfxhtml.cxx @@ -251,7 +251,7 @@ bool SfxHTMLParser::FinishFileDownload( OUString& rStr ) aStream.WriteStream( *pStream ); aStream.Seek( STREAM_SEEK_TO_END ); - sal_Size nLen = aStream.Tell(); + sal_uInt64 const nLen = aStream.Tell(); aStream.Seek( 0 ); OString sBuffer = read_uInt8s_ToOString(aStream, nLen); rStr = OStringToOUString( sBuffer, RTL_TEXTENCODING_UTF8 ); diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx index 027c0b759e68..809200f95987 100644 --- a/sfx2/source/doc/oleprops.cxx +++ b/sfx2/source/doc/oleprops.cxx @@ -277,7 +277,7 @@ OUString SfxOleStringHelper::ImplLoadString8( SvStream& rStrm ) const { // load character buffer ::std::vector< sal_Char > aBuffer( static_cast< size_t >( nSize + 1 ), 0 ); - rStrm.ReadBytes(&aBuffer.front(), static_cast<sal_Size>(nSize)); + rStrm.ReadBytes(&aBuffer.front(), static_cast<std::size_t>(nSize)); // create string from encoded character array aValue = OUString( &aBuffer.front(), strlen( &aBuffer.front() ), GetTextEncoding() ); } @@ -1012,7 +1012,7 @@ void SfxOleSection::ImplSave( SvStream& rStrm ) rStrm.WriteUInt32( 0 ).WriteInt32( nPropCount ); // write placeholders for property ID/position pairs - sal_Size nPropPosPos = rStrm.Tell(); + sal_uInt64 nPropPosPos = rStrm.Tell(); rStrm.SeekRel( static_cast< sal_sSize >( 8 * nPropCount ) ); // write dictionary property @@ -1033,7 +1033,7 @@ void SfxOleSection::ImplSave( SvStream& rStrm ) bool SfxOleSection::SeekToPropertyPos( SvStream& rStrm, sal_uInt32 nPropPos ) const { - rStrm.Seek( static_cast< sal_Size >( mnStartPos + nPropPos ) ); + rStrm.Seek( static_cast< std::size_t >( mnStartPos + nPropPos ) ); return rStrm.GetErrorCode() == SVSTREAM_OK; } @@ -1076,7 +1076,7 @@ void SfxOleSection::LoadProperty( SvStream& rStrm, sal_Int32 nPropId ) } } -void SfxOleSection::SaveProperty( SvStream& rStrm, SfxOlePropertyBase& rProp, sal_Size& rnPropPosPos ) +void SfxOleSection::SaveProperty( SvStream& rStrm, SfxOlePropertyBase& rProp, sal_uInt64 & rnPropPosPos ) { rStrm.Seek( STREAM_SEEK_TO_END ); sal_uInt32 nPropPos = static_cast< sal_uInt32 >( rStrm.Tell() - mnStartPos ); @@ -1173,7 +1173,7 @@ void SfxOlePropertySet::ImplLoad( SvStream& rStrm ) rStrm.ReadInt32( nSectCount ); // read sections - sal_Size nSectPosPos = rStrm.Tell(); + sal_uInt64 nSectPosPos = rStrm.Tell(); for (sal_Int32 nSectIdx = 0; nSectIdx < nSectCount; ++nSectIdx) { // read section guid/position pair @@ -1206,7 +1206,7 @@ void SfxOlePropertySet::ImplSave( SvStream& rStrm ) rStrm .WriteInt32( nSectCount ); // number of sections // write placeholders for section guid/position pairs - sal_Size nSectPosPos = rStrm.Tell(); + sal_uInt64 nSectPosPos = rStrm.Tell(); rStrm.SeekRel( static_cast< sal_sSize >( 20 * nSectCount ) ); // write sections diff --git a/sfx2/source/doc/oleprops.hxx b/sfx2/source/doc/oleprops.hxx index ebbf4fa6c1d2..a4190a20ea47 100644 --- a/sfx2/source/doc/oleprops.hxx +++ b/sfx2/source/doc/oleprops.hxx @@ -333,13 +333,13 @@ private: bool SeekToPropertyPos( SvStream& rStrm, sal_uInt32 nPropPos ) const; void LoadProperty( SvStream& rStrm, sal_Int32 nPropId ); - void SaveProperty( SvStream& rStrm, SfxOlePropertyBase& rProp, sal_Size& rnPropPosPos ); + void SaveProperty( SvStream& rStrm, SfxOlePropertyBase& rProp, sal_uInt64 & rnPropPosPos ); private: SfxOlePropMap maPropMap; /// All properties in this section, by identifier. SfxOleCodePageProperty maCodePageProp; /// The codepage property. SfxOleDictionaryProperty maDictProp; /// The dictionary property. - sal_Size mnStartPos; /// Start stream position of the section. + sal_uInt64 mnStartPos; /// Start stream position of the section. bool mbSupportsDict; /// true = section supports dictionary. }; diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx index 68667cec8320..55859d28a30c 100644 --- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx +++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx @@ -494,14 +494,14 @@ namespace virtual uno::Sequence< rendering::RGBColor > SAL_CALL convertToRGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const double* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::RGBColor > aRes(nLen/4); rendering::RGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::RGBColor(pIn[0],pIn[1],pIn[2]); pIn += 4; @@ -511,14 +511,14 @@ namespace virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertToARGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const double* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::ARGBColor(pIn[3],pIn[0],pIn[1],pIn[2]); pIn += 4; @@ -528,14 +528,14 @@ namespace virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertToPARGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const double* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::ARGBColor(pIn[3],pIn[3]*pIn[0],pIn[3]*pIn[1],pIn[3]*pIn[2]); pIn += 4; @@ -545,11 +545,11 @@ namespace virtual uno::Sequence< double > SAL_CALL convertFromRGB( const uno::Sequence< rendering::RGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::RGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< double > aRes(nLen*4); double* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = pIn->Red; *pColors++ = pIn->Green; @@ -562,11 +562,11 @@ namespace virtual uno::Sequence< double > SAL_CALL convertFromARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< double > aRes(nLen*4); double* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = pIn->Red; *pColors++ = pIn->Green; @@ -579,11 +579,11 @@ namespace virtual uno::Sequence< double > SAL_CALL convertFromPARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< double > aRes(nLen*4); double* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = pIn->Red/pIn->Alpha; *pColors++ = pIn->Green/pIn->Alpha; @@ -614,14 +614,14 @@ namespace if( dynamic_cast<OGLColorSpace*>(targetColorSpace.get()) ) { const sal_Int8* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence<double> aRes(nLen); double* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = vcl::unotools::toDoubleColor(*pIn++); *pOut++ = vcl::unotools::toDoubleColor(*pIn++); @@ -660,14 +660,14 @@ namespace virtual uno::Sequence< rendering::RGBColor > SAL_CALL convertIntegerToRGB( const uno::Sequence< sal_Int8 >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const sal_Int8* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::RGBColor > aRes(nLen/4); rendering::RGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::RGBColor( vcl::unotools::toDoubleColor(pIn[0]), @@ -681,14 +681,14 @@ namespace virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertIntegerToARGB( const uno::Sequence< sal_Int8 >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const sal_Int8* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::ARGBColor( vcl::unotools::toDoubleColor(pIn[3]), @@ -703,14 +703,14 @@ namespace virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertIntegerToPARGB( const uno::Sequence< sal_Int8 >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const sal_Int8* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { const sal_Int8 nAlpha( pIn[3] ); *pOut++ = rendering::ARGBColor( @@ -726,11 +726,11 @@ namespace virtual uno::Sequence< sal_Int8 > SAL_CALL convertIntegerFromRGB( const uno::Sequence< rendering::RGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::RGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< sal_Int8 > aRes(nLen*4); sal_Int8* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = vcl::unotools::toByteColor(pIn->Red); *pColors++ = vcl::unotools::toByteColor(pIn->Green); @@ -744,11 +744,11 @@ namespace virtual uno::Sequence< sal_Int8 > SAL_CALL convertIntegerFromARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< sal_Int8 > aRes(nLen*4); sal_Int8* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = vcl::unotools::toByteColor(pIn->Red); *pColors++ = vcl::unotools::toByteColor(pIn->Green); @@ -762,11 +762,11 @@ namespace virtual uno::Sequence< sal_Int8 > SAL_CALL convertIntegerFromPARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< sal_Int8 > aRes(nLen*4); sal_Int8* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = vcl::unotools::toByteColor(pIn->Red/pIn->Alpha); *pColors++ = vcl::unotools::toByteColor(pIn->Green/pIn->Alpha); diff --git a/slideshow/source/engine/shapes/appletshape.cxx b/slideshow/source/engine/shapes/appletshape.cxx index 17aa2ec61833..30808b598325 100644 --- a/slideshow/source/engine/shapes/appletshape.cxx +++ b/slideshow/source/engine/shapes/appletshape.cxx @@ -69,7 +69,7 @@ namespace slideshow double nPrio, const OUString& rServiceName, const char** pPropCopyTable, - sal_Size nNumPropEntries, + std::size_t nNumPropEntries, const SlideShowContext& rContext ); // throw ShapeLoadFailedException; private: @@ -97,7 +97,7 @@ namespace slideshow const OUString maServiceName; const char** mpPropCopyTable; - const sal_Size mnNumPropEntries; + const std::size_t mnNumPropEntries; /// the list of active view shapes (one for each registered view layer) typedef ::std::vector< ViewAppletShapeSharedPtr > ViewAppletShapeVector; @@ -109,7 +109,7 @@ namespace slideshow double nPrio, const OUString& rServiceName, const char** pPropCopyTable, - sal_Size nNumPropEntries, + std::size_t nNumPropEntries, const SlideShowContext& rContext ) : ExternalShapeBase( xShape, nPrio, rContext ), maServiceName( rServiceName ), @@ -271,7 +271,7 @@ namespace slideshow double nPrio, const OUString& rServiceName, const char** pPropCopyTable, - sal_Size nNumPropEntries, + std::size_t nNumPropEntries, const SlideShowContext& rContext ) { std::shared_ptr< AppletShape > pAppletShape( diff --git a/slideshow/source/engine/shapes/appletshape.hxx b/slideshow/source/engine/shapes/appletshape.hxx index 979752588cc1..84d5f07d1ac2 100644 --- a/slideshow/source/engine/shapes/appletshape.hxx +++ b/slideshow/source/engine/shapes/appletshape.hxx @@ -40,7 +40,7 @@ namespace slideshow double nPrio, const OUString& rServiceName, const char** pPropCopyTable, - sal_Size nNumPropEntries, + std::size_t nNumPropEntries, const SlideShowContext& rContext ); } } diff --git a/slideshow/source/engine/shapes/viewappletshape.cxx b/slideshow/source/engine/shapes/viewappletshape.cxx index 2b1ec969c6ae..c9de11fb34fd 100644 --- a/slideshow/source/engine/shapes/viewappletshape.cxx +++ b/slideshow/source/engine/shapes/viewappletshape.cxx @@ -61,7 +61,7 @@ namespace slideshow const uno::Reference< drawing::XShape >& rxShape, const OUString& rServiceName, const char** pPropCopyTable, - sal_Size nNumPropEntries, + std::size_t nNumPropEntries, const uno::Reference< uno::XComponentContext >& rxContext ) : mpViewLayer( rViewLayer ), mxViewer(), @@ -88,7 +88,7 @@ namespace slideshow // copy shape properties to applet viewer OUString aPropName; - for( sal_Size i=0; i<nNumPropEntries; ++i ) + for( std::size_t i=0; i<nNumPropEntries; ++i ) { aPropName = OUString::createFromAscii( pPropCopyTable[i] ); xViewerPropSet->setPropertyValue( aPropName, diff --git a/slideshow/source/engine/shapes/viewappletshape.hxx b/slideshow/source/engine/shapes/viewappletshape.hxx index 67075093e708..26d8b6ce004a 100644 --- a/slideshow/source/engine/shapes/viewappletshape.hxx +++ b/slideshow/source/engine/shapes/viewappletshape.hxx @@ -75,7 +75,7 @@ namespace slideshow const css::uno::Reference< css::drawing::XShape >& rxShape, const OUString& rServiceName, const char** pPropCopyTable, - sal_Size nNumPropEntries, + std::size_t nNumPropEntries, const css::uno::Reference< css::uno::XComponentContext >& rxContext ); /** destroy the object diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx index 48147043691e..a13a68ff6d2f 100644 --- a/sot/source/sdstor/stgole.cxx +++ b/sot/source/sdstor/stgole.cxx @@ -48,7 +48,7 @@ StgInternalStream::~StgInternalStream() delete m_pStrm; } -sal_uLong StgInternalStream::GetData( void* pData, sal_uLong nSize ) +std::size_t StgInternalStream::GetData(void* pData, std::size_t nSize) { if( m_pStrm ) { @@ -60,7 +60,7 @@ sal_uLong StgInternalStream::GetData( void* pData, sal_uLong nSize ) return 0; } -sal_uLong StgInternalStream::PutData( const void* pData, sal_uLong nSize ) +std::size_t StgInternalStream::PutData(const void* pData, std::size_t nSize) { if( m_pStrm ) { diff --git a/sot/source/sdstor/stgole.hxx b/sot/source/sdstor/stgole.hxx index 80a090ea3943..30d8ab3336cb 100644 --- a/sot/source/sdstor/stgole.hxx +++ b/sot/source/sdstor/stgole.hxx @@ -28,8 +28,8 @@ class StgInternalStream : public SvStream { BaseStorageStream* m_pStrm; - virtual sal_uLong GetData( void* pData, sal_uLong nSize ) override; - virtual sal_uLong PutData( const void* pData, sal_uLong nSize ) override; + virtual std::size_t GetData(void* pData, std::size_t nSize) override; + virtual std::size_t PutData(const void* pData, std::size_t nSize) override; virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) override; virtual void FlushData() override; public: diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index 92473d0bca47..7063a4ce99d3 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -1258,7 +1258,7 @@ void StgTmpStrm::SetSize(sal_uInt64 n) } } -sal_Size StgTmpStrm::GetData( void* pData, sal_Size n ) +std::size_t StgTmpStrm::GetData( void* pData, std::size_t n ) { if( m_pStrm ) { @@ -1270,7 +1270,7 @@ sal_Size StgTmpStrm::GetData( void* pData, sal_Size n ) return SvMemoryStream::GetData( pData, n ); } -sal_Size StgTmpStrm::PutData( const void* pData, sal_Size n ) +std::size_t StgTmpStrm::PutData( const void* pData, std::size_t n ) { sal_uInt32 nCur = Tell(); sal_uInt32 nNew = nCur + n; diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx index 739cc124aac6..e523e98a924f 100644 --- a/sot/source/sdstor/stgstrms.hxx +++ b/sot/source/sdstor/stgstrms.hxx @@ -145,8 +145,8 @@ class StgTmpStrm : public SvMemoryStream OUString m_aName; SvFileStream* m_pStrm; using SvMemoryStream::GetData; - virtual sal_Size GetData( void* pData, sal_Size nSize ) override; - virtual sal_Size PutData( const void* pData, sal_Size nSize ) override; + virtual std::size_t GetData( void* pData, std::size_t nSize ) override; + virtual std::size_t PutData( const void* pData, std::size_t nSize ) override; virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) override; virtual void FlushData() override; diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index 3d26f5c12116..1c3d5807726a 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -100,9 +100,9 @@ void SotStorageStream::ResetError() pOwnStm->ResetError(); } -sal_uLong SotStorageStream::GetData( void* pData, sal_uLong nSize ) +std::size_t SotStorageStream::GetData(void* pData, std::size_t const nSize) { - sal_uLong nRet = 0; + std::size_t nRet = 0; if( pOwnStm ) { @@ -115,9 +115,9 @@ sal_uLong SotStorageStream::GetData( void* pData, sal_uLong nSize ) return nRet; } -sal_uLong SotStorageStream::PutData( const void* pData, sal_uLong nSize ) +std::size_t SotStorageStream::PutData(const void* pData, std::size_t const nSize) { - sal_uLong nRet = 0; + std::size_t nRet = 0; if( pOwnStm ) { diff --git a/sot/source/sdstor/storinfo.cxx b/sot/source/sdstor/storinfo.cxx index 1c5025bf13f2..f2813a238db9 100644 --- a/sot/source/sdstor/storinfo.cxx +++ b/sot/source/sdstor/storinfo.cxx @@ -36,7 +36,7 @@ SotClipboardFormatId ReadClipboardFormat( SvStream & rStm ) { // get a string name std::unique_ptr<sal_Char[]> p(new( ::std::nothrow ) sal_Char[ nLen ]); - if (p && rStm.ReadBytes(p.get(), nLen) == static_cast<sal_Size>(nLen)) + if (p && rStm.ReadBytes(p.get(), nLen) == static_cast<std::size_t>(nLen)) { nFormat = SotExchange::RegisterFormatName(OUString(p.get(), nLen-1, RTL_TEXTENCODING_ASCII_US)); } diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index e5078b682d73..d352537b4222 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -405,8 +405,8 @@ class UCBStorageStream_Impl : public SvRefBase, public SvStream virtual ~UCBStorageStream_Impl() override; public: - virtual sal_uLong GetData( void* pData, sal_uLong nSize ) override; - virtual sal_uLong PutData( const void* pData, sal_uLong nSize ) override; + virtual std::size_t GetData(void* pData, std::size_t nSize) override; + virtual std::size_t PutData(const void* pData, std::size_t nSize) override; virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) override; virtual void SetSize( sal_uInt64 nSize ) override; virtual void FlushData() override; @@ -869,9 +869,9 @@ void UCBStorageStream_Impl::CopySourceToTemporary() // UCBStorageStream_Impl must have a SvStream interface, because it then can be used as underlying stream // of an OLEStorage; so every write access caused by storage operations marks the UCBStorageStream as modified -sal_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize ) +std::size_t UCBStorageStream_Impl::GetData(void* pData, std::size_t const nSize) { - sal_uLong aResult = 0; + std::size_t aResult = 0; if( !Init() ) return 0; @@ -884,13 +884,13 @@ sal_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize ) // read the tail of the data from original stream // copy this tail to the temporary stream - sal_uLong aToRead = nSize - aResult; + std::size_t aToRead = nSize - aResult; pData = static_cast<void*>( static_cast<char*>(pData) + aResult ); try { Sequence<sal_Int8> aData( aToRead ); - sal_uLong aReaded = m_rSource->readBytes( aData, aToRead ); + std::size_t aReaded = m_rSource->readBytes( aData, aToRead ); aResult += m_pStream->WriteBytes(static_cast<void*>(aData.getArray()), aReaded); memcpy( pData, aData.getArray(), aReaded ); } @@ -907,7 +907,7 @@ sal_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize ) return aResult; } -sal_uLong UCBStorageStream_Impl::PutData( const void* pData, sal_uLong nSize ) +std::size_t UCBStorageStream_Impl::PutData(const void* pData, std::size_t const nSize) { if ( !(m_nMode & StreamMode::WRITE) ) { @@ -918,7 +918,7 @@ sal_uLong UCBStorageStream_Impl::PutData( const void* pData, sal_uLong nSize ) if( !nSize || !Init() ) return 0; - sal_uLong aResult = m_pStream->WriteBytes( pData, nSize ); + std::size_t aResult = m_pStream->WriteBytes( pData, nSize ); m_bModified = aResult > 0; diff --git a/store/source/storbase.cxx b/store/source/storbase.cxx index 4bdc5dd5fe02..bb2cf277fd04 100644 --- a/store/source/storbase.cxx +++ b/store/source/storbase.cxx @@ -113,8 +113,8 @@ storeError PageData::Allocator_Impl::initialize (sal_uInt16 nPageSize) { char name[RTL_CACHE_NAME_LENGTH + 1]; - sal_Size size = sal::static_int_cast< sal_Size >(nPageSize); - (void) snprintf (name, sizeof(name), "store_page_alloc_%" SAL_PRIuUINTPTR, size); + std::size_t size = sal::static_int_cast<std::size_t>(nPageSize); + (void) snprintf (name, sizeof(name), "store_page_alloc_%" SAL_PRI_SIZET "u", size); m_page_cache = rtl_cache_create (name, size, 0, nullptr, nullptr, nullptr, nullptr, nullptr, 0); if (!m_page_cache) diff --git a/store/source/storcach.cxx b/store/source/storcach.cxx index 1f5e147c29a8..d8449be56440 100644 --- a/store/source/storcach.cxx +++ b/store/source/storcach.cxx @@ -133,7 +133,7 @@ void EntryCache::destroy (Entry * entry) } // highbit():= log2() + 1 (complexity O(1)) -static int highbit(sal_Size n) +static int highbit(std::size_t n) { int k = 1; @@ -190,7 +190,7 @@ PageCache::PageCache (sal_uInt16 nPageSize) PageCache::~PageCache() { double s_x = 0.0; - sal_Size i, n = m_hash_size; + std::size_t i, n = m_hash_size; for (i = 0; i < n; i++) { int x = 0; @@ -219,15 +219,15 @@ PageCache::~PageCache() OSL_TRACE("Hits: %zu, Misses: %zu", m_nHit, m_nMissed); } -void PageCache::rescale_Impl (sal_Size new_size) +void PageCache::rescale_Impl (std::size_t new_size) { - sal_Size new_bytes = new_size * sizeof(Entry*); + std::size_t new_bytes = new_size * sizeof(Entry*); Entry ** new_table = static_cast<Entry**>(rtl_allocateMemory(new_bytes)); if (new_table != nullptr) { Entry ** old_table = m_hash_table; - sal_Size old_size = m_hash_size; + std::size_t old_size = m_hash_size; SAL_INFO( "store", @@ -241,7 +241,7 @@ void PageCache::rescale_Impl (sal_Size new_size) m_hash_size = new_size; m_hash_shift = highbit(m_hash_size) - 1; - sal_Size i; + std::size_t i; for (i = 0; i < old_size; i++) { Entry * curr = old_table[i]; @@ -276,7 +276,7 @@ Entry * PageCache::lookup_Impl (Entry * entry, sal_uInt32 nOffset) } if (lookups > 2) { - sal_Size new_size = m_hash_size, ave = m_hash_entries >> m_hash_shift; + std::size_t new_size = m_hash_size, ave = m_hash_entries >> m_hash_shift; for (; ave > 4; new_size *= 2, ave /= 2) continue; if (new_size != m_hash_size) diff --git a/store/source/storcach.hxx b/store/source/storcach.hxx index b9febd35f213..5125160dd7b9 100644 --- a/store/source/storcach.hxx +++ b/store/source/storcach.hxx @@ -65,7 +65,7 @@ class PageCache : } Entry * lookup_Impl (Entry * entry, sal_uInt32 nOffset); - void rescale_Impl (sal_Size new_size); + void rescale_Impl (std::size_t new_size); public: // Construction diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index 8bded0f5b695..01391b81465d 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -104,7 +104,7 @@ Primitive2DSequence Test::parseSvg(const char* aSource) OUString aPath = m_directories.getPathFromSrc(aSource); SvFileStream aFileStream(aUrl, StreamMode::READ); - sal_Size nSize = aFileStream.remainingSize(); + std::size_t nSize = aFileStream.remainingSize(); std::unique_ptr<sal_Int8[]> pBuffer(new sal_Int8[nSize + 1]); aFileStream.ReadBytes(pBuffer.get(), nSize); pBuffer[nSize] = 0; diff --git a/svl/source/items/lckbitem.cxx b/svl/source/items/lckbitem.cxx index 9126580162e5..bda67f85936a 100644 --- a/svl/source/items/lckbitem.cxx +++ b/svl/source/items/lckbitem.cxx @@ -141,7 +141,7 @@ bool SfxLockBytesItem::QueryValue( css::uno::Any& rVal, sal_uInt8 ) const else return false; - sal_uLong nRead = 0; + std::size_t nRead = 0; css::uno::Sequence< sal_Int8 > aSeq( nLen ); _xVal->ReadAt( 0, aSeq.getArray(), nLen, &nRead ); diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx index 0f2749a9051a..f62b31f06b55 100644 --- a/svl/source/misc/inettype.cxx +++ b/svl/source/misc/inettype.cxx @@ -118,7 +118,7 @@ inline TypeIDMapEntry * Registration::getEntry(INetContentType eTypeID) } MediaTypeEntry const * seekEntry(OUString const & rTypeName, - MediaTypeEntry const * pMap, sal_Size nSize); + MediaTypeEntry const * pMap, std::size_t nSize); /** A mapping from type names to type ids and extensions. Sorted by type name. @@ -499,21 +499,21 @@ namespace { MediaTypeEntry const * seekEntry(OUString const & rTypeName, - MediaTypeEntry const * pMap, sal_Size nSize) + MediaTypeEntry const * pMap, std::size_t nSize) { #if defined DBG_UTIL - for (sal_Size i = 0; i < nSize - 1; ++i) + for (std::size_t i = 0; i < nSize - 1; ++i) DBG_ASSERT( rtl_str_compare( pMap[i].m_pTypeName, pMap[i + 1].m_pTypeName) < 0, "seekEntry(): Bad map"); #endif - sal_Size nLow = 0; - sal_Size nHigh = nSize; + std::size_t nLow = 0; + std::size_t nHigh = nSize; while (nLow != nHigh) { - sal_Size nMiddle = (nLow + nHigh) / 2; + std::size_t nMiddle = (nLow + nHigh) / 2; MediaTypeEntry const * pEntry = pMap + nMiddle; sal_Int32 nCmp = rTypeName.compareToIgnoreAsciiCaseAscii(pEntry->m_pTypeName); if (nCmp < 0) @@ -582,7 +582,7 @@ OUString INetContentTypes::GetContentType(INetContentType eTypeID) static bool bInitialized = false; if (!bInitialized) { - for (sal_Size i = 0; i <= CONTENT_TYPE_LAST; ++i) + for (std::size_t i = 0; i <= CONTENT_TYPE_LAST; ++i) aMap[aStaticTypeNameMap[i].m_eTypeID] = aStaticTypeNameMap[i].m_pTypeName; aMap[CONTENT_TYPE_UNKNOWN] = CONTENT_TYPE_STR_APP_OCTSTREAM; aMap[CONTENT_TYPE_TEXT_PLAIN] = CONTENT_TYPE_STR_TEXT_PLAIN diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx index f29b7663ca36..3e1c17954080 100644 --- a/svl/source/misc/strmadpt.cxx +++ b/svl/source/misc/strmadpt.cxx @@ -139,7 +139,7 @@ bool SvInputStream::open() } // virtual -sal_uLong SvInputStream::GetData(void * pData, sal_uLong nSize) +std::size_t SvInputStream::GetData(void * pData, std::size_t const nSize) { if (!open()) { @@ -168,8 +168,8 @@ sal_uLong SvInputStream::GetData(void * pData, sal_uLong nSize) { sal_Int32 nRemain = sal_Int32( - std::min(sal_uLong(nSize - nRead), - sal_uLong(std::numeric_limits< sal_Int32 >::max()))); + std::min(std::size_t(nSize - nRead), + std::size_t(std::numeric_limits<sal_Int32>::max()))); if (nRemain == 0) break; uno::Sequence< sal_Int8 > aBuffer; @@ -205,8 +205,8 @@ sal_uLong SvInputStream::GetData(void * pData, sal_uLong nSize) sal_Int32 nRemain = sal_Int32( std::min( - sal_uLong(nSize - nRead), - sal_uLong(std::numeric_limits< sal_Int32 >::max()))); + std::size_t(nSize - nRead), + std::size_t(std::numeric_limits<sal_Int32>::max()))); if (nRemain == 0) break; uno::Sequence< sal_Int8 > aBuffer; @@ -235,7 +235,7 @@ sal_uLong SvInputStream::GetData(void * pData, sal_uLong nSize) } // virtual -sal_uLong SvInputStream::PutData(void const *, sal_uLong) +std::size_t SvInputStream::PutData(void const *, std::size_t) { SetError(ERRCODE_IO_NOTSUPPORTED); return 0; @@ -265,7 +265,7 @@ sal_uInt64 SvInputStream::SeekPos(sal_uInt64 const nPos) < STREAM_SEEK_TO_END) { m_nSeekedFrom = Tell(); - return sal_uLong(nLength); + return sal_uInt64(nLength); } } catch (const io::IOException&) @@ -347,27 +347,27 @@ SvInputStream::~SvInputStream() // SvOutputStream // virtual -sal_uLong SvOutputStream::GetData(void *, sal_uLong) +std::size_t SvOutputStream::GetData(void *, std::size_t) { SetError(ERRCODE_IO_NOTSUPPORTED); return 0; } // virtual -sal_uLong SvOutputStream::PutData(void const * pData, sal_uLong nSize) +std::size_t SvOutputStream::PutData(void const * pData, std::size_t nSize) { if (!m_xStream.is()) { SetError(ERRCODE_IO_CANTWRITE); return 0; } - sal_uLong nWritten = 0; + std::size_t nWritten = 0; for (;;) { sal_Int32 nRemain = sal_Int32( - std::min(sal_uLong(nSize - nWritten), - sal_uLong(std::numeric_limits< sal_Int32 >::max()))); + std::min(std::size_t(nSize - nWritten), + std::size_t(std::numeric_limits<sal_Int32>::max()))); if (nRemain == 0) break; try diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 656d17c68260..fd4c9ff7f183 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -1430,7 +1430,7 @@ Reference< XInputStream > SdrGrafObj::getInputStream() sal_uInt8 * pBuffer = new sal_uInt8[ nSize ]; memcpy( pBuffer, pSourceData, nSize ); - SvMemoryStream* pStream = new SvMemoryStream( static_cast<void*>(pBuffer), (sal_Size)nSize, StreamMode::READ ); + SvMemoryStream* pStream = new SvMemoryStream( static_cast<void*>(pBuffer), (std::size_t)nSize, StreamMode::READ ); pStream->ObjectOwnsMemory( true ); xStream.set( new utl::OInputStreamWrapper( pStream, true ) ); } diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx index ae87f5044ad3..9ad0447684e6 100644 --- a/svx/source/table/tablelayouter.cxx +++ b/svx/source/table/tablelayouter.cxx @@ -427,8 +427,8 @@ sal_Int32 TableLayouter::distribute( LayoutVector& rLayouts, sal_Int32 nDistribu // break loops after 100 runs to avoid freezing office due to developer error sal_Int32 nSafe = 100; - const sal_Size nCount = rLayouts.size(); - sal_Size nIndex; + const std::size_t nCount = rLayouts.size(); + std::size_t nIndex; bool bConstrainsBroken = false; diff --git a/svx/source/xoutdev/xexch.cxx b/svx/source/xoutdev/xexch.cxx index dfde6406b0d5..867ece23ccbf 100644 --- a/svx/source/xoutdev/xexch.cxx +++ b/svx/source/xoutdev/xexch.cxx @@ -50,7 +50,7 @@ SvStream& WriteXFillExchangeData( SvStream& rOStm, const XFillExchangeData& rDat sal_uInt16 nWhich = aIter.FirstWhich(); const SfxPoolItem* pItem; sal_uInt32 nItemCount = 0; - sal_Size nFirstPos = rOStm.Tell(); + sal_uInt64 const nFirstPos = rOStm.Tell(); rOStm.WriteUInt32( nItemCount ); diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx index 55a62390ab86..5b6e92ff8a91 100644 --- a/sw/source/filter/basflt/iodetect.cxx +++ b/sw/source/filter/basflt/iodetect.cxx @@ -270,7 +270,7 @@ bool SwIoSystem::IsDetectableText(const sal_Char* pBuf, sal_uLong &rLen, { std::unique_ptr<sal_Unicode[]> aWork(new sal_Unicode[rLen+1]); sal_Unicode *pNewBuf = aWork.get(); - sal_Size nNewLen; + std::size_t nNewLen; if (eCharSet != RTL_TEXTENCODING_UCS2) { nNewLen = rLen; diff --git a/sw/source/filter/html/parcss1.cxx b/sw/source/filter/html/parcss1.cxx index 8af621102e6f..4ba013d8848d 100644 --- a/sw/source/filter/html/parcss1.cxx +++ b/sw/source/filter/html/parcss1.cxx @@ -301,7 +301,7 @@ CSS1Token CSS1Parser::GetNextToken() case '9': // NUMBER | PERCENTAGE | LENGTH { // die aktuelle Position retten - sal_Size nInPosSave = nInPos; + std::size_t nInPosSave = nInPos; sal_Unicode cNextChSave = cNextCh; sal_uInt32 nlLineNrSave = nlLineNr; sal_uInt32 nlLinePosSave = nlLinePos; diff --git a/sw/source/filter/ww8/WW8Sttbf.cxx b/sw/source/filter/ww8/WW8Sttbf.cxx index c3d1132ca0b2..b97d5e5817b7 100644 --- a/sw/source/filter/ww8/WW8Sttbf.cxx +++ b/sw/source/filter/ww8/WW8Sttbf.cxx @@ -34,7 +34,7 @@ namespace ww8 { if (checkSeek(rSt, nPos)) { - sal_Size nRemainingSize = rSt.remainingSize(); + std::size_t nRemainingSize = rSt.remainingSize(); nSize = std::min<sal_uInt32>(nRemainingSize, nSize); m_pData = o3tl::make_shared_array<sal_uInt8>(nSize); mn_size = rSt.ReadBytes(m_pData.get(), nSize); diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx index ccaf68876dfa..848457b74143 100644 --- a/sw/source/filter/ww8/rtfsdrexport.cxx +++ b/sw/source/filter/ww8/rtfsdrexport.cxx @@ -105,7 +105,7 @@ inline sal_uInt16 impl_GetUInt16(const sal_uInt8*& pVal) return nRet; } -inline sal_Int32 impl_GetPointComponent(const sal_uInt8*& pVal, sal_Size& rVerticesPos, sal_uInt16 nPointSize) +inline sal_Int32 impl_GetPointComponent(const sal_uInt8*& pVal, std::size_t& rVerticesPos, sal_uInt16 nPointSize) { sal_Int32 nRet = 0; if ((nPointSize == 0xfff0) || (nPointSize == 4)) @@ -262,7 +262,7 @@ void RtfSdrExport::Commit(EscherPropertyContainer& rProps, const Rectangle& rRec aVertices.nPropSize >= 6 && aSegments.nPropSize >= 6) { const sal_uInt8* pVerticesIt = aVertices.pBuf + 6; - sal_Size nVerticesPos = 6; + std::size_t nVerticesPos = 6; const sal_uInt8* pSegmentIt = aSegments.pBuf; OStringBuffer aSegmentInfo(512); diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 3373bec0b3d1..291b20e7e725 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -377,7 +377,7 @@ OString MSWordStyles::GetStyleId(sal_uInt16 nId) const } /// For WW8 only - extend pO so that the size of pTableStrm is even. -static void impl_SkipOdd( ww::bytes* pO, sal_Size nTableStrmTell ) +static void impl_SkipOdd( ww::bytes* pO, std::size_t nTableStrmTell ) { if ( ( nTableStrmTell + pO->size() ) & 1 ) // Start auf gerader pO->push_back( (sal_uInt8)0 ); // Address diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 08f12df116cf..24851a27b090 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3059,9 +3059,9 @@ namespace rIn.Seek(0); sal_uInt8 in[WW_BLOCKSIZE]; - for (sal_Size nI = 0, nBlock = 0; nI < nLen; nI += WW_BLOCKSIZE, ++nBlock) + for (std::size_t nI = 0, nBlock = 0; nI < nLen; nI += WW_BLOCKSIZE, ++nBlock) { - sal_Size nBS = (nLen - nI > WW_BLOCKSIZE) ? WW_BLOCKSIZE : nLen - nI; + std::size_t nBS = (nLen - nI > WW_BLOCKSIZE) ? WW_BLOCKSIZE : nLen - nI; nBS = rIn.ReadBytes(in, nBS); rCtx.InitCipher(nBlock); rCtx.Encode(in, nBS, in, nBS); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 834714b27919..1d176f26b9ba 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2873,8 +2873,8 @@ void SwWW8ImplReader::PostProcessAttrs() So a encoding converter that on an undefined character attempts to convert from 1252 on the undefined character */ -sal_Size Custom8BitToUnicode(rtl_TextToUnicodeConverter hConverter, - sal_Char *pIn, sal_Size nInLen, sal_Unicode *pOut, sal_Size nOutLen) +std::size_t Custom8BitToUnicode(rtl_TextToUnicodeConverter hConverter, + sal_Char *pIn, std::size_t nInLen, sal_Unicode *pOut, std::size_t nOutLen) { const sal_uInt32 nFlags = RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR | @@ -2888,8 +2888,8 @@ sal_Size Custom8BitToUnicode(rtl_TextToUnicodeConverter hConverter, RTL_TEXTTOUNICODE_FLAGS_INVALID_IGNORE | RTL_TEXTTOUNICODE_FLAGS_FLUSH; - sal_Size nDestChars=0; - sal_Size nConverted=0; + std::size_t nDestChars=0; + std::size_t nConverted=0; do { @@ -2985,7 +2985,7 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, sal_Int32 nEnd, sal_Int32 nCp return true; } - sal_Size nAvailableStrLen = m_pStrm->remainingSize() / (m_bIsUnicode ? 2 : 1); + std::size_t nAvailableStrLen = m_pStrm->remainingSize() / (m_bIsUnicode ? 2 : 1); OSL_ENSURE(nAvailableStrLen, "Document claimed to have more text than available"); if (!nAvailableStrLen) { @@ -2994,7 +2994,7 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, sal_Int32 nEnd, sal_Int32 nCp return true; } - sal_Int32 nValidStrLen = std::min<sal_Size>(nRequestedStrLen, nAvailableStrLen); + sal_Int32 nValidStrLen = std::min<std::size_t>(nRequestedStrLen, nAvailableStrLen); // Reset Unicode flag and correct FilePos if needed. // Note: Seek is not expensive, as we're checking inline whether or not @@ -3500,7 +3500,7 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs) // Reset Unicode flag and correct FilePos if needed. // Note: Seek is not expensive, as we're checking inline whether or not // the correct FilePos has already been reached. - sal_Size nRequestedPos = m_pSBase->WW8Cp2Fc(nCpOfs+nPosCp, &m_bIsUnicode); + std::size_t nRequestedPos = m_pSBase->WW8Cp2Fc(nCpOfs+nPosCp, &m_bIsUnicode); if (!checkSeek(*m_pStrm, nRequestedPos)) return false; @@ -5478,13 +5478,13 @@ namespace void DecryptRC4(msfilter::MSCodec_Std97& rCtx, SvStream &rIn, SvStream &rOut) { rIn.Seek(STREAM_SEEK_TO_END); - const sal_Size nLen = rIn.Tell(); + const std::size_t nLen = rIn.Tell(); rIn.Seek(0); sal_uInt8 in[WW_BLOCKSIZE]; - for (sal_Size nI = 0, nBlock = 0; nI < nLen; nI += WW_BLOCKSIZE, ++nBlock) + for (std::size_t nI = 0, nBlock = 0; nI < nLen; nI += WW_BLOCKSIZE, ++nBlock) { - sal_Size nBS = (nLen - nI > WW_BLOCKSIZE) ? WW_BLOCKSIZE : nLen - nI; + std::size_t nBS = (nLen - nI > WW_BLOCKSIZE) ? WW_BLOCKSIZE : nLen - nI; nBS = rIn.ReadBytes(in, nBS); rCtx.InitCipher(nBlock); rCtx.Decode(in, nBS, in, nBS); @@ -5494,18 +5494,18 @@ namespace void DecryptXOR(msfilter::MSCodec_XorWord95 &rCtx, SvStream &rIn, SvStream &rOut) { - sal_Size nSt = rIn.Tell(); + std::size_t nSt = rIn.Tell(); rIn.Seek(STREAM_SEEK_TO_END); - sal_Size nLen = rIn.Tell(); + std::size_t nLen = rIn.Tell(); rIn.Seek(nSt); rCtx.InitCipher(); rCtx.Skip(nSt); sal_uInt8 in[0x4096]; - for (sal_Size nI = nSt; nI < nLen; nI += 0x4096) + for (std::size_t nI = nSt; nI < nLen; nI += 0x4096) { - sal_Size nBS = (nLen - nI > 0x4096 ) ? 0x4096 : nLen - nI; + std::size_t nBS = (nLen - nI > 0x4096 ) ? 0x4096 : nLen - nI; nBS = rIn.ReadBytes(in, nBS); rCtx.Decode(in, nBS); rOut.WriteBytes(in, nBS); @@ -5764,7 +5764,7 @@ sal_uLong SwWW8ImplReader::LoadThroughDecryption(WW8Glossary *pGloss) pTempMain = MakeTemp(aDecryptMain); m_pStrm->Seek(0); - sal_Size nUnencryptedHdr = 0x44; + std::size_t nUnencryptedHdr = 0x44; sal_uInt8 *pIn = new sal_uInt8[nUnencryptedHdr]; nUnencryptedHdr = m_pStrm->ReadBytes(pIn, nUnencryptedHdr); diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index b483fbcff414..d00ff3529f90 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -3642,7 +3642,7 @@ void WW8RStyle::ImportSprms(sal_uInt8 *pSprms, short nLen, bool bPap) nSprmsLen = 0; } -void WW8RStyle::ImportSprms(sal_Size nPosFc, short nLen, bool bPap) +void WW8RStyle::ImportSprms(std::size_t nPosFc, short nLen, bool bPap) { if (!nLen) return; @@ -3706,7 +3706,7 @@ short WW8RStyle::ImportUPX(short nLen, bool bPAP, bool bOdd) if( 0 < cbUPX ) { - sal_Size nPos = pStStrm->Tell(); // if something is interpreted wrong, + sal_uInt64 const nPos = pStStrm->Tell(); // if something is interpreted wrong, // this should make it work again ImportSprms( nPos, cbUPX, bPAP ); @@ -4146,7 +4146,7 @@ std::vector<sal_uInt8> ChpxToSprms(const Word2CHPX &rChpx) return aRet; } -Word2CHPX ReadWord2Chpx(SvStream &rSt, sal_Size nOffset, sal_uInt8 nSize) +Word2CHPX ReadWord2Chpx(SvStream &rSt, std::size_t nOffset, sal_uInt8 nSize) { Word2CHPX aChpx; @@ -4266,7 +4266,7 @@ Word2CHPX ReadWord2Chpx(SvStream &rSt, sal_Size nOffset, sal_uInt8 nSize) namespace { - struct pxoffset { sal_Size mnOffset; sal_uInt8 mnSize; }; + struct pxoffset { std::size_t mnOffset; sal_uInt8 mnSize; }; } void WW8RStyle::ImportOldFormatStyles() diff --git a/sw/source/filter/ww8/ww8par2.hxx b/sw/source/filter/ww8/ww8par2.hxx index 7f14316d932d..151325c839dd 100644 --- a/sw/source/filter/ww8/ww8par2.hxx +++ b/sw/source/filter/ww8/ww8par2.hxx @@ -107,7 +107,7 @@ friend class SwWW8ImplReader; bool bFCTLSizeChanged; // For Simulating Default-CTL FontSize bool bWidowsChanged; // For Simulating Default-Widows / Orphans - void ImportSprms(sal_Size nPosFc, short nLen, bool bPap); + void ImportSprms(std::size_t nPosFc, short nLen, bool bPap); void ImportSprms(sal_uInt8 *pSprms, short nLen, bool bPap); void ImportGrupx(short nLen, bool bPara, bool bOdd); short ImportUPX(short nLen, bool bPAP, bool bOdd); diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index d3fcc1b37283..845bc77f2f2a 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -1670,7 +1670,7 @@ WW8ScannerBase::WW8ScannerBase( SvStream* pSt, SvStream* pTableSt, // Extended ATRD if (pWwFib->fcAtrdExtra && pWwFib->lcbAtrdExtra) { - sal_Size nOldPos = pTableSt->Tell(); + sal_uInt64 const nOldPos = pTableSt->Tell(); if (checkSeek(*pTableSt, pWwFib->fcAtrdExtra) && (pTableSt->remainingSize() >= pWwFib->lcbAtrdExtra)) { pExtendedAtrds = new sal_uInt8[pWwFib->lcbAtrdExtra]; @@ -1927,13 +1927,13 @@ WW8PLCFspecial::WW8PLCFspecial(SvStream* pSt, sal_uInt32 nFilePos, { const sal_uInt32 nValidMin=4; - sal_Size nOldPos = pSt->Tell(); + sal_uInt64 const nOldPos = pSt->Tell(); bool bValid = checkSeek(*pSt, nFilePos); - sal_Size nRemainingSize = pSt->remainingSize(); + std::size_t nRemainingSize = pSt->remainingSize(); if( !(nRemainingSize >= nValidMin && nPLCF >= nValidMin )) bValid = false; - nPLCF = bValid ? std::min(nRemainingSize, static_cast<sal_Size>(nPLCF)) : nValidMin; + nPLCF = bValid ? std::min(nRemainingSize, static_cast<std::size_t>(nPLCF)) : nValidMin; // Pointer to Pos- and Struct-array pPLCF_PosArray = new sal_Int32[ ( nPLCF + 3 ) / 4 ]; @@ -2082,7 +2082,7 @@ WW8PLCF::WW8PLCF(SvStream& rSt, WW8_FC nFilePos, sal_Int32 nPLCF, int nStruct, void WW8PLCF::ReadPLCF(SvStream& rSt, WW8_FC nFilePos, sal_uInt32 nPLCF) { - sal_Size nOldPos = rSt.Tell(); + sal_uInt64 const nOldPos = rSt.Tell(); bool bValid = nPLCF != 0 && checkSeek(rSt, nFilePos) && (rSt.remainingSize() >= nPLCF); @@ -2176,7 +2176,7 @@ void WW8PLCF::GeneratePLCF(SvStream& rSt, sal_Int32 nPN, sal_Int32 ncpN) { failure = true; - sal_Size nLastFkpPos = nPN + nIMax - 1; + std::size_t nLastFkpPos = nPN + nIMax - 1; nLastFkpPos = nLastFkpPos << 9; // Anz. Fkp-Eintraege des letzten Fkp if (!checkSeek(rSt, nLastFkpPos + 511)) @@ -2278,13 +2278,13 @@ WW8PLCFpcd::WW8PLCFpcd(SvStream* pSt, sal_uInt32 nFilePos, { const sal_uInt32 nValidMin=4; - sal_Size nOldPos = pSt->Tell(); + sal_uInt64 const nOldPos = pSt->Tell(); bool bValid = checkSeek(*pSt, nFilePos); - sal_Size nRemainingSize = pSt->remainingSize(); + std::size_t nRemainingSize = pSt->remainingSize(); if( !(nRemainingSize >= nValidMin && nPLCF >= nValidMin )) bValid = false; - nPLCF = bValid ? std::min(nRemainingSize, static_cast<sal_Size>(nPLCF)) : nValidMin; + nPLCF = bValid ? std::min(nRemainingSize, static_cast<std::size_t>(nPLCF)) : nValidMin; pPLCF_PosArray = new sal_Int32[ ( nPLCF + 3 ) / 4 ]; // Pointer to Pos-array pPLCF_PosArray[0] = 0; @@ -2383,7 +2383,7 @@ bool IsExpandableSprm(sal_uInt16 nSpId) } void WW8PLCFx_Fc_FKP::WW8Fkp::FillEntry(WW8PLCFx_Fc_FKP::WW8Fkp::Entry &rEntry, - sal_Size nDataOffset, sal_uInt16 nLen) + std::size_t nDataOffset, sal_uInt16 nLen) { bool bValidPos = (nDataOffset < sizeof(maRawData)); @@ -2409,7 +2409,7 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(ww::WordVersion eVersion, SvStream* pSt, { memset(maRawData, 0, 512); - sal_Size nOldPos = pSt->Tell(); + sal_uInt64 const nOldPos = pSt->Tell(); bool bCouldSeek = checkSeek(*pSt, nFilePos); bool bCouldRead = bCouldSeek && checkRead(*pSt, maRawData, 512); @@ -2451,7 +2451,7 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(ww::WordVersion eVersion, SvStream* pSt, aEntry.mnLen = maRawData[nOfs]; //len byte - sal_Size nDataOffset = nOfs + 1; + std::size_t nDataOffset = nOfs + 1; FillEntry(aEntry, nDataOffset, aEntry.mnLen); @@ -2511,7 +2511,7 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(ww::WordVersion eVersion, SvStream* pSt, if (aEntry.mnLen >= 2) { //len byte + optional extra len byte - sal_Size nDataOffset = nOfs + 1 + nDelta; + std::size_t nDataOffset = nOfs + 1 + nDelta; aEntry.mnIStd = nDataOffset <= sizeof(maRawData)-sizeof(aEntry.mnIStd) ? SVBT16ToShort(maRawData+nDataOffset) : 0; aEntry.mnLen-=2; //istd @@ -3448,7 +3448,7 @@ void WW8PLCFx_SEPX::GetSprms(WW8PLCFxDesc* p) pStrm->ReadUInt16( nSprmSiz ); } - sal_Size nRemaining = pStrm->remainingSize(); + std::size_t nRemaining = pStrm->remainingSize(); if (nSprmSiz > nRemaining) nSprmSiz = nRemaining; @@ -3820,7 +3820,7 @@ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen if (nLen==0) // Handle Empty STTBF return; - sal_Size nOldPos = rStrm.Tell(); + sal_uInt64 const nOldPos = rStrm.Tell(); if (checkSeek(rStrm, nStart)) { sal_uInt16 nLen2(0); @@ -8022,7 +8022,7 @@ bool checkSeek(SvStream &rSt, sal_uInt32 nOffset) bool checkRead(SvStream &rSt, void *pDest, sal_uInt32 nLength) { - return (rSt.ReadBytes(pDest, nLength) == static_cast<sal_Size>(nLength)); + return (rSt.ReadBytes(pDest, nLength) == static_cast<std::size_t>(nLength)); } #ifdef OSL_BIGENDIAN diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index 7b4e69b0ecc2..f6be78fce08a 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -519,7 +519,7 @@ public: wwSprmParser maSprmParser; //Fill in an Entry with sanity testing - void FillEntry(Entry &rEntry, sal_Size nDataOffset, sal_uInt16 nLen); + void FillEntry(Entry &rEntry, std::size_t nDataOffset, sal_uInt16 nLen); public: WW8Fkp (ww::WordVersion eVersion, SvStream* pFKPStrm, @@ -1844,7 +1844,7 @@ public: void SwapQuotesInField(OUString &rFormat); -Word2CHPX ReadWord2Chpx(SvStream &rSt, sal_Size nOffset, sal_uInt8 nSize); +Word2CHPX ReadWord2Chpx(SvStream &rSt, std::size_t nOffset, sal_uInt8 nSize); std::vector<sal_uInt8> ChpxToSprms(const Word2CHPX &rChpx); bool checkSeek(SvStream &rSt, sal_uInt32 nOffset) diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index cd79d2feb86b..23d88a0baadb 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -732,7 +732,7 @@ void SwDocShell::Execute(SfxRequest& rReq) if ( aLockBytes.Stat( &aStat, SVSTATFLAG_DEFAULT ) == ERRCODE_NONE ) { sal_uInt32 nLen = aStat.nSize; - sal_uLong nRead = 0; + std::size_t nRead = 0; uno::Sequence< sal_Int8 > aSeq( nLen ); aLockBytes.ReadAt( 0, aSeq.getArray(), nLen, &nRead ); @@ -798,7 +798,7 @@ void SwDocShell::Execute(SfxRequest& rReq) if ( aLockBytes.Stat( &aStat, SVSTATFLAG_DEFAULT ) == ERRCODE_NONE ) { sal_uInt32 nLen = aStat.nSize; - sal_uLong nRead = 0; + std::size_t nRead = 0; uno::Sequence< sal_Int8 > aSeq( nLen ); aLockBytes.ReadAt( 0, aSeq.getArray(), nLen, &nRead ); diff --git a/test/source/htmltesttools.cxx b/test/source/htmltesttools.cxx index f318edd21fe6..4f28b1511791 100644 --- a/test/source/htmltesttools.cxx +++ b/test/source/htmltesttools.cxx @@ -26,7 +26,7 @@ htmlDocPtr HtmlTestTools::parseHtml(utl::TempFile& aTempFile) htmlDocPtr HtmlTestTools::parseHtmlStream(SvStream* pStream) { - sal_Size nSize = pStream->remainingSize(); + std::size_t nSize = pStream->remainingSize(); std::unique_ptr<sal_uInt8[]> pBuffer(new sal_uInt8[nSize + 1]); pStream->ReadBytes(pBuffer.get(), nSize); pBuffer[nSize] = 0; diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx index de5a3d9b0d38..55e194935769 100644 --- a/test/source/xmltesttools.cxx +++ b/test/source/xmltesttools.cxx @@ -42,7 +42,7 @@ xmlDocPtr XmlTestTools::parseXml(utl::TempFile& aTempFile) xmlDocPtr XmlTestTools::parseXmlStream(SvStream* pStream) { - sal_Size nSize = pStream->remainingSize(); + std::size_t nSize = pStream->remainingSize(); std::unique_ptr<sal_uInt8[]> pBuffer(new sal_uInt8[nSize + 1]); pStream->ReadBytes(pBuffer.get(), nSize); pBuffer[nSize] = 0; diff --git a/tools/qa/cppunit/test_stream.cxx b/tools/qa/cppunit/test_stream.cxx index c9c97bf0760d..22d66a556492 100644 --- a/tools/qa/cppunit/test_stream.cxx +++ b/tools/qa/cppunit/test_stream.cxx @@ -123,7 +123,7 @@ namespace aMemStream.Seek(0); CPPUNIT_ASSERT(aMemStream.good()); - sal_Size nRet = aMemStream.ReadBytes(buffer, sizeof(buffer)); + std::size_t nRet = aMemStream.ReadBytes(buffer, sizeof(buffer)); CPPUNIT_ASSERT(nRet == 3); CPPUNIT_ASSERT(!aMemStream.good()); CPPUNIT_ASSERT(!aMemStream.bad()); diff --git a/tools/source/generic/config.cxx b/tools/source/generic/config.cxx index ab7c6234c557..879678f25b09 100644 --- a/tools/source/generic/config.cxx +++ b/tools/source/generic/config.cxx @@ -117,7 +117,7 @@ static sal_uInt8* ImplSysReadConfig( const OUString& rFileName, if (nRead > 2 && memcmp(pBuf, BOM, 3) == 0) { nRead -= 3; - memmove(pBuf, pBuf + 3, sal::static_int_cast<sal_Size>(nRead * sizeof(sal_uInt8)) ); + memmove(pBuf, pBuf + 3, sal::static_int_cast<std::size_t>(nRead * sizeof(sal_uInt8)) ); rbIsUTF8BOM = true; } diff --git a/tools/source/ref/pstm.cxx b/tools/source/ref/pstm.cxx index 74e6bc858108..c63459209a7d 100644 --- a/tools/source/ref/pstm.cxx +++ b/tools/source/ref/pstm.cxx @@ -90,18 +90,18 @@ void SvPersistStream::ResetError() pStm->ResetError(); } -sal_uIntPtr SvPersistStream::GetData( void* pData, sal_uIntPtr nSize ) +std::size_t SvPersistStream::GetData( void* pData, std::size_t nSize ) { DBG_ASSERT( pStm, "stream not set" ); - sal_Size const nRet = pStm->ReadBytes( pData, nSize ); + std::size_t const nRet = pStm->ReadBytes( pData, nSize ); SetError( pStm->GetError() ); return nRet; } -sal_uIntPtr SvPersistStream::PutData( const void* pData, sal_uIntPtr nSize ) +std::size_t SvPersistStream::PutData( const void* pData, std::size_t nSize ) { DBG_ASSERT( pStm, "stream not set" ); - sal_Size const nRet = pStm->WriteBytes( pData, nSize ); + std::size_t const nRet = pStm->WriteBytes( pData, nSize ); SetError( pStm->GetError() ); return nRet; } diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index befd9349a2dd..cca67de48127 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -174,8 +174,8 @@ void SvLockBytes::close() // virtual -ErrCode SvLockBytes::ReadAt(sal_uInt64 const nPos, void * pBuffer, sal_Size nCount, - sal_Size * pRead) const +ErrCode SvLockBytes::ReadAt(sal_uInt64 const nPos, void * pBuffer, std::size_t nCount, + std::size_t * pRead) const { if (!m_pStream) { @@ -184,15 +184,15 @@ ErrCode SvLockBytes::ReadAt(sal_uInt64 const nPos, void * pBuffer, sal_Size nCou } m_pStream->Seek(nPos); - sal_Size nTheRead = m_pStream->ReadBytes(pBuffer, nCount); + std::size_t nTheRead = m_pStream->ReadBytes(pBuffer, nCount); if (pRead) *pRead = nTheRead; return m_pStream->GetErrorCode(); } // virtual -ErrCode SvLockBytes::WriteAt(sal_uInt64 const nPos, const void * pBuffer, sal_Size nCount, - sal_Size * pWritten) +ErrCode SvLockBytes::WriteAt(sal_uInt64 const nPos, const void * pBuffer, std::size_t nCount, + std::size_t * pWritten) { if (!m_pStream) { @@ -201,7 +201,7 @@ ErrCode SvLockBytes::WriteAt(sal_uInt64 const nPos, const void * pBuffer, sal_Si } m_pStream->Seek(nPos); - sal_Size nTheWritten = m_pStream->WriteBytes(pBuffer, nCount); + std::size_t nTheWritten = m_pStream->WriteBytes(pBuffer, nCount); if (pWritten) *pWritten = nTheWritten; return m_pStream->GetErrorCode(); @@ -252,12 +252,12 @@ ErrCode SvLockBytes::Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag) const // class SvStream -sal_Size SvStream::GetData( void* pData, sal_Size nSize ) +std::size_t SvStream::GetData( void* pData, std::size_t nSize ) { if( !GetError() ) { DBG_ASSERT( m_xLockBytes.Is(), "pure virtual function" ); - sal_Size nRet(0); + std::size_t nRet(0); m_nError = m_xLockBytes->ReadAt(m_nActPos, pData, nSize, &nRet); m_nActPos += nRet; return nRet; @@ -265,12 +265,12 @@ sal_Size SvStream::GetData( void* pData, sal_Size nSize ) else return 0; } -sal_Size SvStream::PutData( const void* pData, sal_Size nSize ) +std::size_t SvStream::PutData( const void* pData, std::size_t nSize ) { if( !GetError() ) { DBG_ASSERT( m_xLockBytes.Is(), "pure virtual function" ); - sal_Size nRet(0); + std::size_t nRet(0); m_nError = m_xLockBytes->WriteAt(m_nActPos, pData, nSize, &nRet); m_nActPos += nRet; return nRet; @@ -456,7 +456,7 @@ bool SvStream::ReadLine( OString& rStr, sal_Int32 nMaxBytesToRead ) bool bEnd = false; sal_uInt64 nOldFilePos = Tell(); sal_Char c = 0; - sal_Size nTotalLen = 0; + std::size_t nTotalLen = 0; OStringBuffer aBuf(4096); while( !bEnd && !GetError() ) // Don't test for EOF as we @@ -490,7 +490,7 @@ bool SvStream::ReadLine( OString& rStr, sal_Int32 nMaxBytesToRead ) ++n; } nTotalLen += j; - if (nTotalLen > static_cast<sal_Size>(nMaxBytesToRead)) + if (nTotalLen > static_cast<std::size_t>(nMaxBytesToRead)) { n -= nTotalLen - nMaxBytesToRead; nTotalLen = nMaxBytesToRead; @@ -511,7 +511,7 @@ bool SvStream::ReadLine( OString& rStr, sal_Int32 nMaxBytesToRead ) if ( bEnd && (c=='\r' || c=='\n') ) // Special treatment for DOS files { char cTemp; - sal_Size nLen = ReadBytes(&cTemp, sizeof(cTemp)); + std::size_t nLen = ReadBytes(&cTemp, sizeof(cTemp)); if ( nLen ) { if( cTemp == c || (cTemp != '\n' && cTemp != '\r') ) Seek( nOldFilePos ); @@ -530,7 +530,7 @@ bool SvStream::ReadUniStringLine( OUString& rStr, sal_Int32 nMaxCodepointsToRead bool bEnd = false; sal_uInt64 nOldFilePos = Tell(); sal_Unicode c = 0; - sal_Size nTotalLen = 0; + std::size_t nTotalLen = 0; DBG_ASSERT( sizeof(sal_Unicode) == sizeof(sal_uInt16), "ReadUniStringLine: swapping sizeof(sal_Unicode) not implemented" ); @@ -576,7 +576,7 @@ bool SvStream::ReadUniStringLine( OUString& rStr, sal_Int32 nMaxCodepointsToRead } } nTotalLen += j; - if (nTotalLen > static_cast<sal_Size>(nMaxCodepointsToRead)) + if (nTotalLen > static_cast<std::size_t>(nMaxCodepointsToRead)) { n -= nTotalLen - nMaxCodepointsToRead; nTotalLen = nMaxCodepointsToRead; @@ -629,11 +629,11 @@ OString read_zeroTerminated_uInt8s_ToOString(SvStream& rStream) while( !bEnd && !rStream.GetError() ) { - sal_Size nLen = rStream.ReadBytes(buf, sizeof(buf)-1); + std::size_t nLen = rStream.ReadBytes(buf, sizeof(buf)-1); if (!nLen) break; - sal_Size nReallyRead = nLen; + std::size_t nReallyRead = nLen; const sal_Char* pPtr = buf; while (nLen && *pPtr) { @@ -663,16 +663,16 @@ OUString read_zeroTerminated_uInt8s_ToOUString(SvStream& rStream, rtl_TextEncodi /** Attempt to write a prefixed sequence of nUnits 16bit units from an OUString, returned value is number of bytes written */ -sal_Size write_uInt16s_FromOUString(SvStream& rStrm, const OUString& rStr, - sal_Size nUnits) +std::size_t write_uInt16s_FromOUString(SvStream& rStrm, const OUString& rStr, + std::size_t nUnits) { DBG_ASSERT( sizeof(sal_Unicode) == sizeof(sal_uInt16), "write_uInt16s_FromOUString: swapping sizeof(sal_Unicode) not implemented" ); - sal_Size nWritten; + std::size_t nWritten; if (!rStrm.IsEndianSwap()) nWritten = rStrm.WriteBytes(rStr.getStr(), nUnits * sizeof(sal_Unicode)); else { - sal_Size nLen = nUnits; + std::size_t nLen = nUnits; sal_Unicode aBuf[384]; sal_Unicode* const pTmp = ( nLen > 384 ? new sal_Unicode[nLen] : aBuf); memcpy( pTmp, rStr.getStr(), nLen * sizeof(sal_Unicode) ); @@ -1200,9 +1200,9 @@ SvStream& SvStream::WriteUniOrByteString( const OUString& rStr, rtl_TextEncoding return *this; } -sal_Size SvStream::ReadBytes( void* pData, sal_Size nCount ) +std::size_t SvStream::ReadBytes( void* pData, std::size_t nCount ) { - sal_Size nSaveCount = nCount; + std::size_t nSaveCount = nCount; if (!m_isConsistent) RefreshBuffer(); @@ -1218,7 +1218,7 @@ sal_Size SvStream::ReadBytes( void* pData, sal_Size nCount ) // check if block is completely within buffer m_isIoRead = true; m_isIoWrite = false; - if (nCount <= static_cast<sal_Size>(m_nBufActualLen - m_nBufActualPos)) + if (nCount <= static_cast<std::size_t>(m_nBufActualLen - m_nBufActualPos)) { // => yes memcpy(pData, m_pBufPos, (size_t) nCount); @@ -1264,7 +1264,7 @@ sal_Size SvStream::ReadBytes( void* pData, sal_Size nCount ) SeekPos(m_nBufFilePos); // TODO: Typecast before GetData, sal_uInt16 nCountTmp - sal_Size nCountTmp = GetData( m_pRWBuf, m_nBufSize ); + std::size_t nCountTmp = GetData( m_pRWBuf, m_nBufSize ); if (m_nCryptMask) EncryptBuffer(m_pRWBuf, nCountTmp); m_nBufActualLen = (sal_uInt16)nCountTmp; @@ -1287,7 +1287,7 @@ sal_Size SvStream::ReadBytes( void* pData, sal_Size nCount ) return nCount; } -sal_Size SvStream::WriteBytes( const void* pData, sal_Size nCount ) +std::size_t SvStream::WriteBytes( const void* pData, std::size_t nCount ) { if( !nCount ) return 0; @@ -1311,7 +1311,7 @@ sal_Size SvStream::WriteBytes( const void* pData, sal_Size nCount ) m_isIoRead = false; m_isIoWrite = true; - if (nCount <= static_cast<sal_Size>(m_nBufSize - m_nBufActualPos)) + if (nCount <= static_cast<std::size_t>(m_nBufSize - m_nBufActualPos)) { memcpy( m_pBufPos, pData, (size_t)nCount ); m_nBufActualPos = m_nBufActualPos + (sal_uInt16)nCount; @@ -1329,7 +1329,7 @@ sal_Size SvStream::WriteBytes( const void* pData, sal_Size nCount ) { SeekPos(m_nBufFilePos); if (m_nCryptMask) - CryptAndWriteBuffer( m_pRWBuf, (sal_Size)m_nBufActualLen ); + CryptAndWriteBuffer( m_pRWBuf, (std::size_t)m_nBufActualLen ); else PutData( m_pRWBuf, m_nBufActualLen ); m_isDirty = false; @@ -1423,7 +1423,7 @@ void SvStream::Flush() { SeekPos(m_nBufFilePos); if (m_nCryptMask) - CryptAndWriteBuffer( m_pRWBuf, (sal_Size)m_nBufActualLen ); + CryptAndWriteBuffer( m_pRWBuf, (std::size_t)m_nBufActualLen ); else if (PutData( m_pRWBuf, m_nBufActualLen ) != m_nBufActualLen) SetError( SVSTREAM_WRITE_ERROR ); @@ -1439,7 +1439,7 @@ void SvStream::RefreshBuffer() { SeekPos(m_nBufFilePos); if (m_nCryptMask) - CryptAndWriteBuffer( m_pRWBuf, (sal_Size)m_nBufActualLen ); + CryptAndWriteBuffer( m_pRWBuf, (std::size_t)m_nBufActualLen ); else PutData( m_pRWBuf, m_nBufActualLen ); m_isDirty = false; @@ -1449,7 +1449,7 @@ void SvStream::RefreshBuffer() if (m_nBufActualLen && m_nError == ERRCODE_IO_PENDING) m_nError = ERRCODE_NONE; if (m_nCryptMask) - EncryptBuffer(m_pRWBuf, (sal_Size)m_nBufActualLen); + EncryptBuffer(m_pRWBuf, (std::size_t)m_nBufActualLen); m_isConsistent = true; m_isIoRead = m_isIoWrite = false; } @@ -1457,7 +1457,7 @@ void SvStream::RefreshBuffer() SvStream& SvStream::WriteInt32AsString(sal_Int32 nInt32) { char buffer[12]; - sal_Size nLen = sprintf(buffer, "%" SAL_PRIdINT32, nInt32); + std::size_t nLen = sprintf(buffer, "%" SAL_PRIdINT32, nInt32); WriteBytes(buffer, nLen); return *this; } @@ -1465,7 +1465,7 @@ SvStream& SvStream::WriteInt32AsString(sal_Int32 nInt32) SvStream& SvStream::WriteUInt32AsString(sal_uInt32 nUInt32) { char buffer[11]; - sal_Size nLen = sprintf(buffer, "%" SAL_PRIuUINT32, nUInt32); + std::size_t nLen = sprintf(buffer, "%" SAL_PRIuUINT32, nUInt32); WriteBytes(buffer, nLen); return *this; } @@ -1473,12 +1473,12 @@ SvStream& SvStream::WriteUInt32AsString(sal_uInt32 nUInt32) #define CRYPT_BUFSIZE 1024 /// Encrypt and write -sal_Size SvStream::CryptAndWriteBuffer( const void* pStart, sal_Size nLen) +std::size_t SvStream::CryptAndWriteBuffer( const void* pStart, std::size_t nLen) { unsigned char pTemp[CRYPT_BUFSIZE]; unsigned char const * pDataPtr = static_cast<unsigned char const *>(pStart); - sal_Size nCount = 0; - sal_Size nBufCount; + std::size_t nCount = 0; + std::size_t nBufCount; unsigned char nMask = m_nCryptMask; do { @@ -1504,12 +1504,12 @@ sal_Size SvStream::CryptAndWriteBuffer( const void* pStart, sal_Size nLen) return nCount; } -bool SvStream::EncryptBuffer(void* pStart, sal_Size nLen) +bool SvStream::EncryptBuffer(void* pStart, std::size_t nLen) { unsigned char* pTemp = static_cast<unsigned char*>(pStart); unsigned char nMask = m_nCryptMask; - for ( sal_Size n=0; n < nLen; n++, pTemp++ ) + for ( std::size_t n=0; n < nLen; n++, pTemp++ ) { unsigned char aCh = *pTemp; SWAPNIBBLES(aCh) @@ -1561,7 +1561,7 @@ void SvStream::SetCryptMaskKey(const OString& rCryptMaskKey) m_aCryptMaskKey.getLength(), GetVersion()); } -void SvStream::SyncSvStream( sal_Size nNewStreamPos ) +void SvStream::SyncSvStream( std::size_t nNewStreamPos ) { ClearBuffer(); SvStream::m_nBufFilePos = nNewStreamPos; @@ -1624,7 +1624,7 @@ SvStream& endlub( SvStream& rStrm ) return endl( rStrm ); } -SvMemoryStream::SvMemoryStream( void* pBuffer, sal_Size bufSize, +SvMemoryStream::SvMemoryStream( void* pBuffer, std::size_t bufSize, StreamMode eMode ) { if( eMode & StreamMode::WRITE ) @@ -1640,7 +1640,7 @@ SvMemoryStream::SvMemoryStream( void* pBuffer, sal_Size bufSize, SetBufferSize( 0 ); } -SvMemoryStream::SvMemoryStream( sal_Size nInitSize, sal_Size nResizeOffset ) +SvMemoryStream::SvMemoryStream( std::size_t nInitSize, std::size_t nResizeOffset ) { m_isWritable = true; bOwnsData = true; @@ -1685,8 +1685,8 @@ sal_uInt64 SvMemoryStream::GetSize() return nLength; } -void SvMemoryStream::SetBuffer( void* pNewBuf, sal_Size nCount, - sal_Size nEOF ) +void SvMemoryStream::SetBuffer( void* pNewBuf, std::size_t nCount, + std::size_t nEOF ) { SetBufferSize( 0 ); // Buffering in der Basisklasse initialisieren Seek( 0 ); @@ -1709,9 +1709,9 @@ void SvMemoryStream::SetBuffer( void* pNewBuf, sal_Size nCount, ResetError(); } -sal_Size SvMemoryStream::GetData( void* pData, sal_Size nCount ) +std::size_t SvMemoryStream::GetData( void* pData, std::size_t nCount ) { - sal_Size nMaxCount = nEndOfData-nPos; + std::size_t nMaxCount = nEndOfData-nPos; if( nCount > nMaxCount ) nCount = nMaxCount; if (nCount != 0) @@ -1722,12 +1722,12 @@ sal_Size SvMemoryStream::GetData( void* pData, sal_Size nCount ) return nCount; } -sal_Size SvMemoryStream::PutData( const void* pData, sal_Size nCount ) +std::size_t SvMemoryStream::PutData( const void* pData, std::size_t nCount ) { if( GetError() ) return 0L; - sal_Size nMaxCount = nSize-nPos; + std::size_t nMaxCount = nSize-nPos; // check for overflow if( nCount > nMaxCount ) @@ -1824,7 +1824,7 @@ void SvMemoryStream::ResetError() SvStream::ClearError(); } -bool SvMemoryStream::AllocateMemory( sal_Size nNewSize ) +bool SvMemoryStream::AllocateMemory( std::size_t nNewSize ) { pBuf = new sal_uInt8[nNewSize]; return( pBuf != nullptr ); @@ -1836,7 +1836,7 @@ bool SvMemoryStream::ReAllocateMemory( long nDiff ) bool bRetVal = false; long nTemp = (long)nSize; nTemp += nDiff; - sal_Size nNewSize = (sal_Size)nTemp; + std::size_t nNewSize = (std::size_t)nTemp; if( nNewSize ) { @@ -1901,7 +1901,7 @@ void* SvMemoryStream::SwitchBuffer() ResetError(); - sal_Size nInitSize = 512; + std::size_t nInitSize = 512; if( !AllocateMemory(nInitSize) ) { SetError( SVSTREAM_OUTOFMEMORY ); @@ -1978,19 +1978,19 @@ bool SvScriptStream::good() const } //Create a OString of nLen bytes from rStream -OString read_uInt8s_ToOString(SvStream& rStrm, sal_Size nLen) +OString read_uInt8s_ToOString(SvStream& rStrm, std::size_t nLen) { rtl_String *pStr = nullptr; if (nLen) { - nLen = std::min(nLen, static_cast<sal_Size>(SAL_MAX_INT32)); + nLen = std::min(nLen, static_cast<std::size_t>(SAL_MAX_INT32)); //alloc a (ref-count 1) rtl_String of the desired length. //rtl_String's buffer is uninitialized, except for null termination pStr = rtl_string_alloc(sal::static_int_cast<sal_Int32>(nLen)); SAL_WARN_IF(!pStr, "tools", "allocation failed"); if (pStr) { - sal_Size nWasRead = rStrm.ReadBytes(pStr->buffer, nLen); + std::size_t nWasRead = rStrm.ReadBytes(pStr->buffer, nLen); if (nWasRead != nLen) { //on (typically unlikely) short read set length to what we could @@ -2007,19 +2007,19 @@ OString read_uInt8s_ToOString(SvStream& rStrm, sal_Size nLen) } //Create a OUString of nLen sal_Unicodes from rStream -OUString read_uInt16s_ToOUString(SvStream& rStrm, sal_Size nLen) +OUString read_uInt16s_ToOUString(SvStream& rStrm, std::size_t nLen) { rtl_uString *pStr = nullptr; if (nLen) { - nLen = std::min(nLen, static_cast<sal_Size>(SAL_MAX_INT32)); + nLen = std::min(nLen, static_cast<std::size_t>(SAL_MAX_INT32)); //alloc a (ref-count 1) rtl_uString of the desired length. //rtl_String's buffer is uninitialized, except for null termination pStr = rtl_uString_alloc(sal::static_int_cast<sal_Int32>(nLen)); SAL_WARN_IF(!pStr, "tools", "allocation failed"); if (pStr) { - sal_Size nWasRead = rStrm.ReadBytes(pStr->buffer, nLen*2)/2; + std::size_t nWasRead = rStrm.ReadBytes(pStr->buffer, nLen*2)/2; if (nWasRead != nLen) { //on (typically unlikely) short read set length to what we could @@ -2131,12 +2131,12 @@ OUString convertLineEnd(const OUString &rIn, LineEnd eLineEnd) return tmpl_convertLineEnd<OUString, OUStringBuffer>(rIn, eLineEnd); } -sal_Size write_uInt32_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm, +std::size_t write_uInt32_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm, const OUString &rStr) { - sal_Size nWritten = 0; - sal_uInt32 nUnits = std::min<sal_Size>(rStr.getLength(), std::numeric_limits<sal_uInt32>::max()); - SAL_WARN_IF(static_cast<sal_Size>(nUnits) != static_cast<sal_Size>(rStr.getLength()), + std::size_t nWritten = 0; + sal_uInt32 nUnits = std::min<std::size_t>(rStr.getLength(), std::numeric_limits<sal_uInt32>::max()); + SAL_WARN_IF(static_cast<std::size_t>(nUnits) != static_cast<std::size_t>(rStr.getLength()), "tools.stream", "string too long for prefix count to fit in output type"); rStrm.WriteUInt32(nUnits); @@ -2148,11 +2148,11 @@ sal_Size write_uInt32_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm, return nWritten; } -sal_Size write_uInt16_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm, +std::size_t write_uInt16_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm, const OUString &rStr) { - sal_Size nWritten = 0; - sal_uInt16 nUnits = std::min<sal_Size>(rStr.getLength(), std::numeric_limits<sal_uInt16>::max()); + std::size_t nWritten = 0; + sal_uInt16 nUnits = std::min<std::size_t>(rStr.getLength(), std::numeric_limits<sal_uInt16>::max()); SAL_WARN_IF(nUnits != rStr.getLength(), "tools.stream", "string too long for prefix count to fit in output type"); @@ -2165,12 +2165,12 @@ sal_Size write_uInt16_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm, return nWritten; } -sal_Size write_uInt16_lenPrefixed_uInt8s_FromOString(SvStream& rStrm, +std::size_t write_uInt16_lenPrefixed_uInt8s_FromOString(SvStream& rStrm, const OString &rStr) { - sal_Size nWritten = 0; - sal_uInt16 nUnits = std::min<sal_Size>(rStr.getLength(), std::numeric_limits<sal_uInt16>::max()); - SAL_WARN_IF(static_cast<sal_Size>(nUnits) != static_cast<sal_Size>(rStr.getLength()), + std::size_t nWritten = 0; + sal_uInt16 nUnits = std::min<std::size_t>(rStr.getLength(), std::numeric_limits<sal_uInt16>::max()); + SAL_WARN_IF(static_cast<std::size_t>(nUnits) != static_cast<std::size_t>(rStr.getLength()), "tools.stream", "string too long for sal_uInt16 count to fit in output type"); rStrm.WriteUInt16( nUnits ); diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx index e26237e69606..36ed303b81cc 100644 --- a/tools/source/stream/strmunx.cxx +++ b/tools/source/stream/strmunx.cxx @@ -48,20 +48,20 @@ struct LockMutex : public rtl::Static< osl::Mutex, LockMutex > {}; struct InternalStreamLock { - sal_Size m_nStartPos; - sal_Size m_nEndPos; + std::size_t m_nStartPos; + std::size_t m_nEndPos; SvFileStream* m_pStream; osl::DirectoryItem m_aItem; - InternalStreamLock( sal_Size, sal_Size, SvFileStream* ); + InternalStreamLock( std::size_t, std::size_t, SvFileStream* ); ~InternalStreamLock(); }; struct LockList : public rtl::Static< std::vector<InternalStreamLock>, LockList > {}; InternalStreamLock::InternalStreamLock( - sal_Size nStart, - sal_Size nEnd, + std::size_t nStart, + std::size_t nEnd, SvFileStream* pStream ) : m_nStartPos( nStart ), m_nEndPos( nEnd ), @@ -90,7 +90,7 @@ InternalStreamLock::~InternalStreamLock() #endif } -bool lockFile( sal_Size nStart, sal_Size nEnd, SvFileStream* pStream ) +bool lockFile( std::size_t nStart, std::size_t nEnd, SvFileStream* pStream ) { osl::DirectoryItem aItem; if (osl::DirectoryItem::get( pStream->GetFileName(), aItem) != osl::FileBase::E_None ) @@ -145,7 +145,7 @@ bool lockFile( sal_Size nStart, sal_Size nEnd, SvFileStream* pStream ) return true; } -void unlockFile( sal_Size nStart, sal_Size nEnd, SvFileStream const * pStream ) +void unlockFile( std::size_t nStart, std::size_t nEnd, SvFileStream const * pStream ) { osl::MutexGuard aGuard( LockMutex::get() ); std::vector<InternalStreamLock> &rLockList = LockList::get(); @@ -305,7 +305,7 @@ SvFileStream::~SvFileStream() delete pInstanceData; } -sal_Size SvFileStream::GetData( void* pData, sal_Size nSize ) +std::size_t SvFileStream::GetData( void* pData, std::size_t nSize ) { #ifdef DBG_UTIL OString aTraceStr("SvFileStream::GetData(): " + OString::number(static_cast<sal_Int64>(nSize)) + " Bytes from " + OUStringToOString(aFilename, osl_getThreadTextEncoding())); @@ -322,10 +322,10 @@ sal_Size SvFileStream::GetData( void* pData, sal_Size nSize ) return -1; } } - return (sal_Size)nRead; + return (std::size_t)nRead; } -sal_Size SvFileStream::PutData( const void* pData, sal_Size nSize ) +std::size_t SvFileStream::PutData( const void* pData, std::size_t nSize ) { #ifdef DBG_UTIL OString aTraceStr("SvFileStream::PutData(): " + OString::number(static_cast<sal_Int64>(nSize)) + " Bytes to " + OUStringToOString(aFilename, osl_getThreadTextEncoding())); @@ -344,7 +344,7 @@ sal_Size SvFileStream::PutData( const void* pData, sal_Size nSize ) else if( !nWrite ) SetError( SVSTREAM_DISK_FULL ); } - return (sal_Size)nWrite; + return (std::size_t)nWrite; } sal_uInt64 SvFileStream::SeekPos(sal_uInt64 const nPos) @@ -368,7 +368,7 @@ sal_uInt64 SvFileStream::SeekPos(sal_uInt64 const nPos) if ( nPos != STREAM_SEEK_TO_END ) return nPos; rc = osl_getFilePos( pInstanceData->rHandle, &nNewPos ); - return (sal_Size) nNewPos; + return nNewPos; } SetError( SVSTREAM_GENERALERROR ); return 0L; @@ -379,7 +379,7 @@ void SvFileStream::FlushData() // does not exist locally } -bool SvFileStream::LockRange( sal_Size nByteOffset, sal_Size nBytes ) +bool SvFileStream::LockRange( std::size_t nByteOffset, std::size_t nBytes ) { int nLockMode = 0; @@ -428,7 +428,7 @@ bool SvFileStream::LockRange( sal_Size nByteOffset, sal_Size nBytes ) return true; } -bool SvFileStream::UnlockRange( sal_Size nByteOffset, sal_Size nBytes ) +bool SvFileStream::UnlockRange( std::size_t nByteOffset, std::size_t nBytes ) { if ( ! IsOpen() ) return false; diff --git a/tools/source/stream/strmwnt.cxx b/tools/source/stream/strmwnt.cxx index 3618d217f427..22c10665211a 100644 --- a/tools/source/stream/strmwnt.cxx +++ b/tools/source/stream/strmwnt.cxx @@ -44,9 +44,9 @@ public: } }; -static sal_Size GetSvError( DWORD nWntError ) +static std::size_t GetSvError( DWORD nWntError ) { - static struct { DWORD wnt; sal_Size sv; } errArr[] = + static struct { DWORD wnt; std::size_t sv; } errArr[] = { { ERROR_SUCCESS, SVSTREAM_OK }, { ERROR_ACCESS_DENIED, SVSTREAM_ACCESS_DENIED }, @@ -86,7 +86,7 @@ static sal_Size GetSvError( DWORD nWntError ) { (DWORD)0xFFFFFFFF, SVSTREAM_GENERALERROR } }; - sal_Size nRetVal = SVSTREAM_GENERALERROR; // default error + std::size_t nRetVal = SVSTREAM_GENERALERROR; // default error int i=0; do { @@ -133,7 +133,7 @@ SvFileStream::~SvFileStream() } /// Does not check for EOF, makes isEof callable -sal_Size SvFileStream::GetData( void* pData, sal_Size nSize ) +std::size_t SvFileStream::GetData( void* pData, std::size_t nSize ) { DWORD nCount = 0; if( IsOpen() ) @@ -141,14 +141,14 @@ sal_Size SvFileStream::GetData( void* pData, sal_Size nSize ) bool bResult = ReadFile(pInstanceData->hFile,(LPVOID)pData,nSize,&nCount,NULL); if( !bResult ) { - sal_Size nTestError = GetLastError(); + std::size_t nTestError = GetLastError(); SetError(::GetSvError( nTestError ) ); } } return (DWORD)nCount; } -sal_Size SvFileStream::PutData( const void* pData, sal_Size nSize ) +std::size_t SvFileStream::PutData( const void* pData, std::size_t nSize ) { DWORD nCount = 0; if( IsOpen() ) @@ -192,7 +192,7 @@ void SvFileStream::FlushData() } } -bool SvFileStream::LockRange( sal_Size nByteOffset, sal_Size nBytes ) +bool SvFileStream::LockRange( std::size_t nByteOffset, std::size_t nBytes ) { bool bRetVal = false; if( IsOpen() ) @@ -204,7 +204,7 @@ bool SvFileStream::LockRange( sal_Size nByteOffset, sal_Size nBytes ) return bRetVal; } -bool SvFileStream::UnlockRange( sal_Size nByteOffset, sal_Size nBytes ) +bool SvFileStream::UnlockRange( std::size_t nByteOffset, std::size_t nBytes ) { bool bRetVal = false; if( IsOpen() ) @@ -339,7 +339,7 @@ void SvFileStream::Open( const OUString& rFilename, StreamMode nMode ) if( (pInstanceData->hFile==INVALID_HANDLE_VALUE) && (nAccessMode & GENERIC_WRITE)) { - sal_Size nErr = ::GetSvError( GetLastError() ); + std::size_t nErr = ::GetSvError( GetLastError() ); if(nErr==SVSTREAM_ACCESS_DENIED || nErr==SVSTREAM_SHARING_VIOLATION) { nMode &= (~StreamMode::WRITE); @@ -409,7 +409,7 @@ void SvFileStream::SetSize(sal_uInt64 const nSize) { int bError = false; HANDLE hFile = pInstanceData->hFile; - sal_Size nOld = SetFilePointer( hFile, 0L, NULL, FILE_CURRENT ); + DWORD const nOld = SetFilePointer( hFile, 0L, NULL, FILE_CURRENT ); if( nOld != 0xffffffff ) { if( SetFilePointer(hFile,nSize,NULL,FILE_BEGIN ) != 0xffffffff) diff --git a/unotools/source/streaming/streamhelper.cxx b/unotools/source/streaming/streamhelper.cxx index 9efb0e992419..e2881b7b9a55 100644 --- a/unotools/source/streaming/streamhelper.cxx +++ b/unotools/source/streaming/streamhelper.cxx @@ -35,7 +35,7 @@ sal_Int32 SAL_CALL OInputStreamHelper::readBytes(css::uno::Sequence< sal_Int8 >& if (aData.getLength() < nBytesToRead) aData.realloc(nBytesToRead); - sal_Size nRead(0); + std::size_t nRead(0); ErrCode nError = m_xLockBytes->ReadAt(m_nActPos, static_cast<void*>(aData.getArray()), nBytesToRead, &nRead); m_nActPos += nRead; @@ -43,7 +43,7 @@ sal_Int32 SAL_CALL OInputStreamHelper::readBytes(css::uno::Sequence< sal_Int8 >& throw css::io::IOException(OUString(), static_cast<css::uno::XWeak*>(this)); // adjust sequence if data read is lower than the desired data - if (nRead < (sal_Size)aData.getLength()) + if (nRead < (std::size_t)aData.getLength()) aData.realloc( nRead ); return nRead; diff --git a/unotools/source/streaming/streamwrap.cxx b/unotools/source/streaming/streamwrap.cxx index e64957005a03..92f7aa4165d2 100644 --- a/unotools/source/streaming/streamwrap.cxx +++ b/unotools/source/streaming/streamwrap.cxx @@ -62,7 +62,7 @@ sal_Int32 SAL_CALL OInputStreamWrapper::readBytes(css::uno::Sequence< sal_Int8 > checkError(); // Wenn gelesene Zeichen < MaxLength, css::uno::Sequence anpassen - if (nRead < (sal_Size)aData.getLength()) + if (nRead < (std::size_t)aData.getLength()) aData.realloc( nRead ); return nRead; diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index b814387336da..f3a556e06be1 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -1168,7 +1168,7 @@ void UcbLockBytes::terminate_Impl() } ErrCode UcbLockBytes::ReadAt(sal_uInt64 const nPos, - void *pBuffer, sal_uLong nCount, sal_uLong *pRead) const + void *pBuffer, std::size_t nCount, std::size_t *pRead) const { if ( IsSynchronMode() ) { @@ -1230,13 +1230,13 @@ ErrCode UcbLockBytes::ReadAt(sal_uInt64 const nPos, memcpy (pBuffer, aData.getConstArray(), nSize); if (pRead) - *pRead = sal_uLong(nSize); + *pRead = static_cast<std::size_t>(nSize); return ERRCODE_NONE; } ErrCode UcbLockBytes::WriteAt(sal_uInt64 const nPos, const void *pBuffer, - sal_uLong nCount, sal_uLong *pWritten) + std::size_t nCount, std::size_t *pWritten) { if ( pWritten ) *pWritten = 0; @@ -1296,7 +1296,7 @@ ErrCode UcbLockBytes::SetSize (sal_uInt64 const nNewSize) { SvLockBytesStat aStat; Stat( &aStat, (SvLockBytesStatFlag) 0 ); - sal_uLong nSize = aStat.nSize; + std::size_t nSize = aStat.nSize; if ( nSize > nNewSize ) { @@ -1313,7 +1313,7 @@ ErrCode UcbLockBytes::SetSize (sal_uInt64 const nNewSize) if ( nSize < nNewSize ) { - sal_uLong nDiff = nNewSize-nSize, nCount=0; + std::size_t nDiff = nNewSize-nSize, nCount=0; sal_uInt8* pBuffer = new sal_uInt8[ nDiff ]; memset(pBuffer, 0, nDiff); // initialize for enhanced security WriteAt( nSize, pBuffer, nDiff, &nCount ); diff --git a/unotools/source/ucbhelper/ucblockbytes.hxx b/unotools/source/ucbhelper/ucblockbytes.hxx index f9d3fb29de60..06ec8d30dd42 100644 --- a/unotools/source/ucbhelper/ucblockbytes.hxx +++ b/unotools/source/ucbhelper/ucblockbytes.hxx @@ -102,8 +102,8 @@ public: static UcbLockBytesRef CreateLockBytes( const css::uno::Reference < css::io::XStream >& xContent ); // SvLockBytes - virtual ErrCode ReadAt(sal_uInt64 nPos, void *pBuffer, sal_uLong nCount, sal_uLong *pRead) const override; - virtual ErrCode WriteAt(sal_uInt64, const void*, sal_uLong, sal_uLong *pWritten) override; + virtual ErrCode ReadAt(sal_uInt64 nPos, void *pBuffer, std::size_t nCount, std::size_t *pRead) const override; + virtual ErrCode WriteAt(sal_uInt64, const void*, std::size_t, std::size_t *pWritten) override; virtual ErrCode Flush() const override; virtual ErrCode SetSize(sal_uInt64) override; virtual ErrCode Stat ( SvLockBytesStat *pStat, SvLockBytesStatFlag) const override; diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx index c05ed9821c55..572871e3e4df 100644 --- a/unotools/source/ucbhelper/xtempfile.cxx +++ b/unotools/source/ucbhelper/xtempfile.cxx @@ -163,7 +163,7 @@ throw (css::io::NotConnectedException, css::io::BufferSizeExceededException, css sal_uInt32 nRead = mpStream->ReadBytes(static_cast<void*>(aData.getArray()), nBytesToRead); checkError(); - if (nRead < (sal_Size)aData.getLength()) + if (nRead < (std::size_t)aData.getLength()) aData.realloc( nRead ); if ( sal::static_int_cast<sal_uInt32>(nBytesToRead) > nRead ) @@ -315,7 +315,7 @@ void OTempFileService::checkConnected () mpStream = mpTempFile->GetStream( StreamMode::STD_READWRITE ); if ( mpStream && mbHasCachedPos ) { - mpStream->Seek( sal::static_int_cast<sal_Size>(mnCachedPos) ); + mpStream->Seek( sal::static_int_cast<std::size_t>(mnCachedPos) ); if ( mpStream->SvStream::GetError () == ERRCODE_NONE ) { mbHasCachedPos = false; diff --git a/vcl/inc/unx/i18n_ic.hxx b/vcl/inc/unx/i18n_ic.hxx index ee963406338a..037680cbc21e 100644 --- a/vcl/inc/unx/i18n_ic.hxx +++ b/vcl/inc/unx/i18n_ic.hxx @@ -67,7 +67,7 @@ public: void HandleDestroyIM(); void EndExtTextInput( EndExtTextInputFlags nFlags ); // unused - void CommitKeyEvent( sal_Unicode* pText, sal_Size nLength ); + void CommitKeyEvent( sal_Unicode* pText, std::size_t nLength ); int UpdateSpotLocation(); void Map( SalFrame *pFrame ); diff --git a/vcl/qa/cppunit/canvasbitmaptest.cxx b/vcl/qa/cppunit/canvasbitmaptest.cxx index 8076d2b0384b..7198b097ebc1 100644 --- a/vcl/qa/cppunit/canvasbitmaptest.cxx +++ b/vcl/qa/cppunit/canvasbitmaptest.cxx @@ -522,10 +522,10 @@ private: uno::RuntimeException, std::exception) override { const uno::Sequence< rendering::ARGBColor > aTemp( convertIntegerToARGB(deviceColor) ); - const sal_Size nLen(aTemp.getLength()); + const std::size_t nLen(aTemp.getLength()); uno::Sequence< rendering::RGBColor > aRes( nLen ); rendering::RGBColor* pOut = aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pOut++ = rendering::RGBColor(aTemp[i].Red, aTemp[i].Green, @@ -538,7 +538,7 @@ private: virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertIntegerToARGB( const uno::Sequence< ::sal_Int8 >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); const sal_Int32 nBytesPerPixel(mnBitsPerPixel == 8 ? 1 : 4); CPPUNIT_ASSERT_MESSAGE("number of channels no multiple of pixel element count", nLen%nBytesPerPixel==0); @@ -548,7 +548,7 @@ private: if( getPalette().is() ) { - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pOut++ = rendering::ARGBColor( 1.0, @@ -559,7 +559,7 @@ private: } else { - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::ARGBColor( vcl::unotools::toDoubleColor(deviceColor[i+3]), @@ -578,7 +578,7 @@ private: uno::RuntimeException, std::exception) override { - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); const sal_Int32 nBytesPerPixel(mnBitsPerPixel == 8 ? 1 : 4); CPPUNIT_ASSERT_MESSAGE("number of channels no multiple of pixel element count", nLen%nBytesPerPixel==0); @@ -588,7 +588,7 @@ private: if( getPalette().is() ) { - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pOut++ = rendering::ARGBColor( 1.0, @@ -599,7 +599,7 @@ private: } else { - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { const double fAlpha=vcl::unotools::toDoubleColor(deviceColor[i+3]); *pOut++ = rendering::ARGBColor( diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx index 98aef88379e4..f50cca876ee9 100644 --- a/vcl/source/bitmap/BitmapTools.cxx +++ b/vcl/source/bitmap/BitmapTools.cxx @@ -34,7 +34,7 @@ void BitmapTools::loadFromSvg(SvStream& rStream, const OUString& sPath, BitmapEx uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext()); const uno::Reference<graphic::XSvgParser> xSvgParser = graphic::SvgTools::create(xContext); - sal_Size nSize = rStream.remainingSize(); + std::size_t nSize = rStream.remainingSize(); std::vector<sal_Int8> aBuffer(nSize + 1); rStream.ReadBytes(aBuffer.data(), nSize); aBuffer[nSize] = 0; diff --git a/vcl/source/filter/graphicfilter2.cxx b/vcl/source/filter/graphicfilter2.cxx index b31c0cb58fc0..4e57a0172980 100644 --- a/vcl/source/filter/graphicfilter2.cxx +++ b/vcl/source/filter/graphicfilter2.cxx @@ -948,8 +948,8 @@ bool GraphicDescriptor::ImpDetectPCT( SvStream& rStm, bool ) nFormat = GraphicFileFormat::PCT; else { - sal_Size nStreamPos = rStm.Tell(); - sal_Size nStreamLen = rStm.remainingSize(); + sal_uInt64 const nStreamPos = rStm.Tell(); + sal_uInt64 const nStreamLen = rStm.remainingSize(); if (isPCT(rStm, nStreamPos, nStreamLen)) { bRet = true; diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx index 4f7fe836e23f..7b9ac2ab799c 100644 --- a/vcl/source/filter/igif/gifread.cxx +++ b/vcl/source/filter/igif/gifread.cxx @@ -270,7 +270,7 @@ void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, sal_uLong nCount ) if (nLen > nMaxPossible) nLen = nMaxPossible; std::unique_ptr<sal_uInt8[]> pBuf(new sal_uInt8[ nLen ]); - sal_Size nRead = rIStm.ReadBytes(pBuf.get(), nLen); + std::size_t nRead = rIStm.ReadBytes(pBuf.get(), nLen); nCount = nRead/3UL; if( NO_PENDING( rIStm ) ) { @@ -417,7 +417,7 @@ bool GIFReader::ReadExtension() std::unique_ptr<sal_uInt8[]> pBuffer(new sal_uInt8[nCount]); bRet = false; - sal_Size nRead = rIStm.ReadBytes(pBuffer.get(), nCount); + std::size_t nRead = rIStm.ReadBytes(pBuffer.get(), nCount); if (NO_PENDING(rIStm) && cSize < nRead) { cSize = pBuffer[cSize]; @@ -437,7 +437,7 @@ bool GIFReader::ReadLocalHeader() sal_uInt8 pBuf[ 9 ]; bool bRet = false; - sal_Size nRead = rIStm.ReadBytes(pBuf, 9); + std::size_t nRead = rIStm.ReadBytes(pBuf, 9); if (NO_PENDING(rIStm) && nRead == 9) { SvMemoryStream aMemStm; diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx index 9b3a42a8b47e..05b4f79431ed 100644 --- a/vcl/source/filter/wmf/enhwmf.cxx +++ b/vcl/source/filter/wmf/enhwmf.cxx @@ -418,7 +418,7 @@ void EnhWMFReader::ReadEMFPlusComment(sal_uInt32 length, bool& bHaveDC) #if OSL_DEBUG_LEVEL > 1 // debug code - write the stream to debug file /tmp/emf-stream.emf - int pos = pWMF->Tell(); + sal_uInt64 const pos = pWMF->Tell(); pWMF->Seek(0); SvFileStream file( OUString( "/tmp/emf-stream.emf" ), StreamMode::WRITE | StreamMode::TRUNC ); @@ -432,7 +432,7 @@ void EnhWMFReader::ReadEMFPlusComment(sal_uInt32 length, bool& bHaveDC) } bEMFPlus = true; - sal_Size pos = pWMF->Tell(); + sal_uInt64 const pos = pWMF->Tell(); void *buffer = malloc( length ); pOut->PassEMFPlus( buffer, pWMF->ReadBytes(buffer, length) ); free( buffer ); diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx index e66f3ed8d8a0..bb56e7c91ed5 100644 --- a/vcl/source/filter/wmf/winwmf.cxx +++ b/vcl/source/filter/wmf/winwmf.cxx @@ -1156,7 +1156,7 @@ static const long aMaxWidth = 1024; bool WMFReader::ReadHeader() { - sal_Size nStrmPos = pWMF->Tell(); + sal_uInt64 const nStrmPos = pWMF->Tell(); sal_uInt32 nPlaceableMetaKey(0); // if available read the METAFILEHEADER diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index dfdb36e21e1d..7973b4368be1 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -1836,7 +1836,7 @@ void WMFWriter::WriteEmbeddedEMF( const GDIMetaFile& rMTF ) if( aEMFWriter.WriteEMF( rMTF ) ) { - sal_Size nTotalSize = aStream.Tell(); + sal_uInt64 const nTotalSize = aStream.Tell(); if( nTotalSize > SAL_MAX_UINT32 ) return; aStream.Seek( 0 ); diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx index 8814965eee89..d12559b1240c 100644 --- a/vcl/source/gdi/dibtools.cxx +++ b/vcl/source/gdi/dibtools.cxx @@ -159,7 +159,7 @@ inline bool isBitfieldCompression( ScanlineFormat nScanlineFormat ) bool ImplReadDIBInfoHeader(SvStream& rIStm, DIBV5Header& rHeader, bool& bTopDown, bool bMSOFormat) { // BITMAPINFOHEADER or BITMAPCOREHEADER or BITMAPV5HEADER - const sal_Size aStartPos(rIStm.Tell()); + sal_uInt64 const aStartPos(rIStm.Tell()); rIStm.ReadUInt32( rHeader.nSize ); // BITMAPCOREHEADER @@ -198,7 +198,7 @@ bool ImplReadDIBInfoHeader(SvStream& rIStm, DIBV5Header& rHeader, bool& bTopDown else { // BITMAPCOREHEADER, BITMAPV5HEADER or unknown. Read as far as possible - sal_Size nUsed(sizeof(rHeader.nSize)); + std::size_t nUsed(sizeof(rHeader.nSize)); auto readUInt16 = [&nUsed, &rHeader, &rIStm](sal_uInt16 & v) { if (nUsed < rHeader.nSize) { @@ -514,11 +514,11 @@ bool ImplReadDIBBits(SvStream& rIStm, DIBV5Header& rHeader, BitmapWriteAccess& r if (bNative) { if (nAlignedWidth - > std::numeric_limits<sal_Size>::max() / rHeader.nHeight) + > std::numeric_limits<std::size_t>::max() / rHeader.nHeight) { return false; } - sal_Size n = nAlignedWidth * rHeader.nHeight; + std::size_t n = nAlignedWidth * rHeader.nHeight; if (rIStm.ReadBytes(rAcc.GetBuffer(), n) != n) { return false; diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx index cddf455af34a..4fdd0e1398e9 100644 --- a/vcl/source/gdi/gfxlink.cxx +++ b/vcl/source/gdi/gfxlink.cxx @@ -269,7 +269,7 @@ std::shared_ptr<sal_uInt8> GfxLink::GetSwapInData() const pData = o3tl::make_shared_array<sal_uInt8>(mnSwapInDataSize); xIStm->ReadBytes( pData.get(), mnSwapInDataSize ); bool bError = ( ERRCODE_NONE != xIStm->GetError() ); - sal_Size nActReadSize = xIStm->Tell(); + sal_uInt64 const nActReadSize = xIStm->Tell(); if (nActReadSize != mnSwapInDataSize) { bError = true; diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx index 22de45135d15..f80e246a5c68 100644 --- a/vcl/source/gdi/jobset.cxx +++ b/vcl/source/gdi/jobset.cxx @@ -246,7 +246,7 @@ SvStream& ReadJobSetup( SvStream& rIStream, JobSetup& rJobSetup ) " max possible entries, but " << nRead << " claimed, truncating"); return rIStream; } - sal_Size nFirstPos = rIStream.Tell(); + sal_uInt64 const nFirstPos = rIStream.Tell(); std::unique_ptr<char[]> pTempBuf(new char[nRead]); rIStream.ReadBytes(pTempBuf.get(), nRead); if (nRead >= sizeof(ImplOldJobSetupData)) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index d05762cfdeb6..251672cc56aa 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2153,7 +2153,7 @@ bool PDFWriterImpl::writeBuffer( const void* pBuffer, sal_uInt64 nBytes ) { m_aOutputStreams.front().m_pStream->Seek( STREAM_SEEK_TO_END ); m_aOutputStreams.front().m_pStream->WriteBytes( - pBuffer, sal::static_int_cast<sal_Size>(nBytes)); + pBuffer, sal::static_int_cast<std::size_t>(nBytes)); return true; } @@ -2819,7 +2819,7 @@ bool PDFWriterImpl::emitTilings() bool bDeflate = compressStream( it->m_pTilingStream ); it->m_pTilingStream->Seek( STREAM_SEEK_TO_END ); - sal_Size nTilingStreamSize = it->m_pTilingStream->Tell(); + sal_uInt64 const nTilingStreamSize = it->m_pTilingStream->Tell(); it->m_pTilingStream->Seek( STREAM_SEEK_TO_BEGIN ); // write pattern object diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx index 9e4fcb58adc4..00497a337b0a 100644 --- a/vcl/source/gdi/pngread.cxx +++ b/vcl/source/gdi/pngread.cxx @@ -85,7 +85,7 @@ private: sal_uInt8* mpTransTab; // for transparency in images with palette colortype sal_uInt8* mpScanCurrent; // pointer into the current scanline sal_uInt8* mpColorTable; - sal_Size mnStreamSize; // estimate of PNG file size + std::size_t mnStreamSize; // estimate of PNG file size sal_uInt32 mnChunkType; // Type of current PNG chunk sal_Int32 mnChunkLen; // Length of current PNG chunk Size maOrigSize; // pixel size of the full image @@ -220,7 +220,7 @@ PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream ) maChunkIter = maChunkSeq.begin(); // estimate PNG file size (to allow sanity checks) - const sal_Size nStreamPos = mrPNGStream.Tell(); + const std::size_t nStreamPos = mrPNGStream.Tell(); mrPNGStream.Seek( STREAM_SEEK_TO_END ); mnStreamSize = mrPNGStream.Tell(); mrPNGStream.Seek( nStreamPos ); @@ -278,7 +278,7 @@ bool PNGReaderImpl::ReadNextChunk() rChunkData.nType = mnChunkType; // fdo#61847 truncate over-long, trailing chunks - const sal_Size nStreamPos = mrPNGStream.Tell(); + const std::size_t nStreamPos = mrPNGStream.Tell(); if( mnChunkLen < 0 || nStreamPos + mnChunkLen >= mnStreamSize ) mnChunkLen = mnStreamSize - nStreamPos; diff --git a/vcl/source/gdi/svmconverter.cxx b/vcl/source/gdi/svmconverter.cxx index ea21233cc115..2ae6dfd770d8 100644 --- a/vcl/source/gdi/svmconverter.cxx +++ b/vcl/source/gdi/svmconverter.cxx @@ -287,7 +287,7 @@ void ImplReadUnicodeComment( sal_uInt32 nStrmPos, SvStream& rIStm, OUString& rSt { sal_uInt16 nType; sal_uInt32 nActionSize; - sal_Size nStringLen; + std::size_t nStringLen; rIStm.Seek( nStrmPos ); rIStm .ReadUInt16( nType ) diff --git a/vcl/source/helper/canvasbitmap.cxx b/vcl/source/helper/canvasbitmap.cxx index 60f4686fdc8a..3c1b95129303 100644 --- a/vcl/source/helper/canvasbitmap.cxx +++ b/vcl/source/helper/canvasbitmap.cxx @@ -755,7 +755,7 @@ uno::Sequence<rendering::RGBColor> SAL_CALL VclCanvasBitmap::convertToRGB( const { SolarMutexGuard aGuard; - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); const sal_Int32 nComponentsPerPixel(m_aComponentTags.getLength()); ENSURE_ARG_OR_THROW2(nLen%nComponentsPerPixel==0, "number of channels no multiple of pixel element count", @@ -771,7 +771,7 @@ uno::Sequence<rendering::RGBColor> SAL_CALL VclCanvasBitmap::convertToRGB( const ENSURE_OR_THROW(m_pBmpAcc, "Unable to get BitmapAccess"); - for( sal_Size i=0; i<nLen; i+=nComponentsPerPixel ) + for( std::size_t i=0; i<nLen; i+=nComponentsPerPixel ) { const BitmapColor aCol = m_pBmpAcc->GetPaletteColor( sal::static_int_cast<sal_uInt16>(deviceColor[i+m_nIndexIndex])); @@ -787,7 +787,7 @@ uno::Sequence<rendering::RGBColor> SAL_CALL VclCanvasBitmap::convertToRGB( const OSL_ENSURE(m_nRedIndex != -1 && m_nGreenIndex != -1 && m_nBlueIndex != -1, "Invalid color channel indices"); - for( sal_Size i=0; i<nLen; i+=nComponentsPerPixel ) + for( std::size_t i=0; i<nLen; i+=nComponentsPerPixel ) { // TODO(F3): Convert result to sRGB color space *pOut++ = rendering::RGBColor( @@ -804,7 +804,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertToARGB( con { SolarMutexGuard aGuard; - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); const sal_Int32 nComponentsPerPixel(m_aComponentTags.getLength()); ENSURE_ARG_OR_THROW2(nLen%nComponentsPerPixel==0, "number of channels no multiple of pixel element count", @@ -820,7 +820,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertToARGB( con ENSURE_OR_THROW(m_pBmpAcc, "Unable to get BitmapAccess"); - for( sal_Size i=0; i<nLen; i+=nComponentsPerPixel ) + for( std::size_t i=0; i<nLen; i+=nComponentsPerPixel ) { const BitmapColor aCol = m_pBmpAcc->GetPaletteColor( sal::static_int_cast<sal_uInt16>(deviceColor[i+m_nIndexIndex])); @@ -838,7 +838,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertToARGB( con OSL_ENSURE(m_nRedIndex != -1 && m_nGreenIndex != -1 && m_nBlueIndex != -1, "Invalid color channel indices"); - for( sal_Size i=0; i<nLen; i+=nComponentsPerPixel ) + for( std::size_t i=0; i<nLen; i+=nComponentsPerPixel ) { // TODO(F3): Convert result to sRGB color space const double nAlpha( m_nAlphaIndex != -1 ? 1.0 - deviceColor[i+m_nAlphaIndex] : 1.0 ); @@ -857,7 +857,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertToPARGB( co { SolarMutexGuard aGuard; - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); const sal_Int32 nComponentsPerPixel(m_aComponentTags.getLength()); ENSURE_ARG_OR_THROW2(nLen%nComponentsPerPixel==0, "number of channels no multiple of pixel element count", @@ -873,7 +873,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertToPARGB( co ENSURE_OR_THROW(m_pBmpAcc, "Unable to get BitmapAccess"); - for( sal_Size i=0; i<nLen; i+=nComponentsPerPixel ) + for( std::size_t i=0; i<nLen; i+=nComponentsPerPixel ) { const BitmapColor aCol = m_pBmpAcc->GetPaletteColor( sal::static_int_cast<sal_uInt16>(deviceColor[i+m_nIndexIndex])); @@ -891,7 +891,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertToPARGB( co OSL_ENSURE(m_nRedIndex != -1 && m_nGreenIndex != -1 && m_nBlueIndex != -1, "Invalid color channel indices"); - for( sal_Size i=0; i<nLen; i+=nComponentsPerPixel ) + for( std::size_t i=0; i<nLen; i+=nComponentsPerPixel ) { // TODO(F3): Convert result to sRGB color space const double nAlpha( m_nAlphaIndex != -1 ? 1.0 - deviceColor[i+m_nAlphaIndex] : 1.0 ); @@ -910,7 +910,7 @@ uno::Sequence< double > SAL_CALL VclCanvasBitmap::convertFromRGB( const uno::Seq { SolarMutexGuard aGuard; - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); const sal_Int32 nComponentsPerPixel(m_aComponentTags.getLength()); uno::Sequence< double > aRes(nLen*nComponentsPerPixel); @@ -918,7 +918,7 @@ uno::Sequence< double > SAL_CALL VclCanvasBitmap::convertFromRGB( const uno::Seq if( m_bPalette ) { - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { pColors[m_nIndexIndex] = m_pBmpAcc->GetBestPaletteIndex( BitmapColor(toByteColor(rgbColor[i].Red), @@ -932,7 +932,7 @@ uno::Sequence< double > SAL_CALL VclCanvasBitmap::convertFromRGB( const uno::Seq } else { - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { pColors[m_nRedIndex] = rgbColor[i].Red; pColors[m_nGreenIndex] = rgbColor[i].Green; @@ -950,7 +950,7 @@ uno::Sequence< double > SAL_CALL VclCanvasBitmap::convertFromARGB( const uno::Se { SolarMutexGuard aGuard; - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); const sal_Int32 nComponentsPerPixel(m_aComponentTags.getLength()); uno::Sequence< double > aRes(nLen*nComponentsPerPixel); @@ -958,7 +958,7 @@ uno::Sequence< double > SAL_CALL VclCanvasBitmap::convertFromARGB( const uno::Se if( m_bPalette ) { - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { pColors[m_nIndexIndex] = m_pBmpAcc->GetBestPaletteIndex( BitmapColor(toByteColor(rgbColor[i].Red), @@ -972,7 +972,7 @@ uno::Sequence< double > SAL_CALL VclCanvasBitmap::convertFromARGB( const uno::Se } else { - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { pColors[m_nRedIndex] = rgbColor[i].Red; pColors[m_nGreenIndex] = rgbColor[i].Green; @@ -990,7 +990,7 @@ uno::Sequence< double > SAL_CALL VclCanvasBitmap::convertFromPARGB( const uno::S { SolarMutexGuard aGuard; - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); const sal_Int32 nComponentsPerPixel(m_aComponentTags.getLength()); uno::Sequence< double > aRes(nLen*nComponentsPerPixel); @@ -998,7 +998,7 @@ uno::Sequence< double > SAL_CALL VclCanvasBitmap::convertFromPARGB( const uno::S if( m_bPalette ) { - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { const double nAlpha( rgbColor[i].Alpha ); pColors[m_nIndexIndex] = m_pBmpAcc->GetBestPaletteIndex( @@ -1013,7 +1013,7 @@ uno::Sequence< double > SAL_CALL VclCanvasBitmap::convertFromPARGB( const uno::S } else { - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { const double nAlpha( rgbColor[i].Alpha ); pColors[m_nRedIndex] = rgbColor[i].Red / nAlpha; @@ -1053,7 +1053,7 @@ uno::Sequence<double> SAL_CALL VclCanvasBitmap::convertFromIntegerColorSpace( co { SolarMutexGuard aGuard; - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); const sal_Int32 nComponentsPerPixel(m_aComponentTags.getLength()); ENSURE_ARG_OR_THROW2(nLen%nComponentsPerPixel==0, "number of channels no multiple of pixel element count", @@ -1069,7 +1069,7 @@ uno::Sequence<double> SAL_CALL VclCanvasBitmap::convertFromIntegerColorSpace( co ENSURE_OR_THROW(m_pBmpAcc, "Unable to get BitmapAccess"); - for( sal_Size i=0; i<nLen; i+=nComponentsPerPixel ) + for( std::size_t i=0; i<nLen; i+=nComponentsPerPixel ) { const BitmapColor aCol = m_pBmpAcc->GetPaletteColor( sal::static_int_cast<sal_uInt16>(deviceColor[i+m_nIndexIndex])); @@ -1087,7 +1087,7 @@ uno::Sequence<double> SAL_CALL VclCanvasBitmap::convertFromIntegerColorSpace( co OSL_ENSURE(m_nRedIndex != -1 && m_nGreenIndex != -1 && m_nBlueIndex != -1, "Invalid color channel indices"); - for( sal_Size i=0; i<nLen; i+=nComponentsPerPixel ) + for( std::size_t i=0; i<nLen; i+=nComponentsPerPixel ) { // TODO(F3): Convert result to sRGB color space const double nAlpha( m_nAlphaIndex != -1 ? 1.0 - deviceColor[i+m_nAlphaIndex] : 1.0 ); @@ -1133,7 +1133,7 @@ uno::Sequence<rendering::RGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToRGB SolarMutexGuard aGuard; const sal_uInt8* pIn( reinterpret_cast<const sal_uInt8*>(deviceColor.getConstArray()) ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); const sal_Int32 nNumColors((nLen*8 + m_nBitsPerOutputPixel-1)/m_nBitsPerOutputPixel); uno::Sequence< rendering::RGBColor > aRes(nNumColors); @@ -1145,7 +1145,7 @@ uno::Sequence<rendering::RGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToRGB if( m_aBmpEx.IsTransparent() ) { const sal_Int32 nBytesPerPixel((m_nBitsPerOutputPixel+7)/8); - for( sal_Size i=0; i<nLen; i+=nBytesPerPixel ) + for( std::size_t i=0; i<nLen; i+=nBytesPerPixel ) { // if palette, index is guaranteed to be 8 bit const BitmapColor aCol = @@ -1185,7 +1185,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToAR SolarMutexGuard aGuard; const sal_uInt8* pIn( reinterpret_cast<const sal_uInt8*>(deviceColor.getConstArray()) ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); const sal_Int32 nNumColors((nLen*8 + m_nBitsPerOutputPixel-1)/m_nBitsPerOutputPixel); uno::Sequence< rendering::ARGBColor > aRes(nNumColors); @@ -1199,7 +1199,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToAR const long nNonAlphaBytes( (m_nBitsPerInputPixel+7)/8 ); const sal_Int32 nBytesPerPixel((m_nBitsPerOutputPixel+7)/8); const sal_uInt8 nAlphaFactor( m_aBmpEx.IsAlpha() ? 1 : 255 ); - for( sal_Size i=0; i<nLen; i+=nBytesPerPixel ) + for( std::size_t i=0; i<nLen; i+=nBytesPerPixel ) { // if palette, index is guaranteed to be 8 bit const BitmapColor aCol = @@ -1240,7 +1240,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToPA SolarMutexGuard aGuard; const sal_uInt8* pIn( reinterpret_cast<const sal_uInt8*>(deviceColor.getConstArray()) ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); const sal_Int32 nNumColors((nLen*8 + m_nBitsPerOutputPixel-1)/m_nBitsPerOutputPixel); uno::Sequence< rendering::ARGBColor > aRes(nNumColors); @@ -1254,7 +1254,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToPA const long nNonAlphaBytes( (m_nBitsPerInputPixel+7)/8 ); const sal_Int32 nBytesPerPixel((m_nBitsPerOutputPixel+7)/8); const sal_uInt8 nAlphaFactor( m_aBmpEx.IsAlpha() ? 1 : 255 ); - for( sal_Size i=0; i<nLen; i+=nBytesPerPixel ) + for( std::size_t i=0; i<nLen; i+=nBytesPerPixel ) { // if palette, index is guaranteed to be 8 bit const BitmapColor aCol = @@ -1295,7 +1295,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromRGB( con { SolarMutexGuard aGuard; - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); const sal_Int32 nNumBytes((nLen*m_nBitsPerOutputPixel+7)/8); uno::Sequence< sal_Int8 > aRes(nNumBytes); @@ -1304,7 +1304,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromRGB( con if( m_aBmpEx.IsTransparent() ) { const long nNonAlphaBytes( (m_nBitsPerInputPixel+7)/8 ); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { const BitmapColor aCol(toByteColor(rgbColor[i].Red), toByteColor(rgbColor[i].Green), @@ -1322,7 +1322,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromRGB( con } else { - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { const BitmapColor aCol(toByteColor(rgbColor[i].Red), toByteColor(rgbColor[i].Green), @@ -1344,7 +1344,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromARGB( co { SolarMutexGuard aGuard; - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); const sal_Int32 nNumBytes((nLen*m_nBitsPerOutputPixel+7)/8); uno::Sequence< sal_Int8 > aRes(nNumBytes); @@ -1353,7 +1353,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromARGB( co if( m_aBmpEx.IsTransparent() ) { const long nNonAlphaBytes( (m_nBitsPerInputPixel+7)/8 ); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { const BitmapColor aCol(toByteColor(rgbColor[i].Red), toByteColor(rgbColor[i].Green), @@ -1371,7 +1371,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromARGB( co } else { - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { const BitmapColor aCol(toByteColor(rgbColor[i].Red), toByteColor(rgbColor[i].Green), @@ -1393,7 +1393,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromPARGB( c { SolarMutexGuard aGuard; - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); const sal_Int32 nNumBytes((nLen*m_nBitsPerOutputPixel+7)/8); uno::Sequence< sal_Int8 > aRes(nNumBytes); @@ -1402,7 +1402,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromPARGB( c if( m_aBmpEx.IsTransparent() ) { const long nNonAlphaBytes( (m_nBitsPerInputPixel+7)/8 ); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { const double nAlpha( rgbColor[i].Alpha ); const BitmapColor aCol(toByteColor(rgbColor[i].Red / nAlpha), @@ -1421,7 +1421,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromPARGB( c } else { - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { const BitmapColor aCol(toByteColor(rgbColor[i].Red), toByteColor(rgbColor[i].Green), diff --git a/vcl/source/helper/canvastools.cxx b/vcl/source/helper/canvastools.cxx index de6fcaa44b7d..a25b983b78b3 100644 --- a/vcl/source/helper/canvastools.cxx +++ b/vcl/source/helper/canvastools.cxx @@ -220,7 +220,7 @@ namespace vcl const uno::Sequence<sal_Int8> aTags( aLayout.ColorSpace->getComponentTags() ); const sal_Int8* pStart(aTags.getConstArray()); - const sal_Size nLen(aTags.getLength()); + const std::size_t nLen(aTags.getLength()); const sal_Int8* pEnd(pStart+nLen); const std::ptrdiff_t nAlphaIndex = @@ -450,14 +450,14 @@ namespace vcl virtual uno::Sequence< rendering::RGBColor > SAL_CALL convertToRGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const double* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::RGBColor > aRes(nLen/4); rendering::RGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::RGBColor(pIn[0],pIn[1],pIn[2]); pIn += 4; @@ -467,14 +467,14 @@ namespace vcl virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertToARGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const double* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::ARGBColor(pIn[3],pIn[0],pIn[1],pIn[2]); pIn += 4; @@ -484,14 +484,14 @@ namespace vcl virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertToPARGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const double* pIn( deviceColor.getConstArray() ); - const sal_Size nLen( deviceColor.getLength() ); + const std::size_t nLen( deviceColor.getLength() ); ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); uno::Sequence< rendering::ARGBColor > aRes(nLen/4); rendering::ARGBColor* pOut( aRes.getArray() ); - for( sal_Size i=0; i<nLen; i+=4 ) + for( std::size_t i=0; i<nLen; i+=4 ) { *pOut++ = rendering::ARGBColor(pIn[3],pIn[3]*pIn[0],pIn[3]*pIn[1],pIn[3]*pIn[2]); pIn += 4; @@ -501,11 +501,11 @@ namespace vcl virtual uno::Sequence< double > SAL_CALL convertFromRGB( const uno::Sequence< rendering::RGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::RGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< double > aRes(nLen*4); double* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = pIn->Red; *pColors++ = pIn->Green; @@ -518,11 +518,11 @@ namespace vcl virtual uno::Sequence< double > SAL_CALL convertFromARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< double > aRes(nLen*4); double* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = pIn->Red; *pColors++ = pIn->Green; @@ -535,11 +535,11 @@ namespace vcl virtual uno::Sequence< double > SAL_CALL convertFromPARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) override { const rendering::ARGBColor* pIn( rgbColor.getConstArray() ); - const sal_Size nLen( rgbColor.getLength() ); + const std::size_t nLen( rgbColor.getLength() ); uno::Sequence< double > aRes(nLen*4); double* pColors=aRes.getArray(); - for( sal_Size i=0; i<nLen; ++i ) + for( std::size_t i=0; i<nLen; ++i ) { *pColors++ = pIn->Red/pIn->Alpha; *pColors++ = pIn->Green/pIn->Alpha; diff --git a/vcl/unx/generic/app/i18n_ic.cxx b/vcl/unx/generic/app/i18n_ic.cxx index e83a3f531810..abac4c89af76 100644 --- a/vcl/unx/generic/app/i18n_ic.cxx +++ b/vcl/unx/generic/app/i18n_ic.cxx @@ -512,7 +512,7 @@ SalI18N_InputContext::SupportInputMethodStyle( XIMStyles *pIMStyles ) // handle extended and normal key input void -SalI18N_InputContext::CommitKeyEvent(sal_Unicode* pText, sal_Size nLength) +SalI18N_InputContext::CommitKeyEvent(sal_Unicode* pText, std::size_t nLength) { if (nLength == 1 && IsControlCode(pText[0])) return; diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx index 89caeb7da885..cca391c159d7 100644 --- a/vcl/unx/generic/dtrans/X11_selection.cxx +++ b/vcl/unx/generic/dtrans/X11_selection.cxx @@ -1412,7 +1412,7 @@ PixmapHolder* SelectionManager::getPixmapHolder( Atom selection ) return it->second->m_pPixmap; } -static sal_Size GetTrueFormatSize(int nFormat) +static std::size_t GetTrueFormatSize(int nFormat) { // http://mail.gnome.org/archives/wm-spec-list/2003-March/msg00067.html return nFormat == 32 ? sizeof(long) : nFormat/8; @@ -1541,7 +1541,7 @@ bool SelectionManager::sendData( SelectionAdaptor* pAdaptor, } else { - sal_Size nUnitSize = GetTrueFormatSize(nFormat); + std::size_t nUnitSize = GetTrueFormatSize(nFormat); XChangeProperty( m_pDisplay, requestor, property, @@ -1846,7 +1846,7 @@ bool SelectionManager::handleReceivePropertyNotify( XPropertyEvent& rNotify ) nFormat, nBytes ); #endif - sal_Size nUnitSize = GetTrueFormatSize(nFormat); + std::size_t nUnitSize = GetTrueFormatSize(nFormat); if( it->second->m_eState == Selection::WaitingForData || it->second->m_eState == Selection::WaitingForResponse ) @@ -1948,7 +1948,7 @@ bool SelectionManager::handleSendPropertyNotify( XPropertyEvent& rNotify ) (const unsigned char*)rInc.m_aData.getConstArray()+rInc.m_nBufferPos ); #endif - sal_Size nUnitSize = GetTrueFormatSize(rInc.m_nFormat); + std::size_t nUnitSize = GetTrueFormatSize(rInc.m_nFormat); XChangeProperty( m_pDisplay, rInc.m_aRequestor, @@ -2046,7 +2046,7 @@ bool SelectionManager::handleSelectionNotify( XSelectionEvent& rNotify ) &pData ); } it->second->m_eState = Selection::Inactive; - sal_Size nUnitSize = GetTrueFormatSize(nFormat); + std::size_t nUnitSize = GetTrueFormatSize(nFormat); it->second->m_aData = Sequence< sal_Int8 >(reinterpret_cast<sal_Int8*>(pData), nItems * nUnitSize); it->second->m_aDataArrived.set(); if( pData ) diff --git a/vcl/unx/generic/print/psputil.cxx b/vcl/unx/generic/print/psputil.cxx index 7c363b9898ee..53b94c465e99 100644 --- a/vcl/unx/generic/print/psputil.cxx +++ b/vcl/unx/generic/print/psputil.cxx @@ -210,9 +210,9 @@ ConverterFactory::Get (rtl_TextEncoding nEncoding) // wrapper for rtl_convertUnicodeToText that handles the usual cases for // textconversion in drawtext -sal_Size +std::size_t ConverterFactory::Convert (const sal_Unicode *pText, int nTextLen, - unsigned char *pBuffer, sal_Size nBufferSize, rtl_TextEncoding nEncoding) + unsigned char *pBuffer, std::size_t nBufferSize, rtl_TextEncoding nEncoding) { const sal_uInt32 nCvtFlags = RTL_UNICODETOTEXT_FLAGS_UNDEFINED_QUESTIONMARK | RTL_UNICODETOTEXT_FLAGS_INVALID_QUESTIONMARK ; diff --git a/vcl/unx/generic/print/psputil.hxx b/vcl/unx/generic/print/psputil.hxx index 01a2d4f3cb31..b035de16aafe 100644 --- a/vcl/unx/generic/print/psputil.hxx +++ b/vcl/unx/generic/print/psputil.hxx @@ -53,8 +53,8 @@ public: ConverterFactory(); ~ConverterFactory(); rtl_UnicodeToTextConverter Get (rtl_TextEncoding nEncoding); - sal_Size Convert (const sal_Unicode *pText, int nTextLen, - unsigned char *pBuffer, sal_Size nBufferSize, + std::size_t Convert (const sal_Unicode *pText, int nTextLen, + unsigned char *pBuffer, std::size_t nBufferSize, rtl_TextEncoding nEncoding); private: diff --git a/vcl/unx/generic/print/text_gfx.cxx b/vcl/unx/generic/print/text_gfx.cxx index 723fd46e2fa7..bcb46583a8ae 100644 --- a/vcl/unx/generic/print/text_gfx.cxx +++ b/vcl/unx/generic/print/text_gfx.cxx @@ -536,7 +536,7 @@ PrinterGfx::LicenseWarning(const Point& rPoint, const sal_Unicode* pStr, RTL_TEXTENCODING_ASCII_US); PSSetFont (aFontName, RTL_TEXTENCODING_ISO_8859_1); - sal_Size nSize = 4 * nLen; + std::size_t nSize = 4 * nLen; unsigned char* pBuffer = static_cast<unsigned char*>(alloca (nSize* sizeof(unsigned char))); ConverterFactory &rCvt = GetConverterFactory (); diff --git a/vcl/win/gdi/salprn.cxx b/vcl/win/gdi/salprn.cxx index 04478467380c..926854aeeb2d 100644 --- a/vcl/win/gdi/salprn.cxx +++ b/vcl/win/gdi/salprn.cxx @@ -382,7 +382,7 @@ static bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS } // make Outputbuffer - const sal_Size nDriverDataLen = sizeof(SalDriverData) + nSysJobSize-1; + const std::size_t nDriverDataLen = sizeof(SalDriverData) + nSysJobSize-1; pOutBuffer = (SalDriverData*)rtl_allocateZeroMemory( nDriverDataLen ); pOutBuffer->mnSysSignature = SAL_DRIVERDATA_SYSSIGN; // calculate driver data offset including structure padding diff --git a/writerfilter/source/rtftok/rtfdispatchdestination.cxx b/writerfilter/source/rtftok/rtfdispatchdestination.cxx index af8a3f19b933..75d70199b01f 100644 --- a/writerfilter/source/rtftok/rtfdispatchdestination.cxx +++ b/writerfilter/source/rtftok/rtfdispatchdestination.cxx @@ -61,7 +61,7 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword) case RTF_FLDINST: { // Look for the field type - sal_Size nPos = Strm().Tell(); + sal_uInt64 const nPos = Strm().Tell(); OStringBuffer aBuf; char ch = 0; bool bFoundCode = false; @@ -192,7 +192,7 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword) if (!m_pSuperstream) { Id nId = 0; - sal_Size nPos = m_nGroupStartPos - 1; + std::size_t nPos = m_nGroupStartPos - 1; switch (nKeyword) { case RTF_HEADER: @@ -235,7 +235,7 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword) // Check if this is an endnote. OStringBuffer aBuf; char ch; - sal_Size nCurrent = Strm().Tell(); + sal_uInt64 const nCurrent = Strm().Tell(); for (int i = 0; i < 7; ++i) { Strm().ReadChar(ch); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 60872d3259ca..92b9b96f8c86 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -338,14 +338,14 @@ void RTFDocumentImpl::setIgnoreFirst(OUString& rIgnoreFirst) m_aIgnoreFirst = rIgnoreFirst; } -void RTFDocumentImpl::resolveSubstream(sal_Size nPos, Id nId) +void RTFDocumentImpl::resolveSubstream(std::size_t nPos, Id nId) { OUString aStr; resolveSubstream(nPos, nId, aStr); } -void RTFDocumentImpl::resolveSubstream(sal_Size nPos, Id nId, OUString& rIgnoreFirst) +void RTFDocumentImpl::resolveSubstream(std::size_t nPos, Id nId, OUString& rIgnoreFirst) { - sal_Size nCurrent = Strm().Tell(); + sal_uInt64 const nCurrent = Strm().Tell(); // Seek to header position, parse, then seek back. auto pImpl = std::make_shared<RTFDocumentImpl>(m_xContext, m_xInputStream, m_xDstDoc, m_xFrame, m_xStatusIndicator, m_rMediaDescriptor); pImpl->setSuperstream(this); @@ -600,7 +600,7 @@ void RTFDocumentImpl::sectBreak(bool bFinal) } while (!m_nHeaderFooterPositions.empty()) { - std::pair<Id, sal_Size> aPair = m_nHeaderFooterPositions.front(); + std::pair<Id, std::size_t> aPair = m_nHeaderFooterPositions.front(); m_nHeaderFooterPositions.pop(); resolveSubstream(aPair.second, aPair.first); } @@ -635,7 +635,7 @@ void RTFDocumentImpl::sectBreak(bool bFinal) m_bNeedSect = false; } -void RTFDocumentImpl::seek(sal_Size nPos) +void RTFDocumentImpl::seek(sal_uInt64 const nPos) { Strm().Seek(nPos); } @@ -1545,7 +1545,7 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t& rBuffer, else if (std::get<0>(aTuple) == BUFFER_RESOLVESUBSTREAM) { RTFSprms& rAttributes = std::get<1>(aTuple)->getAttributes(); - sal_Size nPos = rAttributes.find(0)->getInt(); + std::size_t nPos = rAttributes.find(0)->getInt(); Id nId = rAttributes.find(1)->getInt(); OUString aCustomMark = rAttributes.find(2)->getString(); resolveSubstream(nPos, nId, aCustomMark); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index 66588ba35436..d1b5ca1f1bad 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -417,7 +417,7 @@ public: void setAuthor(OUString& rAuthor); void setAuthorInitials(OUString& rAuthorInitials); void setIgnoreFirst(OUString& rIgnoreFirst); - void seek(sal_Size nPos); + void seek(sal_uInt64 nPos); const css::uno::Reference<css::lang::XMultiServiceFactory>& getModelFactory() { return m_xModelFactory; @@ -460,8 +460,8 @@ private: writerfilter::Reference<Properties>::Pointer_t createStyleProperties(); void resetSprms(); void resetAttributes(); - void resolveSubstream(sal_Size nPos, Id nId); - void resolveSubstream(sal_Size nPos, Id nId, OUString& rIgnoreFirst); + void resolveSubstream(std::size_t nPos, Id nId); + void resolveSubstream(std::size_t nPos, Id nId, OUString& rIgnoreFirst); void text(OUString& rString); // Sends a single character to dmapper, taking care of buffering. @@ -585,8 +585,8 @@ private: RTFDocumentImpl* m_pSuperstream; /// Type of the stream: header, footer, footnote, etc. Id m_nStreamType; - std::queue< std::pair<Id, sal_Size> > m_nHeaderFooterPositions; - sal_Size m_nGroupStartPos; + std::queue< std::pair<Id, std::size_t> > m_nHeaderFooterPositions; + std::size_t m_nGroupStartPos; /// Ignore the first occurrence of this text. OUString m_aIgnoreFirst; /// Bookmark name <-> index map. diff --git a/writerfilter/source/rtftok/rtflookahead.cxx b/writerfilter/source/rtftok/rtflookahead.cxx index 8a3fc95c060c..9f43301666e6 100644 --- a/writerfilter/source/rtftok/rtflookahead.cxx +++ b/writerfilter/source/rtftok/rtflookahead.cxx @@ -17,11 +17,11 @@ namespace writerfilter namespace rtftok { -RTFLookahead::RTFLookahead(SvStream& rStream, sal_Size nGroupStart) +RTFLookahead::RTFLookahead(SvStream& rStream, sal_uInt64 nGroupStart) : m_rStream(rStream), m_bHasTable(false) { - sal_Size nPos = m_rStream.Tell(); + sal_uInt64 const nPos = m_rStream.Tell(); m_rStream.Seek(nGroupStart); uno::Reference<task::XStatusIndicator> xStatusIndicator; m_pTokenizer.reset(new RTFTokenizer(*this, &m_rStream, xStatusIndicator)); diff --git a/writerfilter/source/rtftok/rtflookahead.hxx b/writerfilter/source/rtftok/rtflookahead.hxx index f96b2f7cf37f..aa17ab5776ae 100644 --- a/writerfilter/source/rtftok/rtflookahead.hxx +++ b/writerfilter/source/rtftok/rtflookahead.hxx @@ -27,7 +27,7 @@ namespace rtftok class RTFLookahead : public RTFListener { public: - RTFLookahead(SvStream& rStream, sal_Size nGroupStart); + RTFLookahead(SvStream& rStream, sal_uInt64 nGroupStart); virtual ~RTFLookahead() override; virtual RTFError dispatchDestination(RTFKeyword nKeyword) override; virtual RTFError dispatchFlag(RTFKeyword nKeyword) override; diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx b/writerfilter/source/rtftok/rtftokenizer.cxx index 5afceabaaaa4..8ca74334707d 100644 --- a/writerfilter/source/rtftok/rtftokenizer.cxx +++ b/writerfilter/source/rtftok/rtftokenizer.cxx @@ -59,16 +59,16 @@ RTFError RTFTokenizer::resolveParse() RTFError ret; // for hex chars int b = 0, count = 2; - sal_Size nPercentSize = 0; - sal_Size nLastPos = 0; + std::size_t nPercentSize = 0; + sal_uInt64 nLastPos = 0; if (m_xStatusIndicator.is()) { static ResMgr* pResMgr = ResMgr::CreateResMgr("svx", Application::GetSettings().GetUILanguageTag()); OUString sDocLoad(ResId(RID_SVXSTR_DOC_LOAD, *pResMgr).toString()); - sal_Size nCurrentPos = Strm().Tell(); - sal_Size nEndPos = nCurrentPos + Strm().remainingSize(); + sal_uInt64 const nCurrentPos = Strm().Tell(); + sal_uInt64 const nEndPos = nCurrentPos + Strm().remainingSize(); m_xStatusIndicator->start(sDocLoad, nEndPos); nPercentSize = nEndPos / 100; @@ -79,7 +79,7 @@ RTFError RTFTokenizer::resolveParse() { //SAL_INFO("writerfilter", OSL_THIS_FUNC << ": parsing character '" << ch << "'"); - sal_Size nCurrentPos = Strm().Tell(); + sal_uInt64 const nCurrentPos = Strm().Tell(); if (m_xStatusIndicator.is() && nCurrentPos > (nLastPos + nPercentSize)) m_xStatusIndicator->setValue(nLastPos = nCurrentPos); diff --git a/writerfilter/source/rtftok/rtftokenizer.hxx b/writerfilter/source/rtftok/rtftokenizer.hxx index 9701f65918d6..0e2039d61674 100644 --- a/writerfilter/source/rtftok/rtftokenizer.hxx +++ b/writerfilter/source/rtftok/rtftokenizer.hxx @@ -42,7 +42,7 @@ public: /// To be invoked by the popState() callback to single when the importer leaves a group. void popGroup(); OUString getPosition(); - sal_Size getGroupStart() + std::size_t getGroupStart() { return m_nGroupStart; } @@ -68,8 +68,8 @@ private: /// Same as the size of the importer's states, except that this can be negative for invalid input. int m_nGroup; sal_Int32 m_nLineNumber; - sal_Size m_nLineStartPos; - sal_Size m_nGroupStart; + std::size_t m_nLineStartPos; + std::size_t m_nGroupStart; }; } // namespace rtftok } // namespace writerfilter |