[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/quartz

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Sun Nov 15 18:03:49 UTC 2020


 vcl/inc/osx/salframe.h       |   19 ++++++-----
 vcl/inc/osx/salinst.h        |    3 +
 vcl/inc/osx/salobj.h         |    7 ++--
 vcl/inc/osx/salprn.h         |   11 ++++--
 vcl/inc/quartz/salgdi.h      |   36 +++++++++++---------
 vcl/inc/quartz/salvd.h       |   14 ++++----
 vcl/osx/a11yutil.mm          |    3 +
 vcl/osx/salframe.cxx         |   49 +++++++++++++++-------------
 vcl/osx/salframeview.mm      |   26 +++++++--------
 vcl/osx/salmenu.cxx          |   10 ++---
 vcl/osx/salnativewidgets.cxx |   12 +++---
 vcl/osx/salobj.cxx           |    6 ++-
 vcl/osx/salprn.cxx           |   23 ++++++-------
 vcl/osx/salsys.cxx           |    6 +--
 vcl/quartz/ctfonts.cxx       |   10 ++---
 vcl/quartz/salgdi.cxx        |   13 ++++---
 vcl/quartz/salgdicommon.cxx  |   74 +++++++++++++++++++++++--------------------
 vcl/quartz/salvd.cxx         |   13 ++++---
 18 files changed, 185 insertions(+), 150 deletions(-)

New commits:
commit 7a83d0a268a348a86dd31acbac94872eab82f75b
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Nov 12 15:13:56 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sun Nov 15 19:03:09 2020 +0100

    loplugin:toolslong in Library_vclplug_osx
    
    Change-Id: I63892376154893a97e6b205b93c1682f66fd3064
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105756
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index 3d0f19f418a0..d634647715ce 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -24,6 +24,7 @@
 #include <IOKit/pwr_mgt/IOPMLib.h>
 #include <postmac.h>
 
+#include <tools/long.hxx>
 #include <vcl/sysdata.hxx>
 
 #include <osx/salinst.h>
@@ -117,10 +118,12 @@ public:
     virtual void                SetMenu( SalMenu* pSalMenu ) override;
     virtual void                DrawMenuBar() override;
     virtual void                Show( bool bVisible, bool bNoActivate = false ) override;
-    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                SetMinClientSize( tools::Long nWidth, tools::Long nHeight )
+        override;
+    virtual void                SetMaxClientSize( tools::Long nWidth, tools::Long nHeight )
+        override;
+    virtual void                SetPosSize( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt16 nFlags ) override;
+    virtual void                GetClientSize( tools::Long& rWidth, tools::Long& rHeight ) override;
     virtual void                GetWorkArea( tools::Rectangle& rRect ) override;
     virtual SalFrame*           GetParent() const override;
     virtual void                SetWindowState( const SalFrameState* pState ) override;
@@ -131,7 +134,7 @@ public:
     virtual void                ToTop( SalFrameToTop nFlags ) override;
     virtual void                SetPointer( PointerStyle ePointerStyle ) override;
     virtual void                CaptureMouse( bool bMouse ) override;
-    virtual void                SetPointerPos( long nX, long nY ) override;
+    virtual void                SetPointerPos( tools::Long nX, tools::Long nY ) override;
     virtual void                Flush( void ) override;
     virtual void                Flush( const tools::Rectangle& ) override;
     virtual void                SetInputContext( SalInputContext* pContext ) override;
@@ -157,7 +160,8 @@ public:
     // start setting the clipregion consisting of nRects rectangles
     virtual void BeginSetClipRegion( sal_uInt32 nRects ) override;
     // add a rectangle to the clip region
-    virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) override;
+    virtual void UnionClipRegion(
+        tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) override;
     // done setting up the clipregion
     virtual void EndSetClipRegion() override;
 
@@ -193,7 +197,8 @@ public:
     void screenParametersChanged();
 
 protected:
-    SalEvent PreparePosSize(long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags);
+    SalEvent PreparePosSize(
+        tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt16 nFlags);
 
 private: // methods
     /** do things on initial show (like centering on parent or on screen)
diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index edece53b6bea..97cbe37e2038 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -30,6 +30,7 @@
 #include <comphelper/solarmutex.hxx>
 #include <osl/conditn.hxx>
 #include <osl/thread.hxx>
+#include <tools/long.hxx>
 
 #ifdef MACOSX
 #include <osx/osxvcltypes.h>
@@ -101,7 +102,7 @@ public:
     virtual void            DestroyObject( SalObject* pObject ) override;
     virtual std::unique_ptr<SalVirtualDevice>
                             CreateVirtualDevice( SalGraphics* pGraphics,
-                                                   long &nDX, long &nDY,
+                                                   tools::Long &nDX, tools::Long &nDY,
                                                    DeviceFormat eFormat,
                                                    const SystemGraphicsData *pData = nullptr ) override;
     virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
diff --git a/vcl/inc/osx/salobj.h b/vcl/inc/osx/salobj.h
index 144c1cb069a1..4c2ac88be6c1 100644
--- a/vcl/inc/osx/salobj.h
+++ b/vcl/inc/osx/salobj.h
@@ -20,6 +20,9 @@
 #ifndef INCLUDED_VCL_INC_OSX_SALOBJ_H
 #define INCLUDED_VCL_INC_OSX_SALOBJ_H
 
+#include <sal/config.h>
+
+#include <tools/long.hxx>
 #include <vcl/sysdata.hxx>
 #include <salobj.hxx>
 
@@ -56,9 +59,9 @@ public:
 
     virtual void                    ResetClipRegion() override;
     virtual void                    BeginSetClipRegion( sal_uInt32 nRects ) override;
-    virtual void                    UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) override;
+    virtual void                    UnionClipRegion( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) override;
     virtual void                    EndSetClipRegion() override;
-    virtual void                    SetPosSize( long nX, long nY, long nWidth, long nHeight ) override;
+    virtual void                    SetPosSize( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) override;
     virtual void                    Show( bool bVisible ) override;
     virtual const SystemEnvData*    GetSystemData() const override;
 };
diff --git a/vcl/inc/osx/salprn.h b/vcl/inc/osx/salprn.h
index 0c7ec1e9edfd..abb787f5746e 100644
--- a/vcl/inc/osx/salprn.h
+++ b/vcl/inc/osx/salprn.h
@@ -20,6 +20,10 @@
 #ifndef INCLUDED_VCL_INC_OSX_SALPRN_H
 #define INCLUDED_VCL_INC_OSX_SALPRN_H
 
+#include <sal/config.h>
+
+#include <tools/long.hxx>
+
 #include <osx/osxvcltypes.h>
 
 #include <salprn.hxx>
@@ -72,7 +76,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,
+                                             tools::Long& o_rOutWidth, tools::Long& o_rOutHeight,
                                              Point& rPageOffset,
                                              Size& rPaperSize ) override;
     virtual sal_uInt32          GetCapabilities( const ImplJobSetup* i_pSetupData, PrinterCapType i_nType ) override;
@@ -102,8 +106,9 @@ class AquaSalInfoPrinter : public SalInfoPrinter
     sal_Int32 getCurPageRangeCount() const { return mnCurPageRangeCount; }
 
     // match width/height against known paper formats, possibly switching orientation
-    const PaperInfo* matchPaper( long i_nWidth, long i_nHeight, Orientation& o_rOrientation ) const;
-    void setPaperSize( long i_nWidth, long i_nHeight, Orientation i_eSetOrientation );
+    const PaperInfo* matchPaper(
+        tools::Long i_nWidth, tools::Long i_nHeight, Orientation& o_rOrientation ) const;
+    void setPaperSize( tools::Long i_nWidth, tools::Long i_nHeight, Orientation i_eSetOrientation );
 
     private:
     AquaSalInfoPrinter( const AquaSalInfoPrinter& ) = delete;
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 0dbfd0065090..d718cf788dcc 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -23,6 +23,7 @@
 #include <vector>
 
 #include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <tools/long.hxx>
 
 #include <premac.h>
 #ifdef MACOSX
@@ -203,7 +204,7 @@ public:
     void                    setGraphicsFrame( AquaSalFrame* pFrame ) { mpFrame = pFrame; }
 #endif
 
-    void                    ImplDrawPixel( long nX, long nY, const RGBAColor& ); // helper to draw single pixels
+    void                    ImplDrawPixel( tools::Long nX, tools::Long nY, const RGBAColor& ); // helper to draw single pixels
 
     bool                    CheckContext();
     CGContextRef            GetContext();
@@ -225,10 +226,12 @@ public:
     virtual bool            setClipRegion( const vcl::Region& ) override;
 
     // draw --> LineColor and FillColor and RasterOp and ClipRegion
-    virtual void            drawPixel( long nX, long nY ) override;
-    virtual void            drawPixel( long nX, long nY, Color nColor ) override;
-    virtual void            drawLine( long nX1, long nY1, long nX2, long nY2 ) override;
-    virtual void            drawRect( long nX, long nY, long nWidth, long nHeight ) override;
+    virtual void            drawPixel( tools::Long nX, tools::Long nY ) override;
+    virtual void            drawPixel( tools::Long nX, tools::Long nY, Color nColor ) override;
+    virtual void            drawLine(
+        tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2 ) override;
+    virtual void            drawRect(
+        tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) override;
     virtual void            drawPolyLine( sal_uInt32 nPoints, const Point* pPtAry ) override;
     virtual void            drawPolygon( sal_uInt32 nPoints, const Point* pPtAry ) override;
     virtual void            drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, const Point** pPtAry ) override;
@@ -252,8 +255,8 @@ public:
     virtual bool            drawGradient( const tools::PolyPolygon&, const Gradient& ) override { return false; };
 
     // CopyArea --> No RasterOp, but ClipRegion
-    virtual void            copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
-                                      long nSrcHeight, bool bWindowInvalidate ) override;
+    virtual void            copyArea( tools::Long nDestX, tools::Long nDestY, tools::Long nSrcX, tools::Long nSrcY, tools::Long nSrcWidth,
+                                      tools::Long nSrcHeight, bool bWindowInvalidate ) override;
 
     // CopyBits and DrawBitmap --> RasterOp and ClipRegion
     // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
@@ -266,14 +269,14 @@ public:
                                       const SalBitmap& rSalBitmap,
                                       Color nMaskColor ) override;
 
-    virtual std::shared_ptr<SalBitmap> getBitmap( long nX, long nY, long nWidth, long nHeight ) override;
-    virtual Color           getPixel( long nX, long nY ) override;
+    virtual std::shared_ptr<SalBitmap> getBitmap( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) override;
+    virtual Color           getPixel( tools::Long nX, tools::Long nY ) override;
 
     // invert --> ClipRegion (only Windows or VirDevs)
-    virtual void            invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags) override;
+    virtual void            invert( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, SalInvert nFlags) override;
     virtual void            invert( sal_uInt32 nPoints, const Point* pPtAry, SalInvert nFlags ) override;
 
-    virtual bool            drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uInt32 nSize ) override;
+    virtual bool            drawEPS( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, void* pPtr, sal_uInt32 nSize ) override;
 
     virtual bool            blendBitmap( const SalTwoRect&,
                                          const SalBitmap& rBitmap ) override;
@@ -294,8 +297,8 @@ public:
                                             const SalBitmap& rSourceBitmap,
                                             const SalBitmap* pAlphaBitmap) override;
 
-    virtual bool            drawAlphaRect( long nX, long nY, long nWidth,
-                                           long nHeight, sal_uInt8 nTransparency ) override;
+    virtual bool            drawAlphaRect( tools::Long nX, tools::Long nY, tools::Long nWidth,
+                                           tools::Long nHeight, sal_uInt8 nTransparency ) override;
 
     // native widget rendering methods that require mirroring
 #ifdef MACOSX
@@ -319,7 +322,7 @@ public:
     // get the depth of the device
     virtual sal_uInt16      GetBitCount() const override;
     // get the width of the device
-    virtual long            GetGraphicsWidth() const override;
+    virtual tools::Long     GetGraphicsWidth() const override;
 
     // set the clip region to empty
     virtual void            ResetClipRegion() override;
@@ -378,9 +381,10 @@ public:
     // embeddable by GetDevFontList or NULL in case of error
     // parameters: pFont: describes the font in question
     //             pDataLen: out parameter, contains the byte length of the returned buffer
-    virtual const void*     GetEmbedFontData(const PhysicalFontFace*, long* pDataLen) override;
+    virtual const void*     GetEmbedFontData(const PhysicalFontFace*, tools::Long* pDataLen)
+        override;
     // frees the font data again
-    virtual void            FreeEmbedFontData( const void* pData, long nDataLen ) override;
+    virtual void            FreeEmbedFontData( const void* pData, tools::Long nDataLen ) override;
 
     virtual void            GetGlyphWidths( const PhysicalFontFace*,
                                             bool bVertical,
diff --git a/vcl/inc/quartz/salvd.h b/vcl/inc/quartz/salvd.h
index 9c2d707981cc..41d43fa5e538 100644
--- a/vcl/inc/quartz/salvd.h
+++ b/vcl/inc/quartz/salvd.h
@@ -28,6 +28,8 @@
 #endif
 #include <postmac.h>
 
+#include <tools/long.hxx>
+
 #include <quartz/salgdi.h>
 
 #include <salvd.hxx>
@@ -44,25 +46,25 @@ private:
     CGLayerHolder maLayer; // Quartz layer
     AquaSalGraphics* mpGraphics;     // current VirDev graphics
 
-    long mnWidth;
-    long mnHeight;
+    tools::Long mnWidth;
+    tools::Long mnHeight;
 
     void Destroy();
 
 public:
-    AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long &nDX, long &nDY, DeviceFormat eFormat, const SystemGraphicsData *pData );
+    AquaSalVirtualDevice( AquaSalGraphics* pGraphic, tools::Long &nDX, tools::Long &nDY, DeviceFormat eFormat, const SystemGraphicsData *pData );
     virtual ~AquaSalVirtualDevice() override;
 
     virtual SalGraphics*            AcquireGraphics() override;
     virtual void                    ReleaseGraphics( SalGraphics* pGraphics ) override;
-    virtual bool                    SetSize( long nNewDX, long nNewDY ) override;
+    virtual bool                    SetSize( tools::Long nNewDX, tools::Long nNewDY ) override;
 
-    long GetWidth() const override
+    tools::Long GetWidth() const override
     {
         return mnWidth;
     }
 
-    long GetHeight() const override
+    tools::Long GetHeight() const override
     {
         return mnHeight;
     }
diff --git a/vcl/osx/a11yutil.mm b/vcl/osx/a11yutil.mm
index de0389a19e23..87edfc73cf1e 100644
--- a/vcl/osx/a11yutil.mm
+++ b/vcl/osx/a11yutil.mm
@@ -19,6 +19,7 @@
 
 
 #include <osx/osxvcltypes.h>
+#include <tools/long.hxx>
 
 #include "a11yutil.h"
 
@@ -38,7 +39,7 @@ using namespace ::com::sun::star::awt;
 +(Point)nsPointToVclPoint:(NSValue *)nsPoint {
     // VCL coordinates are in upper-left-notation, Cocoa likes it the Cartesian way (lower-left)
     NSRect screenRect = [ [ NSScreen mainScreen ] frame ];
-    return Point ( static_cast<long>([ nsPoint pointValue ].x), static_cast<long>(screenRect.size.height - [ nsPoint pointValue ].y) );
+    return Point ( static_cast<tools::Long>([ nsPoint pointValue ].x), static_cast<tools::Long>(screenRect.size.height - [ nsPoint pointValue ].y) );
 }
 
 @end
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 76cd52e65541..b4168a2142e7 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -22,6 +22,7 @@
 #include <comphelper/fileurl.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <sal/log.hxx>
+#include <tools/long.hxx>
 #include <o3tl/safeint.hxx>
 #include <osl/diagnose.h>
 
@@ -400,12 +401,12 @@ void AquaSalFrame::initShow()
         if( mpParent ) // center relative to parent
         {
             // center on parent
-            long nNewX = mpParent->maGeometry.nX + (static_cast<long>(mpParent->maGeometry.nWidth) - static_cast<long>(maGeometry.nWidth))/2;
+            tools::Long nNewX = mpParent->maGeometry.nX + (static_cast<tools::Long>(mpParent->maGeometry.nWidth) - static_cast<tools::Long>(maGeometry.nWidth))/2;
             if( nNewX < aScreenRect.Left() )
                 nNewX = aScreenRect.Left();
-            if( long(nNewX + maGeometry.nWidth) > aScreenRect.Right() )
+            if( tools::Long(nNewX + maGeometry.nWidth) > aScreenRect.Right() )
                 nNewX = aScreenRect.Right() - maGeometry.nWidth-1;
-            long nNewY = mpParent->maGeometry.nY + (static_cast<long>(mpParent->maGeometry.nHeight) - static_cast<long>(maGeometry.nHeight))/2;
+            tools::Long nNewY = mpParent->maGeometry.nY + (static_cast<tools::Long>(mpParent->maGeometry.nHeight) - static_cast<tools::Long>(maGeometry.nHeight))/2;
             if( nNewY < aScreenRect.Top() )
                 nNewY = aScreenRect.Top();
             if( nNewY > aScreenRect.Bottom() )
@@ -417,8 +418,8 @@ void AquaSalFrame::initShow()
         else if( ! (mnStyle & SalFrameStyleFlags::SIZEABLE) )
         {
             // center on screen
-            long nNewX = (aScreenRect.GetWidth() - maGeometry.nWidth)/2;
-            long nNewY = (aScreenRect.GetHeight() - maGeometry.nHeight)/2;
+            tools::Long nNewX = (aScreenRect.GetWidth() - maGeometry.nWidth)/2;
+            tools::Long nNewY = (aScreenRect.GetHeight() - maGeometry.nHeight)/2;
             SetPosSize( nNewX, nNewY, 0, 0,  SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y );
         }
     }
@@ -503,7 +504,7 @@ void AquaSalFrame::Show(bool bVisible, bool bNoActivate)
     }
 }
 
-void AquaSalFrame::SetMinClientSize( long nWidth, long nHeight )
+void AquaSalFrame::SetMinClientSize( tools::Long nWidth, tools::Long nHeight )
 {
     OSX_SALDATA_RUNINMAIN( SetMinClientSize( nWidth, nHeight ) )
 
@@ -525,7 +526,7 @@ void AquaSalFrame::SetMinClientSize( long nWidth, long nHeight )
     }
 }
 
-void AquaSalFrame::SetMaxClientSize( long nWidth, long nHeight )
+void AquaSalFrame::SetMaxClientSize( tools::Long nWidth, tools::Long nHeight )
 {
     OSX_SALDATA_RUNINMAIN( SetMaxClientSize( nWidth, nHeight ) )
 
@@ -551,7 +552,7 @@ void AquaSalFrame::SetMaxClientSize( long nWidth, long nHeight )
     }
 }
 
-void AquaSalFrame::GetClientSize( long& rWidth, long& rHeight )
+void AquaSalFrame::GetClientSize( tools::Long& rWidth, tools::Long& rHeight )
 {
     if (mbShown || mbInitShow || Application::IsBitmapRendering())
     {
@@ -565,7 +566,7 @@ void AquaSalFrame::GetClientSize( long& rWidth, long& rHeight )
     }
 }
 
-SalEvent AquaSalFrame::PreparePosSize(long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags)
+SalEvent AquaSalFrame::PreparePosSize(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt16 nFlags)
 {
     SalEvent nEvent = SalEvent::NONE;
     assert(mpNSWindow || Application::IsBitmapRendering());
@@ -711,10 +712,10 @@ bool AquaSalFrame::GetWindowState( SalFrameState* pState )
     NSRect aStateRect = [mpNSWindow frame];
     aStateRect = [NSWindow contentRectForFrameRect: aStateRect styleMask: mnStyleMask];
     CocoaToVCL( aStateRect );
-    pState->mnX         = long(aStateRect.origin.x);
-    pState->mnY         = long(aStateRect.origin.y);
-    pState->mnWidth     = long(aStateRect.size.width);
-    pState->mnHeight    = long(aStateRect.size.height);
+    pState->mnX         = tools::Long(aStateRect.origin.x);
+    pState->mnY         = tools::Long(aStateRect.origin.y);
+    pState->mnWidth     = tools::Long(aStateRect.size.width);
+    pState->mnHeight    = tools::Long(aStateRect.size.height);
 
     if( [mpNSWindow isMiniaturized] )
         pState->mnState = WindowStateState::Minimized;
@@ -962,7 +963,7 @@ void AquaSalFrame::SetPointer( PointerStyle ePointerStyle )
     [mpNSWindow invalidateCursorRectsForView: mpNSView];
 }
 
-void AquaSalFrame::SetPointerPos( long nX, long nY )
+void AquaSalFrame::SetPointerPos( tools::Long nX, tools::Long nY )
 {
     OSX_SALDATA_RUNINMAIN( SetPointerPos( nX, nY ) )
 
@@ -1333,7 +1334,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
     // set scrollbar size
 SAL_WNODEPRECATED_DECLARATIONS_PUSH
         // 'NSRegularControlSize' is deprecated: first deprecated in macOS 10.12
-    aStyleSettings.SetScrollBarSize( static_cast<long int>([NSScroller scrollerWidthForControlSize:NSRegularControlSize scrollerStyle:NSScrollerStyleLegacy]) );
+    aStyleSettings.SetScrollBarSize( static_cast<tools::Long>([NSScroller scrollerWidthForControlSize:NSRegularControlSize scrollerStyle:NSScrollerStyleLegacy]) );
 SAL_WNODEPRECATED_DECLARATIONS_POP
     // images in menus false for MacOSX
     aStyleSettings.SetPreferredUseImagesInMenus( false );
@@ -1364,7 +1365,8 @@ void AquaSalFrame::Beep()
     NSBeep();
 }
 
-void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags)
+void AquaSalFrame::SetPosSize(
+    tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt16 nFlags)
 {
     if (!mpNSWindow && !Application::IsBitmapRendering())
         return;
@@ -1391,7 +1393,7 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_u
             if( (nFlags & SAL_FRAME_POSSIZE_WIDTH) != 0 )
                 nX = mpParent->maGeometry.nWidth - nWidth-1 - nX;
             else
-                nX = mpParent->maGeometry.nWidth - static_cast<long int>( aContentRect.size.width-1) - nX;
+                nX = mpParent->maGeometry.nWidth - static_cast<tools::Long>( aContentRect.size.width-1) - nX;
         }
         NSRect aParentFrameRect = [mpParent->mpNSWindow frame];
         aParentContentRect = [NSWindow contentRectForFrameRect: aParentFrameRect styleMask: mpParent->mnStyleMask];
@@ -1459,10 +1461,10 @@ void AquaSalFrame::GetWorkArea( tools::Rectangle& rRect )
         pScreen = [NSScreen mainScreen];
     NSRect aRect = [pScreen visibleFrame];
     CocoaToVCL( aRect );
-    rRect.SetLeft( static_cast<long>(aRect.origin.x) );
-    rRect.SetTop( static_cast<long>(aRect.origin.y) );
-    rRect.SetRight( static_cast<long>(aRect.origin.x + aRect.size.width - 1) );
-    rRect.SetBottom( static_cast<long>(aRect.origin.y + aRect.size.height - 1) );
+    rRect.SetLeft( static_cast<tools::Long>(aRect.origin.x) );
+    rRect.SetTop( static_cast<tools::Long>(aRect.origin.y) );
+    rRect.SetRight( static_cast<tools::Long>(aRect.origin.x + aRect.size.width - 1) );
+    rRect.SetBottom( static_cast<tools::Long>(aRect.origin.y + aRect.size.height - 1) );
 }
 
 SalFrame::SalPointerState AquaSalFrame::GetPointerState()
@@ -1475,7 +1477,7 @@ SalFrame::SalPointerState AquaSalFrame::GetPointerState()
     // get position
     NSPoint aPt = [mpNSWindow mouseLocationOutsideOfEventStream];
     CocoaToVCL( aPt, false );
-    state.maPos = Point(static_cast<long>(aPt.x), static_cast<long>(aPt.y));
+    state.maPos = Point(static_cast<tools::Long>(aPt.x), static_cast<tools::Long>(aPt.y));
 
     NSEvent* pCur = [NSApp currentEvent];
     bool bMouseEvent = false;
@@ -1793,7 +1795,8 @@ void AquaSalFrame::BeginSetClipRegion( sal_uInt32 nRects )
     maClippingRects.reserve( nRects );
 }
 
-void AquaSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight )
+void AquaSalFrame::UnionClipRegion(
+    tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight )
 {
     // #i113170# may not be the main thread if called from UNO API
     SalData::ensureThreadAutoreleasePool();
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index e4bb30413e31..517998b188ea 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -21,7 +21,7 @@
 
 #include <sal/macros.h>
 #include <tools/helpers.hxx>
-
+#include <tools/long.hxx>
 #include <vcl/event.hxx>
 #include <vcl/inputctx.hxx>
 #include <vcl/settings.hxx>
@@ -613,8 +613,8 @@ static AquaSalFrame* getMouseContainerFrame()
 
         SalMouseEvent aEvent;
         aEvent.mnTime   = pDispatchFrame->mnLastEventTime;
-        aEvent.mnX      = static_cast<long>(aPt.x) - pDispatchFrame->maGeometry.nX;
-        aEvent.mnY      = static_cast<long>(aPt.y) - pDispatchFrame->maGeometry.nY;
+        aEvent.mnX      = static_cast<tools::Long>(aPt.x) - pDispatchFrame->maGeometry.nX;
+        aEvent.mnY      = static_cast<tools::Long>(aPt.y) - pDispatchFrame->maGeometry.nY;
         aEvent.mnButton = nButton;
         aEvent.mnCode   =  aEvent.mnButton | nModMask;
 
@@ -773,8 +773,8 @@ static AquaSalFrame* getMouseContainerFrame()
 
         SalWheelMouseEvent aEvent;
         aEvent.mnTime           = mpFrame->mnLastEventTime;
-        aEvent.mnX              = static_cast<long>(aPt.x) - mpFrame->maGeometry.nX;
-        aEvent.mnY              = static_cast<long>(aPt.y) - mpFrame->maGeometry.nY;
+        aEvent.mnX              = static_cast<tools::Long>(aPt.x) - mpFrame->maGeometry.nX;
+        aEvent.mnY              = static_cast<tools::Long>(aPt.y) - mpFrame->maGeometry.nY;
         aEvent.mnCode           = ImplGetModifierMask( mpFrame->mnLastModifierFlags );
         aEvent.mnCode           |= KEY_MOD1; // we want zooming, no scrolling
         aEvent.mbDeltaIsPixel   = true;
@@ -833,8 +833,8 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 
         SalWheelMouseEvent aEvent;
         aEvent.mnTime           = mpFrame->mnLastEventTime;
-        aEvent.mnX              = static_cast<long>(aPt.x) - mpFrame->maGeometry.nX;
-        aEvent.mnY              = static_cast<long>(aPt.y) - mpFrame->maGeometry.nY;
+        aEvent.mnX              = static_cast<tools::Long>(aPt.x) - mpFrame->maGeometry.nX;
+        aEvent.mnY              = static_cast<tools::Long>(aPt.y) - mpFrame->maGeometry.nY;
         aEvent.mnCode           = ImplGetModifierMask( mpFrame->mnLastModifierFlags );
         aEvent.mbDeltaIsPixel   = true;
 
@@ -843,7 +843,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 
         if( dX != 0.0 )
         {
-            aEvent.mnDelta = static_cast<long>(floor(dX));
+            aEvent.mnDelta = static_cast<tools::Long>(floor(dX));
             aEvent.mnNotchDelta = (dX < 0) ? -1 : +1;
             if( aEvent.mnDelta == 0 )
                 aEvent.mnDelta = aEvent.mnNotchDelta;
@@ -853,7 +853,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
         }
         if( dY != 0.0 && AquaSalFrame::isAlive( mpFrame ))
         {
-            aEvent.mnDelta = static_cast<long>(floor(dY));
+            aEvent.mnDelta = static_cast<tools::Long>(floor(dY));
             aEvent.mnNotchDelta = (dY < 0) ? -1 : +1;
             if( aEvent.mnDelta == 0 )
                 aEvent.mnDelta = aEvent.mnNotchDelta;
@@ -895,8 +895,8 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 
         SalWheelMouseEvent aEvent;
         aEvent.mnTime         = mpFrame->mnLastEventTime;
-        aEvent.mnX            = static_cast<long>(aPt.x) - mpFrame->maGeometry.nX;
-        aEvent.mnY            = static_cast<long>(aPt.y) - mpFrame->maGeometry.nY;
+        aEvent.mnX            = static_cast<tools::Long>(aPt.x) - mpFrame->maGeometry.nX;
+        aEvent.mnY            = static_cast<tools::Long>(aPt.y) - mpFrame->maGeometry.nY;
         aEvent.mnCode         = ImplGetModifierMask( mpFrame->mnLastModifierFlags );
         aEvent.mbDeltaIsPixel = false;
 
@@ -905,7 +905,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 
         if( dX != 0.0 )
         {
-            aEvent.mnDelta = static_cast<long>(floor(dX));
+            aEvent.mnDelta = static_cast<tools::Long>(floor(dX));
             aEvent.mnNotchDelta = (dX < 0) ? -1 : +1;
             if( aEvent.mnDelta == 0 )
                 aEvent.mnDelta = aEvent.mnNotchDelta;
@@ -919,7 +919,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
         }
         if( dY != 0.0 && AquaSalFrame::isAlive( mpFrame ) )
         {
-            aEvent.mnDelta = static_cast<long>(floor(dY));
+            aEvent.mnDelta = static_cast<tools::Long>(floor(dY));
             aEvent.mnNotchDelta = (dY < 0) ? -1 : +1;
             if( aEvent.mnDelta == 0 )
                 aEvent.mnDelta = aEvent.mnNotchDelta;
diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index e52b145634ad..80752b0c05ce 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -25,7 +25,7 @@
 
 #include <rtl/ustrbuf.hxx>
 #include <tools/debug.hxx>
-
+#include <tools/long.hxx>
 #include <vcl/commandevent.hxx>
 #include <vcl/floatwin.hxx>
 #include <vcl/window.hxx>
@@ -843,11 +843,11 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
     aRect.origin.x -= i_pReferenceFrame->maGeometry.nX;
     aRect.origin.y -= i_pReferenceFrame->maGeometry.nY + aRect.size.height;
 
-    return tools::Rectangle( Point(static_cast<long int>(aRect.origin.x),
-                static_cast<long int>(aRect.origin.y)
+    return tools::Rectangle( Point(static_cast<tools::Long>(aRect.origin.x),
+                static_cast<tools::Long>(aRect.origin.y)
                 ),
-              Size( static_cast<long int>(aRect.size.width),
-                static_cast<long int>(aRect.size.height)
+              Size( static_cast<tools::Long>(aRect.size.width),
+                static_cast<tools::Long>(aRect.size.height)
               )
             );
 }
diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 7776009e9704..ff3e5c450edd 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -18,7 +18,7 @@
  */
 
 #include <config_features.h>
-
+#include <tools/long.hxx>
 #include <vcl/salnativewidgets.hxx>
 #include <vcl/decoview.hxx>
 #include <vcl/svapp.hxx>
@@ -522,7 +522,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
         case ControlType::Progress:
         case ControlType::IntroProgress:
             {
-                long nProgressWidth = aValue.getNumericVal();
+                tools::Long nProgressWidth = aValue.getNumericVal();
                 HIThemeTrackDrawInfo aTrackInfo;
                 aTrackInfo.version = 0;
                 aTrackInfo.kind  = (rc.size.height > 10) ? kThemeProgressBarLarge : kThemeProgressBarMedium;
@@ -878,10 +878,10 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
         if (mxClipPath)
             aRect = CGPathGetBoundingBox(mxClipPath);
         if (aRect.size.width != 0 && aRect.size.height != 0)
-            buttonRect.Intersection(tools::Rectangle(Point(static_cast<long int>(aRect.origin.x),
-                                                           static_cast<long int>(aRect.origin.y)),
-                                                     Size(static_cast<long int>(aRect.size.width),
-                                                          static_cast<long int>(aRect.size.height))));
+            buttonRect.Intersection(tools::Rectangle(Point(static_cast<tools::Long>(aRect.origin.x),
+                                                           static_cast<tools::Long>(aRect.origin.y)),
+                                                     Size(static_cast<tools::Long>(aRect.size.width),
+                                                          static_cast<tools::Long>(aRect.size.height))));
     }
     RefreshRect(buttonRect.Left(), buttonRect.Top(), buttonRect.GetWidth(), buttonRect.GetHeight());
     return bOK;
diff --git a/vcl/osx/salobj.cxx b/vcl/osx/salobj.cxx
index 75969d4e6b8c..6cf114f20c1b 100644
--- a/vcl/osx/salobj.cxx
+++ b/vcl/osx/salobj.cxx
@@ -199,7 +199,8 @@ void AquaSalObject::BeginSetClipRegion( sal_uInt32 )
     mbClip = false;
 }
 
-void AquaSalObject::UnionClipRegion( long nX, long nY, long nWidth, long nHeight )
+void AquaSalObject::UnionClipRegion(
+    tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight )
 {
     if( mbClip )
     {
@@ -233,7 +234,8 @@ void AquaSalObject::EndSetClipRegion()
     setClippedPosSize();
 }
 
-void AquaSalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight )
+void AquaSalObject::SetPosSize(
+    tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight )
 {
     mnX = nX;
     mnY = nY;
diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx
index 7da42376569f..0f2f38fa530a 100644
--- a/vcl/osx/salprn.cxx
+++ b/vcl/osx/salprn.cxx
@@ -23,6 +23,7 @@
 #include <vcl/print.hxx>
 #include <sal/macros.h>
 #include <osl/diagnose.h>
+#include <tools/long.hxx>
 
 #include <osx/salinst.h>
 #include <osx/salprn.h>
@@ -198,7 +199,7 @@ bool AquaSalInfoPrinter::SetPrinterData( ImplJobSetup* io_pSetupData )
     return bSuccess;
 }
 
-void AquaSalInfoPrinter::setPaperSize( long i_nWidth, long i_nHeight, Orientation i_eSetOrientation )
+void AquaSalInfoPrinter::setPaperSize( tools::Long i_nWidth, tools::Long i_nHeight, Orientation i_eSetOrientation )
 {
 
     Orientation ePaperOrientation = Orientation::Portrait;
@@ -231,7 +232,7 @@ bool AquaSalInfoPrinter::SetData( JobSetFlags i_nFlags, ImplJobSetup* io_pSetupD
         if( i_nFlags & JobSetFlags::PAPERSIZE )
         {
             // set paper format
-            long width = 21000, height = 29700;
+            tools::Long width = 21000, height = 29700;
             if( io_pSetupData->GetPaperFormat() == PAPER_USER )
             {
                 // #i101108# sanity check
@@ -294,7 +295,7 @@ sal_uInt32 AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup*, PrinterCapT
 }
 
 void AquaSalInfoPrinter::GetPageInfo( const ImplJobSetup*,
-                                  long& o_rOutWidth, long& o_rOutHeight,
+                                  tools::Long& o_rOutWidth, tools::Long& o_rOutHeight,
                                   Point& rPageOffset,
                                   Size& rPaperSize )
 {
@@ -306,20 +307,20 @@ void AquaSalInfoPrinter::GetPageInfo( const ImplJobSetup*,
                      fYScaling = static_cast<double>(nDPIY)/72.0;
 
         NSSize aPaperSize = [mpPrintInfo paperSize];
-        rPaperSize.setWidth( static_cast<long>( double(aPaperSize.width) * fXScaling ) );
-        rPaperSize.setHeight( static_cast<long>( double(aPaperSize.height) * fYScaling ) );
+        rPaperSize.setWidth( static_cast<tools::Long>( double(aPaperSize.width) * fXScaling ) );
+        rPaperSize.setHeight( static_cast<tools::Long>( double(aPaperSize.height) * fYScaling ) );
 
         NSRect aImageRect = [mpPrintInfo imageablePageBounds];
-        rPageOffset.setX( static_cast<long>( aImageRect.origin.x * fXScaling ) );
-        rPageOffset.setY( static_cast<long>( (aPaperSize.height - aImageRect.size.height - aImageRect.origin.y) * fYScaling ) );
-        o_rOutWidth   = static_cast<long>( aImageRect.size.width * fXScaling );
-        o_rOutHeight  = static_cast<long>( aImageRect.size.height * fYScaling );
+        rPageOffset.setX( static_cast<tools::Long>( aImageRect.origin.x * fXScaling ) );
+        rPageOffset.setY( static_cast<tools::Long>( (aPaperSize.height - aImageRect.size.height - aImageRect.origin.y) * fYScaling ) );
+        o_rOutWidth   = static_cast<tools::Long>( aImageRect.size.width * fXScaling );
+        o_rOutHeight  = static_cast<tools::Long>( aImageRect.size.height * fYScaling );
 
         if( mePageOrientation == Orientation::Landscape )
         {
             std::swap( o_rOutWidth, o_rOutHeight );
             // swap width and height
-            long n = rPaperSize.Width();
+            tools::Long n = rPaperSize.Width();
             rPaperSize.setWidth(rPaperSize.Height());
             rPaperSize.setHeight(n);
             // swap offset x and y
@@ -651,7 +652,7 @@ void AquaSalInfoPrinter::InitPaperFormats( const ImplJobSetup* )
     }
 }
 
-const PaperInfo* AquaSalInfoPrinter::matchPaper( long i_nWidth, long i_nHeight, Orientation& o_rOrientation ) const
+const PaperInfo* AquaSalInfoPrinter::matchPaper( tools::Long i_nWidth, tools::Long i_nHeight, Orientation& o_rOrientation ) const
 {
     if( ! m_bPapersInit )
         const_cast<AquaSalInfoPrinter*>(this)->InitPaperFormats( nullptr );
diff --git a/vcl/osx/salsys.cxx b/vcl/osx/salsys.cxx
index 36c92b8f2757..80b53b785266 100644
--- a/vcl/osx/salsys.cxx
+++ b/vcl/osx/salsys.cxx
@@ -18,7 +18,7 @@
  */
 
 #include <rtl/ustrbuf.hxx>
-
+#include <tools/long.hxx>
 #include <vcl/stdtext.hxx>
 
 #include <osx/salsys.h>
@@ -59,8 +59,8 @@ tools::Rectangle AquaSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScre
     if( pScreen )
     {
         NSRect aFrame = [pScreen frame];
-        aRet = tools::Rectangle( Point( static_cast<long int>(aFrame.origin.x), static_cast<long int>(aFrame.origin.y) ),
-                          Size( static_cast<long int>(aFrame.size.width), static_cast<long int>(aFrame.size.height) ) );
+        aRet = tools::Rectangle( Point( static_cast<tools::Long>(aFrame.origin.x), static_cast<tools::Long>(aFrame.origin.y) ),
+                          Size( static_cast<tools::Long>(aFrame.size.width), static_cast<tools::Long>(aFrame.size.height) ) );
     }
     return aRet;
 }
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 20c05c98bbb1..56408f4f9891 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -22,7 +22,7 @@
 
 #include <basegfx/polygon/b2dpolygon.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
-
+#include <tools/long.hxx>
 #include <vcl/settings.hxx>
 
 
@@ -135,10 +135,10 @@ bool CoreTextStyle::ImplGetGlyphBoundRect(sal_GlyphId nId, tools::Rectangle& rRe
     if (mfFontRotation && !bVertical)
         aCGRect = CGRectApplyAffineTransform(aCGRect, CGAffineTransformMakeRotation(mfFontRotation));
 
-    long xMin = floor(aCGRect.origin.x);
-    long yMin = floor(aCGRect.origin.y);
-    long xMax = ceil(aCGRect.origin.x + aCGRect.size.width);
-    long yMax = ceil(aCGRect.origin.y + aCGRect.size.height);
+    tools::Long xMin = floor(aCGRect.origin.x);
+    tools::Long yMin = floor(aCGRect.origin.y);
+    tools::Long xMax = ceil(aCGRect.origin.x + aCGRect.size.width);
+    tools::Long yMax = ceil(aCGRect.origin.y + aCGRect.size.height);
     rRect = tools::Rectangle(xMin, -yMax, xMax, -yMin);
     return true;
 }
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index a0bb509dc2b6..704bba1fae9c 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -30,6 +30,7 @@
 #include <osl/process.h>
 #include <rtl/bootstrap.h>
 #include <rtl/strbuf.hxx>
+#include <tools/long.hxx>
 #include <comphelper/lok.hxx>
 
 #include <vcl/metric.hxx>
@@ -769,12 +770,12 @@ void AquaSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFontData, bool bV
     ::CloseTTFont( pSftFont );
 }
 
-const void* AquaSalGraphics::GetEmbedFontData(const PhysicalFontFace*, long* /*pDataLen*/)
+const void* AquaSalGraphics::GetEmbedFontData(const PhysicalFontFace*, tools::Long* /*pDataLen*/)
 {
     return nullptr;
 }
 
-void AquaSalGraphics::FreeEmbedFontData( const void* pData, long /*nDataLen*/ )
+void AquaSalGraphics::FreeEmbedFontData( const void* pData, tools::Long /*nDataLen*/ )
 {
     // TODO: implementing this only makes sense when the implementation of
     //      AquaSalGraphics::GetEmbedFontData() returns non-NULL
@@ -803,10 +804,10 @@ void AquaSalGraphics::RefreshRect(float lX, float lY, float lWidth, float lHeigh
         // Rounding down x and width can accumulate a rounding error of up to 2
         // The decrementing of x, the rounding error and the antialiasing border
         // require that the width and the height need to be increased by four
-        const tools::Rectangle aVclRect(Point(static_cast<long int>(lX-1),
-                                       static_cast<long int>(lY-1) ),
-                                 Size(  static_cast<long int>(lWidth+4),
-                                        static_cast<long int>(lHeight+4) ) );
+        const tools::Rectangle aVclRect(Point(static_cast<tools::Long>(lX-1),
+                                       static_cast<tools::Long>(lY-1) ),
+                                 Size(  static_cast<tools::Long>(lWidth+4),
+                                        static_cast<tools::Long>(lHeight+4) ) );
         mpFrame->maInvalidRect.Union( aVclRect );
     }
 #else
diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 4b2b59459e1e..d33b690fdaff 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -30,7 +30,7 @@
 #include <osl/endian.h>
 #include <osl/file.hxx>
 #include <sal/types.h>
-
+#include <tools/long.hxx>
 #include <vcl/sysdata.hxx>
 
 #include <fontsubset.hxx>
@@ -310,12 +310,13 @@ static void DrawPattern50( void*, CGContextRef rContext )
 }
 
 static void getBoundRect( sal_uInt32 nPoints, const Point *pPtAry,
-                          long &rX, long& rY, long& rWidth, long& rHeight )
+                          tools::Long &rX, tools::Long& rY, tools::Long& rWidth,
+                          tools::Long& rHeight )
 {
-    long nX1 = pPtAry->getX();
-    long nX2 = nX1;
-    long nY1 = pPtAry->getY();
-    long nY2 = nY1;
+    tools::Long nX1 = pPtAry->getX();
+    tools::Long nX2 = nX1;
+    tools::Long nY1 = pPtAry->getY();
+    tools::Long nY2 = nY1;
 
     for( sal_uInt32 n = 1; n < nPoints; n++ )
     {
@@ -369,8 +370,9 @@ void AquaSalGraphics::ApplyXorContext()
     }
 }
 
-void AquaSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY,
-                                long nSrcWidth, long nSrcHeight, bool /*bWindowInvalidate*/ )
+void AquaSalGraphics::copyArea(
+    tools::Long nDstX, tools::Long nDstY,tools::Long nSrcX, tools::Long nSrcY,
+    tools::Long nSrcWidth, tools::Long nSrcHeight, bool /*bWindowInvalidate*/ )
 {
     SAL_WARN_IF (!maLayer.isSet(), "vcl.quartz",
                  "AquaSalGraphics::copyArea() for non-layered graphics this=" << this);
@@ -381,14 +383,14 @@ void AquaSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY,
 #endif
     float fScale = maLayer.getScale();
 
-    long nScaledSourceX = nSrcX * fScale;
-    long nScaledSourceY = nSrcY * fScale;
+    tools::Long nScaledSourceX = nSrcX * fScale;
+    tools::Long nScaledSourceY = nSrcY * fScale;
 
-    long nScaledTargetX = nDstX * fScale;
-    long nScaledTargetY = nDstY * fScale;
+    tools::Long nScaledTargetX = nDstX * fScale;
+    tools::Long nScaledTargetY = nDstY * fScale;
 
-    long nScaledSourceWidth = nSrcWidth * fScale;
-    long nScaledSourceHeight = nSrcHeight * fScale;
+    tools::Long nScaledSourceWidth = nSrcWidth * fScale;
+    tools::Long nScaledSourceHeight = nSrcHeight * fScale;
 
     ApplyXorContext();
 
@@ -555,8 +557,8 @@ bool AquaSalGraphics::drawTransformedBitmap(
     return true;
 }
 
-bool AquaSalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
-                                     long nHeight, sal_uInt8 nTransparency )
+bool AquaSalGraphics::drawAlphaRect( tools::Long nX, tools::Long nY, tools::Long nWidth,
+                                     tools::Long nHeight, sal_uInt8 nTransparency )
 {
     if( !CheckContext() )
         return true;
@@ -621,8 +623,9 @@ void AquaSalGraphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rS
 
 #ifndef IOS
 
-bool AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight,
-                                   void* pEpsData, sal_uInt32 nByteCount )
+bool AquaSalGraphics::drawEPS(
+    tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight,
+    void* pEpsData, sal_uInt32 nByteCount )
 {
     // convert the raw data to an NSImageRef
     NSData* xNSData = [NSData dataWithBytes:pEpsData length:static_cast<int>(nByteCount)];
@@ -668,7 +671,7 @@ bool AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight,
 
 #endif
 
-void AquaSalGraphics::drawLine( long nX1, long nY1, long nX2, long nY2 )
+void AquaSalGraphics::drawLine( tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2 )
 {
     if( nX1 == nX2 && nY1 == nY2 )
     {
@@ -709,13 +712,13 @@ void AquaSalGraphics::drawMask( const SalTwoRect& rPosAry, const SalBitmap& rSal
     RefreshRect( aDstRect );
 }
 
-void AquaSalGraphics::drawPixel( long nX, long nY )
+void AquaSalGraphics::drawPixel( tools::Long nX, tools::Long nY )
 {
     // draw pixel with current line color
     ImplDrawPixel( nX, nY, maLineColor );
 }
 
-void AquaSalGraphics::drawPixel( long nX, long nY, Color nColor )
+void AquaSalGraphics::drawPixel( tools::Long nX, tools::Long nY, Color nColor )
 {
     const RGBAColor aPixelColor( nColor );
     ImplDrawPixel( nX, nY, aPixelColor );
@@ -947,12 +950,12 @@ void AquaSalGraphics::drawPolyPolygon( sal_uInt32 nPolyCount, const sal_uInt32 *
         return;
 
     // find bound rect
-    long leftX = 0, topY = 0, maxWidth = 0, maxHeight = 0;
+    tools::Long leftX = 0, topY = 0, maxWidth = 0, maxHeight = 0;
     getBoundRect( pPoints[0], ppPtAry[0], leftX, topY, maxWidth, maxHeight );
 
     for( sal_uInt32 n = 1; n < nPolyCount; n++ )
     {
-        long nX = leftX, nY = topY, nW = maxWidth, nH = maxHeight;
+        tools::Long nX = leftX, nY = topY, nW = maxWidth, nH = maxHeight;
         getBoundRect( pPoints[n], ppPtAry[n], nX, nY, nW, nH );
         if( nX < leftX )
         {
@@ -1051,7 +1054,7 @@ void AquaSalGraphics::drawPolygon( sal_uInt32 nPoints, const Point *pPtAry )
     if( !CheckContext() )
         return;
 
-    long nX = 0, nY = 0, nWidth = 0, nHeight = 0;
+    tools::Long nX = 0, nY = 0, nWidth = 0, nHeight = 0;
     getBoundRect( nPoints, pPtAry, nX, nY, nWidth, nHeight );
 
     CGPathDrawingMode eMode;
@@ -1113,7 +1116,8 @@ bool AquaSalGraphics::drawPolyPolygonBezier( sal_uInt32, const sal_uInt32*,
     return false;
 }
 
-void AquaSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
+void AquaSalGraphics::drawRect(
+    tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight )
 {
     if( !CheckContext() )
         return;
@@ -1146,7 +1150,7 @@ void AquaSalGraphics::drawPolyLine( sal_uInt32 nPoints, const Point *pPtAry )
     if( !CheckContext() )
         return;
 
-    long nX = 0, nY = 0, nWidth = 0, nHeight = 0;
+    tools::Long nX = 0, nY = 0, nWidth = 0, nHeight = 0;
     getBoundRect( nPoints, pPtAry, nX, nY, nWidth, nHeight );
 
     float fX, fY;
@@ -1171,7 +1175,8 @@ sal_uInt16 AquaSalGraphics::GetBitCount() const
     return nBits;
 }
 
-std::shared_ptr<SalBitmap> AquaSalGraphics::getBitmap( long  nX, long  nY, long  nDX, long  nDY )
+std::shared_ptr<SalBitmap> AquaSalGraphics::getBitmap(
+    tools::Long  nX, tools::Long  nY, tools::Long  nDX, tools::Long  nDY )
 {
     SAL_WARN_IF(!maLayer.isSet(), "vcl.quartz", "AquaSalGraphics::getBitmap() with no layer this=" << this);
 
@@ -1193,9 +1198,9 @@ SystemGraphicsData AquaSalGraphics::GetGraphicsData() const
     return aRes;
 }
 
-long AquaSalGraphics::GetGraphicsWidth() const
+tools::Long AquaSalGraphics::GetGraphicsWidth() const
 {
-    long w = 0;
+    tools::Long w = 0;
     if( maContextHolder.isSet() && (
 #ifndef IOS
                       mbWindow ||
@@ -1217,7 +1222,7 @@ long AquaSalGraphics::GetGraphicsWidth() const
     return w;
 }
 
-Color AquaSalGraphics::getPixel( long nX, long nY )
+Color AquaSalGraphics::getPixel( tools::Long nX, tools::Long nY )
 {
     // return default value on printers or when out of bounds
     if (!maLayer.isSet() || (nX < 0) || (nX >= mnWidth) ||
@@ -1280,7 +1285,7 @@ void AquaSalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY )
 #endif
 }
 
-void AquaSalGraphics::ImplDrawPixel( long nX, long nY, const RGBAColor& rColor )
+void AquaSalGraphics::ImplDrawPixel( tools::Long nX, tools::Long nY, const RGBAColor& rColor )
 {
     if( !CheckContext() )
     {
@@ -1406,7 +1411,8 @@ void AquaSalGraphics::initResolution(NSWindow* nsWindow)
 
 #endif
 
-void AquaSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags )
+void AquaSalGraphics::invert(
+    tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, SalInvert nFlags )
 {
     if ( CheckContext() )
     {
@@ -1620,11 +1626,11 @@ bool AquaSalGraphics::setClipRegion( const vcl::Region& i_rClip )
 
         for(const auto& rRect : aRectangles)
         {
-            const long nW(rRect.Right() - rRect.Left() + 1); // uses +1 logic in original
+            const tools::Long nW(rRect.Right() - rRect.Left() + 1); // uses +1 logic in original
 
             if(nW)
             {
-                const long nH(rRect.Bottom() - rRect.Top() + 1); // uses +1 logic in original
+                const tools::Long nH(rRect.Bottom() - rRect.Top() + 1); // uses +1 logic in original
 
                 if(nH)
                 {
diff --git a/vcl/quartz/salvd.cxx b/vcl/quartz/salvd.cxx
index c06ba33c5b6f..57ba971a927a 100644
--- a/vcl/quartz/salvd.cxx
+++ b/vcl/quartz/salvd.cxx
@@ -37,7 +37,7 @@
 #include <quartz/utils.h>
 
 std::unique_ptr<SalVirtualDevice> AquaSalInstance::CreateVirtualDevice( SalGraphics* pGraphics,
-                                                        long &nDX, long &nDY,
+                                                        tools::Long &nDX, tools::Long &nDY,
                                                         DeviceFormat eFormat,
                                                         const SystemGraphicsData *pData )
 {
@@ -62,8 +62,9 @@ std::unique_ptr<SalVirtualDevice> AquaSalInstance::CreateVirtualDevice( SalGraph
 #endif
 }
 
-AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long &nDX, long &nDY,
-                                            DeviceFormat eFormat, const SystemGraphicsData *pData )
+AquaSalVirtualDevice::AquaSalVirtualDevice(
+    AquaSalGraphics* pGraphic, tools::Long &nDX, tools::Long &nDY,
+    DeviceFormat eFormat, const SystemGraphicsData *pData )
   : mbGraphicsUsed( false )
   , mnBitmapDepth( 0 )
   , mnWidth(0)
@@ -93,8 +94,8 @@ AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long &nDX
         if (maLayer.isSet())
         {
             const CGSize aSize = CGLayerGetSize(maLayer.get());
-            nDX = static_cast<long>(aSize.width);
-            nDY = static_cast<long>(aSize.height);
+            nDX = static_cast<tools::Long>(aSize.width);
+            nDY = static_cast<tools::Long>(aSize.height);
         }
         else
         {
@@ -201,7 +202,7 @@ void AquaSalVirtualDevice::ReleaseGraphics( SalGraphics* )
     mbGraphicsUsed = false;
 }
 
-bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
+bool AquaSalVirtualDevice::SetSize( tools::Long nDX, tools::Long nDY )
 {
     SAL_INFO( "vcl.virdev", "AquaSalVirtualDevice::SetSize() this=" << this <<
               " (" << nDX << "x" << nDY << ") mbForeignContext=" << (mbForeignContext ? "YES" : "NO"));


More information about the Libreoffice-commits mailing list