summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-04-18 20:57:27 +0200
committerAndras Timar <andras.timar@collabora.com>2014-04-22 21:54:04 +0200
commit49e5bdc10ca7e1c7fde0353f98cb454c1b22c8e7 (patch)
tree6acad82483aa9a7f596ab901c74181f0d091e1d0
parenthandle properly page breaks even if a page contains only a frame (fdo#55381) (diff)
downloadcore-49e5bdc10ca7e1c7fde0353f98cb454c1b22c8e7.tar.gz
core-49e5bdc10ca7e1c7fde0353f98cb454c1b22c8e7.zip
fdo#77088 WMF - replace 32-bit min/max assumption with const
Added RECT_MIN and RECT_MAX which represent the minimum and maximum value a Rectangle object can hold. In WMF we used a 32-bit assumption what the min and max value could be (0x7fffffff, 0x80000000) which causes problems on 64-bit systems. Change-Id: Ic62daebbc2708cdeb7b0cf7b694bd9940eb98313
-rw-r--r--include/tools/gen.hxx2
-rw-r--r--vcl/source/filter/wmf/winwmf.cxx8
2 files changed, 6 insertions, 4 deletions
diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx
index c1a1e359bccc..e012f2d8ed13 100644
--- a/include/tools/gen.hxx
+++ b/include/tools/gen.hxx
@@ -355,6 +355,8 @@ inline std::basic_ostream<charT, traits> & operator <<(
// Rectangle
#define RECT_EMPTY ((short)-32767)
+#define RECT_MAX LONG_MAX
+#define RECT_MIN LONG_MIN
class TOOLS_DLLPUBLIC SAL_WARN_UNUSED Rectangle
{
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index 3777c3b99373..6c5093dadc51 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -1271,10 +1271,10 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt
{
sal_Bool bRet = sal_True;
- rPlaceableBound.Left() = (sal_Int32)0x7fffffff;
- rPlaceableBound.Top() = (sal_Int32)0x7fffffff;
- rPlaceableBound.Right() = (sal_Int32)0x80000000;
- rPlaceableBound.Bottom() = (sal_Int32)0x80000000;
+ rPlaceableBound.Left() = RECT_MAX;
+ rPlaceableBound.Top() = RECT_MAX;
+ rPlaceableBound.Right() = RECT_MIN;
+ rPlaceableBound.Bottom() = RECT_MIN;
sal_uInt32 nPos = pStm->Tell();
sal_uInt32 nEnd = pStm->Seek( STREAM_SEEK_TO_END );