diff options
Diffstat (limited to 'vcl')
47 files changed, 210 insertions, 207 deletions
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx index 724220ad60a9..30c80ef16905 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( long& rWidth, long& rHeight ) +void SvpSalFrame::GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight ) { rWidth = maGeometry.nWidth; rHeight = maGeometry.nHeight; diff --git a/vcl/inc/headless/svpframe.hxx b/vcl/inc/headless/svpframe.hxx index 16de568794f8..6c5dc905a3e9 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( long& rWidth, long& rHeight ) override; + virtual void GetClientSize( sal_Int32& rWidth, sal_Int32& 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 c2b53e270648..30571d2cf077 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( long& rWidth, long& rHeight ) override; + virtual void GetClientSize( sal_Int32& rWidth, sal_Int32& 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 8f9c04017a66..cc668f0d2f66 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, - long& o_rOutWidth, long& o_rOutHeight, + sal_Int32& o_rOutWidth, sal_Int32& 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 c04f0a8f767e..4da52068ca58 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( long& rWidth, long& rHeight ) = 0; + virtual void GetClientSize( sal_Int32& rWidth, sal_Int32& 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 71ef1eae1c08..70f2b1a4bf9c 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( long& nX, const OutputDevice *pOutDev ) const; + void mirror( sal_Int32& nX, const OutputDevice *pOutDev ) const; // only called mirror2 to avoid ambiguity SAL_WARN_UNUSED_RESULT - long mirror2( long nX, const OutputDevice *pOutDev ) const; - void mirror( long& nX, long nWidth, const OutputDevice *pOutDev, bool bBack = false ) const; + 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; 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( long nX, long nY, const OutputDevice *pOutDev ); - void DrawPixel( long nX, long nY, Color nColor, const OutputDevice *pOutDev ); + 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 DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev ); + void DrawLine( sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2, const OutputDevice *pOutDev ); - void DrawRect( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev ); + void DrawRect( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 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( - long nDestX, long nDestY, - long nSrcX, long nSrcY, - long nSrcWidth, long nSrcHeight, + sal_Int32 nDestX, sal_Int32 nDestY, + sal_Int32 nSrcX, sal_Int32 nSrcY, + sal_Int32 nSrcWidth, sal_Int32 nSrcHeight, const OutputDevice *pOutDev ); // CopyBits and DrawBitmap --> RasterOp and ClipRegion @@ -308,18 +308,18 @@ public: const OutputDevice *pOutDev ); SalBitmap* GetBitmap( - long nX, long nY, - long nWidth, long nHeight, + sal_Int32 nX, sal_Int32 nY, + sal_Int32 nWidth, sal_Int32 nHeight, const OutputDevice *pOutDev ); Color GetPixel( - long nX, long nY, + sal_Int32 nX, sal_Int32 nY, const OutputDevice *pOutDev ); // invert --> ClipRegion (only Windows) void Invert( - long nX, long nY, - long nWidth, long nHeight, + sal_Int32 nX, sal_Int32 nY, + sal_Int32 nWidth, sal_Int32 nHeight, SalInvert nFlags, const OutputDevice *pOutDev ); @@ -330,8 +330,8 @@ public: const OutputDevice *pOutDev ); bool DrawEPS( - long nX, long nY, - long nWidth, long nHeight, + sal_Int32 nX, sal_Int32 nY, + sal_Int32 nWidth, sal_Int32 nHeight, void* pPtr, sal_uLong nSize, const OutputDevice *pOutDev ); @@ -417,8 +417,8 @@ public: const OutputDevice* pOutDev ); bool DrawAlphaRect( - long nX, long nY, - long nWidth, long nHeight, + sal_Int32 nX, sal_Int32 nY, + sal_Int32 nWidth, sal_Int32 nHeight, sal_uInt8 nTransparency, const OutputDevice *pOutDev ); diff --git a/vcl/inc/salprn.hxx b/vcl/inc/salprn.hxx index d9da1a6d80ed..5a70751c9112 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, - long& rOutWidth, long& rOutHeight, + sal_Int32& rOutWidth, sal_Int32& 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 9d80de32f99b..c00b589471dc 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, - long& rOutWidth, long& rOutHeight, + sal_Int32& rOutWidth, sal_Int32& 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 3db18f03fbcf..dc6f512c4526 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( long& rWidth, long& rHeight ) override; + virtual void GetClientSize( sal_Int32& rWidth, sal_Int32& 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 3f45cd5d853c..0dd228c0b13f 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, - long nDrawableDepth, - long nX, - long nY, - long nWidth, - long nHeight, + sal_Int32 nDrawableDepth, + sal_Int32 nX, + sal_Int32 nY, + sal_Int32 nWidth, + sal_Int32 nHeight, bool bGrey ); diff --git a/vcl/inc/unx/salframe.h b/vcl/inc/unx/salframe.h index 92bfcbfb9d31..5deb7f009325 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( long& rWidth, long& rHeight ) override; + virtual void GetClientSize( sal_Int32& rWidth, sal_Int32& 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 df4996a6ca09..0730a1991c81 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 ) { - long nX1( nX ); - long nY1( nY ); - long nX2( nX + nWidth ); - long nY2( nY + nHeight ); + sal_Int32 nX1( nX ); + sal_Int32 nY1( nY ); + sal_Int32 nX2( nX + nWidth ); + sal_Int32 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 ) { - long nX1( rRect.Left() ); - long nY1( rRect.Top() ); - long nX2( rRect.Right() ); - long nY2( rRect.Bottom() ); + sal_Int32 nX1( rRect.Left() ); + sal_Int32 nY1( rRect.Top() ); + sal_Int32 nX2( rRect.Right() ); + sal_Int32 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 7b5b203668d8..d8bf6be5ba7f 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( long& rWidth, long& rHeight ) +void AquaSalFrame::GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight ) { if( mbShown || mbInitShow ) { diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx index b87585de91db..b16984387464 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*, - long& o_rOutWidth, long& o_rOutHeight, + sal_Int32& o_rOutWidth, sal_Int32& o_rOutHeight, Point& rPageOffset, Size& rPaperSize ) { diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx index f835c7b78bc3..c92d1753c6ff 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<long>(0), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(0), aSize.Height()); + 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 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<long>(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height()); + 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 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<long>(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height()); + 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 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<long>(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height()); + 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 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<long>(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height()); + 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 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<long>(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height()); + 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 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<long>(10), aSize.Width()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong height", static_cast<long>(10), aSize.Height()); + 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 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(static_cast<long>(10), aBitmap24Bit.GetSizePixel().Width()); - CPPUNIT_ASSERT_EQUAL(static_cast<long>(10), aBitmap24Bit.GetSizePixel().Height()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(10), aBitmap24Bit.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(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(static_cast<long>(20), aBitmap24Bit.GetSizePixel().Width()); - CPPUNIT_ASSERT_EQUAL(static_cast<long>(20), aBitmap24Bit.GetSizePixel().Height()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(20), aBitmap24Bit.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(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 a423a17081e8..9399dd43f339 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 %ld, %ld\n", aAfter.Width(), aAfter.Height() ); + fprintf( stderr, "size %" SAL_PRIdINT32 ", %" SAL_PRIdINT32 "\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(100L, aSize.Width()); - CPPUNIT_ASSERT_EQUAL(100L, aSize.Height()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(100), aSize.Width()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(100), aSize.Height()); } void VclFiltersTest::testExportImport() diff --git a/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx b/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx index 4cae79645bd6..7727a13c18ad 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(12L, aSize.Width()); - CPPUNIT_ASSERT_EQUAL(12L, aSize.Height()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Width()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(12), 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(12L, aSize.Width()); - CPPUNIT_ASSERT_EQUAL(12L, aSize.Height()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Width()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(12), 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(12L, aSize.Width()); - CPPUNIT_ASSERT_EQUAL(12L, aSize.Height()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Width()); + CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aSize.Height()); int maxDelta = 1; CPPUNIT_ASSERT(checkRect(aBitmap, 0, 8, 8, Color(0xff, 0xff, 0xff), maxDelta)); diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 35400b70ed8a..7c3238979e7d 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( aSize.Height(), long( textSize.Height() * 1.15 ) ) ); + aSize.setHeight( std::max<sal_Int32>( aSize.Height(), sal_Int32( textSize.Height() * 1.15 ) ) ); } // cf. ImplDrawPushButton ... diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 7b14c8da64c2..abb0a5e0c677 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, static_cast<sal_Int32>(aSel.Max()) ); + OUString aStartText = aFullText.copy( 0, 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(aSz.Width(), nMaxWidth) ); + aSz.setWidth( std::min<sal_Int32>(aSz.Width(), nMaxWidth) ); } if (IsDropDownBox()) diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 42dd22296585..e6c8e07bb824 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( static_cast<sal_Int32>(aSelection.Min()), static_cast<sal_Int32>(aSelection.Len()) ); + maText.remove( aSelection.Min(), 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( static_cast<sal_Int32>(aSelection.Min()), static_cast<sal_Int32>(aSelection.Len()) ); + maText.remove( aSelection.Min(), aSelection.Len() ); else if ( !mbInsertMode && (aSelection.Max() < maText.getLength()) ) - maText.remove( static_cast<sal_Int32>(aSelection.Max()), 1 ); + maText.remove( 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 = static_cast< sal_Int32 >( aSelection.Min() ); + sal_Int32 nTmpPos = 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( static_cast<sal_Int32>(aSelection.Min()), aNewText ); + maText.insert( aSelection.Min(), aNewText ); if ( !pNewSel ) { @@ -2036,7 +2036,7 @@ void Edit::Command( const CommandEvent& rCEvt ) { DeleteSelected(); delete mpIMEInfos; - sal_Int32 nPos = static_cast<sal_Int32>(maSelection.Max()); + sal_Int32 nPos = 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 a59557dcbb9b..13fe3a348a96 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 ( static_cast<sal_Int32>(aSelection.Max()) == aText.getLength() ) + if ( 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 e438fb0a7efa..e05960b660f0 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -467,7 +467,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 = static_cast<sal_Int32>(aOldSel.Max()); + sal_Int32 nCursorPos = aOldSel.Max(); sal_Int32 nNewPos; sal_Int32 nTempPos; @@ -524,7 +524,7 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, // all was selected by the focus Selection aSel( aOldSel ); aSel.Justify(); - nCursorPos = static_cast<sal_Int32>(aSel.Min()); + nCursorPos = aSel.Min(); ImplPatternMaxPos( pEdit->GetText(), rEditMask, nFormatFlags, bSameMask, nCursorPos, nNewPos ); aSel.Max() = nNewPos; if ( bShift ) @@ -541,16 +541,16 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, Selection aSel = aOldSel; aSel.Justify(); - nNewPos = static_cast<sal_Int32>(aSel.Min()); + nNewPos = aSel.Min(); // if selection then delete it if ( aSel.Len() ) { if ( bSameMask ) - aStr.remove( static_cast<sal_Int32>(aSel.Min()), static_cast<sal_Int32>(aSel.Len()) ); + aStr.remove( aSel.Min(), aSel.Len() ); else { - OUString aRep = rLiteralMask.copy( static_cast<sal_Int32>(aSel.Min()), static_cast<sal_Int32>(aSel.Len()) ); + OUString aRep = rLiteralMask.copy( aSel.Min(), aSel.Len() ); aStr.remove( aSel.Min(), aRep.getLength() ); aStr.insert( aSel.Min(), aRep ); } @@ -1324,7 +1324,7 @@ void DateField::ImplDateSpinArea( bool bUp ) Selection aSelection = GetField()->GetSelection(); aSelection.Justify(); OUString aText( GetText() ); - if ( static_cast<sal_Int32>(aSelection.Len()) == aText.getLength() ) + if ( aSelection.Len() == aText.getLength() ) ImplDateIncrementDay( aDate, bUp ); else { @@ -1344,7 +1344,7 @@ void DateField::ImplDateSpinArea( bool bUp ) for ( sal_Int8 i = 1; i <= 3; i++ ) { nPos = aText.indexOf( aDateSep, nPos ); - if (nPos < 0 || nPos >= static_cast<sal_Int32>(aSelection.Max())) + if (nPos < 0 || nPos >= aSelection.Max()) { nDateArea = i; break; @@ -1585,7 +1585,7 @@ void DateFormatter::ImplNewFieldValue( const Date& rDate ) OUString aText = GetField()->GetText(); // If selected until the end then keep it that way - if ( static_cast<sal_Int32>(aSelection.Max()) == aText.getLength() ) + if ( aSelection.Max() == aText.getLength() ) { if ( !aSelection.Len() ) aSelection.Min() = SELECTION_MAX; @@ -2364,7 +2364,7 @@ void TimeFormatter::ImplNewFieldValue( const tools::Time& rTime ) OUString aText = GetField()->GetText(); // If selected until the end then keep it that way - if ( static_cast<sal_Int32>(aSelection.Max()) == aText.getLength() ) + if ( 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 f998285abc1a..f82d1dc992f5 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, 0x7fffffff)), + return pControl->GetTextRect(tools::Rectangle( Point(), Size(nMaxWidth, RECT_MAX)), rTxt, nStyle).GetSize(); } diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index 171b75afd151..6f510684b866 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( aMetrics.nImgWidth, maUserItemSize.Width() ); + aMetrics.nEntryWidth = std::max<sal_Int32>( aMetrics.nImgWidth, maUserItemSize.Width() ); if ( aMetrics.bText ) aMetrics.nEntryWidth += aMetrics.nTextWidth + IMG_TXT_DISTANCE; - aMetrics.nEntryHeight = std::max( std::max( mnMaxImgHeight, maUserItemSize.Height() ) + 2, + aMetrics.nEntryHeight = std::max<sal_Int32>( std::max<sal_Int32>( mnMaxImgHeight, maUserItemSize.Height() ) + 2, aMetrics.nEntryHeight ); } @@ -1802,7 +1802,7 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32 if (!bDrawTextAtImagePos && (mpEntryList->HasEntryImage(nPos) || IsUserDrawEnabled())) { - long nImageWidth = std::max(mnMaxImgWidth, maUserItemSize.Width()); + sal_Int32 nImageWidth = std::max<sal_Int32>(mnMaxImgWidth, maUserItemSize.Width()); aTextRect.AdjustLeft(nImageWidth + IMG_TXT_DISTANCE ); } diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx index ef945a087659..17d1c9c8cefc 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(aSz.Width(), nMaxWidth) ); + aSz.setWidth( std::min<sal_Int32>(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 54931df82557..370891802b9f 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(nWidth, aSize.Width()); + nWidth = std::max<sal_Int32>(nWidth, aSize.Width()); if (!bCanHandleSmallerHeight) - nHeight = std::max(nHeight, aSize.Height()); + nHeight = std::max<sal_Int32>(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 a4f06757c2ea..a1bcc29273c6 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(), LONG_MAX); + tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), RECT_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(nTabLabelsRight, aOptimalSize.Width()) ); + aOptimalSize.setWidth( std::max<sal_Int32>(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(), LONG_MAX); + tools::Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aOptimalPageSize.Width(), RECT_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(nTabLabelsRight, aOptimalSize.Width()) ); + aOptimalSize.setWidth( std::max<sal_Int32>(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 34919a3149bf..50d201d32e02 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( mpBuffer->mnWidth, rReadAcc.Width() ); nX < nWidth; nX++ ) + for( long nX = 0, nWidth = std::min<sal_Int32>( 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( mpBuffer->mnHeight, rReadAcc.Height() ); + const long nHeight = std::min<sal_Int32>( 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( mpBuffer->mnHeight, rReadAcc.Height() ); nY < nHeight; nY++ ) + for( long nY = 0, nHeight = std::min<sal_Int32>( 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 915a3b2de479..9c153d986790 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( static_cast<sal_Int32>(rRect.GetWidth()), rBuffer, false ); + appendMappedLength( rRect.GetWidth(), rBuffer, false ); rBuffer.append( ' ' ); - appendMappedLength( static_cast<sal_Int32>(rRect.GetHeight()), rBuffer ); + appendMappedLength( rRect.GetHeight(), rBuffer ); rBuffer.append( " re" ); } @@ -2768,10 +2768,10 @@ bool PDFWriterImpl::emitTilings() emitComment( "PDFWriterImpl::emitTilings" ); } - 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()); + 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(); 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( static_cast<sal_Int32>(rInfo.m_aFontBBox.TopLeft().X()) ); + aLine.append( rInfo.m_aFontBBox.TopLeft().X() ); aLine.append( ' ' ); - aLine.append( static_cast<sal_Int32>(rInfo.m_aFontBBox.TopLeft().Y()) ); + aLine.append( rInfo.m_aFontBBox.TopLeft().Y() ); aLine.append( ' ' ); - aLine.append( static_cast<sal_Int32>(rInfo.m_aFontBBox.BottomRight().X()) ); + aLine.append( 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( sal_Int32( aCheckRect.GetHeight() ), aDA ); + m_aPages[ m_nCurrentPage ].appendMappedLength( 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( sal_Int32( aCheckRect.GetHeight() ), aDA ); + m_aPages[m_nCurrentPage].appendMappedLength( 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( static_cast<sal_Int32>(aSize.Width()) ); + aLine.append( aSize.Width() ); aLine.append( ' ' ); - aLine.append( static_cast<sal_Int32>(aSize.Height()) ); + aLine.append( 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( static_cast<sal_Int32>(aPoly[0].X()) ); + aLine.append( aPoly[0].X() ); aLine.append( " " ); - aLine.append( static_cast<sal_Int32>(aPoly[0].Y()) ); + aLine.append( aPoly[0].Y() ); aLine.append( " " ); - aLine.append( static_cast<sal_Int32>(aPoly[1].X())); + aLine.append( aPoly[1].X() ); aLine.append( " "); - aLine.append( static_cast<sal_Int32>(aPoly[1].Y())); + aLine.append( 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( static_cast<sal_Int32>(aSize.Width()) ); + aLine.append( aSize.Width() ); aLine.append( " 0 0 " ); - aLine.append( static_cast<sal_Int32>(aSize.Height()) ); + aLine.append( 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( static_cast<sal_Int32>(rObject.m_aID.m_aPixelSize.Width()) ); + aLine.append( rObject.m_aID.m_aPixelSize.Width() ); aLine.append( " /Height " ); - aLine.append( static_cast<sal_Int32>(rObject.m_aID.m_aPixelSize.Height()) ); + aLine.append( 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( static_cast<sal_Int32>(aBitmap.GetSizePixel().Width()) ); + aLine.append( aBitmap.GetSizePixel().Width() ); aLine.append( "/Height " ); - aLine.append( static_cast<sal_Int32>(aBitmap.GetSizePixel().Height()) ); + aLine.append( 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( static_cast<sal_Int32>(aBitmap.GetSizePixel().Width()) ); + aLine.append( 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( static_cast<sal_Int32>(rTargetArea.GetWidth()), aLine, false, &nCheckWidth ); + m_aPages.back().appendMappedLength( rTargetArea.GetWidth(), aLine, false, &nCheckWidth ); aLine.append( " 0 0 " ); sal_Int32 nCheckHeight = 0; - m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rTargetArea.GetHeight()), aLine, true, &nCheckHeight ); + m_aPages.back().appendMappedLength( 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( static_cast<sal_Int32>(rDestSize.Width()), aLine, false, &nCheckWidth ); + m_aPages.back().appendMappedLength( rDestSize.Width(), aLine, false, &nCheckWidth ); aLine.append( " 0 0 " ); sal_Int32 nCheckHeight = 0; - m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rDestSize.Height()), aLine, true, &nCheckHeight ); + m_aPages.back().appendMappedLength( 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( static_cast<sal_Int32>(rRect.GetWidth()), aLine, false ); + m_aPages.back().appendMappedLength( rRect.GetWidth(), aLine, false ); aLine.append( ' ' ); - m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rRect.GetHeight()), aLine ); + m_aPages.back().appendMappedLength( 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( static_cast<sal_Int32>(rRect.GetWidth()), aLine, false ); + m_aPages.back().appendMappedLength( rRect.GetWidth(), aLine, false ); aLine.append( ' ' ); - m_aPages.back().appendMappedLength( static_cast<sal_Int32>(rRect.GetHeight()), aLine ); + m_aPages.back().appendMappedLength( 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 49cc105d5d54..2887158ea67b 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -106,13 +106,13 @@ bool SalGraphics::drawTransformedBitmap( return false; } -long SalGraphics::mirror2( long x, const OutputDevice *pOutDev ) const +sal_Int32 SalGraphics::mirror2( sal_Int32 x, const OutputDevice *pOutDev ) const { mirror(x, pOutDev); return x; } -void SalGraphics::mirror( long& x, const OutputDevice *pOutDev ) const +void SalGraphics::mirror( sal_Int32& x, const OutputDevice *pOutDev ) const { long w; if( pOutDev && pOutDev->GetOutDevType() == OUTDEV_VIRDEV ) @@ -142,7 +142,7 @@ void SalGraphics::mirror( long& x, const OutputDevice *pOutDev ) const } } -void SalGraphics::mirror( long& x, long nWidth, const OutputDevice *pOutDev, bool bBack ) const +void SalGraphics::mirror( sal_Int32& x, sal_Int32 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 { - long nWidth = rRect.GetWidth(); - long x = rRect.Left(); - long x_org = x; + sal_Int32 nWidth = rRect.GetWidth(); + sal_Int32 x = rRect.Left(); + sal_Int32 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( long nX, long nY, const OutputDevice *pOutDev ) +void SalGraphics::DrawPixel( sal_Int32 nX, sal_Int32 nY, const OutputDevice *pOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) mirror( nX, pOutDev ); drawPixel( nX, nY ); } -void SalGraphics::DrawPixel( long nX, long nY, Color nColor, const OutputDevice *pOutDev ) +void SalGraphics::DrawPixel( sal_Int32 nX, sal_Int32 nY, Color nColor, const OutputDevice *pOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) mirror( nX, pOutDev ); drawPixel( nX, nY, nColor ); } -void SalGraphics::DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev ) +void SalGraphics::DrawLine( sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2, const OutputDevice *pOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) { @@ -390,7 +390,7 @@ void SalGraphics::DrawLine( long nX1, long nY1, long nX2, long nY2, const Output drawLine( nX1, nY1, nX2, nY2 ); } -void SalGraphics::DrawRect( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev ) +void SalGraphics::DrawRect( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 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( long nDestX, long nDestY, - long nSrcX, long nSrcY, - long nSrcWidth, long nSrcHeight, +void SalGraphics::CopyArea( sal_Int32 nDestX, sal_Int32 nDestY, + sal_Int32 nSrcX, sal_Int32 nSrcY, + sal_Int32 nSrcWidth, sal_Int32 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( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev ) +SalBitmap* SalGraphics::GetBitmap( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 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( long nX, long nY, const OutputDevice *pOutDev ) +Color SalGraphics::GetPixel( sal_Int32 nX, sal_Int32 nY, const OutputDevice *pOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) mirror( nX, pOutDev ); return getPixel( nX, nY ); } -void SalGraphics::Invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev ) +void SalGraphics::Invert( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 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( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize, const OutputDevice *pOutDev ) +bool SalGraphics::DrawEPS( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 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( long nX, long nY, long nWidth, long nHeight, +bool SalGraphics::DrawAlphaRect( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 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 d302d6952877..1d54de94ee71 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( 1L, pOut->LogicToPixel( rSize, aOutMapMode ).Width() ), - ::std::max( 1L, pOut->LogicToPixel( rSize, aOutMapMode ).Height() ) ); + const Size aOutTileSize( ::std::max<sal_Int32>( 1, pOut->LogicToPixel( rSize, aOutMapMode ).Width() ), + ::std::max<sal_Int32>( 1, 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 c9f0e7c460ce..78b0a5382a59 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( rDist.Width(), 1L ); - const long nDistY = std::max( rDist.Height(), 1L ); + const long nDistX = std::max<sal_Int32>( rDist.Width(), 1 ); + const long nDistY = std::max<sal_Int32>( rDist.Height(), 1 ); 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 a3547b1bb491..7c8a81bd8de2 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(); - long nX = aPoint.X(); - long nY = aPoint.Y(); + sal_Int32 nX = aPoint.X(); + sal_Int32 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) ) { - long nX2 = nX+nWidth; - long nY2 = nY+nHeight; + sal_Int32 nX2 = nX+nWidth; + sal_Int32 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 bff62fe6e660..009651c7b4a3 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, - long nCurX, long nCurY, + sal_Int32 nCurX, sal_Int32 nCurY, short nOrientation, SalGraphics* pGraphics, OutputDevice const * pOutDev, @@ -94,8 +94,8 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY, if ( !nHeight ) return; - long nStartX = nBaseX + nDistX; - long nStartY = nBaseY + nDistY; + sal_Int32 nStartX = nBaseX + nDistX; + sal_Int32 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; - long nEndX = nStartX+nWidth; - long nEndY = nStartY; + sal_Int32 nEndX = nStartX+nWidth; + sal_Int32 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, - long nDistX, long nDistY, long nWidth, + sal_Int32 nDistX, sal_Int32 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(); - long nEndX = aEndPt.X(); - long nEndY = aEndPt.Y(); + sal_Int32 nEndX = aEndPt.X(); + sal_Int32 nEndY = aEndPt.Y(); short nOrientation = 0; // when rotated diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index ef3437eba967..08e5d6924e8f 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(rWidths[x].m_nValue, aChildSize.Width()); + rWidths[x].m_nValue = std::max<sal_Int32>(rWidths[x].m_nValue, aChildSize.Width()); if (nHeight == 1) - rHeights[y].m_nValue = std::max(rHeights[y].m_nValue, aChildSize.Height()); + rHeights[y].m_nValue = std::max<sal_Int32>(rHeights[y].m_nValue, aChildSize.Height()); } } } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 6c6c4715047e..7ae0f8e41d68 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( std::max( nTextHeight, pData->aSz.Height() ), nMinMenuItemHeight ) ); + pData->aSz.setHeight( std::max<sal_Int32>( std::max<sal_Int32>( 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( std::max( nFontHeight, pData->aSz.Height() ), nMinMenuItemHeight ) ); + pData->aSz.setHeight( std::max<sal_Int32>( std::max<sal_Int32>( 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( nImgOrChkWidth, aMaxImgSz.Width() + gfxExtra ); + nImgOrChkWidth = std::max<sal_Int32>( 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 5e7b424c1392..094d9cc1589a 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( long &rWidth, long& rHeight, bool bNativeButtons ) +static void ImplAddButtonBorder( sal_Int32 &rWidth, sal_Int32& rHeight, bool bNativeButtons ) { rWidth += SMALLBUTTON_HSIZE; rHeight += SMALLBUTTON_VSIZE; @@ -1411,8 +1411,8 @@ bool ToolBox::ImplCalcItem() long nDefWidth; long nDefHeight; - long nMaxWidth = 0; - long nMaxHeight = 0; + sal_Int32 nMaxWidth = 0; + sal_Int32 nMaxHeight = 0; long nMinWidth = 6; long nMinHeight = 6; long nDropDownArrowWidth = TB_DROPDOWNARROWWIDTH; @@ -1625,16 +1625,16 @@ bool ToolBox::ImplCalcItem() if ( item.meType == ToolBoxItemType::BUTTON || item.meType == ToolBoxItemType::SPACE ) { // add borders - long w = item.maItemSize.Width(); - long h = item.maItemSize.Height(); + sal_Int32 w = item.maItemSize.Width(); + sal_Int32 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(nMinWidth, item.maMinimalItemSize.Width()); - long nMinH = std::max(nMinHeight, item.maMinimalItemSize.Height()); + long nMinW = std::max<sal_Int32>(nMinWidth, item.maMinimalItemSize.Width()); + long nMinH = std::max<sal_Int32>(nMinHeight, item.maMinimalItemSize.Height()); long nGrowContentWidth = 0; long nGrowContentHeight = 0; @@ -1679,8 +1679,8 @@ bool ToolBox::ImplCalcItem() // as this is used for alignment of multiple toolbars // it is only required for docked toolbars - long nFixedWidth = nDefWidth+nDropDownArrowWidth; - long nFixedHeight = nDefHeight; + sal_Int32 nFixedWidth = nDefWidth+nDropDownArrowWidth; + sal_Int32 nFixedHeight = nDefHeight; ImplAddButtonBorder( nFixedWidth, nFixedHeight, mpData->mbNativeButtons ); if( mbHorz ) diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index f5548205b846..11d48b3ada08 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 ) { - long nOutWidth; - long nOutHeight; + sal_Int32 nOutWidth; + sal_Int32 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 b838f08f848b..c1ba01a0ca24 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: { - long nNewWidth; - long nNewHeight; + sal_Int32 nNewWidth; + sal_Int32 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 c80846e621ca..9406b94a8c45 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 ) { - long w, h; + sal_Int32 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 e5db7853548f..92b0b4eb2fe9 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, - long nDrawableDepth, - long nX, - long nY, - long nWidth, - long nHeight, + sal_Int32 nDrawableDepth, + sal_Int32 nX, + sal_Int32 nY, + sal_Int32 nWidth, + sal_Int32 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 85984e835736..67bed525c5ea 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, "%li %li moveto\n", pPath[0].X(), pPath[0].Y()); + snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " 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, "%li %li lineto\n", pPath[i].X(), pPath[i].Y()); + snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " lineto\n", pPath[i].X(), pPath[i].Y()); i++; } else //Otherwise we're drawing a spline @@ -504,7 +504,8 @@ 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, "%li %li %li %li %li %li curveto\n", + snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 + " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " curveto\n", pPath[i].X(), pPath[i].Y(), pPath[i+1].X(), pPath[i+1].Y(), pPath[i+2].X(), pPath[i+2].Y()); @@ -532,13 +533,13 @@ PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const Pol if (nPoints <= 0 || (pPath == nullptr) || !(maFillColor.Is() || maLineColor.Is())) return; - snprintf(pString, nBezString, "%li %li moveto\n", pPath[0].X(), pPath[0].Y()); + snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " 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, "%li %li lineto\n", pPath[i].X(), pPath[i].Y()); + snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " lineto\n", pPath[i].X(), pPath[i].Y()); WritePS(mpPageBody, pString); i++; } @@ -549,7 +550,8 @@ 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, "%li %li %li %li %li %li curveto\n", + snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 + " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " curveto\n", pPath[i].X(), pPath[i].Y(), pPath[i+1].X(), pPath[i+1].Y(), pPath[i+2].X(), pPath[i+2].Y()); @@ -594,7 +596,7 @@ PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints, if( nPoints == 0 || pPtAry[i] == nullptr ) continue; - snprintf(pString, nBezString, "%li %li moveto\n", pPtAry[i][0].X(), pPtAry[i][0].Y()); //Move to the starting point + snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " 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;) { @@ -602,7 +604,7 @@ PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints, // polygon without beziers if ( ! pFlgAry[i] || pFlgAry[i][j] != PolyFlags::Control) { - snprintf(pString, nBezString, "%li %li lineto\n", pPtAry[i][j].X(), pPtAry[i][j].Y()); + snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " lineto\n", pPtAry[i][j].X(), pPtAry[i][j].Y()); WritePS(mpPageBody, pString); j++; } @@ -612,7 +614,8 @@ 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, "%li %li %li %li %li %li curveto\n", + snprintf(pString, nBezString, "%" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 + " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " %" SAL_PRIdINT32 " 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 f8951f4ea160..3b2659c5bcef 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, - long& rOutWidth, long& rOutHeight, + sal_Int32& rOutWidth, sal_Int32& rOutHeight, Point& rPageOffset, Size& rPaperSize ) { diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 8f8bc056e054..872d8ca947ac 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( long &rWidth, long &rHeight ) +void X11SalFrame::GetClientSize( sal_Int32 &rWidth, sal_Int32 &rHeight ) { if( ! bViewable_ ) { diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx index d95fa6ec60ac..404f45bf8015 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( long& rWidth, long& rHeight ) +void GtkSalFrame::GetClientSize( sal_Int32& rWidth, sal_Int32& 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 4ba26b017ed4..78bb5c2bd93d 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( long& rWidth, long& rHeight ) +void GtkSalFrame::GetClientSize( sal_Int32& rWidth, sal_Int32& rHeight ) { if( m_pWindow && !(m_nState & GDK_WINDOW_STATE_ICONIFIED) ) { diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 841cc2103cd8..a8616e8118df 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(%ld,%ld,%ld,%ld)\n", rRect.getX(), rRect.getY(), rRect.getWidth(), rRect.getHeight()); + fprintf(stderr, "DemoWin::Paint(%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 ")\n", rRect.getX(), rRect.getY(), rRect.getWidth(), rRect.getHeight()); if (mrRenderer.getIterCount() == 0) mrRenderer.drawToDevice(rRenderContext, GetSizePixel(), false); else |