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 /sw/source/filter | |
parent | a19a67e20e847a42063559694ec5beec71abcfb3 (diff) |
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
Diffstat (limited to 'sw/source/filter')
-rw-r--r-- | sw/source/filter/basflt/iodetect.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/parcss1.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/WW8Sttbf.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfsdrexport.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8sty.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 30 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par2.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par2.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.cxx | 32 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.hxx | 4 |
11 files changed, 46 insertions, 46 deletions
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) |