diff options
author | Noel Grandin <noel@peralex.com> | 2020-10-28 08:30:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-11 06:34:17 +0100 |
commit | 3d90997fb6f232d8008df4d166d7b97b869c200f (patch) | |
tree | d26a1756dac5b7b55fac0f4322fe25ea02e9017e /filter | |
parent | 3de38e95561ab7ca114d9f3307702ba89c4e3e9a (diff) |
make tools::Long 64-bit on Windows platform
This is only for the 64-bit windows platform.
I don't see the point in messing with the 32-bit platforms, they are
(a) become more and more rare
(b) unlikely to even have enough available process memory to load extremely large calc spreadsheets
The primary problem we are addressing here is bringing
Windows-64bit up to same capability as Linux-64bit when it
comes to handling very large spreadsheets,
which is caused by things like tools::Rectangle using "long",
which means that all the work done to make Libreoffice on 64-bit
Linux capable of loading large spreadsheets is useless on Windows,
where long is 32-bit.
The operator<< for tools::Rectangle needs to be inside
the tools namespace because of an interaction with the cppunit
printing template stuff that I don't understand.
SalPoint changed to use sal_Int32, since it needs to be
the same definition as the Windows POINT structure.
Change-Id: Iab6f1af88847b6c8d46995e8ceda3f82b6722ff7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104913
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/graphicfilter/idxf/dxf2mtf.cxx | 2 | ||||
-rw-r--r-- | filter/source/graphicfilter/ieps/ieps.cxx | 4 | ||||
-rw-r--r-- | filter/source/graphicfilter/itiff/itiff.cxx | 6 | ||||
-rw-r--r-- | filter/source/svg/svgwriter.cxx | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx index 4b8de3428759..9ff520167e79 100644 --- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx +++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx @@ -643,7 +643,7 @@ void DXF2GDIMetaFile::Draw3DFaceEntity(const DXF3DFaceEntity & rE, const DXFTran if ((rE.nIEFlags&0x0f)==0) pVirDev->DrawPolygon(aPoly); else { for (i=0; i<nN; i++) { - if ( (rE.nIEFlags & (1<<i)) == 0 ) { + if ( (rE.nIEFlags & (static_cast<tools::Long>(1)<<i)) == 0 ) { DrawLine(aPoly[i],aPoly[(i+1)%nN]); } } diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index 0873bf9cff75..2c67a6effa3c 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -779,9 +779,9 @@ ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* ) bool bFail = nSecurityCount == 0; tools::Long nWidth(0), nHeight(0); if (!bFail) - bFail = o3tl::checked_sub(nNumb[2], nNumb[0], nWidth) || o3tl::checked_add(nWidth, 1L, nWidth); + bFail = o3tl::checked_sub(nNumb[2], nNumb[0], nWidth) || o3tl::checked_add(nWidth, tools::Long(1), nWidth); if (!bFail) - bFail = o3tl::checked_sub(nNumb[3], nNumb[1], nHeight) || o3tl::checked_add(nHeight, 1L, nHeight); + bFail = o3tl::checked_sub(nNumb[3], nNumb[1], nHeight) || o3tl::checked_add(nHeight, tools::Long(1), nHeight); if (!bFail && nWidth > 0 && nHeight > 0) { GDIMetaFile aMtf; diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx index 370371ece4fe..061d1a0ac73b 100644 --- a/filter/source/graphicfilter/itiff/itiff.cxx +++ b/filter/source/graphicfilter/itiff/itiff.cxx @@ -981,11 +981,11 @@ bool TIFFReader::ConvertScanline(sal_Int32 nY) } } const tools::Long nBlack = nSamp[ 3 ]; - nRed = static_cast<sal_uInt8>(std::max( 0L, 255L - ( ( static_cast<sal_Int32>(nSamp[ 0 ]) + nBlack - static_cast<sal_Int32>(nMinSampleValue << 1U ) ) * + nRed = static_cast<sal_uInt8>(std::max<sal_Int32>( 0, 255 - ( ( static_cast<sal_Int32>(nSamp[ 0 ]) + nBlack - static_cast<sal_Int32>(nMinSampleValue << 1U ) ) * 255L/static_cast<sal_Int32>(nMaxSampleValue-nMinSampleValue) ) )); - nGreen = static_cast<sal_uInt8>(std::max( 0L, 255L - ( ( static_cast<sal_Int32>(nSamp[ 1 ]) + nBlack - static_cast<sal_Int32>(nMinSampleValue << 1U ) ) * + nGreen = static_cast<sal_uInt8>(std::max<sal_Int32>( 0, 255 - ( ( static_cast<sal_Int32>(nSamp[ 1 ]) + nBlack - static_cast<sal_Int32>(nMinSampleValue << 1U ) ) * 255L/static_cast<sal_Int32>(nMaxSampleValue-nMinSampleValue) ) )); - nBlue = static_cast<sal_uInt8>(std::max( 0L, 255L - ( ( static_cast<sal_Int32>(nSamp[ 2 ]) + nBlack - static_cast<sal_Int32>(nMinSampleValue << 1U ) ) * + nBlue = static_cast<sal_uInt8>(std::max<sal_Int32>( 0, 255 - ( ( static_cast<sal_Int32>(nSamp[ 2 ]) + nBlack - static_cast<sal_Int32>(nMinSampleValue << 1U ) ) * 255L/static_cast<sal_Int32>(nMaxSampleValue-nMinSampleValue) ) )); SetPixel(nY, nx, Color(static_cast<sal_uInt8>(nRed), static_cast<sal_uInt8>(nGreen), static_cast<sal_uInt8>(nBlue))); } diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 7d5ac70e1a0c..02de5a40e649 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -2583,12 +2583,12 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const OUString& rText, ImplMap( rPos, aPos ); - std::unique_ptr<long[]> xTmpArray(new long[nLen]); + std::unique_ptr<tools::Long[]> xTmpArray(new tools::Long[nLen]); // get text sizes if( pDXArray ) { aNormSize = Size( mpVDev->GetTextWidth( rText ), 0 ); - memcpy(xTmpArray.get(), pDXArray, nLen * sizeof(long)); + memcpy(xTmpArray.get(), pDXArray, nLen * sizeof(tools::Long)); } else { |