diff options
Diffstat (limited to 'vcl/source')
28 files changed, 79 insertions, 77 deletions
diff --git a/vcl/source/bitmap/BitmapConvolutionMatrixFilter.cxx b/vcl/source/bitmap/BitmapConvolutionMatrixFilter.cxx index 1febdf3503c5..b92a0124b458 100644 --- a/vcl/source/bitmap/BitmapConvolutionMatrixFilter.cxx +++ b/vcl/source/bitmap/BitmapConvolutionMatrixFilter.cxx @@ -35,8 +35,8 @@ BitmapEx BitmapConvolutionMatrixFilter::execute(BitmapEx const& rBitmapEx) const { const tools::Long nWidth = pWriteAcc->Width(), nWidth2 = nWidth + 2; const tools::Long nHeight = pWriteAcc->Height(), nHeight2 = nHeight + 2; - std::unique_ptr<long[]> pColm(new long[nWidth2]); - std::unique_ptr<long[]> pRows(new long[nHeight2]); + std::unique_ptr<tools::Long[]> pColm(new tools::Long[nWidth2]); + std::unique_ptr<tools::Long[]> pRows(new tools::Long[nHeight2]); std::unique_ptr<BitmapColor[]> pColRow1(new BitmapColor[nWidth2]); std::unique_ptr<BitmapColor[]> pColRow2(new BitmapColor[nWidth2]); std::unique_ptr<BitmapColor[]> pColRow3(new BitmapColor[nWidth2]); @@ -45,7 +45,7 @@ BitmapEx BitmapConvolutionMatrixFilter::execute(BitmapEx const& rBitmapEx) const BitmapColor* pRowTmp3 = pColRow3.get(); BitmapColor* pColor; tools::Long nY, nX, i, nSumR, nSumG, nSumB, nMatrixVal, nTmp; - std::array<std::array<long, 256>, 9> aKoeff; + std::array<std::array<tools::Long, 256>, 9> aKoeff; tools::Long* pTmp; // create LUT of products of matrix value and possible color component values diff --git a/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx b/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx index a19683ab6582..aa8dff8aaa29 100644 --- a/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx +++ b/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx @@ -55,7 +55,8 @@ BitmapEx BitmapEmbossGreyFilter::execute(BitmapEx const& rBitmapEx) const const tools::Long nLz = FRound(sin(fElev) * 255.0); const auto nZ2 = ((6 * 255) / 4) * ((6 * 255) / 4); const tools::Long nNzLz = ((6 * 255) / 4) * nLz; - const sal_uInt8 cLz = static_cast<sal_uInt8>(std::clamp(nLz, 0L, 255L)); + const sal_uInt8 cLz + = static_cast<sal_uInt8>(std::clamp(nLz, tools::Long(0), tools::Long(255))); // fill mapping tables pHMap[0] = 0; diff --git a/vcl/source/bitmap/BitmapFilterStackBlur.cxx b/vcl/source/bitmap/BitmapFilterStackBlur.cxx index 9bf4b810ac60..d3e1ddea9310 100644 --- a/vcl/source/bitmap/BitmapFilterStackBlur.cxx +++ b/vcl/source/bitmap/BitmapFilterStackBlur.cxx @@ -96,7 +96,7 @@ struct BlurArrays { for (tools::Long i = 0; i < maShared.mnDiv; i++) { - maPositionTable[i] = std::clamp(i - maShared.mnRadius, 0L, nLastIndex); + maPositionTable[i] = std::clamp(i - maShared.mnRadius, tools::Long(0), nLastIndex); maWeightTable[i] = maShared.mnRadius + 1 - std::abs(i - maShared.mnRadius); } } diff --git a/vcl/source/bitmap/BitmapSobelGreyFilter.cxx b/vcl/source/bitmap/BitmapSobelGreyFilter.cxx index e6609f77d9f4..e34af85df300 100644 --- a/vcl/source/bitmap/BitmapSobelGreyFilter.cxx +++ b/vcl/source/bitmap/BitmapSobelGreyFilter.cxx @@ -120,7 +120,8 @@ BitmapEx BitmapSobelGreyFilter::execute(BitmapEx const& rBitmapEx) const nSum1 = static_cast<tools::Long>( sqrt(static_cast<double>(nSum1 * nSum1 + nSum2 * nSum2))); - aGrey.SetIndex(~static_cast<sal_uInt8>(std::clamp(nSum1, 0L, 255L))); + aGrey.SetIndex(~static_cast<sal_uInt8>( + std::clamp(nSum1, tools::Long(0), tools::Long(255)))); pWriteAcc->SetPixelOnData(pScanline, nX, aGrey); if (nX < (nWidth - 1)) diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 27eaddaf1949..0484797de298 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -472,14 +472,14 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const tools::Rectangl const sal_Int32 nLen = aText.getLength(); tools::Long nDXBuffer[256]; - std::unique_ptr<long[]> pDXBuffer; + std::unique_ptr<tools::Long[]> pDXBuffer; tools::Long* pDX = nDXBuffer; if (nLen) { if (o3tl::make_unsigned(2 * nLen) > SAL_N_ELEMENTS(nDXBuffer)) { - pDXBuffer.reset(new long[2 * (nLen + 1)]); + pDXBuffer.reset(new tools::Long[2 * (nLen + 1)]); pDX = pDXBuffer.get(); } @@ -1068,14 +1068,14 @@ void Edit::ImplShowCursor( bool bOnlyIfVisible ) tools::Long nTextPos = 0; tools::Long nDXBuffer[256]; - std::unique_ptr<long[]> pDXBuffer; + std::unique_ptr<tools::Long[]> pDXBuffer; tools::Long* pDX = nDXBuffer; if( !aText.isEmpty() ) { if( o3tl::make_unsigned(2*aText.getLength()) > SAL_N_ELEMENTS(nDXBuffer) ) { - pDXBuffer.reset(new long[2*(aText.getLength()+1)]); + pDXBuffer.reset(new tools::Long[2*(aText.getLength()+1)]); pDX = pDXBuffer.get(); } @@ -1192,11 +1192,11 @@ sal_Int32 Edit::ImplGetCharPos( const Point& rWindowPos ) const OUString aText = ImplGetText(); tools::Long nDXBuffer[256]; - std::unique_ptr<long[]> pDXBuffer; + std::unique_ptr<tools::Long[]> pDXBuffer; tools::Long* pDX = nDXBuffer; if( o3tl::make_unsigned(2*aText.getLength()) > SAL_N_ELEMENTS(nDXBuffer) ) { - pDXBuffer.reset(new long[2*(aText.getLength()+1)]); + pDXBuffer.reset(new tools::Long[2*(aText.getLength()+1)]); pDX = pDXBuffer.get(); } @@ -2131,14 +2131,14 @@ void Edit::Command( const CommandEvent& rCEvt ) { OUString aText = ImplGetText(); tools::Long nDXBuffer[256]; - std::unique_ptr<long[]> pDXBuffer; + std::unique_ptr<tools::Long[]> pDXBuffer; tools::Long* pDX = nDXBuffer; if( !aText.isEmpty() ) { if( o3tl::make_unsigned(2*aText.getLength()) > SAL_N_ELEMENTS(nDXBuffer) ) { - pDXBuffer.reset(new long[2*(aText.getLength()+1)]); + pDXBuffer.reset(new tools::Long[2*(aText.getLength()+1)]); pDX = pDXBuffer.get(); } diff --git a/vcl/source/filter/jpeg/JpegReader.cxx b/vcl/source/filter/jpeg/JpegReader.cxx index 3b3b75204f81..b0681709eb2a 100644 --- a/vcl/source/filter/jpeg/JpegReader.cxx +++ b/vcl/source/filter/jpeg/JpegReader.cxx @@ -105,7 +105,7 @@ static boolean fill_input_buffer (j_decompress_ptr cinfo) return TRUE; } -static void skip_input_data (j_decompress_ptr cinfo, tools::Long numberOfBytes) +static void skip_input_data (j_decompress_ptr cinfo, long numberOfBytes) { SourceManagerStruct * source = reinterpret_cast<SourceManagerStruct *>(cinfo->src); diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx index 63026cd2e7dc..b2d692e339dd 100644 --- a/vcl/source/filter/wmf/emfwr.cxx +++ b/vcl/source/filter/wmf/emfwr.cxx @@ -846,18 +846,18 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const OUString& rText, c return; sal_uInt32 nNormWidth; - std::unique_ptr<long[]> pOwnArray; + std::unique_ptr<tools::Long[]> pOwnArray; tools::Long* pDX; // get text sizes if( pDXArray ) { nNormWidth = maVDev->GetTextWidth( rText ); - pDX = const_cast<long*>(pDXArray); + pDX = const_cast<tools::Long*>(pDXArray); } else { - pOwnArray.reset(new long[ nLen ]); + pOwnArray.reset(new tools::Long[ nLen ]); nNormWidth = maVDev->GetTextArray( rText, pOwnArray.get() ); pDX = pOwnArray.get(); } diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index 43463c10e62e..515468386488 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -1196,7 +1196,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) pVirDev->SetFont( aSrcFont ); const sal_Int32 nLen = aTemp.getLength(); - std::unique_ptr<long[]> pDXAry(nLen ? new long[ nLen ] : nullptr); + std::unique_ptr<tools::Long[]> pDXAry(nLen ? new tools::Long[ nLen ] : nullptr); const sal_Int32 nNormSize = pVirDev->GetTextArray( aTemp, pDXAry.get() ); if (nLen && nNormSize == 0) { diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index 78ac64e7961f..3b0b1cd76bfb 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -591,7 +591,7 @@ bool Bitmap::ImplConvertDown(sal_uInt16 nBitCount, Color const * pExtColor) pWriteAcc->SetPalette(aPalette); - for (tools::Long nY = 0; nY < std::min(nHeight, 2L); nY++, nYTmp++) + for (tools::Long nY = 0; nY < std::min(nHeight, tools::Long(2)); nY++, nYTmp++) { pQLine2 = !nY ? aErrQuad1.data() : aErrQuad2.data(); Scanline pScanlineRead = pReadAcc->GetScanline(nYTmp); @@ -872,8 +872,8 @@ bool Bitmap::Dither() tools::Long nW2 = nW - 3; tools::Long nRErr, nGErr, nBErr; tools::Long nRC, nGC, nBC; - std::unique_ptr<long[]> p1(new long[ nW ]); - std::unique_ptr<long[]> p2(new long[ nW ]); + std::unique_ptr<tools::Long[]> p1(new tools::Long[ nW ]); + std::unique_ptr<tools::Long[]> p2(new tools::Long[ nW ]); tools::Long* p1T = p1.get(); tools::Long* p2T = p2.get(); tools::Long* pTmp; @@ -991,7 +991,7 @@ bool Bitmap::Dither() return bRet; } -void Bitmap::Vectorize( GDIMetaFile& rMtf, sal_uInt8 cReduce, const Link<long,void>* pProgress ) +void Bitmap::Vectorize( GDIMetaFile& rMtf, sal_uInt8 cReduce, const Link<tools::Long,void>* pProgress ) { ImplVectorizer::ImplVectorize( *this, rMtf, cReduce, pProgress ); } diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 40c1d7aba529..5fdcac0b3255 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -2181,16 +2181,16 @@ void GDIMetaFile::ReplaceColors( const Color* pSearchColors, const Color* pRepla tools::Long nVal; nVal = pSearchColors[ i ].GetRed(); - aColParam.pMinR[ i ] = static_cast<sal_uLong>(std::max( nVal, 0L )); - aColParam.pMaxR[ i ] = static_cast<sal_uLong>(std::min( nVal, 255L )); + aColParam.pMinR[ i ] = static_cast<sal_uLong>(std::max( nVal, tools::Long(0) )); + aColParam.pMaxR[ i ] = static_cast<sal_uLong>(std::min( nVal, tools::Long(255) )); nVal = pSearchColors[ i ].GetGreen(); - aColParam.pMinG[ i ] = static_cast<sal_uLong>(std::max( nVal, 0L )); - aColParam.pMaxG[ i ] = static_cast<sal_uLong>(std::min( nVal, 255L )); + aColParam.pMinG[ i ] = static_cast<sal_uLong>(std::max( nVal, tools::Long(0) )); + aColParam.pMaxG[ i ] = static_cast<sal_uLong>(std::min( nVal, tools::Long(255) )); nVal = pSearchColors[ i ].GetBlue(); - aColParam.pMinB[ i ] = static_cast<sal_uLong>(std::max( nVal, 0L )); - aColParam.pMaxB[ i ] = static_cast<sal_uLong>(std::min( nVal, 255L )); + aColParam.pMinB[ i ] = static_cast<sal_uLong>(std::max( nVal, tools::Long(0) )); + aColParam.pMaxB[ i ] = static_cast<sal_uLong>(std::min( nVal, tools::Long(255) )); } aColParam.pDstCols = pReplaceColors; diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx index 621a3592661a..f64d5c437c26 100644 --- a/vcl/source/gdi/impvect.cxx +++ b/vcl/source/gdi/impvect.cxx @@ -49,7 +49,7 @@ static constexpr tools::Long BACK_MAP( tools::Long _def_nVal ) { return ((_def_nVal + 2) >> 2) - 1; } -static void VECT_PROGRESS( const Link<long, void>* pProgress, tools::Long _def_nVal ) +static void VECT_PROGRESS( const Link<tools::Long, void>* pProgress, tools::Long _def_nVal ) { if(pProgress) pProgress->Call(_def_nVal); @@ -642,7 +642,7 @@ void ImplChain::ImplPostProcess( const ImplPointArray& rArr ) namespace ImplVectorizer { bool ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf, - sal_uInt8 cReduce, const Link<long,void>* pProgress ) + sal_uInt8 cReduce, const Link<tools::Long,void>* pProgress ) { bool bRet = false; diff --git a/vcl/source/gdi/impvect.hxx b/vcl/source/gdi/impvect.hxx index 017b2dc1a728..41f0884e9626 100644 --- a/vcl/source/gdi/impvect.hxx +++ b/vcl/source/gdi/impvect.hxx @@ -27,7 +27,7 @@ namespace tools { class PolyPolygon; } namespace ImplVectorizer { bool ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf, - sal_uInt8 cReduce, const Link<long,void>* pProgress ); + sal_uInt8 cReduce, const Link<tools::Long,void>* pProgress ); }; #endif diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index ac70349d4647..2a1bb8562438 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -1091,7 +1091,7 @@ MetaTextArrayAction::MetaTextArrayAction( const MetaTextArrayAction& rAction ) : { if( rAction.mpDXAry ) { - mpDXAry.reset( new long[ mnLen ] ); + mpDXAry.reset( new tools::Long[ mnLen ] ); memcpy( mpDXAry.get(), rAction.mpDXAry.get(), mnLen * sizeof( long ) ); } } @@ -1111,7 +1111,7 @@ MetaTextArrayAction::MetaTextArrayAction( const Point& rStartPt, if (nAryLen > 0) { - mpDXAry.reset( new long[ nAryLen ] ); + mpDXAry.reset( new tools::Long[ nAryLen ] ); memcpy( mpDXAry.get(), pDXAry, nAryLen * sizeof(long) ); } } @@ -1194,7 +1194,7 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData ) // #i9762#, #106172# Ensure that DX array is at least mnLen entries long if ( mnLen >= nAryLen ) { - mpDXAry.reset( new (std::nothrow)long[ mnLen ] ); + mpDXAry.reset( new (std::nothrow)tools::Long[ mnLen ] ); if ( mpDXAry ) { sal_Int32 i; diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 16db9ad61bd4..756752275b51 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -240,7 +240,7 @@ void Printer::EmulateDrawTransparent ( const tools::PolyPolygon& rPolyPoly, tools::Rectangle aPolyRect( LogicToPixel( rPolyPoly ).GetBoundRect() ); const Size aDPISize( LogicToPixel(Size(1, 1), MapMode(MapUnit::MapInch)) ); - const tools::Long nBaseExtent = std::max( FRound( aDPISize.Width() / 300. ), 1L ); + const tools::Long nBaseExtent = std::max<tools::Long>( FRound( aDPISize.Width() / 300. ), 1 ); tools::Long nMove; const sal_uInt16 nTrans = ( nTransparencePercent < 13 ) ? 0 : ( nTransparencePercent < 38 ) ? 25 : diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 16fa84ab95d5..7beea9a01091 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -1486,7 +1486,7 @@ void MultiSalLayout::GetCaretPositions( int nMaxIndex, tools::Long* pCaretXArray if( mnLevel <= 1 ) return; - std::unique_ptr<long[]> const pTempPos(new long[nMaxIndex]); + std::unique_ptr<tools::Long[]> const pTempPos(new tools::Long[nMaxIndex]); for( int n = 1; n < mnLevel; ++n ) { mpLayouts[ n ]->GetCaretPositions( nMaxIndex, pTempPos.get() ); diff --git a/vcl/source/gdi/salmisc.cxx b/vcl/source/gdi/salmisc.cxx index aa9220b53136..a077e50be4d6 100644 --- a/vcl/source/gdi/salmisc.cxx +++ b/vcl/source/gdi/salmisc.cxx @@ -363,15 +363,15 @@ std::unique_ptr<BitmapBuffer> StretchAndConvert( std::unique_ptr<Scanline[]> pSrcScan; std::unique_ptr<Scanline[]> pDstScan; - std::unique_ptr<long[]> pMapX; - std::unique_ptr<long[]> pMapY; + std::unique_ptr<tools::Long[]> pMapX; + std::unique_ptr<tools::Long[]> pMapY; try { pSrcScan.reset(new Scanline[rSrcBuffer.mnHeight]); pDstScan.reset(new Scanline[pDstBuffer->mnHeight]); - pMapX.reset(new long[pDstBuffer->mnWidth]); - pMapY.reset(new long[pDstBuffer->mnHeight]); + pMapX.reset(new tools::Long[pDstBuffer->mnWidth]); + pMapY.reset(new tools::Long[pDstBuffer->mnHeight]); } catch( const std::bad_alloc& ) { diff --git a/vcl/source/gdi/svmconverter.cxx b/vcl/source/gdi/svmconverter.cxx index 2af54eabf368..6912654a6164 100644 --- a/vcl/source/gdi/svmconverter.cxx +++ b/vcl/source/gdi/svmconverter.cxx @@ -713,7 +713,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) OUString aStr(OStringToOUString(aByteStr, eActualCharSet)); - std::unique_ptr<long[]> pDXAry; + std::unique_ptr<tools::Long[]> pDXAry; if (nAryLen > 0) { const size_t nMinRecordSize = sizeof(sal_Int32); @@ -740,7 +740,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) } else { - pDXAry.reset(new long[nDXAryLen]); + pDXAry.reset(new tools::Long[nDXAryLen]); for (sal_Int32 j = 0; j < nAryLen; ++j) { @@ -753,7 +753,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) { if (nAryLen+1 == nStrLen && nIndex >= 0) { - std::unique_ptr<long[]> pTmpAry(new long[nStrLen]); + std::unique_ptr<tools::Long[]> pTmpAry(new tools::Long[nStrLen]); aFontVDev->GetTextArray( aStr, pTmpAry.get(), nIndex, nLen ); diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx index 988c5bfa578f..ea86aa47b049 100644 --- a/vcl/source/gdi/textlayout.cxx +++ b/vcl/source/gdi/textlayout.cxx @@ -207,7 +207,7 @@ namespace vcl return; } - std::unique_ptr<long[]> pCharWidths(new long[ _nLength ]); + std::unique_ptr<tools::Long[]> pCharWidths(new tools::Long[ _nLength ]); tools::Long nTextWidth = GetTextArray( _rText, pCharWidths.get(), _nStartIndex, _nLength ); m_rTargetDevice.DrawTextArray( _rStartPoint, _rText, pCharWidths.get(), _nStartIndex, _nLength ); pCharWidths.reset(); diff --git a/vcl/source/graphic/GraphicObject.cxx b/vcl/source/graphic/GraphicObject.cxx index aa8b5a3169b7..a34e8a064d46 100644 --- a/vcl/source/graphic/GraphicObject.cxx +++ b/vcl/source/graphic/GraphicObject.cxx @@ -527,8 +527,8 @@ void GraphicObject::DrawTiled( OutputDevice* pOut, const tools::Rectangle& rArea const MapMode aOutMapMode( pOut->GetMapMode() ); // #106258# Clamp size to 1 for zero values. This is okay, since // logical size of zero is handled above already - const Size aOutTileSize( ::std::max( 1L, pOut->LogicToPixel( rSize, aOutMapMode ).Width() ), - ::std::max( 1L, pOut->LogicToPixel( rSize, aOutMapMode ).Height() ) ); + const Size aOutTileSize( ::std::max( tools::Long(1), pOut->LogicToPixel( rSize, aOutMapMode ).Width() ), + ::std::max( tools::Long(1), pOut->LogicToPixel( rSize, aOutMapMode ).Height() ) ); //#i69780 clip final tile size to a sane max size while ((static_cast<sal_Int64>(rSize.Width()) * nTileCacheSize1D) > SAL_MAX_UINT16) diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index ad25020a620e..7b6e8ab6be91 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -726,19 +726,19 @@ namespace struct LinearScaleContext { - std::unique_ptr<long[]> mpMapX; - std::unique_ptr<long[]> mpMapY; + std::unique_ptr<tools::Long[]> mpMapX; + std::unique_ptr<tools::Long[]> mpMapY; - std::unique_ptr<long[]> mpMapXOffset; - std::unique_ptr<long[]> mpMapYOffset; + std::unique_ptr<tools::Long[]> mpMapXOffset; + std::unique_ptr<tools::Long[]> mpMapYOffset; LinearScaleContext(tools::Rectangle const & aDstRect, tools::Rectangle const & aBitmapRect, Size const & aOutSize, tools::Long nOffX, tools::Long nOffY) - : mpMapX(new long[aDstRect.GetWidth()]) - , mpMapY(new long[aDstRect.GetHeight()]) - , mpMapXOffset(new long[aDstRect.GetWidth()]) - , mpMapYOffset(new long[aDstRect.GetHeight()]) + : mpMapX(new tools::Long[aDstRect.GetWidth()]) + , mpMapY(new tools::Long[aDstRect.GetHeight()]) + , mpMapXOffset(new tools::Long[aDstRect.GetWidth()]) + , mpMapYOffset(new tools::Long[aDstRect.GetHeight()]) { const tools::Long nSrcWidth = aBitmapRect.GetWidth(); const tools::Long nSrcHeight = aBitmapRect.GetHeight(); @@ -760,7 +760,7 @@ private: const double fReverseScale = (std::abs(nOutDimension) > 1) ? (nSrcDimension - 1) / double(std::abs(nOutDimension) - 1) : 0.0; - tools::Long nSampleRange = std::max(0L, nSrcDimension - 2); + tools::Long nSampleRange = std::max(tools::Long(0), nSrcDimension - 2); for (tools::Long i = 0; i < nDstDimension; i++) { @@ -893,14 +893,14 @@ public: struct TradScaleContext { - std::unique_ptr<long[]> mpMapX; - std::unique_ptr<long[]> mpMapY; + std::unique_ptr<tools::Long[]> mpMapX; + std::unique_ptr<tools::Long[]> mpMapY; TradScaleContext(tools::Rectangle const & aDstRect, tools::Rectangle const & aBitmapRect, Size const & aOutSize, tools::Long nOffX, tools::Long nOffY) - : mpMapX(new long[aDstRect.GetWidth()]) - , mpMapY(new long[aDstRect.GetHeight()]) + : mpMapX(new tools::Long[aDstRect.GetWidth()]) + , mpMapY(new tools::Long[aDstRect.GetHeight()]) { const tools::Long nSrcWidth = aBitmapRect.GetWidth(); const tools::Long nSrcHeight = aBitmapRect.GetHeight(); diff --git a/vcl/source/outdev/gradient.cxx b/vcl/source/outdev/gradient.cxx index d67430da187d..32852eefc34e 100644 --- a/vcl/source/outdev/gradient.cxx +++ b/vcl/source/outdev/gradient.cxx @@ -479,7 +479,7 @@ void OutputDevice::DrawComplexGradient( const tools::Rectangle& rRect, tools::Long nStepCount = GetGradientSteps( rGradient, rRect, false/*bMtf*/, true/*bComplex*/ ); // at least three steps and at most the number of colour differences - tools::Long nSteps = std::max( nStepCount, 2L ); + tools::Long nSteps = std::max( nStepCount, tools::Long(2) ); tools::Long nCalcSteps = std::abs( nRedSteps ); tools::Long nTempSteps = std::abs( nGreenSteps ); if ( nTempSteps > nCalcSteps ) @@ -829,7 +829,7 @@ void OutputDevice::DrawComplexGradientToMetafile( const tools::Rectangle& rRect, tools::Long nStepCount = GetGradientSteps( rGradient, rRect, true, true ); // at least three steps and at most the number of colour differences - tools::Long nSteps = std::max( nStepCount, 2L ); + tools::Long nSteps = std::max( nStepCount, tools::Long(2) ); tools::Long nCalcSteps = std::abs( nRedSteps ); tools::Long nTempSteps = std::abs( nGreenSteps ); if ( nTempSteps > nCalcSteps ) diff --git a/vcl/source/outdev/hatch.cxx b/vcl/source/outdev/hatch.cxx index bb2cb67cb1ac..44cf941149bb 100644 --- a/vcl/source/outdev/hatch.cxx +++ b/vcl/source/outdev/hatch.cxx @@ -167,7 +167,7 @@ void OutputDevice::DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& { tools::Rectangle aRect( rPolyPoly.GetBoundRect() ); const tools::Long nLogPixelWidth = ImplDevicePixelToLogicWidth( 1 ); - const tools::Long nWidth = ImplDevicePixelToLogicWidth( std::max( ImplLogicWidthToDevicePixel( rHatch.GetDistance() ), 3L ) ); + const tools::Long nWidth = ImplDevicePixelToLogicWidth( std::max( ImplLogicWidthToDevicePixel( rHatch.GetDistance() ), tools::Long(3) ) ); std::unique_ptr<Point[]> pPtBuffer(new Point[ HATCH_MAXPOINTS ]); Point aPt1, aPt2, aEndPt1; Size aInc; diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx index 2a1b46ae0b72..a2134bd468d5 100644 --- a/vcl/source/outdev/map.cxx +++ b/vcl/source/outdev/map.cxx @@ -588,12 +588,12 @@ LineInfo OutputDevice::ImplLogicToDevicePixel( const LineInfo& rLineInfo ) const if( aInfo.GetStyle() == LineStyle::Dash ) { if( aInfo.GetDotCount() && aInfo.GetDotLen() ) - aInfo.SetDotLen( std::max( ImplLogicWidthToDevicePixel( aInfo.GetDotLen() ), 1L ) ); + aInfo.SetDotLen( std::max( ImplLogicWidthToDevicePixel( aInfo.GetDotLen() ), tools::Long(1) ) ); else aInfo.SetDotCount( 0 ); if( aInfo.GetDashCount() && aInfo.GetDashLen() ) - aInfo.SetDashLen( std::max( ImplLogicWidthToDevicePixel( aInfo.GetDashLen() ), 1L ) ); + aInfo.SetDashLen( std::max( ImplLogicWidthToDevicePixel( aInfo.GetDashLen() ), tools::Long(1) ) ); else aInfo.SetDashCount( 0 ); diff --git a/vcl/source/outdev/rect.cxx b/vcl/source/outdev/rect.cxx index 252cbc308daf..9252959d0f5e 100644 --- a/vcl/source/outdev/rect.cxx +++ b/vcl/source/outdev/rect.cxx @@ -251,8 +251,8 @@ void OutputDevice::DrawGrid( const tools::Rectangle& rRect, const Size& rDist, D if( mbOutputClipped ) return; - const tools::Long nDistX = std::max( rDist.Width(), 1L ); - const tools::Long nDistY = std::max( rDist.Height(), 1L ); + const tools::Long nDistX = std::max( rDist.Width(), tools::Long(1) ); + const tools::Long nDistY = std::max( rDist.Height(), tools::Long(1) ); tools::Long nX = ( rRect.Left() >= aDstRect.Left() ) ? rRect.Left() : ( rRect.Left() + ( ( aDstRect.Left() - rRect.Left() ) / nDistX ) * nDistX ); tools::Long nY = ( rRect.Top() >= aDstRect.Top() ) ? rRect.Top() : ( rRect.Top() + ( ( aDstRect.Top() - rRect.Top() ) / nDistY ) * nDistY ); const tools::Long nRight = aDstRect.Right(); diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 8573affbae99..0057fb4a2a14 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -1622,7 +1622,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const tools::Recta tools::Long nMnemonicY; DeviceCoordinate nMnemonicWidth; - std::unique_ptr<long[]> const pCaretXArray(new long[2 * nLineLen]); + std::unique_ptr<tools::Long[]> const pCaretXArray(new tools::Long[2 * nLineLen]); /*sal_Bool bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray.get(), nIndex, nLineLen ); tools::Long lc_x1 = pCaretXArray[2*(nMnemonicPos - nIndex)]; @@ -1691,7 +1691,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const tools::Recta DeviceCoordinate nMnemonicWidth = 0; if ( nMnemonicPos != -1 ) { - std::unique_ptr<long[]> const pCaretXArray(new long[2 * aStr.getLength()]); + std::unique_ptr<tools::Long[]> const pCaretXArray(new tools::Long[2 * aStr.getLength()]); /*sal_Bool bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray.get(), 0, aStr.getLength() ); tools::Long lc_x1 = pCaretXArray[2*nMnemonicPos]; tools::Long lc_x2 = pCaretXArray[2*nMnemonicPos+1]; @@ -2129,7 +2129,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const OUString& rStr, nMnemonicPos = nLen-1; } - std::unique_ptr<long[]> const pCaretXArray(new long[2 * nLen]); + std::unique_ptr<tools::Long[]> const pCaretXArray(new tools::Long[2 * nLen]); /*sal_Bool bRet =*/ GetCaretPositions( aStr, pCaretXArray.get(), nIndex, nLen, pGlyphs ); tools::Long lc_x1 = pCaretXArray[ 2*(nMnemonicPos - nIndex) ]; tools::Long lc_x2 = pCaretXArray[ 2*(nMnemonicPos - nIndex)+1 ]; diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 800b869f0676..1f13715a5e7f 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -1577,7 +1577,7 @@ Size Menu::ImplCalcSize( vcl::Window* pWin ) if( nMaxWidth > nScreenWidth/2 ) nMaxWidth = nScreenWidth/2; - sal_uInt16 gfxExtra = static_cast<sal_uInt16>(std::max( nExtra, 7L )); // #107710# increase space between checkmarks/images/text + sal_uInt16 gfxExtra = static_cast<sal_uInt16>(std::max( nExtra, tools::Long(7) )); // #107710# increase space between checkmarks/images/text nImgOrChkPos = static_cast<sal_uInt16>(nExtra); tools::Long nImgOrChkWidth = 0; if( aMaxSize.Height() > 0 ) // NWF case @@ -2968,7 +2968,7 @@ sal_uInt16 PopupMenu::ImplExecute( const VclPtr<vcl::Window>& pW, const tools::R SAL_WARN_IF(nMaxHeight < 768, "vcl", "Available height misdetected as " << nMaxHeight << "px. Setting to 768px instead."); - nMaxHeight = std::max(nMaxHeight, 768l); + nMaxHeight = std::max(nMaxHeight, tools::Long(768)); if (pStartedFrom && pStartedFrom->IsMenuBar()) nMaxHeight -= pW->GetSizePixel().Height(); diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index 2d26fcff10e8..d43eccb2725c 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -1762,7 +1762,7 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt ) { std::vector< ImplSplitItem >& rItems = mpSplitSet->mvItems; sal_uInt16 nItems = mpSplitSet->mvItems.size(); - mpLastSizes = new long[nItems*2]; + mpLastSizes = new tools::Long[nItems*2]; for ( sal_uInt16 i = 0; i < nItems; i++ ) { mpLastSizes[i*2] = rItems[i].mnSize; diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index a16cce9c39f0..8e396207df92 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -707,15 +707,15 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData ) if( std::abs(g.nX-aState.mnX) < 2 && std::abs(g.nY-aState.mnY) < 5 ) { tools::Long displacement = g.nTopDecoration ? g.nTopDecoration : 20; - if( aState.mnX + displacement + aState.mnWidth + g.nRightDecoration > o3tl::make_unsigned(aDesktop.Right()) || - aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration > o3tl::make_unsigned(aDesktop.Bottom()) ) + if( static_cast<tools::Long>(aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > aDesktop.Right() || + static_cast<tools::Long>(aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > aDesktop.Bottom() ) { // displacing would leave screen aState.mnX = g.nLeftDecoration ? g.nLeftDecoration : 10; // should result in (0,0) aState.mnY = displacement; if( bWrapped || - aState.mnX + displacement + aState.mnWidth + g.nRightDecoration > o3tl::make_unsigned(aDesktop.Right()) || - aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration > o3tl::make_unsigned(aDesktop.Bottom()) ) + static_cast<tools::Long>(aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > aDesktop.Right() || + static_cast<tools::Long>(aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > aDesktop.Bottom() ) break; // further displacement not possible -> break // avoid endless testing bWrapped = true; |