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 /emfio | |
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 'emfio')
-rw-r--r-- | emfio/source/reader/emfreader.cxx | 6 | ||||
-rw-r--r-- | emfio/source/reader/mtftools.cxx | 2 | ||||
-rw-r--r-- | emfio/source/reader/wmfreader.cxx | 10 |
3 files changed, 9 insertions, 9 deletions
diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx index 5f396bf2244a..8114584ba61f 100644 --- a/emfio/source/reader/emfreader.cxx +++ b/emfio/source/reader/emfreader.cxx @@ -1821,17 +1821,17 @@ namespace emfio SAL_INFO("emfio", "\t\tText: " << aText); SAL_INFO("emfio", "\t\tDxBuffer:"); - std::unique_ptr<long[]> pDXAry, pDYAry; + std::unique_ptr<tools::Long[]> pDXAry, pDYAry; sal_Int32 nDxSize; bool bOverflow = o3tl::checked_multiply<sal_Int32>(nLen, (nOptions & ETO_PDY) ? 8 : 4, nDxSize); if (!bOverflow && offDx && ((nCurPos + offDx + nDxSize) <= nNextPos ) && nNextPos <= mnEndPos) { mpInputStream->Seek( nCurPos + offDx ); - pDXAry.reset( new long[aText.getLength()] ); + pDXAry.reset( new tools::Long[aText.getLength()] ); if (nOptions & ETO_PDY) { - pDYAry.reset( new long[aText.getLength()] ); + pDYAry.reset( new tools::Long[aText.getLength()] ); } for (sal_Int32 i = 0; i < aText.getLength(); ++i) diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx index 7cd1ff58093d..4b12f38675ce 100644 --- a/emfio/source/reader/mtftools.cxx +++ b/emfio/source/reader/mtftools.cxx @@ -1595,7 +1595,7 @@ namespace emfio // #i117968# VirtualDevice is not thread safe, but filter is used in multithreading SolarMutexGuard aGuard; ScopedVclPtrInstance< VirtualDevice > pVDev; - pDX = new long[ rText.getLength() ]; + pDX = new tools::Long[ rText.getLength() ]; pVDev->SetMapMode(MapMode(MapUnit::Map100thMM)); pVDev->SetFont( maLatestFont ); pVDev->GetTextArray( rText, pDX, 0, rText.getLength()); diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx index 155a74bec48b..1473930e83ec 100644 --- a/emfio/source/reader/wmfreader.cxx +++ b/emfio/source/reader/wmfreader.cxx @@ -609,7 +609,7 @@ namespace emfio // dxAry will not fit if ( nNewTextLen ) { - std::unique_ptr<long[]> pDXAry, pDYAry; + std::unique_ptr<tools::Long[]> pDXAry, pDYAry; auto nDxArySize = nMaxStreamPos - mpInputStream->Tell(); auto nDxAryEntries = nDxArySize >> 1; bool bUseDXAry = false; @@ -617,10 +617,10 @@ namespace emfio if ( ( ( nDxAryEntries % nOriginalTextLen ) == 0 ) && ( nNewTextLen <= nOriginalTextLen ) ) { sal_Int32 i; // needed just outside the for - pDXAry.reset(new long[ nNewTextLen ]); + pDXAry.reset(new tools::Long[ nNewTextLen ]); if ( nOptions & ETO_PDY ) { - pDYAry.reset(new long[ nNewTextLen ]); + pDYAry.reset(new tools::Long[ nNewTextLen ]); } for (i = 0; i < nNewTextLen; i++ ) { @@ -1109,7 +1109,7 @@ namespace emfio { Point aPt; sal_uInt32 nStringLen, nDXCount; - std::unique_ptr<long[]> pDXAry; + std::unique_ptr<tools::Long[]> pDXAry; SvMemoryStream aMemoryStream( nEscLen ); aMemoryStream.WriteBytes(pData.get(), nEscLen); aMemoryStream.Seek( STREAM_SEEK_TO_BEGIN ); @@ -1127,7 +1127,7 @@ namespace emfio if ( ( static_cast< sal_uInt64 >( nDXCount ) * sizeof( sal_Int32 ) ) >= ( nEscLen - aMemoryStream.Tell() ) ) nDXCount = 0; if ( nDXCount ) - pDXAry.reset(new long[ nDXCount ]); + pDXAry.reset(new tools::Long[ nDXCount ]); for (sal_uInt32 i = 0; i < nDXCount; i++ ) { sal_Int32 val; |