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 /include | |
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 'include')
-rw-r--r-- | include/svtools/unitconv.hxx | 2 | ||||
-rw-r--r-- | include/tools/bigint.hxx | 4 | ||||
-rw-r--r-- | include/tools/fract.hxx | 2 | ||||
-rw-r--r-- | include/tools/gen.hxx | 3 | ||||
-rw-r--r-- | include/tools/long.hxx | 12 | ||||
-rw-r--r-- | include/vcl/bitmap.hxx | 2 | ||||
-rw-r--r-- | include/vcl/devicecoordinate.hxx | 3 | ||||
-rw-r--r-- | include/vcl/metaact.hxx | 2 | ||||
-rw-r--r-- | include/vcl/salgtype.hxx | 6 |
9 files changed, 21 insertions, 15 deletions
diff --git a/include/svtools/unitconv.hxx b/include/svtools/unitconv.hxx index d269037578ac..f763ac0743c2 100644 --- a/include/svtools/unitconv.hxx +++ b/include/svtools/unitconv.hxx @@ -30,7 +30,7 @@ namespace weld { class MetricSpinButton; } // typedef --------------------------------------------------------------- -typedef long (*FUNC_CONVERT)(tools::Long); +typedef tools::Long (*FUNC_CONVERT)(tools::Long); // Functions ------------------------------------------------------------- diff --git a/include/tools/bigint.hxx b/include/tools/bigint.hxx index f80d64fe87c3..de03339f041d 100644 --- a/include/tools/bigint.hxx +++ b/include/tools/bigint.hxx @@ -88,7 +88,7 @@ public: operator sal_Int32() const; operator sal_uInt32() const; operator double() const; -#if SAL_TYPES_SIZEOFLONG == 8 +#if SAL_TYPES_SIZEOFPOINTER == 8 operator tools::Long() const; #endif @@ -156,7 +156,7 @@ inline BigInt::operator sal_uInt32() const return 0; } -#if SAL_TYPES_SIZEOFLONG == 8 +#if SAL_TYPES_SIZEOFPOINTER == 8 inline BigInt::operator tools::Long() const { // Clamp to int32 since long is int32 on Windows. diff --git a/include/tools/fract.hxx b/include/tools/fract.hxx index 79f5b525aed4..c37859d7c17a 100644 --- a/include/tools/fract.hxx +++ b/include/tools/fract.hxx @@ -53,7 +53,7 @@ public: sal_Int32 GetDenominator() const; explicit operator sal_Int32() const; -#if SAL_TYPES_SIZEOFLONG == 8 +#if SAL_TYPES_SIZEOFPOINTER == 8 explicit operator ::tools::Long() const { return sal_Int32(*this); } #endif explicit operator double() const; diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx index 1198b8dbaab4..13372a916d76 100644 --- a/include/tools/gen.hxx +++ b/include/tools/gen.hxx @@ -724,6 +724,8 @@ inline Rectangle operator - ( const Rectangle& rRect, const Point& rPt ) } } +namespace tools +{ template< typename charT, typename traits > inline std::basic_ostream<charT, traits> & operator <<( std::basic_ostream<charT, traits> & stream, const tools::Rectangle& rectangle ) @@ -734,6 +736,7 @@ inline std::basic_ostream<charT, traits> & operator <<( return stream << rectangle.getWidth() << 'x' << rectangle.getHeight() << "@(" << rectangle.getX() << ',' << rectangle.getY() << ")"; } +} #endif diff --git a/include/tools/long.hxx b/include/tools/long.hxx index 0a633e0f23cc..ceda30676913 100644 --- a/include/tools/long.hxx +++ b/include/tools/long.hxx @@ -23,11 +23,13 @@ */ namespace tools { -typedef long Long; -typedef unsigned long ULong; -// stage 3: -//typedef sal_Int64 Long; -//typedef sal_uInt64 ULong; +#if SAL_TYPES_SIZEOFPOINTER == 8 +typedef sal_Int64 Long; +typedef sal_uInt64 ULong; +#else +typedef sal_Int32 Long; +typedef sal_uInt32 ULong; +#endif } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index 74d3a2e11724..b995111f16a4 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -466,7 +466,7 @@ public: void Vectorize( GDIMetaFile& rMtf, sal_uInt8 cReduce, - const Link<long,void>* pProgress ); + const Link<tools::Long,void>* pProgress ); /** Change various global color characteristics diff --git a/include/vcl/devicecoordinate.hxx b/include/vcl/devicecoordinate.hxx index 14e43b22c024..0d5eeb6aeb28 100644 --- a/include/vcl/devicecoordinate.hxx +++ b/include/vcl/devicecoordinate.hxx @@ -11,6 +11,7 @@ #define INCLUDED_VCL_DEVICE_COORDINATE_HXX #include <config_vcl.h> +#include <tools/long.hxx> #if VCL_FLOAT_DEVICE_PIXEL #include <basegfx/point/b2dpoint.hxx> @@ -19,7 +20,7 @@ typedef double DeviceCoordinate; #else /* !VCL_FLOAT_DEVICE_PIXEL */ #include <basegfx/point/b2ipoint.hxx> -typedef long DeviceCoordinate; +typedef tools::Long DeviceCoordinate; #endif /* ! Carpet Cushion */ diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx index 52c1bf7d935d..600afe9b6790 100644 --- a/include/vcl/metaact.hxx +++ b/include/vcl/metaact.hxx @@ -503,7 +503,7 @@ private: Point maStartPt; OUString maStr; - std::unique_ptr<long[]> + std::unique_ptr<tools::Long[]> mpDXAry; sal_Int32 mnIndex; sal_Int32 mnLen; diff --git a/include/vcl/salgtype.hxx b/include/vcl/salgtype.hxx index 720c4c1d8255..d19bf776a31f 100644 --- a/include/vcl/salgtype.hxx +++ b/include/vcl/salgtype.hxx @@ -36,11 +36,11 @@ enum class DeviceFormat { constexpr ::Color SALCOLOR_NONE ( 0xFF, 0xFF, 0xFF, 0xFF ); -// must equal to class Point +// must equal to the Windows POINT type, which is why we use sal_Int32 struct SalPoint { - tools::Long mnX; - tools::Long mnY; + sal_Int32 mnX; + sal_Int32 mnY; }; typedef const SalPoint* PCONSTSALPOINT; |