summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-09-14 17:01:50 +0200
committerMichael Stahl <mstahl@redhat.com>2016-09-15 12:01:11 +0200
commitb647996a9babbee7b33cf45192e57df6a124628b (patch)
treeddc6dfe8a62ec53fbacc4eeccfeb20019f3ef4f0 /filter
parenta19a67e20e847a42063559694ec5beec71abcfb3 (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 'filter')
-rw-r--r--filter/source/graphicfilter/ieps/ieps.cxx2
-rw-r--r--filter/source/msfilter/dffpropset.cxx2
-rw-r--r--filter/source/msfilter/escherex.cxx4
-rw-r--r--filter/source/msfilter/mscodec.cxx40
-rw-r--r--filter/source/msfilter/msdffimp.cxx8
-rw-r--r--filter/source/svg/gfxtypes.hxx2
-rw-r--r--filter/source/svg/svgreader.cxx12
-rw-r--r--filter/source/textfilterdetect/filterdetect.cxx2
-rw-r--r--filter/source/xmlfilterdetect/filterdetect.cxx2
9 files changed, 37 insertions, 37 deletions
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;