summaryrefslogtreecommitdiff
path: root/vcl/headless
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-10-19 15:12:38 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-19 21:34:46 +0200
commit3aef606f2758172a27718a06fea0ff9080e4d80f (patch)
treead323c90301d80bbb3b68163d8b87e5402b687ed /vcl/headless
parent5afba3e12c8d4eb1ebb8e087134eb87593bb017a (diff)
use tools::Long in vcl
Change-Id: Ice1055021e8568634e9a66ba89d3bb4ef4e731df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104522 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/headless')
-rw-r--r--vcl/headless/CustomWidgetDraw.cxx4
-rw-r--r--vcl/headless/svpbmp.cxx2
-rw-r--r--vcl/headless/svpdummies.cxx4
-rw-r--r--vcl/headless/svpframe.cxx20
-rw-r--r--vcl/headless/svpgdi.cxx56
-rw-r--r--vcl/headless/svpinst.cxx2
-rw-r--r--vcl/headless/svptext.cxx4
-rw-r--r--vcl/headless/svpvd.cxx10
8 files changed, 51 insertions, 51 deletions
diff --git a/vcl/headless/CustomWidgetDraw.cxx b/vcl/headless/CustomWidgetDraw.cxx
index 7515a1a136bc..6ff10a34c7bb 100644
--- a/vcl/headless/CustomWidgetDraw.cxx
+++ b/vcl/headless/CustomWidgetDraw.cxx
@@ -84,8 +84,8 @@ bool CustomWidgetDraw::drawNativeControl(ControlType eType, ControlPart ePart,
cairo_translate(pCairoContext, rControlRegion.Left(), rControlRegion.Top());
- long nWidth = rControlRegion.GetWidth();
- long nHeight = rControlRegion.GetHeight();
+ tools::Long nWidth = rControlRegion.GetWidth();
+ tools::Long nHeight = rControlRegion.GetHeight();
bool bOK = false;
diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx
index 4d881f025d0b..b5748e560d2c 100644
--- a/vcl/headless/svpbmp.cxx
+++ b/vcl/headless/svpbmp.cxx
@@ -101,7 +101,7 @@ static std::unique_ptr<BitmapBuffer> ImplCreateDIB(
pDIB->mnFormat |= ScanlineFormat::TopDown;
pDIB->mnWidth = rSize.Width();
pDIB->mnHeight = rSize.Height();
- long nScanlineBase;
+ tools::Long nScanlineBase;
bool bFail = o3tl::checked_multiply<long>(pDIB->mnWidth, nBitCount, nScanlineBase);
if (bFail)
{
diff --git a/vcl/headless/svpdummies.cxx b/vcl/headless/svpdummies.cxx
index 548868c05349..4d8e639b78dc 100644
--- a/vcl/headless/svpdummies.cxx
+++ b/vcl/headless/svpdummies.cxx
@@ -27,9 +27,9 @@ SvpSalObject::~SvpSalObject()
void SvpSalObject::ResetClipRegion() {}
void SvpSalObject::BeginSetClipRegion( sal_uInt32 ) {}
-void SvpSalObject::UnionClipRegion( long, long, long, long ) {}
+void SvpSalObject::UnionClipRegion( tools::Long, tools::Long, tools::Long, tools::Long ) {}
void SvpSalObject::EndSetClipRegion() {}
-void SvpSalObject::SetPosSize( long, long, long, long ) {}
+void SvpSalObject::SetPosSize( tools::Long, tools::Long, tools::Long, tools::Long ) {}
void SvpSalObject::Show( bool ) {}
const SystemEnvData* SvpSalObject::GetSystemData() const { return &m_aSystemChildData; }
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index 7e5d00af208c..3f79ead63783 100644
--- a/vcl/headless/svpframe.cxx
+++ b/vcl/headless/svpframe.cxx
@@ -217,19 +217,19 @@ void SvpSalFrame::Show( bool bVisible, bool bNoActivate )
}
}
-void SvpSalFrame::SetMinClientSize( long nWidth, long nHeight )
+void SvpSalFrame::SetMinClientSize( tools::Long nWidth, tools::Long nHeight )
{
m_nMinWidth = nWidth;
m_nMinHeight = nHeight;
}
-void SvpSalFrame::SetMaxClientSize( long nWidth, long nHeight )
+void SvpSalFrame::SetMaxClientSize( tools::Long nWidth, tools::Long nHeight )
{
m_nMaxWidth = nWidth;
m_nMaxHeight = nHeight;
}
-void SvpSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags )
+void SvpSalFrame::SetPosSize( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt16 nFlags )
{
if( (nFlags & SAL_FRAME_POSSIZE_X) != 0 )
maGeometry.nX = nX;
@@ -283,7 +283,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( tools::Long& rWidth, tools::Long& rHeight )
{
rWidth = maGeometry.nWidth;
rHeight = maGeometry.nHeight;
@@ -313,10 +313,10 @@ void SvpSalFrame::SetWindowState( const SalFrameState *pState )
if (!(pState->mnMask & FRAMESTATE_MASK_GEOMETRY))
return;
- long nX = maGeometry.nX;
- long nY = maGeometry.nY;
- long nWidth = maGeometry.nWidth;
- long nHeight = maGeometry.nHeight;
+ tools::Long nX = maGeometry.nX;
+ tools::Long nY = maGeometry.nY;
+ tools::Long nWidth = maGeometry.nWidth;
+ tools::Long nHeight = maGeometry.nHeight;
// change requested properties
if (pState->mnMask & WindowStateMask::X)
@@ -372,7 +372,7 @@ void SvpSalFrame::CaptureMouse( bool )
{
}
-void SvpSalFrame::SetPointerPos( long, long )
+void SvpSalFrame::SetPointerPos( tools::Long, tools::Long )
{
}
@@ -491,7 +491,7 @@ void SvpSalFrame::BeginSetClipRegion( sal_uInt32 )
{
}
-void SvpSalFrame::UnionClipRegion( long, long, long, long )
+void SvpSalFrame::UnionClipRegion( tools::Long, tools::Long, tools::Long, tools::Long )
{
}
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index c9826c774d59..edf0e061d0a6 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -175,8 +175,8 @@ namespace
return nullptr;
assert(pSrc->mnFormat == SVP_24BIT_FORMAT);
- const long nWidth = pSrc->mnWidth;
- const long nHeight = pSrc->mnHeight;
+ const tools::Long nWidth = pSrc->mnWidth;
+ const tools::Long nHeight = pSrc->mnHeight;
std::unique_ptr<BitmapBuffer> pDst(new BitmapBuffer);
pDst->mnFormat = (ScanlineFormat::N32BitTcArgb | ScanlineFormat::TopDown);
pDst->mnWidth = nWidth;
@@ -185,7 +185,7 @@ namespace
pDst->maColorMask = pSrc->maColorMask;
pDst->maPalette = pSrc->maPalette;
- long nScanlineBase;
+ tools::Long nScanlineBase;
const bool bFail = o3tl::checked_multiply<long>(pDst->mnBitCount, nWidth, nScanlineBase);
if (bFail)
{
@@ -213,11 +213,11 @@ namespace
return nullptr;
}
- for (long y = 0; y < nHeight; ++y)
+ for (tools::Long y = 0; y < nHeight; ++y)
{
sal_uInt8* pS = pSrc->mpBits + y * pSrc->mnScanlineSize;
sal_uInt8* pD = pDst->mpBits + y * pDst->mnScanlineSize;
- for (long x = 0; x < nWidth; ++x)
+ for (tools::Long x = 0; x < nWidth; ++x)
{
#if defined(ANDROID) && !HAVE_FEATURE_ANDROID_LOK
static_assert((SVP_CAIRO_FORMAT & ~ScanlineFormat::TopDown) == ScanlineFormat::N32BitTcRgba, "Expected SVP_CAIRO_FORMAT set to N32BitTcBgra");
@@ -467,8 +467,8 @@ namespace
if(pSurface)
{
- const long nStride(cairo_image_surface_get_stride(pSurface));
- const long nHeight(cairo_image_surface_get_height(pSurface));
+ const tools::Long nStride(cairo_image_surface_get_stride(pSurface));
+ const tools::Long nHeight(cairo_image_surface_get_height(pSurface));
nRetval = nStride * nHeight;
@@ -597,7 +597,7 @@ namespace
// MM02 decide to use buffers or not
const char* pDisableMM02Goodies(getenv("SAL_DISABLE_MM02_GOODIES"));
bool bUseBuffer(nullptr == pDisableMM02Goodies);
- long nMinimalSquareSizeToBuffer(64*64);
+ tools::Long nMinimalSquareSizeToBuffer(64*64);
void tryToUseSourceBuffer(
const SalBitmap& rSourceBitmap,
@@ -765,8 +765,8 @@ bool SvpSalGraphics::drawTransformedBitmap(
// MM02 try to access buffered BitmapHelper
std::shared_ptr<BitmapHelper> aSurface;
tryToUseSourceBuffer(rSourceBitmap, aSurface);
- const long nDestWidth(basegfx::fround(basegfx::B2DVector(rX - rNull).getLength()));
- const long nDestHeight(basegfx::fround(basegfx::B2DVector(rY - rNull).getLength()));
+ const tools::Long nDestWidth(basegfx::fround(basegfx::B2DVector(rX - rNull).getLength()));
+ const tools::Long nDestHeight(basegfx::fround(basegfx::B2DVector(rY - rNull).getLength()));
cairo_surface_t* source(
aSurface->getSurface(
nDestWidth,
@@ -853,7 +853,7 @@ void SvpSalGraphics::clipRegion(cairo_t* cr)
SvpSalGraphics::clipRegion(cr, m_aClipRegion);
}
-bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency)
+bool SvpSalGraphics::drawAlphaRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency)
{
const bool bHasFill(m_aFillColor != SALCOLOR_NONE);
const bool bHasLine(m_aLineColor != SALCOLOR_NONE);
@@ -949,7 +949,7 @@ sal_uInt16 SvpSalGraphics::GetBitCount() const
return 32;
}
-long SvpSalGraphics::GetGraphicsWidth() const
+tools::Long SvpSalGraphics::GetGraphicsWidth() const
{
return m_pSurface ? m_aFrameSize.getX() : 0;
}
@@ -1022,7 +1022,7 @@ void SvpSalGraphics::SetROPFillColor( SalROPColor nROPColor )
}
}
-void SvpSalGraphics::drawPixel( long nX, long nY )
+void SvpSalGraphics::drawPixel( tools::Long nX, tools::Long nY )
{
if (m_aLineColor != SALCOLOR_NONE)
{
@@ -1030,7 +1030,7 @@ void SvpSalGraphics::drawPixel( long nX, long nY )
}
}
-void SvpSalGraphics::drawPixel( long nX, long nY, Color aColor )
+void SvpSalGraphics::drawPixel( tools::Long nX, tools::Long nY, Color aColor )
{
cairo_t* cr = getCairoContext(true);
clipRegion(cr);
@@ -1043,7 +1043,7 @@ void SvpSalGraphics::drawPixel( long nX, long nY, Color aColor )
releaseCairoContext(cr, true, extents);
}
-void SvpSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
+void SvpSalGraphics::drawRect( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight )
{
// because of the -1 hack we have to do fill and draw separately
Color aOrigFillColor = m_aFillColor;
@@ -1329,7 +1329,7 @@ static size_t AddPolygonToPath(
return nSizeMeasure;
}
-void SvpSalGraphics::drawLine( long nX1, long nY1, long nX2, long nY2 )
+void SvpSalGraphics::drawLine( tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2 )
{
basegfx::B2DPolygon aPoly;
@@ -2041,12 +2041,12 @@ void SvpSalGraphics::applyColor(cairo_t *cr, Color aColor, double fTransparency)
}
}
-void SvpSalGraphics::copyArea( long nDestX,
- long nDestY,
- long nSrcX,
- long nSrcY,
- long nSrcWidth,
- long nSrcHeight,
+void SvpSalGraphics::copyArea( tools::Long nDestX,
+ tools::Long nDestY,
+ tools::Long nSrcX,
+ tools::Long nSrcY,
+ tools::Long nSrcWidth,
+ tools::Long nSrcHeight,
bool /*bWindowInvalidate*/ )
{
SalTwoRect aTR(nSrcX, nSrcY, nSrcWidth, nSrcHeight, nDestX, nDestY, nSrcWidth, nSrcHeight);
@@ -2196,11 +2196,11 @@ void SvpSalGraphics::drawMask( const SalTwoRect& rTR,
sal_Int32 nStride;
unsigned char *mask_data = aSurface.getBits(nStride);
vcl::bitmap::lookup_table unpremultiply_table = vcl::bitmap::get_unpremultiply_table();
- for (long y = rTR.mnSrcY ; y < rTR.mnSrcY + rTR.mnSrcHeight; ++y)
+ for (tools::Long y = rTR.mnSrcY ; y < rTR.mnSrcY + rTR.mnSrcHeight; ++y)
{
unsigned char *row = mask_data + (nStride*y);
unsigned char *data = row + (rTR.mnSrcX * 4);
- for (long x = rTR.mnSrcX; x < rTR.mnSrcX + rTR.mnSrcWidth; ++x)
+ for (tools::Long x = rTR.mnSrcX; x < rTR.mnSrcX + rTR.mnSrcWidth; ++x)
{
sal_uInt8 a = data[SVP_CAIRO_ALPHA];
sal_uInt8 b = unpremultiply_table[a][data[SVP_CAIRO_BLUE]];
@@ -2250,7 +2250,7 @@ void SvpSalGraphics::drawMask( const SalTwoRect& rTR,
releaseCairoContext(cr, false, extents);
}
-std::shared_ptr<SalBitmap> SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeight )
+std::shared_ptr<SalBitmap> SvpSalGraphics::getBitmap( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight )
{
std::shared_ptr<SvpSalBitmap> pBitmap = std::make_shared<SvpSalBitmap>();
BitmapPalette aPal;
@@ -2286,7 +2286,7 @@ std::shared_ptr<SalBitmap> SvpSalGraphics::getBitmap( long nX, long nY, long nWi
return pBitmap;
}
-Color SvpSalGraphics::getPixel( long nX, long nY )
+Color SvpSalGraphics::getPixel( tools::Long nX, tools::Long nY )
{
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0)
cairo_surface_t *target = cairo_surface_create_similar_image(m_pSurface, CAIRO_FORMAT_ARGB32, 1, 1);
@@ -2406,7 +2406,7 @@ void SvpSalGraphics::invert(const basegfx::B2DPolygon &rPoly, SalInvert nFlags)
releaseCairoContext(cr, false, extents);
}
-void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags )
+void SvpSalGraphics::invert( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, SalInvert nFlags )
{
basegfx::B2DPolygon aRect = basegfx::utils::createPolygonFromRect(basegfx::B2DRectangle(nX, nY, nX+nWidth, nY+nHeight));
@@ -2424,7 +2424,7 @@ void SvpSalGraphics::invert(sal_uInt32 nPoints, const SalPoint* pPtAry, SalInver
invert(aPoly, nFlags);
}
-bool SvpSalGraphics::drawEPS( long, long, long, long, void*, sal_uInt32 )
+bool SvpSalGraphics::drawEPS( tools::Long, tools::Long, tools::Long, tools::Long, void*, sal_uInt32 )
{
return false;
}
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index 4893b8ddd44b..9654243f5ac3 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -242,7 +242,7 @@ void SvpSalInstance::DestroyObject( SalObject* pObject )
#ifndef IOS
std::unique_ptr<SalVirtualDevice> SvpSalInstance::CreateVirtualDevice(SalGraphics* pGraphics,
- long &nDX, long &nDY,
+ tools::Long &nDX, tools::Long &nDY,
DeviceFormat eFormat,
const SystemGraphicsData* pGd)
{
diff --git a/vcl/headless/svptext.cxx b/vcl/headless/svptext.cxx
index f44373f5acc1..0abb57e6e9e4 100644
--- a/vcl/headless/svptext.cxx
+++ b/vcl/headless/svptext.cxx
@@ -73,12 +73,12 @@ bool SvpSalGraphics::CreateFontSubset(
return m_aTextRenderImpl.CreateFontSubset(rToFile, pFont, pGlyphIds, pEncoding, pWidths, nGlyphCount, rInfo);
}
-const void* SvpSalGraphics::GetEmbedFontData(const PhysicalFontFace* pFont, long* pDataLen)
+const void* SvpSalGraphics::GetEmbedFontData(const PhysicalFontFace* pFont, tools::Long* pDataLen)
{
return m_aTextRenderImpl.GetEmbedFontData(pFont, pDataLen);
}
-void SvpSalGraphics::FreeEmbedFontData( const void* pData, long nLen )
+void SvpSalGraphics::FreeEmbedFontData( const void* pData, tools::Long nLen )
{
m_aTextRenderImpl.FreeEmbedFontData(pData, nLen);
}
diff --git a/vcl/headless/svpvd.cxx b/vcl/headless/svpvd.cxx
index 70ac5785ec71..9025326827a6 100644
--- a/vcl/headless/svpvd.cxx
+++ b/vcl/headless/svpvd.cxx
@@ -65,12 +65,12 @@ void SvpSalVirtualDevice::ReleaseGraphics( SalGraphics* pGraphics )
delete pGraphics;
}
-bool SvpSalVirtualDevice::SetSize( long nNewDX, long nNewDY )
+bool SvpSalVirtualDevice::SetSize( tools::Long nNewDX, tools::Long nNewDY )
{
return SetSizeUsingBuffer(nNewDX, nNewDY, nullptr);
}
-void SvpSalVirtualDevice::CreateSurface(long nNewDX, long nNewDY, sal_uInt8 *const pBuffer)
+void SvpSalVirtualDevice::CreateSurface(tools::Long nNewDX, tools::Long nNewDY, sal_uInt8 *const pBuffer)
{
if (m_pSurface)
{
@@ -108,7 +108,7 @@ void SvpSalVirtualDevice::CreateSurface(long nNewDX, long nNewDY, sal_uInt8 *con
}
}
-bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY,
+bool SvpSalVirtualDevice::SetSizeUsingBuffer( tools::Long nNewDX, tools::Long nNewDY,
sal_uInt8 *const pBuffer)
{
if (nNewDX == 0)
@@ -133,12 +133,12 @@ bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY,
return true;
}
-long SvpSalVirtualDevice::GetWidth() const
+tools::Long SvpSalVirtualDevice::GetWidth() const
{
return m_pSurface ? m_aFrameSize.getX() : 0;
}
-long SvpSalVirtualDevice::GetHeight() const
+tools::Long SvpSalVirtualDevice::GetHeight() const
{
return m_pSurface ? m_aFrameSize.getY() : 0;
}