diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-04-07 11:45:13 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-04-07 14:13:18 +0200 |
commit | d36f7c5bd2115fcdd26ba8ff7b6a0446dea70bd4 (patch) | |
tree | 5ae4b15f3302a538ac55d714ba0529ca4c1de87a /vcl | |
parent | 61d57bcebd1a246603cbcd9ad5e0a7df1a8d66cd (diff) |
Revert "long->sal_Int32 in tools/gen.hxx"
This reverts commit 8bc951daf79decbd8a599a409c6d33c5456710e0.
As discussed at
<https://lists.freedesktop.org/archives/libreoffice/2018-April/079955.html>
"long->sal_Int32 in tools/gen.hxx", that commit caused lots of problems with
signed integer overflow, and the original plan was to redo it to consistently
use sal_Int64 instead of sal_Int32. <https://gerrit.libreoffice.org/#/c/52471/>
"sal_Int32->sal_Int64 in tools/gen.hxx" tried that. However, it failed
miserably on Windows, causing odd failures like not writing out Pictures/*.svm
streams out into .odp during CppunitTest_sd_export_ooxml2. So the next best
approach is to just revert the original commit, at least for now.
Includes revert of follow-up 8c50aff2175e85c54957d98ce32af40a3a87e168 "Fix
Library_vclplug_qt5".
Change-Id: Ia8bf34272d1ed38aac00e5d07a9d13fb03f439ae
Reviewed-on: https://gerrit.libreoffice.org/52532
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl')
49 files changed, 209 insertions, 212 deletions
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx index 30c80ef16905..724220ad60a9 100644 --- a/vcl/headless/svpframe.cxx +++ b/vcl/headless/svpframe.cxx @@ -285,7 +285,7 @@ void SvpSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u #endif } -void SvpSalFrame::GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight ) +void SvpSalFrame::GetClientSize( long& rWidth, long& rHeight ) { rWidth = maGeometry.nWidth; rHeight = maGeometry.nHeight; diff --git a/vcl/inc/headless/svpframe.hxx b/vcl/inc/headless/svpframe.hxx index 6c5dc905a3e9..16de568794f8 100644 --- a/vcl/inc/headless/svpframe.hxx +++ b/vcl/inc/headless/svpframe.hxx @@ -82,7 +82,7 @@ public: virtual void SetMinClientSize( long nWidth, long nHeight ) override; virtual void SetMaxClientSize( long nWidth, long nHeight ) override; virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) override; - virtual void GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight ) override; + virtual void GetClientSize( long& rWidth, long& rHeight ) override; virtual void GetWorkArea( tools::Rectangle& rRect ) override; virtual SalFrame* GetParent() const override; virtual void SetWindowState( const SalFrameState* pState ) override; diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h index 30571d2cf077..c2b53e270648 100644 --- a/vcl/inc/osx/salframe.h +++ b/vcl/inc/osx/salframe.h @@ -124,7 +124,7 @@ public: virtual void SetMinClientSize( long nWidth, long nHeight ) override; virtual void SetMaxClientSize( long nWidth, long nHeight ) override; virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) override; - virtual void GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight ) override; + virtual void GetClientSize( long& rWidth, long& rHeight ) override; virtual void GetWorkArea( tools::Rectangle& rRect ) override; virtual SalFrame* GetParent() const override; virtual void SetWindowState( const SalFrameState* pState ) override; diff --git a/vcl/inc/osx/salprn.h b/vcl/inc/osx/salprn.h index cc668f0d2f66..8f9c04017a66 100644 --- a/vcl/inc/osx/salprn.h +++ b/vcl/inc/osx/salprn.h @@ -72,7 +72,7 @@ class AquaSalInfoPrinter : public SalInfoPrinter virtual bool SetPrinterData( ImplJobSetup* pSetupData ) override; virtual bool SetData( JobSetFlags i_nFlags, ImplJobSetup* i_pSetupData ) override; virtual void GetPageInfo( const ImplJobSetup* i_pSetupData, - sal_Int32& o_rOutWidth, sal_Int32& o_rOutHeight, + long& o_rOutWidth, long& o_rOutHeight, Point& rPageOffset, Size& rPaperSize ) override; virtual sal_uInt32 GetCapabilities( const ImplJobSetup* i_pSetupData, PrinterCapType i_nType ) override; diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx index 4da52068ca58..c04f0a8f767e 100644 --- a/vcl/inc/salframe.hxx +++ b/vcl/inc/salframe.hxx @@ -147,7 +147,7 @@ public: virtual void SetMinClientSize( long nWidth, long nHeight ) = 0; virtual void SetMaxClientSize( long nWidth, long nHeight ) = 0; virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) = 0; - virtual void GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight ) = 0; + virtual void GetClientSize( long& rWidth, long& rHeight ) = 0; virtual void GetWorkArea( tools::Rectangle& rRect ) = 0; virtual SalFrame* GetParent() const = 0; // Note: x will be mirrored at parent if UI mirroring is active diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index 70f2b1a4bf9c..71ef1eae1c08 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -202,11 +202,11 @@ public: SalLayoutFlags GetLayout() const { return m_nLayout; } void SetLayout( SalLayoutFlags aLayout ) { m_nLayout = aLayout;} - void mirror( sal_Int32& nX, const OutputDevice *pOutDev ) const; + void mirror( long& nX, const OutputDevice *pOutDev ) const; // only called mirror2 to avoid ambiguity SAL_WARN_UNUSED_RESULT - sal_Int32 mirror2( sal_Int32 nX, const OutputDevice *pOutDev ) const; - void mirror( sal_Int32& nX, sal_Int32 nWidth, const OutputDevice *pOutDev, bool bBack = false ) const; + long mirror2( long nX, const OutputDevice *pOutDev ) const; + void mirror( long& nX, long nWidth, const OutputDevice *pOutDev, bool bBack = false ) const; bool mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev ) const; void mirror( tools::Rectangle& rRect, const OutputDevice*, bool bBack = false ) const; void mirror( vcl::Region& rRgn, const OutputDevice *pOutDev ) const; @@ -220,12 +220,12 @@ public: bool SetClipRegion( const vcl::Region&, const OutputDevice *pOutDev ); // draw --> LineColor and FillColor and RasterOp and ClipRegion - void DrawPixel( sal_Int32 nX, sal_Int32 nY, const OutputDevice *pOutDev ); - void DrawPixel( sal_Int32 nX, sal_Int32 nY, Color nColor, const OutputDevice *pOutDev ); + void DrawPixel( long nX, long nY, const OutputDevice *pOutDev ); + void DrawPixel( long nX, long nY, Color nColor, const OutputDevice *pOutDev ); - void DrawLine( sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2, const OutputDevice *pOutDev ); + void DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev ); - void DrawRect( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, const OutputDevice *pOutDev ); + void DrawRect( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev ); void DrawPolyLine( sal_uInt32 nPoints, SalPoint const * pPtAry, const OutputDevice *pOutDev ); @@ -277,9 +277,9 @@ public: // CopyArea --> No RasterOp, but ClipRegion void CopyArea( - sal_Int32 nDestX, sal_Int32 nDestY, - sal_Int32 nSrcX, sal_Int32 nSrcY, - sal_Int32 nSrcWidth, sal_Int32 nSrcHeight, + long nDestX, long nDestY, + long nSrcX, long nSrcY, + long nSrcWidth, long nSrcHeight, const OutputDevice *pOutDev ); // CopyBits and DrawBitmap --> RasterOp and ClipRegion @@ -308,18 +308,18 @@ public: const OutputDevice *pOutDev ); SalBitmap* GetBitmap( - sal_Int32 nX, sal_Int32 nY, - sal_Int32 nWidth, sal_Int32 nHeight, + long nX, long nY, + long nWidth, long nHeight, const OutputDevice *pOutDev ); Color GetPixel( - sal_Int32 nX, sal_Int32 nY, + long nX, long nY, const OutputDevice *pOutDev ); // invert --> ClipRegion (only Windows) void Invert( - sal_Int32 nX, sal_Int32 nY, - sal_Int32 nWidth, sal_Int32 nHeight, + long nX, long nY, + long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev ); @@ -330,8 +330,8 @@ public: const OutputDevice *pOutDev ); bool DrawEPS( - sal_Int32 nX, sal_Int32 nY, - sal_Int32 nWidth, sal_Int32 nHeight, + long nX, long nY, + long nWidth, long nHeight, void* pPtr, sal_uLong nSize, const OutputDevice *pOutDev ); @@ -417,8 +417,8 @@ public: const OutputDevice* pOutDev ); bool DrawAlphaRect( - sal_Int32 nX, sal_Int32 nY, - sal_Int32 nWidth, sal_Int32 nHeight, + long nX, long nY, + long nWidth, long nHeight, sal_uInt8 nTransparency, const OutputDevice *pOutDev ); diff --git a/vcl/inc/salprn.hxx b/vcl/inc/salprn.hxx index 5a70751c9112..d9da1a6d80ed 100644 --- a/vcl/inc/salprn.hxx +++ b/vcl/inc/salprn.hxx @@ -71,7 +71,7 @@ public: virtual bool SetData( JobSetFlags nFlags, ImplJobSetup* pSetupData ) = 0; virtual void GetPageInfo( const ImplJobSetup* pSetupData, - sal_Int32& rOutWidth, sal_Int32& rOutHeight, + long& rOutWidth, long& rOutHeight, Point& rPageOffset, Size& rPaperSize ) = 0; virtual sal_uInt32 GetCapabilities( const ImplJobSetup* pSetupData, PrinterCapType nType ) = 0; diff --git a/vcl/inc/unx/genprn.h b/vcl/inc/unx/genprn.h index c00b589471dc..9d80de32f99b 100644 --- a/vcl/inc/unx/genprn.h +++ b/vcl/inc/unx/genprn.h @@ -44,7 +44,7 @@ public: virtual bool SetPrinterData( ImplJobSetup* pSetupData ) override; virtual bool SetData( JobSetFlags nFlags, ImplJobSetup* pSetupData ) override; virtual void GetPageInfo( const ImplJobSetup* pSetupData, - sal_Int32& rOutWidth, sal_Int32& rOutHeight, + long& rOutWidth, long& rOutHeight, Point& rPageOffset, Size& rPaperSize ) override; virtual sal_uInt32 GetCapabilities( const ImplJobSetup* pSetupData, PrinterCapType nType ) override; diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx index dc6f512c4526..3db18f03fbcf 100644 --- a/vcl/inc/unx/gtk/gtkframe.hxx +++ b/vcl/inc/unx/gtk/gtkframe.hxx @@ -462,7 +462,7 @@ public: virtual void SetMinClientSize( long nWidth, long nHeight ) override; virtual void SetMaxClientSize( long nWidth, long nHeight ) override; virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) override; - virtual void GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight ) override; + virtual void GetClientSize( long& rWidth, long& rHeight ) override; virtual void GetWorkArea( tools::Rectangle& rRect ) override; virtual SalFrame* GetParent() const override; virtual void SetWindowState( const SalFrameState* pState ) override; diff --git a/vcl/inc/unx/salbmp.h b/vcl/inc/unx/salbmp.h index 0dd228c0b13f..3f45cd5d853c 100644 --- a/vcl/inc/unx/salbmp.h +++ b/vcl/inc/unx/salbmp.h @@ -49,11 +49,11 @@ private: static BitmapBuffer* ImplCreateDIB( Drawable aDrawable, SalX11Screen nXScreen, - sal_Int32 nDrawableDepth, - sal_Int32 nX, - sal_Int32 nY, - sal_Int32 nWidth, - sal_Int32 nHeight, + long nDrawableDepth, + long nX, + long nY, + long nWidth, + long nHeight, bool bGrey ); diff --git a/vcl/inc/unx/salframe.h b/vcl/inc/unx/salframe.h index 5deb7f009325..92bfcbfb9d31 100644 --- a/vcl/inc/unx/salframe.h +++ b/vcl/inc/unx/salframe.h @@ -221,7 +221,7 @@ public: virtual void SetMinClientSize( long nWidth, long nHeight ) override; virtual void SetMaxClientSize( long nWidth, long nHeight ) override; virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) override; - virtual void GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight ) override; + virtual void GetClientSize( long& rWidth, long& rHeight ) override; virtual void GetWorkArea( tools::Rectangle& rRect ) override; virtual SalFrame* GetParent() const override; virtual void SetWindowState( const SalFrameState* pState ) override; diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index 0730a1991c81..df4996a6ca09 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -852,10 +852,10 @@ void OpenGLSalGraphicsImpl::DrawTrapezoid( const basegfx::B2DTrapezoid& trapezoi void OpenGLSalGraphicsImpl::DrawRect( long nX, long nY, long nWidth, long nHeight ) { - sal_Int32 nX1( nX ); - sal_Int32 nY1( nY ); - sal_Int32 nX2( nX + nWidth ); - sal_Int32 nY2( nY + nHeight ); + long nX1( nX ); + long nY1( nY ); + long nX2( nX + nWidth ); + long nY2( nY + nHeight ); const SalPoint aPoints[] = { { nX1, nY2 }, { nX1, nY1 }, { nX2, nY1 }, { nX2, nY2 }}; @@ -864,10 +864,10 @@ void OpenGLSalGraphicsImpl::DrawRect( long nX, long nY, long nWidth, long nHeigh void OpenGLSalGraphicsImpl::DrawRect( const tools::Rectangle& rRect ) { - sal_Int32 nX1( rRect.Left() ); - sal_Int32 nY1( rRect.Top() ); - sal_Int32 nX2( rRect.Right() ); - sal_Int32 nY2( rRect.Bottom() ); + long nX1( rRect.Left() ); + long nY1( rRect.Top() ); + long nX2( rRect.Right() ); + long nY2( rRect.Bottom() ); const SalPoint aPoints[] = { { nX1, nY2 }, { nX1, nY1 }, { nX2, nY1 }, { nX2, nY2 }}; diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index d8bf6be5ba7f..7b5b203668d8 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -531,7 +531,7 @@ void AquaSalFrame::SetMaxClientSize( long nWidth, long nHeight ) } } -void AquaSalFrame::GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight ) +void AquaSalFrame::GetClientSize( long& rWidth, long& rHeight ) { if( mbShown || mbInitShow ) { diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx index b16984387464..b87585de91db 100644 --- a/vcl/osx/salprn.cxx +++ b/vcl/osx/salprn.cxx @@ -293,7 +293,7 @@ sal_uInt32 AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup*, PrinterCapT } void AquaSalInfoPrinter::GetPageInfo( const ImplJobSetup*, - sal_Int32& o_rOutWidth, sal_Int32& o_rOutHeight, + long& o_rOutWidth, long& o_rOutHeight, Point& rPageOffset, Size& rPaperSize ) { diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx index c92d1753c6ff..f835c7b78bc3 100644 --- a/vcl/qa/cppunit/BitmapTest.cxx +++ b/vcl/qa/cppunit/BitmapTest.cxx @@ -61,8 +61,8 @@ void BitmapTest::testCreation() { Bitmap aBmp; Size aSize = aBmp.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(0), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(0), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(0), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(0), aSize.Height()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize()); CPPUNIT_ASSERT_MESSAGE("Not empty", aBmp.IsEmpty()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(0), @@ -76,8 +76,8 @@ void BitmapTest::testCreation() { Bitmap aBmp(Size(10, 10), 1); Size aSize = aBmp.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(10), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(10), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize()); CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(1), @@ -91,8 +91,8 @@ void BitmapTest::testCreation() { Bitmap aBmp(Size(10, 10), 4); Size aSize = aBmp.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(10), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(10), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize()); CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(4), @@ -106,8 +106,8 @@ void BitmapTest::testCreation() { Bitmap aBmp(Size(10, 10), 8); Size aSize = aBmp.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(10), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(10), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize()); CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(8), @@ -121,8 +121,8 @@ void BitmapTest::testCreation() { Bitmap aBmp(Size(10, 10), 16); Size aSize = aBmp.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(10), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(10), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize()); CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(24), @@ -136,8 +136,8 @@ void BitmapTest::testCreation() { Bitmap aBmp(Size(10, 10), 24); Size aSize = aBmp.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(10), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(10), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize()); CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(24), @@ -151,8 +151,8 @@ void BitmapTest::testCreation() { Bitmap aBmp(Size(10, 10), 32); Size aSize = aBmp.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<sal_Int32>(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<sal_Int32>(10), aSize.Height()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong width", static_cast<long>(10), aSize.Width()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong pref size", Size(), aBmp.GetPrefSize()); CPPUNIT_ASSERT_MESSAGE("Empty bitmap", !aBmp.IsEmpty()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong bit count", static_cast<sal_uInt16>(24), @@ -407,8 +407,8 @@ void BitmapTest::testScale() BitmapSymmetryCheck aBitmapSymmetryCheck; - CPPUNIT_ASSERT_EQUAL(sal_Int32(10), aBitmap24Bit.GetSizePixel().Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(10), aBitmap24Bit.GetSizePixel().Height()); + CPPUNIT_ASSERT_EQUAL(static_cast<long>(10), aBitmap24Bit.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(static_cast<long>(10), aBitmap24Bit.GetSizePixel().Height()); // Check symmetry of the bitmap CPPUNIT_ASSERT(BitmapSymmetryCheck::check(aBitmap24Bit)); @@ -422,8 +422,8 @@ void BitmapTest::testScale() aBitmap24Bit.Scale(2, 2, BmpScaleFlag::Fast); - CPPUNIT_ASSERT_EQUAL(sal_Int32(20), aBitmap24Bit.GetSizePixel().Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(20), aBitmap24Bit.GetSizePixel().Height()); + CPPUNIT_ASSERT_EQUAL(static_cast<long>(20), aBitmap24Bit.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(static_cast<long>(20), aBitmap24Bit.GetSizePixel().Height()); // After scaling the bitmap should still be symmetrical. This check guarantees that // scaling doesn't misalign the bitmap. diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-test.cxx index 9399dd43f339..a423a17081e8 100644 --- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx +++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx @@ -95,7 +95,7 @@ void VclFiltersTest::testScaling() fprintf( stderr, "scale with type %d\n", int( i ) ); CPPUNIT_ASSERT( aBitmapEx.Scale( 0.1937046, 0.193154, i ) ); Size aAfter( aBitmapEx.GetSizePixel() ); - fprintf( stderr, "size %" SAL_PRIdINT32 ", %" SAL_PRIdINT32 "\n", aAfter.Width(), aAfter.Height() ); + fprintf( stderr, "size %ld, %ld\n", aAfter.Width(), aAfter.Height() ); CPPUNIT_ASSERT( labs (aAfter.Height() - aAfter.Width()) <= 1 ); } } @@ -129,8 +129,8 @@ void VclFiltersTest::checkExportImport(const OUString& aFilterShortName) BitmapEx aLoadedBitmapEx = aLoadedGraphic.GetBitmapEx(); Size aSize = aLoadedBitmapEx.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(100), aSize.Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(100), aSize.Height()); + CPPUNIT_ASSERT_EQUAL(100L, aSize.Width()); + CPPUNIT_ASSERT_EQUAL(100L, aSize.Height()); } void VclFiltersTest::testExportImport() diff --git a/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx b/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx index 7727a13c18ad..4cae79645bd6 100644 --- a/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx +++ b/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx @@ -106,8 +106,8 @@ void JpegReaderTest::testReadRGB() { Bitmap aBitmap = loadJPG(getFullUrl("JPEGTestRGB.jpeg")); Size aSize = aBitmap.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Height()); + CPPUNIT_ASSERT_EQUAL(12L, aSize.Width()); + CPPUNIT_ASSERT_EQUAL(12L, aSize.Height()); int nMaxDelta = 1; // still acceptable color error CPPUNIT_ASSERT(checkRect(aBitmap, 0, 8, 8, Color(0xff, 0xff, 0xff), nMaxDelta)); @@ -120,8 +120,8 @@ void JpegReaderTest::testReadGray() { Bitmap aBitmap = loadJPG(getFullUrl("JPEGTestGray.jpeg")); Size aSize = aBitmap.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Height()); + CPPUNIT_ASSERT_EQUAL(12L, aSize.Width()); + CPPUNIT_ASSERT_EQUAL(12L, aSize.Height()); aBitmap.Convert(BmpConversion::N24Bit); // convert to 24bit so we don't need to deal with palette @@ -136,8 +136,8 @@ void JpegReaderTest::testReadCMYK() { Bitmap aBitmap = loadJPG(getFullUrl("JPEGTestCMYK.jpeg")); Size aSize = aBitmap.GetSizePixel(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Height()); + CPPUNIT_ASSERT_EQUAL(12L, aSize.Width()); + CPPUNIT_ASSERT_EQUAL(12L, aSize.Height()); int maxDelta = 1; CPPUNIT_ASSERT(checkRect(aBitmap, 0, 8, 8, Color(0xff, 0xff, 0xff), maxDelta)); diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx index 151e8adca44f..c8f8609ea14e 100644 --- a/vcl/qt5/Qt5Frame.cxx +++ b/vcl/qt5/Qt5Frame.cxx @@ -318,7 +318,7 @@ void Qt5Frame::SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_uInt1 m_bDefaultPos = false; } -void Qt5Frame::GetClientSize(sal_Int32& rWidth, sal_Int32& rHeight) +void Qt5Frame::GetClientSize(long& rWidth, long& rHeight) { rWidth = m_pQWidget->width(); rHeight = m_pQWidget->height(); diff --git a/vcl/qt5/Qt5Frame.hxx b/vcl/qt5/Qt5Frame.hxx index 474990352eee..b5f31387b3e2 100644 --- a/vcl/qt5/Qt5Frame.hxx +++ b/vcl/qt5/Qt5Frame.hxx @@ -96,7 +96,7 @@ public: virtual void SetMaxClientSize(long nWidth, long nHeight) override; virtual void SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags) override; - virtual void GetClientSize(sal_Int32& rWidth, sal_Int32& rHeight) override; + virtual void GetClientSize(long& rWidth, long& rHeight) override; virtual void GetWorkArea(tools::Rectangle& rRect) override; virtual SalFrame* GetParent() const override; virtual void SetWindowState(const SalFrameState* pState) override; diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 7c3238979e7d..35400b70ed8a 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -1639,7 +1639,7 @@ Size PushButton::CalcMinimumSize() const Size textSize = GetTextRect( tools::Rectangle( Point(), Size( 0x7fffffff, 0x7fffffff ) ), PushButton::GetText(), ImplGetTextStyle( DrawFlags::NONE ) ).GetSize(); aSize.AdjustWidth(textSize.Width() ); - aSize.setHeight( std::max<sal_Int32>( aSize.Height(), sal_Int32( textSize.Height() * 1.15 ) ) ); + aSize.setHeight( std::max( aSize.Height(), long( textSize.Height() * 1.15 ) ) ); } // cf. ImplDrawPushButton ... diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index abb0a5e0c677..7b14c8da64c2 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -311,7 +311,7 @@ IMPL_LINK(ComboBox::Impl, ImplAutocompleteHdl, Edit&, rEdit, void) { OUString aFullText = rEdit.GetText(); - OUString aStartText = aFullText.copy( 0, aSel.Max() ); + OUString aStartText = aFullText.copy( 0, static_cast<sal_Int32>(aSel.Max()) ); sal_Int32 nStart = m_pImplLB->GetCurrentPos(); if ( nStart == LISTBOX_ENTRY_NOTFOUND ) @@ -1039,7 +1039,7 @@ Size ComboBox::CalcMinimumSize() const if (m_pImpl->m_nMaxWidthChars != -1) { long nMaxWidth = m_pImpl->m_nMaxWidthChars * approximate_char_width(); - aSz.setWidth( std::min<sal_Int32>(aSz.Width(), nMaxWidth) ); + aSz.setWidth( std::min(aSz.Width(), nMaxWidth) ); } if (IsDropDownBox()) diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index e6c8e07bb824..42dd22296585 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -743,7 +743,7 @@ void Edit::ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uI } } - maText.remove( aSelection.Min(), aSelection.Len() ); + maText.remove( static_cast<sal_Int32>(aSelection.Min()), static_cast<sal_Int32>(aSelection.Len()) ); maSelection.Min() = aSelection.Min(); maSelection.Max() = aSelection.Min(); ImplAlignAndPaint(); @@ -807,9 +807,9 @@ void Edit::ImplInsertText( const OUString& rStr, const Selection* pNewSel, bool ImplClearLayoutData(); if ( aSelection.Len() ) - maText.remove( aSelection.Min(), aSelection.Len() ); + maText.remove( static_cast<sal_Int32>(aSelection.Min()), static_cast<sal_Int32>(aSelection.Len()) ); else if ( !mbInsertMode && (aSelection.Max() < maText.getLength()) ) - maText.remove( aSelection.Max(), 1 ); + maText.remove( static_cast<sal_Int32>(aSelection.Max()), 1 ); // take care of input-sequence-checking now if (bIsUserInput && !rStr.isEmpty()) @@ -829,7 +829,7 @@ void Edit::ImplInsertText( const OUString& rStr, const Selection* pNewSel, bool if (bIsInputSequenceChecking && (xISC = ImplGetInputSequenceChecker()).is()) { sal_Unicode cChar = rStr[0]; - sal_Int32 nTmpPos = aSelection.Min(); + sal_Int32 nTmpPos = static_cast< sal_Int32 >( aSelection.Min() ); sal_Int16 nCheckMode = officecfg::Office::Common::I18N::CTL::CTLSequenceCheckingRestricted::get()? i18n::InputSequenceCheckMode::STRICT : i18n::InputSequenceCheckMode::BASIC; @@ -876,7 +876,7 @@ void Edit::ImplInsertText( const OUString& rStr, const Selection* pNewSel, bool } if ( !aNewText.isEmpty() ) - maText.insert( aSelection.Min(), aNewText ); + maText.insert( static_cast<sal_Int32>(aSelection.Min()), aNewText ); if ( !pNewSel ) { @@ -2036,7 +2036,7 @@ void Edit::Command( const CommandEvent& rCEvt ) { DeleteSelected(); delete mpIMEInfos; - sal_Int32 nPos = maSelection.Max(); + sal_Int32 nPos = static_cast<sal_Int32>(maSelection.Max()); mpIMEInfos = new Impl_IMEInfos( nPos, OUString(maText.getStr() + nPos ) ); mpIMEInfos->bWasCursorOverwrite = !IsInsertMode(); } diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 13fe3a348a96..a59557dcbb9b 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -713,7 +713,7 @@ void NumericFormatter::ImplNewFieldValue( sal_Int64 nNewValue ) aSelection.Justify(); OUString aText = GetField()->GetText(); // leave it as is if selected until end - if ( aSelection.Max() == aText.getLength() ) + if ( static_cast<sal_Int32>(aSelection.Max()) == aText.getLength() ) { if ( !aSelection.Len() ) aSelection.Min() = SELECTION_MAX; diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index c57449aec148..dff8cee200b5 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -466,7 +466,7 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, sal_Unicode cChar = rKEvt.GetCharCode(); sal_uInt16 nKeyCode = aCode.GetCode(); bool bShift = aCode.IsShift(); - sal_Int32 nCursorPos = aOldSel.Max(); + sal_Int32 nCursorPos = static_cast<sal_Int32>(aOldSel.Max()); sal_Int32 nNewPos; sal_Int32 nTempPos; @@ -523,7 +523,7 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, // all was selected by the focus Selection aSel( aOldSel ); aSel.Justify(); - nCursorPos = aSel.Min(); + nCursorPos = static_cast<sal_Int32>(aSel.Min()); ImplPatternMaxPos( pEdit->GetText(), rEditMask, nFormatFlags, bSameMask, nCursorPos, nNewPos ); aSel.Max() = nNewPos; if ( bShift ) @@ -540,16 +540,16 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, Selection aSel = aOldSel; aSel.Justify(); - nNewPos = aSel.Min(); + nNewPos = static_cast<sal_Int32>(aSel.Min()); // if selection then delete it if ( aSel.Len() ) { if ( bSameMask ) - aStr.remove( aSel.Min(), aSel.Len() ); + aStr.remove( static_cast<sal_Int32>(aSel.Min()), static_cast<sal_Int32>(aSel.Len()) ); else { - OUString aRep = rLiteralMask.copy( aSel.Min(), aSel.Len() ); + OUString aRep = rLiteralMask.copy( static_cast<sal_Int32>(aSel.Min()), static_cast<sal_Int32>(aSel.Len()) ); aStr.remove( aSel.Min(), aRep.getLength() ); aStr.insert( aSel.Min(), aRep ); } @@ -1323,7 +1323,7 @@ void DateField::ImplDateSpinArea( bool bUp ) Selection aSelection = GetField()->GetSelection(); aSelection.Justify(); OUString aText( GetText() ); - if ( aSelection.Len() == aText.getLength() ) + if ( static_cast<sal_Int32>(aSelection.Len()) == aText.getLength() ) ImplDateIncrementDay( aDate, bUp ); else { @@ -1343,7 +1343,7 @@ void DateField::ImplDateSpinArea( bool bUp ) for ( sal_Int8 i = 1; i <= 3; i++ ) { nPos = aText.indexOf( aDateSep, nPos ); - if (nPos < 0 || nPos >= aSelection.Max()) + if (nPos < 0 || nPos >= static_cast<sal_Int32>(aSelection.Max())) { nDateArea = i; break; @@ -1584,7 +1584,7 @@ void DateFormatter::ImplNewFieldValue( const Date& rDate ) OUString aText = GetField()->GetText(); // If selected until the end then keep it that way - if ( aSelection.Max() == aText.getLength() ) + if ( static_cast<sal_Int32>(aSelection.Max()) == aText.getLength() ) { if ( !aSelection.Len() ) aSelection.Min() = SELECTION_MAX; @@ -2363,7 +2363,7 @@ void TimeFormatter::ImplNewFieldValue( const tools::Time& rTime ) OUString aText = GetField()->GetText(); // If selected until the end then keep it that way - if ( aSelection.Max() == aText.getLength() ) + if ( static_cast<sal_Int32>(aSelection.Max()) == aText.getLength() ) { if ( !aSelection.Len() ) aSelection.Min() = SELECTION_MAX; diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx index f82d1dc992f5..f998285abc1a 100644 --- a/vcl/source/control/fixed.cxx +++ b/vcl/source/control/fixed.cxx @@ -316,7 +316,7 @@ Size FixedText::getTextDimensions(Control const *pControl, const OUString &rTxt, if ( !( pControl->GetStyle() & WB_NOLABEL ) ) nStyle |= DrawTextFlags::Mnemonic; - return pControl->GetTextRect(tools::Rectangle( Point(), Size(nMaxWidth, RECT_MAX)), + return pControl->GetTextRect(tools::Rectangle( Point(), Size(nMaxWidth, 0x7fffffff)), rTxt, nStyle).GetSize(); } diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index 6f510684b866..171b75afd151 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -661,10 +661,10 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry ) } if ( IsUserDrawEnabled() || aMetrics.bImage ) { - aMetrics.nEntryWidth = std::max<sal_Int32>( aMetrics.nImgWidth, maUserItemSize.Width() ); + aMetrics.nEntryWidth = std::max( aMetrics.nImgWidth, maUserItemSize.Width() ); if ( aMetrics.bText ) aMetrics.nEntryWidth += aMetrics.nTextWidth + IMG_TXT_DISTANCE; - aMetrics.nEntryHeight = std::max<sal_Int32>( std::max<sal_Int32>( mnMaxImgHeight, maUserItemSize.Height() ) + 2, + aMetrics.nEntryHeight = std::max( std::max( mnMaxImgHeight, maUserItemSize.Height() ) + 2, aMetrics.nEntryHeight ); } @@ -1802,7 +1802,7 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32 if (!bDrawTextAtImagePos && (mpEntryList->HasEntryImage(nPos) || IsUserDrawEnabled())) { - sal_Int32 nImageWidth = std::max<sal_Int32>(mnMaxImgWidth, maUserItemSize.Width()); + long nImageWidth = std::max(mnMaxImgWidth, maUserItemSize.Width()); aTextRect.AdjustLeft(nImageWidth + IMG_TXT_DISTANCE ); } diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx index 17d1c9c8cefc..ef945a087659 100644 --- a/vcl/source/control/listbox.cxx +++ b/vcl/source/control/listbox.cxx @@ -1230,7 +1230,7 @@ Size ListBox::CalcSubEditSize() const if (m_nMaxWidthChars != -1) { long nMaxWidth = m_nMaxWidthChars * approximate_char_width(); - aSz.setWidth( std::min<sal_Int32>(aSz.Width(), nMaxWidth) ); + aSz.setWidth( std::min(aSz.Width(), nMaxWidth) ); } // Do not create ultrathin ListBoxes, it doesn't look good diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx index 370891802b9f..54931df82557 100644 --- a/vcl/source/control/notebookbar.cxx +++ b/vcl/source/control/notebookbar.cxx @@ -112,9 +112,9 @@ void NotebookBar::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, P Size aSize(GetOptimalSize()); if (!bCanHandleSmallerWidth) - nWidth = std::max<sal_Int32>(nWidth, aSize.Width()); + nWidth = std::max(nWidth, aSize.Width()); if (!bCanHandleSmallerHeight) - nHeight = std::max<sal_Int32>(nHeight, aSize.Height()); + nHeight = std::max(nHeight, aSize.Height()); Control::setPosSizePixel(nX, nY, nWidth, nHeight, nFlags); diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index a1bcc29273c6..a4f06757c2ea 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -2142,7 +2142,7 @@ Size TabControl::calculateRequisition() const { TabControl* pThis = const_cast<TabControl*>(this); - tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), RECT_MAX); + tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), LONG_MAX); if (aTabRect.Bottom() > nTabLabelsBottom) nTabLabelsBottom = aTabRect.Bottom(); if (aTabRect.Right() > nTabLabelsRight) @@ -2151,7 +2151,7 @@ Size TabControl::calculateRequisition() const Size aOptimalSize(aOptimalPageSize); aOptimalSize.AdjustHeight(nTabLabelsBottom ); - aOptimalSize.setWidth( std::max<sal_Int32>(nTabLabelsRight, aOptimalSize.Width()) ); + aOptimalSize.setWidth( std::max(nTabLabelsRight, aOptimalSize.Width()) ); aOptimalSize.AdjustWidth(TAB_OFFSET * 2 ); aOptimalSize.AdjustHeight(TAB_OFFSET * 2 ); @@ -2671,7 +2671,7 @@ Size NotebookbarTabControlBase::calculateRequisition() const { NotebookbarTabControlBase* pThis = const_cast<NotebookbarTabControlBase*>(this); - tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), RECT_MAX); + tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), LONG_MAX); if (aTabRect.Bottom() > nTabLabelsBottom) { nTabLabelsBottom = aTabRect.Bottom(); @@ -2683,7 +2683,7 @@ Size NotebookbarTabControlBase::calculateRequisition() const Size aOptimalSize(aOptimalPageSize); aOptimalSize.AdjustHeight(nTabLabelsBottom ); - aOptimalSize.setWidth( std::max<sal_Int32>(nTabLabelsRight, aOptimalSize.Width()) ); + aOptimalSize.setWidth( std::max(nTabLabelsRight, aOptimalSize.Width()) ); aOptimalSize.AdjustWidth(TAB_OFFSET * 2 ); aOptimalSize.AdjustHeight(TAB_OFFSET * 2 ); diff --git a/vcl/source/gdi/bmpacc.cxx b/vcl/source/gdi/bmpacc.cxx index 50d201d32e02..34919a3149bf 100644 --- a/vcl/source/gdi/bmpacc.cxx +++ b/vcl/source/gdi/bmpacc.cxx @@ -346,7 +346,7 @@ void BitmapWriteAccess::CopyScanline( long nY, const BitmapReadAccess& rReadAcc // TODO: use fastbmp infrastructure Scanline pScanline = GetScanline( nY ); Scanline pScanlineRead = rReadAcc.GetScanline(nY); - for( long nX = 0, nWidth = std::min<sal_Int32>( mpBuffer->mnWidth, rReadAcc.Width() ); nX < nWidth; nX++ ) + for( long nX = 0, nWidth = std::min( mpBuffer->mnWidth, rReadAcc.Width() ); nX < nWidth; nX++ ) SetPixelOnData( pScanline, nX, rReadAcc.GetPixelFromData( pScanlineRead, nX ) ); } } @@ -418,13 +418,13 @@ void BitmapWriteAccess::CopyBuffer( const BitmapReadAccess& rReadAcc ) if( ( GetScanlineFormat() == rReadAcc.GetScanlineFormat() ) && ( GetScanlineSize() == rReadAcc.GetScanlineSize() ) ) { - const long nHeight = std::min<sal_Int32>( mpBuffer->mnHeight, rReadAcc.Height() ); + const long nHeight = std::min( mpBuffer->mnHeight, rReadAcc.Height() ); const sal_uLong nCount = nHeight * mpBuffer->mnScanlineSize; memcpy( mpBuffer->mpBits, rReadAcc.GetBuffer(), nCount ); } else - for( long nY = 0, nHeight = std::min<sal_Int32>( mpBuffer->mnHeight, rReadAcc.Height() ); nY < nHeight; nY++ ) + for( long nY = 0, nHeight = std::min( mpBuffer->mnHeight, rReadAcc.Height() ); nY < nHeight; nY++ ) CopyScanline( nY, rReadAcc ); } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 9c153d986790..915a3b2de479 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -1395,9 +1395,9 @@ void PDFWriterImpl::PDFPage::appendRect( const tools::Rectangle& rRect, OStringB { appendPoint( rRect.BottomLeft() + Point( 0, 1 ), rBuffer ); rBuffer.append( ' ' ); - appendMappedLength( rRect.GetWidth(), rBuffer, false ); + appendMappedLength( static_cast<sal_Int32>(rRect.GetWidth()), rBuffer, false ); rBuffer.append( ' ' ); - appendMappedLength( rRect.GetHeight(), rBuffer ); + appendMappedLength( static_cast<sal_Int32>(rRect.GetHeight()), rBuffer ); rBuffer.append( " re" ); } @@ -2768,10 +2768,10 @@ bool PDFWriterImpl::emitTilings() emitComment( "PDFWriterImpl::emitTilings" ); } - sal_Int32 nX = tiling.m_aRectangle.Left(); - sal_Int32 nY = tiling.m_aRectangle.Top(); - sal_Int32 nW = tiling.m_aRectangle.GetWidth(); - sal_Int32 nH = tiling.m_aRectangle.GetHeight(); + sal_Int32 nX = static_cast<sal_Int32>(tiling.m_aRectangle.Left()); + sal_Int32 nY = static_cast<sal_Int32>(tiling.m_aRectangle.Top()); + sal_Int32 nW = static_cast<sal_Int32>(tiling.m_aRectangle.GetWidth()); + sal_Int32 nH = static_cast<sal_Int32>(tiling.m_aRectangle.GetHeight()); if( tiling.m_aCellSize.Width() == 0 ) tiling.m_aCellSize.setWidth( nW ); if( tiling.m_aCellSize.Height() == 0 ) @@ -3144,11 +3144,11 @@ sal_Int32 PDFWriterImpl::emitFontDescriptor( const PhysicalFontFace* pFont, Font aLine.append( "\n" "/FontBBox[" ); // note: Top and Bottom are reversed in VCL and PDF rectangles - aLine.append( rInfo.m_aFontBBox.TopLeft().X() ); + aLine.append( static_cast<sal_Int32>(rInfo.m_aFontBBox.TopLeft().X()) ); aLine.append( ' ' ); - aLine.append( rInfo.m_aFontBBox.TopLeft().Y() ); + aLine.append( static_cast<sal_Int32>(rInfo.m_aFontBBox.TopLeft().Y()) ); aLine.append( ' ' ); - aLine.append( rInfo.m_aFontBBox.BottomRight().X() ); + aLine.append( static_cast<sal_Int32>(rInfo.m_aFontBBox.BottomRight().X()) ); aLine.append( ' ' ); aLine.append( static_cast<sal_Int32>(rInfo.m_aFontBBox.BottomRight().Y()+1) ); aLine.append( "]/ItalicAngle " ); @@ -4403,7 +4403,7 @@ void PDFWriterImpl::createDefaultCheckBoxAppearance( PDFWidget& rBox, const PDFW aDA.append( ' ' ); aDA.append( m_aBuiltinFonts[nBest].getNameObject() ); aDA.append( ' ' ); - m_aPages[ m_nCurrentPage ].appendMappedLength( aCheckRect.GetHeight(), aDA ); + m_aPages[ m_nCurrentPage ].appendMappedLength( sal_Int32( aCheckRect.GetHeight() ), aDA ); aDA.append( " Tf\n" ); m_aPages[ m_nCurrentPage ].appendMappedLength( nCharXOffset, aDA ); aDA.append( " " ); @@ -4503,7 +4503,7 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P aDA.append( ' ' ); aDA.append( m_aBuiltinFonts[nBest].getNameObject() ); aDA.append( ' ' ); - m_aPages[m_nCurrentPage].appendMappedLength( aCheckRect.GetHeight(), aDA ); + m_aPages[m_nCurrentPage].appendMappedLength( sal_Int32( aCheckRect.GetHeight() ), aDA ); aDA.append( " Tf\n0 0 Td\nET\nQ\n" ); writeBuffer( aDA.getStr(), aDA.getLength() ); setFillColor( replaceColor( rWidget.TextColor, rSettings.GetRadioCheckTextColor() ) ); @@ -8654,9 +8654,9 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit const & rObject ) aLine.append('3'); break; default: - aLine.append( aSize.Width() ); + aLine.append( static_cast<sal_Int32>(aSize.Width()) ); aLine.append( ' ' ); - aLine.append( aSize.Height() ); + aLine.append( static_cast<sal_Int32>(aSize.Height()) ); } aLine.append( " ]\n" "/BitsPerSample 8\n" @@ -8788,13 +8788,13 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit const & rObject ) aPoly[1] = aBoundRect.TopCenter(); aPoly.Rotate( aCenter, 3600 - nAngle ); - aLine.append( aPoly[0].X() ); + aLine.append( static_cast<sal_Int32>(aPoly[0].X()) ); aLine.append( " " ); - aLine.append( aPoly[0].Y() ); + aLine.append( static_cast<sal_Int32>(aPoly[0].Y()) ); aLine.append( " " ); - aLine.append( aPoly[1].X() ); + aLine.append( static_cast<sal_Int32>(aPoly[1].X())); aLine.append( " "); - aLine.append( aPoly[1].Y() ); + aLine.append( static_cast<sal_Int32>(aPoly[1].Y())); aLine.append( " ]\n"); aLine.append("/Extend [true true]\n"); break; @@ -8802,9 +8802,9 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit const & rObject ) default: aLine.append("/Domain[ 0 1 0 1 ]\n" "/Matrix[ " ); - aLine.append( aSize.Width() ); + aLine.append( static_cast<sal_Int32>(aSize.Width()) ); aLine.append( " 0 0 " ); - aLine.append( aSize.Height() ); + aLine.append( static_cast<sal_Int32>(aSize.Height()) ); aLine.append( " 0 0 ]\n"); } aLine.append("/Function " ); @@ -8857,9 +8857,9 @@ void PDFWriterImpl::writeJPG( JPGEmit& rObject ) aLine.append( rObject.m_nObject ); aLine.append( " 0 obj\n" "<</Type/XObject/Subtype/Image/Width " ); - aLine.append( rObject.m_aID.m_aPixelSize.Width() ); + aLine.append( static_cast<sal_Int32>(rObject.m_aID.m_aPixelSize.Width()) ); aLine.append( " /Height " ); - aLine.append( rObject.m_aID.m_aPixelSize.Height() ); + aLine.append( static_cast<sal_Int32>(rObject.m_aID.m_aPixelSize.Height()) ); aLine.append( " /BitsPerComponent 8 " ); if( rObject.m_bTrueColor ) aLine.append( "/ColorSpace/DeviceRGB" ); @@ -9444,9 +9444,9 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask ) aLine.append( rObject.m_nObject ); aLine.append( " 0 obj\n" "<</Type/XObject/Subtype/Image/Width " ); - aLine.append( aBitmap.GetSizePixel().Width() ); + aLine.append( static_cast<sal_Int32>(aBitmap.GetSizePixel().Width()) ); aLine.append( "/Height " ); - aLine.append( aBitmap.GetSizePixel().Height() ); + aLine.append( static_cast<sal_Int32>(aBitmap.GetSizePixel().Height()) ); aLine.append( "/BitsPerComponent " ); aLine.append( nBitsPerComponent ); aLine.append( "/Length " ); @@ -9461,7 +9461,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask ) else { aLine.append( "/Filter/CCITTFaxDecode/DecodeParms<</K -1/BlackIs1 true/Columns " ); - aLine.append( aBitmap.GetSizePixel().Width() ); + aLine.append( static_cast<sal_Int32>(aBitmap.GetSizePixel().Width()) ); aLine.append( ">>\n" ); } } @@ -9765,10 +9765,10 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const aLine.append( "q " ); sal_Int32 nCheckWidth = 0; - m_aPages.back().appendMappedLength( rTargetArea.GetWidth(), aLine, false, &nCheckWidth ); + m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rTargetArea.GetWidth()), aLine, false, &nCheckWidth ); aLine.append( " 0 0 " ); sal_Int32 nCheckHeight = 0; - m_aPages.back().appendMappedLength( rTargetArea.GetHeight(), aLine, true, &nCheckHeight ); + m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rTargetArea.GetHeight()), aLine, true, &nCheckHeight ); aLine.append( ' ' ); m_aPages.back().appendPoint( rTargetArea.BottomLeft(), aLine ); aLine.append( " cm\n/Im" ); @@ -9804,10 +9804,10 @@ void PDFWriterImpl::drawBitmap( const Point& rDestPoint, const Size& rDestSize, aLine.append( ' ' ); } sal_Int32 nCheckWidth = 0; - m_aPages.back().appendMappedLength( rDestSize.Width(), aLine, false, &nCheckWidth ); + m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rDestSize.Width()), aLine, false, &nCheckWidth ); aLine.append( " 0 0 " ); sal_Int32 nCheckHeight = 0; - m_aPages.back().appendMappedLength( rDestSize.Height(), aLine, true, &nCheckHeight ); + m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rDestSize.Height()), aLine, true, &nCheckHeight ); aLine.append( ' ' ); m_aPages.back().appendPoint( rDestPoint + Point( 0, rDestSize.Height()-1 ), aLine ); aLine.append( " cm\n/Im" ); @@ -9952,9 +9952,9 @@ void PDFWriterImpl::drawGradient( const tools::Rectangle& rRect, const Gradient& if( m_aGraphicsStack.front().m_aLineColor != COL_TRANSPARENT ) aLine.append( "q " ); aLine.append( "0 0 " ); - m_aPages.back().appendMappedLength( rRect.GetWidth(), aLine, false ); + m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rRect.GetWidth()), aLine, false ); aLine.append( ' ' ); - m_aPages.back().appendMappedLength( rRect.GetHeight(), aLine ); + m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rRect.GetHeight()), aLine ); aLine.append( " re W n\n" ); aLine.append( "/P" ); @@ -9963,9 +9963,9 @@ void PDFWriterImpl::drawGradient( const tools::Rectangle& rRect, const Gradient& if( m_aGraphicsStack.front().m_aLineColor != COL_TRANSPARENT ) { aLine.append( "Q 0 0 " ); - m_aPages.back().appendMappedLength( rRect.GetWidth(), aLine, false ); + m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rRect.GetWidth()), aLine, false ); aLine.append( ' ' ); - m_aPages.back().appendMappedLength( rRect.GetHeight(), aLine ); + m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rRect.GetHeight()), aLine ); aLine.append( " re S " ); } aLine.append( "Q\n" ); diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 2887158ea67b..49cc105d5d54 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -106,13 +106,13 @@ bool SalGraphics::drawTransformedBitmap( return false; } -sal_Int32 SalGraphics::mirror2( sal_Int32 x, const OutputDevice *pOutDev ) const +long SalGraphics::mirror2( long x, const OutputDevice *pOutDev ) const { mirror(x, pOutDev); return x; } -void SalGraphics::mirror( sal_Int32& x, const OutputDevice *pOutDev ) const +void SalGraphics::mirror( long& x, const OutputDevice *pOutDev ) const { long w; if( pOutDev && pOutDev->GetOutDevType() == OUTDEV_VIRDEV ) @@ -142,7 +142,7 @@ void SalGraphics::mirror( sal_Int32& x, const OutputDevice *pOutDev ) const } } -void SalGraphics::mirror( sal_Int32& x, sal_Int32 nWidth, const OutputDevice *pOutDev, bool bBack ) const +void SalGraphics::mirror( long& x, long nWidth, const OutputDevice *pOutDev, bool bBack ) const { long w; if( pOutDev && pOutDev->GetOutDevType() == OUTDEV_VIRDEV ) @@ -267,9 +267,9 @@ void SalGraphics::mirror( vcl::Region& rRgn, const OutputDevice *pOutDev ) const void SalGraphics::mirror( tools::Rectangle& rRect, const OutputDevice *pOutDev, bool bBack ) const { - sal_Int32 nWidth = rRect.GetWidth(); - sal_Int32 x = rRect.Left(); - sal_Int32 x_org = x; + long nWidth = rRect.GetWidth(); + long x = rRect.Left(); + long x_org = x; mirror( x, nWidth, pOutDev, bBack ); rRect.Move( x - x_org, 0 ); @@ -366,21 +366,21 @@ bool SalGraphics::SetClipRegion( const vcl::Region& i_rClip, const OutputDevice return setClipRegion( i_rClip ); } -void SalGraphics::DrawPixel( sal_Int32 nX, sal_Int32 nY, const OutputDevice *pOutDev ) +void SalGraphics::DrawPixel( long nX, long nY, const OutputDevice *pOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) mirror( nX, pOutDev ); drawPixel( nX, nY ); } -void SalGraphics::DrawPixel( sal_Int32 nX, sal_Int32 nY, Color nColor, const OutputDevice *pOutDev ) +void SalGraphics::DrawPixel( long nX, long nY, Color nColor, const OutputDevice *pOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) mirror( nX, pOutDev ); drawPixel( nX, nY, nColor ); } -void SalGraphics::DrawLine( sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2, const OutputDevice *pOutDev ) +void SalGraphics::DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) { @@ -390,7 +390,7 @@ void SalGraphics::DrawLine( sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int drawLine( nX1, nY1, nX2, nY2 ); } -void SalGraphics::DrawRect( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, const OutputDevice *pOutDev ) +void SalGraphics::DrawRect( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) mirror( nX, nWidth, pOutDev ); @@ -535,9 +535,9 @@ bool SalGraphics::DrawGradient( const tools::PolyPolygon& rPolyPoly, const Gradi return drawGradient( rPolyPoly, rGradient ); } -void SalGraphics::CopyArea( sal_Int32 nDestX, sal_Int32 nDestY, - sal_Int32 nSrcX, sal_Int32 nSrcY, - sal_Int32 nSrcWidth, sal_Int32 nSrcHeight, +void SalGraphics::CopyArea( long nDestX, long nDestY, + long nSrcX, long nSrcY, + long nSrcWidth, long nSrcHeight, const OutputDevice *pOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) @@ -606,21 +606,21 @@ void SalGraphics::DrawMask( const SalTwoRect& rPosAry, drawMask( rPosAry, rSalBitmap, nMaskColor ); } -SalBitmap* SalGraphics::GetBitmap( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, const OutputDevice *pOutDev ) +SalBitmap* SalGraphics::GetBitmap( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) mirror( nX, nWidth, pOutDev ); return getBitmap( nX, nY, nWidth, nHeight ); } -Color SalGraphics::GetPixel( sal_Int32 nX, sal_Int32 nY, const OutputDevice *pOutDev ) +Color SalGraphics::GetPixel( long nX, long nY, const OutputDevice *pOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) mirror( nX, pOutDev ); return getPixel( nX, nY ); } -void SalGraphics::Invert( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, SalInvert nFlags, const OutputDevice *pOutDev ) +void SalGraphics::Invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) mirror( nX, nWidth, pOutDev ); @@ -639,7 +639,7 @@ void SalGraphics::Invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert invert( nPoints, pPtAry, nFlags ); } -bool SalGraphics::DrawEPS( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, void* pPtr, sal_uLong nSize, const OutputDevice *pOutDev ) +bool SalGraphics::DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize, const OutputDevice *pOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) mirror( nX, nWidth, pOutDev ); @@ -806,7 +806,7 @@ bool SalGraphics::DrawTransformedBitmap( } } -bool SalGraphics::DrawAlphaRect( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, +bool SalGraphics::DrawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency, const OutputDevice *pOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) diff --git a/vcl/source/graphic/GraphicObject.cxx b/vcl/source/graphic/GraphicObject.cxx index 1d54de94ee71..d302d6952877 100644 --- a/vcl/source/graphic/GraphicObject.cxx +++ b/vcl/source/graphic/GraphicObject.cxx @@ -565,8 +565,8 @@ void GraphicObject::DrawTiled( OutputDevice* pOut, const tools::Rectangle& rArea const MapMode aMapMode( aOutMapMode.GetMapUnit(), Point(), aOutMapMode.GetScaleX(), aOutMapMode.GetScaleY() ); // #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<sal_Int32>( 1, pOut->LogicToPixel( rSize, aOutMapMode ).Width() ), - ::std::max<sal_Int32>( 1, pOut->LogicToPixel( rSize, aOutMapMode ).Height() ) ); + const Size aOutTileSize( ::std::max( 1L, pOut->LogicToPixel( rSize, aOutMapMode ).Width() ), + ::std::max( 1L, 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/rect.cxx b/vcl/source/outdev/rect.cxx index 78b0a5382a59..c9f0e7c460ce 100644 --- a/vcl/source/outdev/rect.cxx +++ b/vcl/source/outdev/rect.cxx @@ -244,8 +244,8 @@ void OutputDevice::DrawGrid( const tools::Rectangle& rRect, const Size& rDist, D if( mbOutputClipped ) return; - const long nDistX = std::max<sal_Int32>( rDist.Width(), 1 ); - const long nDistY = std::max<sal_Int32>( rDist.Height(), 1 ); + const long nDistX = std::max( rDist.Width(), 1L ); + const long nDistY = std::max( rDist.Height(), 1L ); long nX = ( rRect.Left() >= aDstRect.Left() ) ? rRect.Left() : ( rRect.Left() + ( ( aDstRect.Left() - rRect.Left() ) / nDistX ) * nDistX ); long nY = ( rRect.Top() >= aDstRect.Top() ) ? rRect.Top() : ( rRect.Top() + ( ( aDstRect.Top() - rRect.Top() ) / nDistY ) * nDistY ); const long nRight = aDstRect.Right(); diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 7c8a81bd8de2..a3547b1bb491 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -156,8 +156,8 @@ void OutputDevice::ImplDrawTextBackground( const SalLayout& rSalLayout ) tools::Rectangle OutputDevice::ImplGetTextBoundRect( const SalLayout& rSalLayout ) { Point aPoint = rSalLayout.GetDrawPosition(); - sal_Int32 nX = aPoint.X(); - sal_Int32 nY = aPoint.Y(); + long nX = aPoint.X(); + long nY = aPoint.Y(); long nWidth = rSalLayout.GetTextWidth(); long nHeight = mpFontInstance->mnLineHeight + mnEmphasisAscent + mnEmphasisDescent; @@ -169,8 +169,8 @@ tools::Rectangle OutputDevice::ImplGetTextBoundRect( const SalLayout& rSalLayout long nBaseX = nX, nBaseY = nY; if ( !(mpFontInstance->mnOrientation % 900) ) { - sal_Int32 nX2 = nX+nWidth; - sal_Int32 nY2 = nY+nHeight; + long nX2 = nX+nWidth; + long nY2 = nY+nHeight; Point aBasePt( nBaseX, nBaseY ); aBasePt.RotateAround( nX, nY, mpFontInstance->mnOrientation ); diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx index 009651c7b4a3..bff62fe6e660 100644 --- a/vcl/source/outdev/textline.cxx +++ b/vcl/source/outdev/textline.cxx @@ -61,7 +61,7 @@ void OutputDevice::ImplInitAboveTextLineSize() } void OutputDevice::ImplDrawWavePixel( long nOriginX, long nOriginY, - sal_Int32 nCurX, sal_Int32 nCurY, + long nCurX, long nCurY, short nOrientation, SalGraphics* pGraphics, OutputDevice const * pOutDev, @@ -94,8 +94,8 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY, if ( !nHeight ) return; - sal_Int32 nStartX = nBaseX + nDistX; - sal_Int32 nStartY = nBaseY + nDistY; + long nStartX = nBaseX + nDistX; + long nStartY = nBaseY + nDistY; // If the height is 1 pixel, it's enough output a line if ( (nLineWidth == 1) && (nHeight == 1) ) @@ -103,8 +103,8 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY, mpGraphics->SetLineColor( rColor ); mbInitLineColor = true; - sal_Int32 nEndX = nStartX+nWidth; - sal_Int32 nEndY = nStartY; + long nEndX = nStartX+nWidth; + long nEndY = nStartY; if ( nOrientation ) { Point aOriginPt( nBaseX, nBaseY ); @@ -579,7 +579,7 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY, } void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY, - sal_Int32 nDistX, sal_Int32 nDistY, long nWidth, + long nDistX, long nDistY, long nWidth, FontStrikeout eStrikeout, Color aColor ) { @@ -996,8 +996,8 @@ void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos ) Point aEndPt = ImplLogicToDevicePixel( rEndPos ); long nStartX = aStartPt.X(); long nStartY = aStartPt.Y(); - sal_Int32 nEndX = aEndPt.X(); - sal_Int32 nEndY = aEndPt.Y(); + long nEndX = aEndPt.X(); + long nEndY = aEndPt.Y(); short nOrientation = 0; // when rotated diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 08e5d6924e8f..ef3437eba967 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -1146,9 +1146,9 @@ static void calcMaxs(const array_type &A, std::vector<VclGrid::Value> &rWidths, { Size aChildSize = VclContainer::getLayoutRequisition(*pChild); if (nWidth == 1) - rWidths[x].m_nValue = std::max<sal_Int32>(rWidths[x].m_nValue, aChildSize.Width()); + rWidths[x].m_nValue = std::max(rWidths[x].m_nValue, aChildSize.Width()); if (nHeight == 1) - rHeights[y].m_nValue = std::max<sal_Int32>(rHeights[y].m_nValue, aChildSize.Height()); + rHeights[y].m_nValue = std::max(rHeights[y].m_nValue, aChildSize.Height()); } } } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 7ae0f8e41d68..6c6c4715047e 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -1518,7 +1518,7 @@ Size Menu::ImplCalcSize( vcl::Window* pWin ) aSz.AdjustWidth(pData->aSz.Width() ); } else - pData->aSz.setHeight( std::max<sal_Int32>( std::max<sal_Int32>( nTextHeight, pData->aSz.Height() ), nMinMenuItemHeight ) ); + pData->aSz.setHeight( std::max( std::max( nTextHeight, pData->aSz.Height() ), nMinMenuItemHeight ) ); nWidth += nTextWidth; } @@ -1538,7 +1538,7 @@ Size Menu::ImplCalcSize( vcl::Window* pWin ) if ( nFontHeight > nWidth ) nWidth += nFontHeight; - pData->aSz.setHeight( std::max<sal_Int32>( std::max<sal_Int32>( nFontHeight, pData->aSz.Height() ), nMinMenuItemHeight ) ); + pData->aSz.setHeight( std::max( std::max( nFontHeight, pData->aSz.Height() ), nMinMenuItemHeight ) ); } pData->aSz.AdjustHeight(EXTRAITEMHEIGHT ); // little bit more distance @@ -1594,7 +1594,7 @@ Size Menu::ImplCalcSize( vcl::Window* pWin ) nImgOrChkWidth = aMaxSize.Height() + nExtra; else // non NWF case nImgOrChkWidth = nFontHeight/2 + gfxExtra; - nImgOrChkWidth = std::max<sal_Int32>( nImgOrChkWidth, aMaxImgSz.Width() + gfxExtra ); + nImgOrChkWidth = std::max( nImgOrChkWidth, aMaxImgSz.Width() + gfxExtra ); nTextPos = static_cast<sal_uInt16>(nImgOrChkPos + nImgOrChkWidth); nTextPos = nTextPos + gfxExtra; diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 2785f5889d35..1c92a392e1c2 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -1387,7 +1387,7 @@ ImplToolItem* ToolBox::ImplGetItem( sal_uInt16 nItemId ) const return nullptr; } -static void ImplAddButtonBorder( sal_Int32 &rWidth, sal_Int32& rHeight, bool bNativeButtons ) +static void ImplAddButtonBorder( long &rWidth, long& rHeight, bool bNativeButtons ) { rWidth += SMALLBUTTON_HSIZE; rHeight += SMALLBUTTON_VSIZE; @@ -1411,8 +1411,8 @@ bool ToolBox::ImplCalcItem() long nDefWidth; long nDefHeight; - sal_Int32 nMaxWidth = 0; - sal_Int32 nMaxHeight = 0; + long nMaxWidth = 0; + long nMaxHeight = 0; long nMinWidth = 6; long nMinHeight = 6; long nDropDownArrowWidth = TB_DROPDOWNARROWWIDTH; @@ -1617,16 +1617,16 @@ bool ToolBox::ImplCalcItem() if ( item.meType == ToolBoxItemType::BUTTON || item.meType == ToolBoxItemType::SPACE ) { // add borders - sal_Int32 w = item.maItemSize.Width(); - sal_Int32 h = item.maItemSize.Height(); + long w = item.maItemSize.Width(); + long h = item.maItemSize.Height(); ImplAddButtonBorder( w, h, mpData->mbNativeButtons ); item.maItemSize.setWidth(w); item.maItemSize.setHeight(h); if( item.meType == ToolBoxItemType::BUTTON ) { - long nMinW = std::max<sal_Int32>(nMinWidth, item.maMinimalItemSize.Width()); - long nMinH = std::max<sal_Int32>(nMinHeight, item.maMinimalItemSize.Height()); + long nMinW = std::max(nMinWidth, item.maMinimalItemSize.Width()); + long nMinH = std::max(nMinHeight, item.maMinimalItemSize.Height()); long nGrowContentWidth = 0; long nGrowContentHeight = 0; @@ -1671,8 +1671,8 @@ bool ToolBox::ImplCalcItem() // as this is used for alignment of multiple toolbars // it is only required for docked toolbars - sal_Int32 nFixedWidth = nDefWidth+nDropDownArrowWidth; - sal_Int32 nFixedHeight = nDefHeight; + long nFixedWidth = nDefWidth+nDropDownArrowWidth; + long nFixedHeight = nDefHeight; ImplAddButtonBorder( nFixedWidth, nFixedHeight, mpData->mbNativeButtons ); if( mbHorz ) diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 11d48b3ada08..f5548205b846 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -2352,8 +2352,8 @@ void Window::Show(bool bVisible, ShowFlags nFlags) // a system resize if ( mpWindowImpl->mbWaitSystemResize ) { - sal_Int32 nOutWidth; - sal_Int32 nOutHeight; + long nOutWidth; + long nOutHeight; mpWindowImpl->mpFrame->GetClientSize( nOutWidth, nOutHeight ); ImplHandleResize( this, nOutWidth, nOutHeight ); } diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index c1ba01a0ca24..b838f08f848b 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -2415,8 +2415,8 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, SalEvent nEvent, const void* pE case SalEvent::Resize: { - sal_Int32 nNewWidth; - sal_Int32 nNewHeight; + long nNewWidth; + long nNewHeight; pWindow->ImplGetWindowImpl()->mpFrame->GetClientSize( nNewWidth, nNewHeight ); ImplHandleResize( pWindow, nNewWidth, nNewHeight ); } diff --git a/vcl/unx/generic/app/i18n_status.cxx b/vcl/unx/generic/app/i18n_status.cxx index 9406b94a8c45..c80846e621ca 100644 --- a/vcl/unx/generic/app/i18n_status.cxx +++ b/vcl/unx/generic/app/i18n_status.cxx @@ -371,7 +371,7 @@ void I18NStatus::setStatusText( const OUString& rText ) bool bVisible = true; if( m_pParent ) { - sal_Int32 w, h; + long w, h; m_pParent->GetClientSize( w, h ); if( w == 0 || h == 0 ) { diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx index 92b0b4eb2fe9..e5db7853548f 100644 --- a/vcl/unx/generic/gdi/salbmp.cxx +++ b/vcl/unx/generic/gdi/salbmp.cxx @@ -236,11 +236,11 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, SalX11Screen nScreen, - sal_Int32 nDrawableDepth, - sal_Int32 nX, - sal_Int32 nY, - sal_Int32 nWidth, - sal_Int32 nHeight, + long nDrawableDepth, + long nX, + long nY, + long nWidth, + long nHeight, bool bGrey ) { BitmapBuffer* pDIB = nullptr; diff --git a/vcl/unx/generic/print/common_gfx.cxx b/vcl/unx/generic/print/common_gfx.cxx index 67bed525c5ea..85984e835736 100644 --- a/vcl/unx/generic/print/common_gfx.cxx +++ b/vcl/unx/generic/print/common_gfx.cxx @@ -484,7 +484,7 @@ PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const Po PSSetColor (); PSSetLineWidth (); - snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " moveto\n", pPath[0].X(), pPath[0].Y()); + snprintf(pString, nBezString, "%li %li moveto\n", pPath[0].X(), pPath[0].Y()); WritePS(mpPageBody, pString); // Handle the drawing of mixed lines mixed with curves @@ -494,7 +494,7 @@ PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const Po { if (pFlgAry[i] != PolyFlags::Control) //If the next point is a PolyFlags::Normal, we're drawing a line { - snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " lineto\n", pPath[i].X(), pPath[i].Y()); + snprintf(pString, nBezString, "%li %li lineto\n", pPath[i].X(), pPath[i].Y()); i++; } else //Otherwise we're drawing a spline @@ -504,8 +504,7 @@ PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const Po if ((pFlgAry[i] == PolyFlags::Control) && (pFlgAry[i+1] == PolyFlags::Control) && (pFlgAry[i+2] != PolyFlags::Control)) { - snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 - " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " curveto\n", + snprintf(pString, nBezString, "%li %li %li %li %li %li curveto\n", pPath[i].X(), pPath[i].Y(), pPath[i+1].X(), pPath[i+1].Y(), pPath[i+2].X(), pPath[i+2].Y()); @@ -533,13 +532,13 @@ PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const Pol if (nPoints <= 0 || (pPath == nullptr) || !(maFillColor.Is() || maLineColor.Is())) return; - snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " moveto\n", pPath[0].X(), pPath[0].Y()); + snprintf(pString, nBezString, "%li %li moveto\n", pPath[0].X(), pPath[0].Y()); WritePS(mpPageBody, pString); //Move to the starting point for the PolyPolygon for (unsigned int i=1; i < nPoints;) { if (pFlgAry[i] != PolyFlags::Control) { - snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " lineto\n", pPath[i].X(), pPath[i].Y()); + snprintf(pString, nBezString, "%li %li lineto\n", pPath[i].X(), pPath[i].Y()); WritePS(mpPageBody, pString); i++; } @@ -550,8 +549,7 @@ PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const Pol if ((pFlgAry[i] == PolyFlags::Control) && (pFlgAry[i+1] == PolyFlags::Control) && (pFlgAry[i+2] != PolyFlags::Control)) { - snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 - " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " curveto\n", + snprintf(pString, nBezString, "%li %li %li %li %li %li curveto\n", pPath[i].X(), pPath[i].Y(), pPath[i+1].X(), pPath[i+1].Y(), pPath[i+2].X(), pPath[i+2].Y()); @@ -596,7 +594,7 @@ PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints, if( nPoints == 0 || pPtAry[i] == nullptr ) continue; - snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " moveto\n", pPtAry[i][0].X(), pPtAry[i][0].Y()); //Move to the starting point + snprintf(pString, nBezString, "%li %li moveto\n", pPtAry[i][0].X(), pPtAry[i][0].Y()); //Move to the starting point WritePS(mpPageBody, pString); for (unsigned int j=1; j < nPoints;) { @@ -604,7 +602,7 @@ PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints, // polygon without beziers if ( ! pFlgAry[i] || pFlgAry[i][j] != PolyFlags::Control) { - snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " lineto\n", pPtAry[i][j].X(), pPtAry[i][j].Y()); + snprintf(pString, nBezString, "%li %li lineto\n", pPtAry[i][j].X(), pPtAry[i][j].Y()); WritePS(mpPageBody, pString); j++; } @@ -614,8 +612,7 @@ PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints, break; //Error: wrong sequence of control/normal points somehow if ((pFlgAry[i][j] == PolyFlags::Control) && (pFlgAry[i][j+1] == PolyFlags::Control) && (pFlgAry[i][j+2] != PolyFlags::Control)) { - snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 - " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " curveto\n", + snprintf(pString, nBezString, "%li %li %li %li %li %li curveto\n", pPtAry[i][j].X(), pPtAry[i][j].Y(), pPtAry[i][j+1].X(), pPtAry[i][j+1].Y(), pPtAry[i][j+2].X(), pPtAry[i][j+2].Y()); diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx index 3b2659c5bcef..f8951f4ea160 100644 --- a/vcl/unx/generic/print/genprnpsp.cxx +++ b/vcl/unx/generic/print/genprnpsp.cxx @@ -697,7 +697,7 @@ bool PspSalInfoPrinter::SetData( void PspSalInfoPrinter::GetPageInfo( const ImplJobSetup* pJobSetup, - sal_Int32& rOutWidth, sal_Int32& rOutHeight, + long& rOutWidth, long& rOutHeight, Point& rPageOffset, Size& rPaperSize ) { diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 872d8ca947ac..8f8bc056e054 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -1442,7 +1442,7 @@ void X11SalFrame::GetWorkArea( tools::Rectangle& rWorkArea ) rWorkArea = pDisplay_->getWMAdaptor()->getWorkArea( 0 ); } -void X11SalFrame::GetClientSize( sal_Int32 &rWidth, sal_Int32 &rHeight ) +void X11SalFrame::GetClientSize( long &rWidth, long &rHeight ) { if( ! bViewable_ ) { diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx index 404f45bf8015..d95fa6ec60ac 100644 --- a/vcl/unx/gtk/gtksalframe.cxx +++ b/vcl/unx/gtk/gtksalframe.cxx @@ -1683,7 +1683,7 @@ void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u TriggerPaintEvent(); } -void GtkSalFrame::GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight ) +void GtkSalFrame::GetClientSize( long& rWidth, long& rHeight ) { if( m_pWindow && !(m_nState & GDK_WINDOW_STATE_ICONIFIED) ) { diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index 78bb5c2bd93d..4ba26b017ed4 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -1671,7 +1671,7 @@ void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u m_bDefaultPos = false; } -void GtkSalFrame::GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight ) +void GtkSalFrame::GetClientSize( long& rWidth, long& rHeight ) { if( m_pWindow && !(m_nState & GDK_WINDOW_STATE_ICONIFIED) ) { diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index a8616e8118df..841cc2103cd8 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -1784,7 +1784,7 @@ public: virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override { mrRenderer.SetSizePixel(GetSizePixel()); - fprintf(stderr, "DemoWin::Paint(%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 ")\n", rRect.getX(), rRect.getY(), rRect.getWidth(), rRect.getHeight()); + fprintf(stderr, "DemoWin::Paint(%ld,%ld,%ld,%ld)\n", rRect.getX(), rRect.getY(), rRect.getWidth(), rRect.getHeight()); if (mrRenderer.getIterCount() == 0) mrRenderer.drawToDevice(rRenderContext, GetSizePixel(), false); else |