From 180dd91c189de0bf03d5062e33c20da94c5d35d9 Mon Sep 17 00:00:00 2001 From: Noel Date: Wed, 21 Oct 2020 15:26:38 +0200 Subject: long->tools::Long in emfio..filter Change-Id: I961cee10d45d628ff70dea0694a7a63a4fe867ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104624 Tested-by: Jenkins Reviewed-by: Noel Grandin --- filter/source/graphicfilter/egif/egif.cxx | 22 +++++------ filter/source/graphicfilter/eps/eps.cxx | 52 +++++++++++++------------- filter/source/graphicfilter/icgm/actimpr.cxx | 30 +++++++-------- filter/source/graphicfilter/icgm/bitmap.cxx | 10 ++--- filter/source/graphicfilter/icgm/bitmap.hxx | 2 +- filter/source/graphicfilter/icgm/bundles.hxx | 10 ++--- filter/source/graphicfilter/icgm/cgm.cxx | 2 +- filter/source/graphicfilter/icgm/cgmtypes.hxx | 6 ++- filter/source/graphicfilter/icgm/class1.cxx | 2 +- filter/source/graphicfilter/icgm/class3.cxx | 4 +- filter/source/graphicfilter/icgm/class4.cxx | 26 ++++++------- filter/source/graphicfilter/icgm/class5.cxx | 4 +- filter/source/graphicfilter/icgm/classx.cxx | 2 +- filter/source/graphicfilter/icgm/elements.cxx | 6 +-- filter/source/graphicfilter/icgm/elements.hxx | 12 +++--- filter/source/graphicfilter/icgm/outact.hxx | 4 +- filter/source/graphicfilter/idxf/dxf2mtf.cxx | 32 ++++++++-------- filter/source/graphicfilter/idxf/dxf2mtf.hxx | 6 +-- filter/source/graphicfilter/idxf/dxfblkrd.hxx | 2 +- filter/source/graphicfilter/idxf/dxfentrd.hxx | 53 ++++++++++++++------------- filter/source/graphicfilter/idxf/dxfgrprd.cxx | 2 +- filter/source/graphicfilter/idxf/dxfgrprd.hxx | 9 +++-- filter/source/graphicfilter/idxf/dxftblrd.cxx | 2 +- filter/source/graphicfilter/idxf/dxftblrd.hxx | 34 ++++++++--------- filter/source/graphicfilter/idxf/dxfvec.cxx | 4 +- filter/source/graphicfilter/ieps/ieps.cxx | 24 ++++++------ filter/source/graphicfilter/ipcd/ipcd.cxx | 24 ++++++------ filter/source/graphicfilter/ipict/ipict.cxx | 16 ++++---- filter/source/graphicfilter/ipict/shape.cxx | 40 ++++++++++---------- filter/source/graphicfilter/itga/itga.cxx | 2 +- filter/source/graphicfilter/itiff/itiff.cxx | 14 +++---- filter/source/msfilter/msdffimp.cxx | 36 +++++++++--------- filter/source/msfilter/mstoolbar.cxx | 2 +- filter/source/msfilter/svdfppt.cxx | 14 +++---- filter/source/msfilter/util.cxx | 2 +- filter/source/pdf/pdfexport.cxx | 10 ++--- filter/source/svg/svgfilter.cxx | 2 +- filter/source/svg/svgwriter.cxx | 48 ++++++++++++------------ filter/source/svg/svgwriter.hxx | 14 +++---- 39 files changed, 295 insertions(+), 291 deletions(-) (limited to 'filter') diff --git a/filter/source/graphicfilter/egif/egif.cxx b/filter/source/graphicfilter/egif/egif.cxx index 13521944c7bb..314a899bef00 100644 --- a/filter/source/graphicfilter/egif/egif.cxx +++ b/filter/source/graphicfilter/egif/egif.cxx @@ -38,8 +38,8 @@ class GIFWriter sal_uInt32 nMinPercent; sal_uInt32 nMaxPercent; sal_uInt32 nLastPercent; - long nActX; - long nActY; + tools::Long nActX; + tools::Long nActY; sal_Int32 nInterlaced; bool bStatus; bool bTransparent; @@ -49,7 +49,7 @@ class GIFWriter void WriteGlobalHeader( const Size& rSize ); void WriteLoopExtension( const Animation& rAnimation ); void WriteLogSizeExtension( const Size& rSize100 ); - void WriteImageExtension( long nTimer, Disposal eDisposal ); + void WriteImageExtension( tools::Long nTimer, Disposal eDisposal ); void WriteLocalHeader(); void WritePalette(); void WriteAccess(); @@ -60,7 +60,7 @@ class GIFWriter void WriteAnimation( const Animation& rAnimation ); void WriteBitmapEx( const BitmapEx& rBmpEx, const Point& rPoint, bool bExtended, - long nTimer = 0, Disposal eDisposal = Disposal::Not ); + tools::Long nTimer = 0, Disposal eDisposal = Disposal::Not ); css::uno::Reference< css::task::XStatusIndicator > xStatusIndicator; @@ -171,7 +171,7 @@ bool GIFWriter::WriteGIF(const Graphic& rGraphic, FilterConfigItem* pFilterConfi void GIFWriter::WriteBitmapEx( const BitmapEx& rBmpEx, const Point& rPoint, - bool bExtended, long nTimer, Disposal eDisposal ) + bool bExtended, tools::Long nTimer, Disposal eDisposal ) { if( !CreateAccess( rBmpEx ) ) return; @@ -368,7 +368,7 @@ void GIFWriter::WriteLogSizeExtension( const Size& rSize100 ) } -void GIFWriter::WriteImageExtension( long nTimer, Disposal eDisposal ) +void GIFWriter::WriteImageExtension( tools::Long nTimer, Disposal eDisposal ) { if( !bStatus ) return; @@ -458,8 +458,8 @@ void GIFWriter::WritePalette() void GIFWriter::WriteAccess() { GIFLZWCompressor aCompressor; - const long nWidth = m_pAcc->Width(); - const long nHeight = m_pAcc->Height(); + const tools::Long nWidth = m_pAcc->Width(); + const tools::Long nHeight = m_pAcc->Height(); std::unique_ptr pBuffer; bool bNative = m_pAcc->GetScanlineFormat() == ScanlineFormat::N8BitPal; @@ -471,9 +471,9 @@ void GIFWriter::WriteAccess() aCompressor.StartCompression( m_rGIF, m_pAcc->GetBitCount() ); - long nY, nT; + tools::Long nY, nT; - for( long i = 0; i < nHeight; ++i ) + for( tools::Long i = 0; i < nHeight; ++i ) { if( nInterlaced ) { @@ -505,7 +505,7 @@ void GIFWriter::WriteAccess() else { Scanline pScanline = m_pAcc->GetScanline( nY ); - for( long nX = 0; nX < nWidth; nX++ ) + for( tools::Long nX = 0; nX < nWidth; nX++ ) pBuffer[ nX ] = m_pAcc->GetIndexFromData( pScanline, nX ); aCompressor.Compress( pBuffer.get(), nWidth ); diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index e8cca292467c..38d234e3108f 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -100,7 +100,7 @@ private: bool mbLevelWarning; // if there any embedded eps file which was not exported sal_uInt32 mnLatestPush; // offset to streamposition, where last push was done - long mnLevel; // dialog options + tools::Long mnLevel; // dialog options bool mbGrayScale; bool mbCompression; sal_Int32 mnPreview; @@ -200,10 +200,10 @@ private: void ImplSetClipRegion( vcl::Region const & rRegion ); void ImplBmp( Bitmap const *, Bitmap const *, const Point &, double nWidth, double nHeight ); - void ImplText( const OUString& rUniString, const Point& rPos, const long* pDXArry, sal_Int32 nWidth, VirtualDevice const & rVDev ); + void ImplText( const OUString& rUniString, const Point& rPos, const tools::Long* pDXArry, sal_Int32 nWidth, VirtualDevice const & rVDev ); void ImplSetAttrForText( const Point & rPoint ); void ImplWriteCharacter( char ); - void ImplWriteString( const OString&, VirtualDevice const & rVDev, const long* pDXArry, bool bStretch ); + void ImplWriteString( const OString&, VirtualDevice const & rVDev, const tools::Long* pDXArry, bool bStretch ); void ImplDefineFont( const char*, const char* ); void ImplClosePathDraw(); @@ -496,12 +496,12 @@ void PSWriter::ImplWriteProlog( const Graphic* pPreview ) ImplWriteLong( nLines ); sal_Int32 nCount2, nCount = 4; const BitmapColor aBlack( pAcc->GetBestMatchingColor( COL_BLACK ) ); - for ( long nY = 0; nY < aSizeBitmap.Height(); nY++ ) + for ( tools::Long nY = 0; nY < aSizeBitmap.Height(); nY++ ) { nCount2 = 0; char nVal = 0; Scanline pScanline = pAcc->GetScanline( nY ); - for ( long nX = 0; nX < aSizeBitmap.Width(); nX++ ) + for ( tools::Long nX = 0; nX < aSizeBitmap.Width(); nX++ ) { if ( !nCount2 ) { @@ -1179,7 +1179,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) const Size aDestSize( pA->GetSize() ); const double fScaleX = aSrcSize.Width() ? static_cast(aDestSize.Width()) / aSrcSize.Width() : 1.0; const double fScaleY = aSrcSize.Height() ? static_cast(aDestSize.Height()) / aSrcSize.Height() : 1.0; - long nMoveX, nMoveY; + tools::Long nMoveX, nMoveY; if( fScaleX != 1.0 || fScaleY != 1.0 ) { @@ -1655,13 +1655,13 @@ void PSWriter::ImplBmp( Bitmap const * pBitmap, Bitmap const * pMaskBitmap, cons sal_Int32 nHeightOrg = pBitmap->GetSizePixel().Height(); sal_Int32 nHeightLeft = nHeightOrg; - long nWidth = pBitmap->GetSizePixel().Width(); + tools::Long nWidth = pBitmap->GetSizePixel().Width(); Point aSourcePos( rPoint ); while ( nHeightLeft ) { Bitmap aTileBitmap( *pBitmap ); - long nHeight = nHeightLeft; + tools::Long nHeight = nHeightLeft; double nYHeight = nYHeightOrg; bool bDoTrans = false; @@ -1708,7 +1708,7 @@ void PSWriter::ImplBmp( Bitmap const * pBitmap, Bitmap const * pMaskBitmap, cons RectangleVector aRectangles; aRegion.GetRegionRectangles(aRectangles); - const long nMoveVertical(nHeightLeft - nHeightOrg); + const tools::Long nMoveVertical(nHeightLeft - nHeightOrg); for (auto & rectangle : aRectangles) { @@ -1754,10 +1754,10 @@ void PSWriter::ImplBmp( Bitmap const * pBitmap, Bitmap const * pMaskBitmap, cons ImplWriteLong( nWidth ); ImplWriteLine( "string readhexstring pop}" ); ImplWriteLine( "image" ); - for ( long y = 0; y < nHeight; y++ ) + for ( tools::Long y = 0; y < nHeight; y++ ) { Scanline pScanlineRead = pAcc->GetScanline( y ); - for ( long x = 0; x < nWidth; x++ ) + for ( tools::Long x = 0; x < nWidth; x++ ) { ImplWriteHexByte( pAcc->GetIndexFromData( pScanlineRead, x ) ); } @@ -1793,10 +1793,10 @@ void PSWriter::ImplBmp( Bitmap const * pBitmap, Bitmap const * pMaskBitmap, cons if ( mbCompression ) { StartCompression(); - for ( long y = 0; y < nHeight; y++ ) + for ( tools::Long y = 0; y < nHeight; y++ ) { Scanline pScanlineRead = pAcc->GetScanline( y ); - for ( long x = 0; x < nWidth; x++ ) + for ( tools::Long x = 0; x < nWidth; x++ ) { Compress( pAcc->GetIndexFromData( pScanlineRead, x ) ); } @@ -1805,10 +1805,10 @@ void PSWriter::ImplBmp( Bitmap const * pBitmap, Bitmap const * pMaskBitmap, cons } else { - for ( long y = 0; y < nHeight; y++ ) + for ( tools::Long y = 0; y < nHeight; y++ ) { Scanline pScanlineRead = pAcc->GetScanline( y ); - for ( long x = 0; x < nWidth; x++ ) + for ( tools::Long x = 0; x < nWidth; x++ ) { ImplWriteHexByte( pAcc->GetIndexFromData( pScanlineRead, x ) ); } @@ -1858,10 +1858,10 @@ void PSWriter::ImplBmp( Bitmap const * pBitmap, Bitmap const * pMaskBitmap, cons if ( mbCompression ) { StartCompression(); - for ( long y = 0; y < nHeight; y++ ) + for ( tools::Long y = 0; y < nHeight; y++ ) { Scanline pScanlineRead = pAcc->GetScanline( y ); - for ( long x = 0; x < nWidth; x++ ) + for ( tools::Long x = 0; x < nWidth; x++ ) { Compress( pAcc->GetIndexFromData( pScanlineRead, x ) ); } @@ -1870,10 +1870,10 @@ void PSWriter::ImplBmp( Bitmap const * pBitmap, Bitmap const * pMaskBitmap, cons } else { - for ( long y = 0; y < nHeight; y++ ) + for ( tools::Long y = 0; y < nHeight; y++ ) { Scanline pScanlineRead = pAcc->GetScanline( y ); - for ( long x = 0; x < nWidth; x++ ) + for ( tools::Long x = 0; x < nWidth; x++ ) { ImplWriteHexByte( pAcc->GetIndexFromData( pScanlineRead, x ) ); } @@ -1907,10 +1907,10 @@ void PSWriter::ImplBmp( Bitmap const * pBitmap, Bitmap const * pMaskBitmap, cons if ( mbCompression ) { StartCompression(); - for ( long y = 0; y < nHeight; y++ ) + for ( tools::Long y = 0; y < nHeight; y++ ) { Scanline pScanlineRead = pAcc->GetScanline( y ); - for ( long x = 0; x < nWidth; x++ ) + for ( tools::Long x = 0; x < nWidth; x++ ) { const BitmapColor aBitmapColor( pAcc->GetPixelFromData( pScanlineRead, x ) ); Compress( aBitmapColor.GetRed() ); @@ -1922,10 +1922,10 @@ void PSWriter::ImplBmp( Bitmap const * pBitmap, Bitmap const * pMaskBitmap, cons } else { - for ( long y = 0; y < nHeight; y++ ) + for ( tools::Long y = 0; y < nHeight; y++ ) { Scanline pScanline = pAcc->GetScanline( y ); - for ( long x = 0; x < nWidth; x++ ) + for ( tools::Long x = 0; x < nWidth; x++ ) { const BitmapColor aBitmapColor( pAcc->GetPixelFromData( pScanline, x ) ); ImplWriteHexByte( aBitmapColor.GetRed() ); @@ -1948,7 +1948,7 @@ void PSWriter::ImplBmp( Bitmap const * pBitmap, Bitmap const * pMaskBitmap, cons if ( nHeightLeft ) { nHeightLeft++; - aSourcePos.setY( static_cast( rPoint.Y() + ( nYHeightOrg * ( nHeightOrg - nHeightLeft ) ) / nHeightOrg ) ); + aSourcePos.setY( static_cast( rPoint.Y() + ( nYHeightOrg * ( nHeightOrg - nHeightLeft ) ) / nHeightOrg ) ); } } } @@ -1965,7 +1965,7 @@ void PSWriter::ImplWriteCharacter( char nChar ) ImplWriteByte( static_cast(nChar), PS_NONE ); } -void PSWriter::ImplWriteString( const OString& rString, VirtualDevice const & rVDev, const long* pDXArry, bool bStretch ) +void PSWriter::ImplWriteString( const OString& rString, VirtualDevice const & rVDev, const tools::Long* pDXArry, bool bStretch ) { sal_Int32 nLen = rString.getLength(); if ( !nLen ) @@ -1995,7 +1995,7 @@ void PSWriter::ImplWriteString( const OString& rString, VirtualDevice const & rV } } -void PSWriter::ImplText( const OUString& rUniString, const Point& rPos, const long* pDXArry, sal_Int32 nWidth, VirtualDevice const & rVDev ) +void PSWriter::ImplText( const OUString& rUniString, const Point& rPos, const tools::Long* pDXArry, sal_Int32 nWidth, VirtualDevice const & rVDev ) { if ( rUniString.isEmpty() ) return; diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx index 0f1352dfc7eb..728c74b44c03 100644 --- a/filter/source/graphicfilter/icgm/actimpr.cxx +++ b/filter/source/graphicfilter/icgm/actimpr.cxx @@ -453,9 +453,9 @@ void CGMImpressOutAct::DrawRectangle( FloatRect const & rFloatRect ) { if ( ImplCreateShape( "com.sun.star.drawing.RectangleShape" ) ) { - awt::Size aSize( static_cast(rFloatRect.Right - rFloatRect.Left ), static_cast(rFloatRect.Bottom-rFloatRect.Top ) ); + awt::Size aSize( static_cast(rFloatRect.Right - rFloatRect.Left ), static_cast(rFloatRect.Bottom-rFloatRect.Top ) ); maXShape->setSize( aSize ); - maXShape->setPosition( awt::Point( static_cast(rFloatRect.Left), static_cast(rFloatRect.Top) ) ); + maXShape->setPosition( awt::Point( static_cast(rFloatRect.Left), static_cast(rFloatRect.Top) ) ); ImplSetFillBundle(); } } @@ -470,14 +470,14 @@ void CGMImpressOutAct::DrawEllipse( FloatPoint const & rCenter, FloatPoint const uno::Any aAny( &eCircleKind, ::cppu::UnoType::get() ); maXPropSet->setPropertyValue( "CircleKind", aAny ); - long nXSize = static_cast( rSize.X * 2.0 ); // strange behaviour with an awt::Size of 0 - long nYSize = static_cast( rSize.Y * 2.0 ); + tools::Long nXSize = static_cast( rSize.X * 2.0 ); // strange behaviour with an awt::Size of 0 + tools::Long nYSize = static_cast( rSize.Y * 2.0 ); if ( nXSize < 1 ) nXSize = 1; if ( nYSize < 1 ) nYSize = 1; maXShape->setSize( awt::Size( nXSize, nYSize ) ); - maXShape->setPosition( awt::Point( static_cast( rCenter.X - rSize.X ), static_cast( rCenter.Y - rSize.Y ) ) ); + maXShape->setPosition( awt::Point( static_cast( rCenter.X - rSize.X ), static_cast( rCenter.Y - rSize.Y ) ) ); if ( rOrientation != 0 ) { @@ -496,8 +496,8 @@ void CGMImpressOutAct::DrawEllipticalArc( FloatPoint const & rCenter, FloatPoint drawing::CircleKind eCircleKind; - long nXSize = static_cast( rSize.X * 2.0 ); // strange behaviour with an awt::Size of 0 - long nYSize = static_cast( rSize.Y * 2.0 ); + tools::Long nXSize = static_cast( rSize.X * 2.0 ); // strange behaviour with an awt::Size of 0 + tools::Long nYSize = static_cast( rSize.Y * 2.0 ); if ( nXSize < 1 ) nXSize = 1; if ( nYSize < 1 ) @@ -517,7 +517,7 @@ void CGMImpressOutAct::DrawEllipticalArc( FloatPoint const & rCenter, FloatPoint case 2 : eCircleKind = drawing::CircleKind_ARC; break; default : eCircleKind = drawing::CircleKind_FULL; break; } - if ( static_cast(fStartAngle) == static_cast(fEndAngle) ) + if ( static_cast(fStartAngle) == static_cast(fEndAngle) ) { eCircleKind = drawing::CircleKind_FULL; maXPropSet->setPropertyValue( "CircleKind", uno::Any(eCircleKind) ); @@ -528,7 +528,7 @@ void CGMImpressOutAct::DrawEllipticalArc( FloatPoint const & rCenter, FloatPoint maXPropSet->setPropertyValue( "CircleStartAngle", uno::Any(static_cast( fStartAngle * 100 )) ); maXPropSet->setPropertyValue( "CircleEndAngle", uno::Any(static_cast( fEndAngle * 100 )) ); } - maXShape->setPosition( awt::Point( static_cast( rCenter.X - rSize.X ), static_cast( rCenter.Y - rSize.Y ) ) ); + maXShape->setPosition( awt::Point( static_cast( rCenter.X - rSize.X ), static_cast( rCenter.Y - rSize.Y ) ) ); if ( rOrientation != 0 ) { ImplSetOrientation( rCenter, rOrientation ); @@ -571,8 +571,8 @@ void CGMImpressOutAct::DrawBitmap( CGMBitmapDescriptor* pBmpDesc ) if ( !ImplCreateShape( "com.sun.star.drawing.GraphicObjectShape" ) ) return; - maXShape->setSize( awt::Size( static_cast(fdx), static_cast(fdy) ) ); - maXShape->setPosition( awt::Point( static_cast(aOrigin.X), static_cast(aOrigin.Y) ) ); + maXShape->setSize( awt::Size( static_cast(fdx), static_cast(fdy) ) ); + maXShape->setPosition( awt::Point( static_cast(aOrigin.X), static_cast(aOrigin.Y) ) ); if ( pBmpDesc->mnOrientation != 0 ) { @@ -725,8 +725,8 @@ void CGMImpressOutAct::DrawText(awt::Point const & rTextPos, awt::Size const & r return; uno::Any aAny; - long nWidth = rTextSize.Width; - long nHeight = rTextSize.Height; + tools::Long nWidth = rTextSize.Width; + tools::Long nHeight = rTextSize.Height; awt::Point aTextPos( rTextPos ); switch ( mpCGM->pElement->eTextAlignmentV ) @@ -960,7 +960,7 @@ void CGMImpressOutAct::RegPolyLine( tools::Polygon const & rPolygon, bool bRever } } -void CGMImpressOutAct::SetGradientOffset( long nHorzOfs, long nVertOfs ) +void CGMImpressOutAct::SetGradientOffset( tools::Long nHorzOfs, tools::Long nVertOfs ) { if ( !mpGradient ) mpGradient.reset( new awt::Gradient ); @@ -968,7 +968,7 @@ void CGMImpressOutAct::SetGradientOffset( long nHorzOfs, long nVertOfs ) mpGradient->YOffset = ( static_cast(nVertOfs) & 0x7f ); } -void CGMImpressOutAct::SetGradientAngle( long nAngle ) +void CGMImpressOutAct::SetGradientAngle( tools::Long nAngle ) { if ( !mpGradient ) mpGradient.reset( new awt::Gradient ); diff --git a/filter/source/graphicfilter/icgm/bitmap.cxx b/filter/source/graphicfilter/icgm/bitmap.cxx index 75a958474979..d857c5848ed6 100644 --- a/filter/source/graphicfilter/icgm/bitmap.cxx +++ b/filter/source/graphicfilter/icgm/bitmap.cxx @@ -87,9 +87,9 @@ void CGMBitmap::ImplGetBitmap( CGMBitmapDescriptor& rDesc ) // the picture may either be read from left to right or right to left, from top to bottom ... - long nxCount = rDesc.mnX + 1; // +1 because we are using prefix decreasing - long nyCount = rDesc.mnY + 1; - long nx, ny, nxC; + tools::Long nxCount = rDesc.mnX + 1; // +1 because we are using prefix decreasing + tools::Long nyCount = rDesc.mnY + 1; + tools::Long nx, ny, nxC; switch ( rDesc.mnDstBitsPerPixel ) { case 1 : { @@ -291,7 +291,7 @@ bool CGMBitmap::ImplGetDimensions( CGMBitmapDescriptor& rDesc ) rDesc.mnScanSize = 0; switch( rDesc.mnLocalColorPrecision ) { - case long(0x80000001) : // monochrome ( bit = 0->backgroundcolor ) + case tools::Long(0x80000001) : // monochrome ( bit = 0->backgroundcolor ) case 0 : // bit = 1->fillcolor rDesc.mnDstBitsPerPixel = 1; break; @@ -420,7 +420,7 @@ std::unique_ptr CGMBitmap::GetNext() if (!!pCGMBitmapDescriptor->mxBitmap && pCGMBitmapDescriptor->mbStatus) { xCGMTempBitmap.reset(new CGMBitmap(*mpCGM)); - if ( ( static_cast(xCGMTempBitmap->pCGMBitmapDescriptor->mnOrientation) == static_cast(pCGMBitmapDescriptor->mnOrientation) ) && + if ( ( static_cast(xCGMTempBitmap->pCGMBitmapDescriptor->mnOrientation) == static_cast(pCGMBitmapDescriptor->mnOrientation) ) && ( ( ( xCGMTempBitmap->pCGMBitmapDescriptor->mnR.X == pCGMBitmapDescriptor->mnQ.X ) && ( xCGMTempBitmap->pCGMBitmapDescriptor->mnR.Y == pCGMBitmapDescriptor->mnQ.Y ) ) || ( ( xCGMTempBitmap->pCGMBitmapDescriptor->mnQ.X == pCGMBitmapDescriptor->mnR.X ) && diff --git a/filter/source/graphicfilter/icgm/bitmap.hxx b/filter/source/graphicfilter/icgm/bitmap.hxx index 971a33cf071b..2fb7de98b32f 100644 --- a/filter/source/graphicfilter/icgm/bitmap.hxx +++ b/filter/source/graphicfilter/icgm/bitmap.hxx @@ -43,7 +43,7 @@ class CGMBitmapDescriptor double mnOrientation; sal_uInt32 mnX, mnY; - long mnLocalColorPrecision; + tools::Long mnLocalColorPrecision; sal_uInt32 mnCompressionMode; CGMBitmapDescriptor() diff --git a/filter/source/graphicfilter/icgm/bundles.hxx b/filter/source/graphicfilter/icgm/bundles.hxx index 8d87bac2082b..d4cd01839acc 100644 --- a/filter/source/graphicfilter/icgm/bundles.hxx +++ b/filter/source/graphicfilter/icgm/bundles.hxx @@ -29,14 +29,14 @@ class Bundle { - long mnBundleIndex; + tools::Long mnBundleIndex; sal_uInt32 mnColor; public: void SetColor( sal_uInt32 nColor ) ; sal_uInt32 GetColor() const { return mnColor;} - long GetIndex() const { return mnBundleIndex; } ; - void SetIndex( long nBundleIndex ) { mnBundleIndex = nBundleIndex; } ; + tools::Long GetIndex() const { return mnBundleIndex; } ; + void SetIndex( tools::Long nBundleIndex ) { mnBundleIndex = nBundleIndex; } ; Bundle() : mnBundleIndex( 0 ) @@ -126,8 +126,8 @@ class FillBundle : public Bundle public: FillInteriorStyle eFillInteriorStyle; - long nFillPatternIndex; - long nFillHatchIndex; + tools::Long nFillPatternIndex; + tools::Long nFillHatchIndex; FillBundle() : eFillInteriorStyle(FIS_HOLLOW) diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx index b9736b610dc6..02f1d0219f02 100644 --- a/filter/source/graphicfilter/icgm/cgm.cxx +++ b/filter/source/graphicfilter/icgm/cgm.cxx @@ -212,7 +212,7 @@ double CGM::ImplGetFloat( RealPrecision eRealPrecision, sal_uInt32 nRealSize ) } else // ->RP_FIXED { - long nVal; + tools::Long nVal; const int nSwitch = bCompatible ? 0 : 1 ; if ( nRealSize == 4 ) { diff --git a/filter/source/graphicfilter/icgm/cgmtypes.hxx b/filter/source/graphicfilter/icgm/cgmtypes.hxx index b9a80fb4c83a..e78d2757a8d3 100644 --- a/filter/source/graphicfilter/icgm/cgmtypes.hxx +++ b/filter/source/graphicfilter/icgm/cgmtypes.hxx @@ -20,6 +20,8 @@ #ifndef INCLUDED_FILTER_SOURCE_GRAPHICFILTER_ICGM_CGMTYPES_HXX #define INCLUDED_FILTER_SOURCE_GRAPHICFILTER_ICGM_CGMTYPES_HXX +#include + struct FloatPoint { double X; @@ -55,8 +57,8 @@ struct FloatRect struct HatchEntry { int HatchStyle; - long HatchDistance; - long HatchAngle; + tools::Long HatchDistance; + tools::Long HatchAngle; }; #define ASF_LINETYPE 0x00000001UL diff --git a/filter/source/graphicfilter/icgm/class1.cxx b/filter/source/graphicfilter/icgm/class1.cxx index 289e28db428f..07a6fe253e4e 100644 --- a/filter/source/graphicfilter/icgm/class1.cxx +++ b/filter/source/graphicfilter/icgm/class1.cxx @@ -29,7 +29,7 @@ void CGM::ImplDoClass1() { - long nInteger, nI0, nI1; + tools::Long nInteger, nI0, nI1; sal_uInt32 nUInteger; switch ( mnElementID ) diff --git a/filter/source/graphicfilter/icgm/class3.cxx b/filter/source/graphicfilter/icgm/class3.cxx index c3d56367947b..3cc25730fffa 100644 --- a/filter/source/graphicfilter/icgm/class3.cxx +++ b/filter/source/graphicfilter/icgm/class3.cxx @@ -41,8 +41,8 @@ void CGM::ImplDoClass3() case 0x02 : /*VDC Real Precision*/ { nUInteger = ImplGetUI16(); - const long nI0 = ImplGetI( pElement->nIntegerPrecision ); // exponent - const long nI1 = ImplGetI( pElement->nIntegerPrecision ); // mantissa + const tools::Long nI0 = ImplGetI( pElement->nIntegerPrecision ); // exponent + const tools::Long nI1 = ImplGetI( pElement->nIntegerPrecision ); // mantissa switch( nUInteger ) { case 0 : diff --git a/filter/source/graphicfilter/icgm/class4.cxx b/filter/source/graphicfilter/icgm/class4.cxx index 394c2ada5f89..18eff3452451 100644 --- a/filter/source/graphicfilter/icgm/class4.cxx +++ b/filter/source/graphicfilter/icgm/class4.cxx @@ -132,7 +132,7 @@ void CGM::ImplDoClass4() { FloatPoint aFloatPoint; ImplGetPoint( aFloatPoint, true ); - aPolygon.SetPoint( Point( static_cast(aFloatPoint.X), static_cast(aFloatPoint.Y) ), i ); + aPolygon.SetPoint( Point( static_cast(aFloatPoint.X), static_cast(aFloatPoint.Y) ), i ); } if ( mbFigure ) mpOutAct->RegPolyLine( aPolygon ); @@ -155,7 +155,7 @@ void CGM::ImplDoClass4() for ( sal_uInt16 i = 0; i < nPoints; i++ ) { ImplGetPoint( aFloatPoint, true ); - aPolygon.SetPoint( Point( static_cast(aFloatPoint.X), static_cast(aFloatPoint.Y) ), 0 ); + aPolygon.SetPoint( Point( static_cast(aFloatPoint.X), static_cast(aFloatPoint.Y) ), 0 ); } mpOutAct->RegPolyLine( aPolygon ); } @@ -166,9 +166,9 @@ void CGM::ImplDoClass4() for ( sal_uInt16 i = 0; i < nPoints; i++ ) { ImplGetPoint( aFloatPoint, true ); - aPolygon.SetPoint( Point( static_cast(aFloatPoint.X), static_cast(aFloatPoint.Y) ), 0 ); + aPolygon.SetPoint( Point( static_cast(aFloatPoint.X), static_cast(aFloatPoint.Y) ), 0 ); ImplGetPoint( aFloatPoint, true ); - aPolygon.SetPoint( Point( static_cast(aFloatPoint.X), static_cast(aFloatPoint.Y) ), 1); + aPolygon.SetPoint( Point( static_cast(aFloatPoint.X), static_cast(aFloatPoint.Y) ), 1); mpOutAct->DrawPolyLine( aPolygon ); } mpOutAct->EndGroup(); @@ -195,7 +195,7 @@ void CGM::ImplDoClass4() OUString aStr(reinterpret_cast(mpSource) + mnParaSize, nSize, RTL_TEXTENCODING_ASCII_US); awt::Size aSize; - awt::Point aPoint( static_cast(aFloatPoint.X), static_cast(aFloatPoint.Y) ); + awt::Point aPoint( static_cast(aFloatPoint.X), static_cast(aFloatPoint.Y) ); mpOutAct->DrawText(aPoint, aSize, aStr, static_cast(nType)); mnParaSize = mnElementSize; } @@ -231,8 +231,8 @@ void CGM::ImplDoClass4() OUString aStr(reinterpret_cast(mpSource) + mnParaSize, nSize, RTL_TEXTENCODING_ASCII_US); - awt::Point aPoint( static_cast(aFloatPoint.X), static_cast(aFloatPoint.Y) ); - awt::Size aSize(static_cast(dx), static_cast(dy)); + awt::Point aPoint( static_cast(aFloatPoint.X), static_cast(aFloatPoint.Y) ); + awt::Size aSize(static_cast(dx), static_cast(dy)); mpOutAct->DrawText(aPoint, aSize , aStr, static_cast(nType)); mnParaSize = mnElementSize; } @@ -265,7 +265,7 @@ void CGM::ImplDoClass4() { FloatPoint aFloatPoint; ImplGetPoint( aFloatPoint, true ); - aPolygon.SetPoint( Point ( static_cast( aFloatPoint.X ), static_cast( aFloatPoint.Y ) ), i ); + aPolygon.SetPoint( Point ( static_cast( aFloatPoint.X ), static_cast( aFloatPoint.Y ) ), i ); } mpOutAct->DrawPolygon( aPolygon ); } @@ -286,7 +286,7 @@ void CGM::ImplDoClass4() { ImplGetPoint( aFloatPoint, true ); nEdgeFlag = ImplGetUI16(); - pPoints[ nPoints++ ] = Point( static_cast(aFloatPoint.X), static_cast(aFloatPoint.Y) ); + pPoints[ nPoints++ ] = Point( static_cast(aFloatPoint.X), static_cast(aFloatPoint.Y) ); if ( ( nEdgeFlag & 2 ) || ( mnParaSize == mnElementSize ) ) { tools::Polygon aPolygon( nPoints ); @@ -414,7 +414,7 @@ void CGM::ImplDoClass4() { tools::Rectangle aBoundingBox(aCenterPoint.X - fRadius, aCenterPoint.Y - fRadius); aBoundingBox.SaturatingSetSize(Size(2 * fRadius, 2 * fRadius)); - tools::Polygon aPolygon( aBoundingBox, Point( static_cast(aStartingPoint.X), static_cast(aStartingPoint.Y) ) ,Point( static_cast(aEndingPoint.X), static_cast(aEndingPoint.Y) ), PolyStyle::Arc ); + tools::Polygon aPolygon( aBoundingBox, Point( static_cast(aStartingPoint.X), static_cast(aStartingPoint.Y) ) ,Point( static_cast(aEndingPoint.X), static_cast(aEndingPoint.Y) ), PolyStyle::Arc ); if ( nSwitch ) mpOutAct->RegPolyLine( aPolygon, true ); else @@ -534,8 +534,8 @@ void CGM::ImplDoClass4() tools::Rectangle aBoundingBox(aCenter.X - aRadius.X, aCenter.Y - aRadius.X); aBoundingBox.SaturatingSetSize(Size(2 * aRadius.X, 2 * aRadius.X)); tools::Polygon aPolygon( aBoundingBox, - Point( static_cast(vector[ 0 ]), static_cast(vector[ 1 ]) ), - Point( static_cast(vector[ 2 ]), static_cast(vector[ 3 ]) ), PolyStyle::Arc ); + Point( static_cast(vector[ 0 ]), static_cast(vector[ 1 ]) ), + Point( static_cast(vector[ 2 ]), static_cast(vector[ 3 ]) ), PolyStyle::Arc ); mpOutAct->RegPolyLine( aPolygon ); } else @@ -724,7 +724,7 @@ void CGM::ImplDoClass4() { FloatPoint aFloatPoint; ImplGetPoint( aFloatPoint, true ); - aPolygon.SetPoint( Point ( static_cast( aFloatPoint.X ), static_cast( aFloatPoint.Y ) ), i ); + aPolygon.SetPoint( Point ( static_cast( aFloatPoint.X ), static_cast( aFloatPoint.Y ) ), i ); } if ( nOrder & 4 ) { diff --git a/filter/source/graphicfilter/icgm/class5.cxx b/filter/source/graphicfilter/icgm/class5.cxx index 888a9ca1259c..7cfd9911c7d4 100644 --- a/filter/source/graphicfilter/icgm/class5.cxx +++ b/filter/source/graphicfilter/icgm/class5.cxx @@ -446,8 +446,8 @@ void CGM::ImplDoClass5() case 0x72 : /*External Leading*/ break; case 0x7a : /*set Gradient Offset*/ { - long nHorzOffset = ImplGetI( pElement->nIndexPrecision ); - long nVertOffset = ImplGetI( pElement->nIndexPrecision ); + tools::Long nHorzOffset = ImplGetI( pElement->nIndexPrecision ); + tools::Long nVertOffset = ImplGetI( pElement->nIndexPrecision ); (void)ImplGetUI16(); // nType mpOutAct->SetGradientOffset( nHorzOffset, nVertOffset ); mnAct4PostReset |= ACT4_GRADIENT_ACTION; diff --git a/filter/source/graphicfilter/icgm/classx.cxx b/filter/source/graphicfilter/icgm/classx.cxx index ea1fc79196a9..2b624f63b206 100644 --- a/filter/source/graphicfilter/icgm/classx.cxx +++ b/filter/source/graphicfilter/icgm/classx.cxx @@ -43,7 +43,7 @@ void CGM::ImplDoClass6() { case 0x01 : /*Escape*/ { - long nIdentifier = ImplGetI( pElement->nIntegerPrecision ); + tools::Long nIdentifier = ImplGetI( pElement->nIntegerPrecision ); switch ( nIdentifier ) { case 0 : /*inquire function support */break; diff --git a/filter/source/graphicfilter/icgm/elements.cxx b/filter/source/graphicfilter/icgm/elements.cxx index 2be08c32f04b..9a0221066fec 100644 --- a/filter/source/graphicfilter/icgm/elements.cxx +++ b/filter/source/graphicfilter/icgm/elements.cxx @@ -278,7 +278,7 @@ void CGMElements::Init() } -void CGMElements::ImplInsertHatch( sal_Int32 nKey, int nStyle, long nDistance, long nAngle ) +void CGMElements::ImplInsertHatch( sal_Int32 nKey, int nStyle, tools::Long nDistance, tools::Long nAngle ) { HatchEntry& rEntry = maHatchMap[nKey]; rEntry.HatchStyle = nStyle; @@ -298,7 +298,7 @@ void CGMElements::CopyAllBundles( const BundleList& rSource, BundleList& rDest ) }; -Bundle* CGMElements::GetBundleIndex( long nIndex, BundleList& rList, Bundle& rBundle ) +Bundle* CGMElements::GetBundleIndex( tools::Long nIndex, BundleList& rList, Bundle& rBundle ) { rBundle.SetIndex( nIndex ); Bundle* pBundle = GetBundle( rList, nIndex ); @@ -308,7 +308,7 @@ Bundle* CGMElements::GetBundleIndex( long nIndex, BundleList& rList, Bundle& rBu } -Bundle* CGMElements::GetBundle( BundleList& rList, long nIndex ) +Bundle* CGMElements::GetBundle( BundleList& rList, tools::Long nIndex ) { for (auto const & i : rList) { if ( i->GetIndex() == nIndex ) { diff --git a/filter/source/graphicfilter/icgm/elements.hxx b/filter/source/graphicfilter/icgm/elements.hxx index 4dbd0e9aa08e..8a7812cb699c 100644 --- a/filter/source/graphicfilter/icgm/elements.hxx +++ b/filter/source/graphicfilter/icgm/elements.hxx @@ -30,9 +30,9 @@ typedef ::std::vector< std::unique_ptr > BundleList; class CGMElements { - void ImplInsertHatch( sal_Int32 Key, int Style, long Distance, long Angle ); + void ImplInsertHatch( sal_Int32 Key, int Style, tools::Long Distance, tools::Long Angle ); public: - long nMetaFileVersion; + tools::Long nMetaFileVersion; sal_uInt32 nIntegerPrecision; // maybe 1, 2, 4 Bytes sal_uInt32 nIndexPrecision; // " " " @@ -105,8 +105,8 @@ class CGMElements TextAlignmentV eTextAlignmentV; double nTextAlignmentHCont; double nTextAlignmentVCont; - long nCharacterSetIndex; - long nAlternateCharacterSetIndex; + tools::Long nCharacterSetIndex; + tools::Long nAlternateCharacterSetIndex; CharacterCodingA eCharacterCodingA; CGMFList aFontList; @@ -128,8 +128,8 @@ class CGMElements ~CGMElements(); CGMElements& operator=( const CGMElements& ); void Init(); - static Bundle* GetBundleIndex( long nIndex, BundleList&, Bundle& ); - static Bundle* GetBundle( BundleList& rList, long nIndex ); + static Bundle* GetBundleIndex( tools::Long nIndex, BundleList&, Bundle& ); + static Bundle* GetBundle( BundleList& rList, tools::Long nIndex ); static Bundle* InsertBundle( BundleList&, Bundle& ); static void CopyAllBundles( const BundleList& Source, BundleList& Dest ); }; diff --git a/filter/source/graphicfilter/icgm/outact.hxx b/filter/source/graphicfilter/icgm/outact.hxx index 43af85d10844..2364c787fea1 100644 --- a/filter/source/graphicfilter/icgm/outact.hxx +++ b/filter/source/graphicfilter/icgm/outact.hxx @@ -99,8 +99,8 @@ public: void NewRegion(); void EndFigure(); void RegPolyLine( tools::Polygon const &, bool bReverse = false ); - void SetGradientOffset( long nHorzOfs, long nVertOfs ); - void SetGradientAngle( long nAngle ); + void SetGradientOffset( tools::Long nHorzOfs, tools::Long nVertOfs ); + void SetGradientAngle( tools::Long nAngle ); void SetGradientDescriptor( sal_uInt32 nColorFrom, sal_uInt32 nColorTo ); void SetGradientStyle( sal_uInt32 nStyle ); }; diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx index f6fc91ae792d..4b8de3428759 100644 --- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx +++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx @@ -46,9 +46,9 @@ Color DXF2GDIMetaFile::ConvertColor(sal_uInt8 nColor) pDXF->aPalette.GetBlue( nColor ) ); } -long DXF2GDIMetaFile::GetEntityColor(const DXFBasicEntity & rE) +tools::Long DXF2GDIMetaFile::GetEntityColor(const DXFBasicEntity & rE) { - long nColor; + tools::Long nColor; nColor=rE.nColor; if (nColor==256) { @@ -75,7 +75,7 @@ DXFLineInfo DXF2GDIMetaFile::LTypeToDXFLineInfo(OString const& rLineType) } else { aDXFLineInfo.eStyle = LineStyle::Dash; - for (long i=0; i < (pLT->nDashCount); i++) { + for (tools::Long i=0; i < (pLT->nDashCount); i++) { const double x = pLT->fDash[i] * pDXF->getGlobalLineTypeScale(); if ( x >= 0.0 ) { if ( aDXFLineInfo.nDotCount == 0 ) { @@ -145,7 +145,7 @@ DXFLineInfo DXF2GDIMetaFile::GetEntityDXFLineInfo(const DXFBasicEntity & rE) bool DXF2GDIMetaFile::SetLineAttribute(const DXFBasicEntity & rE) { - long nColor; + tools::Long nColor; Color aColor; nColor=GetEntityColor(rE); @@ -167,7 +167,7 @@ bool DXF2GDIMetaFile::SetLineAttribute(const DXFBasicEntity & rE) bool DXF2GDIMetaFile::SetAreaAttribute(const DXFBasicEntity & rE) { - long nColor; + tools::Long nColor; Color aColor; nColor=GetEntityColor(rE); @@ -189,7 +189,7 @@ bool DXF2GDIMetaFile::SetAreaAttribute(const DXFBasicEntity & rE) bool DXF2GDIMetaFile::SetFontAttribute(const DXFBasicEntity & rE, short nAngle, sal_uInt16 nHeight) { - long nColor; + tools::Long nColor; Color aColor; vcl::Font aFont; @@ -267,8 +267,8 @@ void DXF2GDIMetaFile::DrawCircleEntity(const DXFCircleEntity & rE, const DXFTran rTransform.Transform(rE.aP0,aC); if (rE.fThickness==0 && rTransform.TransCircleToEllipse(rE.fRadius,frx,fry)) { pVirDev->DrawEllipse( - tools::Rectangle(static_cast(aC.fx-frx+0.5),static_cast(aC.fy-fry+0.5), - static_cast(aC.fx+frx+0.5),static_cast(aC.fy+fry+0.5))); + tools::Rectangle(static_cast(aC.fx-frx+0.5),static_cast(aC.fy-fry+0.5), + static_cast(aC.fx+frx+0.5),static_cast(aC.fy+fry+0.5))); } else { double fAng; @@ -338,8 +338,8 @@ void DXF2GDIMetaFile::DrawArcEntity(const DXFArcEntity & rE, const DXFTransform rTransform.Transform(aVE,aPS); } pVirDev->DrawArc( - tools::Rectangle(static_cast(aC.fx-frx+0.5),static_cast(aC.fy-fry+0.5), - static_cast(aC.fx+frx+0.5),static_cast(aC.fy+fry+0.5)), + tools::Rectangle(static_cast(aC.fx-frx+0.5),static_cast(aC.fy-fry+0.5), + static_cast(aC.fx+frx+0.5),static_cast(aC.fy+fry+0.5)), aPS,aPE ); } @@ -461,7 +461,7 @@ void DXF2GDIMetaFile::DrawInsertEntity(const DXFInsertEntity & rE, const DXFTran DXFTransform( aDXFTransform1, aDXFTransform2 ), rTransform ); - long nSavedBlockColor, nSavedParentLayerColor; + tools::Long nSavedBlockColor, nSavedParentLayerColor; DXFLineInfo aSavedBlockDXFLineInfo, aSavedParentLayerDXFLineInfo; nSavedBlockColor=nBlockColor; nSavedParentLayerColor=nParentLayerColor; @@ -661,7 +661,7 @@ void DXF2GDIMetaFile::DrawDimensionEntity(const DXFDimensionEntity & rE, const D DXFTransform(1.0,1.0,1.0,DXFVector(0.0,0.0,0.0)-pB->aBasePoint), rTransform ); - long nSavedBlockColor, nSavedParentLayerColor; + tools::Long nSavedBlockColor, nSavedParentLayerColor; DXFLineInfo aSavedBlockDXFLineInfo, aSavedParentLayerDXFLineInfo; nSavedBlockColor=nBlockColor; nSavedParentLayerColor=nParentLayerColor; @@ -854,8 +854,8 @@ bool DXF2GDIMetaFile::Convert(const DXFRepresentation & rDXF, GDIMetaFile & rMTF pDXF->aBoundingBox.fMaxY*fScale, -pDXF->aBoundingBox.fMinZ*fScale)); } - aPrefSize.setWidth(static_cast(fWidth*fScale+1.5) ); - aPrefSize.setHeight(static_cast(fHeight*fScale+1.5) ); + aPrefSize.setWidth(static_cast(fWidth*fScale+1.5) ); + aPrefSize.setHeight(static_cast(fHeight*fScale+1.5) ); } } else { @@ -876,8 +876,8 @@ bool DXF2GDIMetaFile::Convert(const DXFRepresentation & rDXF, GDIMetaFile & rMTF ) ); } - aPrefSize.setWidth(static_cast(fWidth*fScale+1.5) ); - aPrefSize.setHeight(static_cast(fHeight*fScale+1.5) ); + aPrefSize.setWidth(static_cast(fWidth*fScale+1.5) ); + aPrefSize.setHeight(static_cast(fHeight*fScale+1.5) ); } if (bStatus) diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.hxx b/filter/source/graphicfilter/idxf/dxf2mtf.hxx index de10b865f7f3..426932fd1fba 100644 --- a/filter/source/graphicfilter/idxf/dxf2mtf.hxx +++ b/filter/source/graphicfilter/idxf/dxf2mtf.hxx @@ -40,9 +40,9 @@ private: sal_uInt16 nLastPercent; sal_uInt16 nMainEntitiesCount; - long nBlockColor; + tools::Long nBlockColor; DXFLineInfo aBlockDXFLineInfo; - long nParentLayerColor; + tools::Long nParentLayerColor; DXFLineInfo aParentLayerDXFLineInfo; Color aActLineColor; Color aActFillColor; @@ -53,7 +53,7 @@ private: Color ConvertColor(sal_uInt8 nColor); - long GetEntityColor(const DXFBasicEntity & rE); + tools::Long GetEntityColor(const DXFBasicEntity & rE); DXFLineInfo LTypeToDXFLineInfo(OString const& rLineType); diff --git a/filter/source/graphicfilter/idxf/dxfblkrd.hxx b/filter/source/graphicfilter/idxf/dxfblkrd.hxx index 5547f571134f..6aa488641d1a 100644 --- a/filter/source/graphicfilter/idxf/dxfblkrd.hxx +++ b/filter/source/graphicfilter/idxf/dxfblkrd.hxx @@ -36,7 +36,7 @@ public: // properties of blocks; commented with group codes: OString m_sName; // 2 OString m_sAlsoName; // 3 - long nFlags; // 70 + tools::Long nFlags; // 70 DXFVector aBasePoint; // 10,20,30 OString m_sXRef; // 1 diff --git a/filter/source/graphicfilter/idxf/dxfentrd.hxx b/filter/source/graphicfilter/idxf/dxfentrd.hxx index 8c56ba6317c1..35b05bdbf4dc 100644 --- a/filter/source/graphicfilter/idxf/dxfentrd.hxx +++ b/filter/source/graphicfilter/idxf/dxfentrd.hxx @@ -22,6 +22,7 @@ #include "dxfgrprd.hxx" #include "dxfvec.hxx" +#include #include #include @@ -64,8 +65,8 @@ public: OString m_sLayer; // 8 OString m_sLineType; // 6 double fThickness; // 39 - long nColor; // 62 - long nSpace; // 67 + tools::Long nColor; // 62 + tools::Long nSpace; // 67 DXFVector aExtrusion; // 210,220,230 protected: @@ -192,9 +193,9 @@ public: double fXScale; // 41 double fOblAngle; // 42 OString m_sStyle; // 7 - long nGenFlags; // 71 - long nHorzJust; // 72 - long nVertJust; // 73 + tools::Long nGenFlags; // 71 + tools::Long nHorzJust; // 72 + tools::Long nVertJust; // 73 DXFVector aAlign; // 11,21,31 DXFTextEntity(); @@ -226,15 +227,15 @@ class DXFInsertEntity : public DXFBasicEntity { public: - long nAttrFlag; // 66 + tools::Long nAttrFlag; // 66 OString m_sName; // 2 DXFVector aP0; // 10,20,30 double fXScale; // 41 double fYScale; // 42 double fZScale; // 43 double fRotAngle; // 50 - long nColCount; // 70 - long nRowCount; // 71 + tools::Long nColCount; // 70 + tools::Long nRowCount; // 71 double fColSpace; // 44 double fRowSpace; // 45 @@ -252,15 +253,15 @@ class DXFAttDefEntity : public DXFBasicEntity { OString m_sDefVal; // 1 OString m_sPrompt; // 3 OString m_sTagStr; // 2 - long nAttrFlags; // 70 - long nFieldLen; // 73 + tools::Long nAttrFlags; // 70 + tools::Long nFieldLen; // 73 double fRotAngle; // 50 double fXScale; // 41 double fOblAngle; // 51 OString m_sStyle; // 7 - long nGenFlags; // 71 - long nHorzJust; // 72 - long nVertJust; // 74 + tools::Long nGenFlags; // 71 + tools::Long nHorzJust; // 72 + tools::Long nVertJust; // 74 DXFVector aAlign; // 11,21,31 public: @@ -280,15 +281,15 @@ public: double fHeight; // 40 OString m_sText; // 1 OString m_sTagStr; // 2 - long nAttrFlags; // 70 - long nFieldLen; // 73 + tools::Long nAttrFlags; // 70 + tools::Long nFieldLen; // 73 double fRotAngle; // 50 double fXScale; // 41 double fOblAngle; // 51 OString m_sStyle; // 7 - long nGenFlags; // 71 - long nHorzJust; // 72 - long nVertJust; // 74 + tools::Long nGenFlags; // 71 + tools::Long nHorzJust; // 72 + tools::Long nVertJust; // 74 DXFVector aAlign; // 11,21,31 DXFAttribEntity(); @@ -302,14 +303,14 @@ class DXFPolyLineEntity : public DXFBasicEntity { public: - long nFlags; // 70 + tools::Long nFlags; // 70 double fSWidth; // 40 double fEWidth; // 41 - long nMeshMCount; // 71 - long nMeshNCount; // 72 - long nMDensity; // 73 - long nNDensity; // 74 - long nCSSType; // 75 + tools::Long nMeshMCount; // 71 + tools::Long nMeshNCount; // 72 + tools::Long nMDensity; // 73 + tools::Long nNDensity; // 74 + tools::Long nCSSType; // 75 DXFPolyLineEntity(); @@ -456,7 +457,7 @@ public: double fSWidth; // 40 (if <0.0, then one has DXFPolyLine::fSWidth) double fEWidth; // 41 (if <0.0, then one has DXFPolyLine::fEWidth) double fBulge; // 42 - long nFlags; // 70 + tools::Long nFlags; // 70 double fCFTDir; // 50 DXFVertexEntity(); @@ -481,7 +482,7 @@ public: DXFVector aP1; // 11,21,31 DXFVector aP2; // 12,22,32 DXFVector aP3; // 13,23,33 - long nIEFlags; // 70 + tools::Long nIEFlags; // 70 DXF3DFaceEntity(); diff --git a/filter/source/graphicfilter/idxf/dxfgrprd.cxx b/filter/source/graphicfilter/idxf/dxfgrprd.cxx index 9a65e560c57f..f5d42106c2ad 100644 --- a/filter/source/graphicfilter/idxf/dxfgrprd.cxx +++ b/filter/source/graphicfilter/idxf/dxfgrprd.cxx @@ -155,7 +155,7 @@ sal_uInt16 DXFGroupReader::Read() return nG; } -long DXFGroupReader::ReadI() +tools::Long DXFGroupReader::ReadI() { OString s = DXFReadLine(rIS); char *p=s.pData->buffer; diff --git a/filter/source/graphicfilter/idxf/dxfgrprd.hxx b/filter/source/graphicfilter/idxf/dxfgrprd.hxx index d97f81a48e1b..f114f043eea8 100644 --- a/filter/source/graphicfilter/idxf/dxfgrprd.hxx +++ b/filter/source/graphicfilter/idxf/dxfgrprd.hxx @@ -23,6 +23,7 @@ #include #include #include +#include class SvStream; @@ -44,7 +45,7 @@ public: sal_uInt16 GetG() const; // Return the last group code (the one the last Read() did return). - long GetI() const; + tools::Long GetI() const; // Returns the integer value of the group which was read earlier with Read(). // This read must have returned a group code for datatype Integer. // If not 0 is returned @@ -62,7 +63,7 @@ public: sal_uInt64 remainingSize() const; private: - long ReadI(); + tools::Long ReadI(); double ReadF(); void ReadS(); @@ -73,7 +74,7 @@ private: OString S; union { double F; - long I; + tools::Long I; }; }; @@ -94,7 +95,7 @@ inline sal_uInt16 DXFGroupReader::GetG() const return nLastG; } -inline long DXFGroupReader::GetI() const +inline tools::Long DXFGroupReader::GetI() const { return I; } diff --git a/filter/source/graphicfilter/idxf/dxftblrd.cxx b/filter/source/graphicfilter/idxf/dxftblrd.cxx index e328c797a0f1..7820b04f4343 100644 --- a/filter/source/graphicfilter/idxf/dxftblrd.cxx +++ b/filter/source/graphicfilter/idxf/dxftblrd.cxx @@ -32,7 +32,7 @@ DXFLType::DXFLType() void DXFLType::Read(DXFGroupReader & rDGR) { - long nDashIndex=-1; + tools::Long nDashIndex=-1; while (rDGR.Read()!=0) { diff --git a/filter/source/graphicfilter/idxf/dxftblrd.hxx b/filter/source/graphicfilter/idxf/dxftblrd.hxx index fa9eb2ae6bba..9549458dabd5 100644 --- a/filter/source/graphicfilter/idxf/dxftblrd.hxx +++ b/filter/source/graphicfilter/idxf/dxftblrd.hxx @@ -36,9 +36,9 @@ public: DXFLType * pSucc; OString m_sName; // 2 - long nFlags; // 70 + tools::Long nFlags; // 70 OString m_sDescription; // 3 - long nDashCount; // 73 + tools::Long nDashCount; // 73 double fPatternLength; // 40 double fDash[DXF_MAX_DASH_COUNT]; // 49,49,... @@ -57,8 +57,8 @@ public: DXFLayer * pSucc; OString m_sName; // 2 - long nFlags; // 70 - long nColor; // 62 + tools::Long nFlags; // 70 + tools::Long nColor; // 62 OString m_sLineType; // 6 DXFLayer(); @@ -76,11 +76,11 @@ public: DXFStyle * pSucc; OString m_sName; // 2 - long nFlags; // 70 + tools::Long nFlags; // 70 double fHeight; // 40 double fWidthFak; // 41 double fOblAngle; // 50 - long nTextGenFlags; // 71 + tools::Long nTextGenFlags; // 71 double fLastHeightUsed; // 42 OString m_sPrimFontFile; // 3 OString m_sBigFontFile; // 4 @@ -100,7 +100,7 @@ public: DXFVPort * pSucc; OString m_sName; // 2 - long nFlags; // 70 + tools::Long nFlags; // 70 double fMinX; // 10 double fMinY; // 20 double fMaxX; // 11 @@ -121,16 +121,16 @@ public: double fFrontClipPlane; // 43 double fBackClipPlane; // 44 double fTwistAngle; // 51 - long nStatus; // 68 - long nID; // 69 - long nMode; // 71 - long nCircleZoomPercent; // 72 - long nFastZoom; // 73 - long nUCSICON; // 74 - long nSnap; // 75 - long nGrid; // 76 - long nSnapStyle; // 77 - long nSnapIsopair; // 78 + tools::Long nStatus; // 68 + tools::Long nID; // 69 + tools::Long nMode; // 71 + tools::Long nCircleZoomPercent; // 72 + tools::Long nFastZoom; // 73 + tools::Long nUCSICON; // 74 + tools::Long nSnap; // 75 + tools::Long nGrid; // 76 + tools::Long nSnapStyle; // 77 + tools::Long nSnapIsopair; // 78 DXFVPort(); void Read(DXFGroupReader & rDGR); diff --git a/filter/source/graphicfilter/idxf/dxfvec.cxx b/filter/source/graphicfilter/idxf/dxfvec.cxx index e0189c3eca51..fb1ff647d591 100644 --- a/filter/source/graphicfilter/idxf/dxfvec.cxx +++ b/filter/source/graphicfilter/idxf/dxfvec.cxx @@ -152,8 +152,8 @@ void DXFTransform::Transform(const DXFVector & rSrc, DXFVector & rTgt) const void DXFTransform::Transform(const DXFVector & rSrc, Point & rTgt) const { - rTgt.setX(static_cast( rSrc.fx * aMX.fx + rSrc.fy * aMY.fx + rSrc.fz * aMZ.fx + aMP.fx + 0.5 ) ); - rTgt.setY(static_cast( rSrc.fx * aMX.fy + rSrc.fy * aMY.fy + rSrc.fz * aMZ.fy + aMP.fy + 0.5 ) ); + rTgt.setX(static_cast( rSrc.fx * aMX.fx + rSrc.fy * aMY.fx + rSrc.fz * aMZ.fx + aMP.fx + 0.5 ) ); + rTgt.setY(static_cast( rSrc.fx * aMX.fy + rSrc.fy * aMY.fy + rSrc.fz * aMZ.fy + aMP.fy + 0.5 ) ); } diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index ee1315f2bf28..010d984d3eb0 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -70,11 +70,11 @@ static sal_uInt8* ImplSearchEntry( sal_uInt8* pSource, sal_uInt8 const * pDest, // SecurityCount is the buffersize of the buffer in which we will parse for a number -static long ImplGetNumber(sal_uInt8* &rBuf, sal_uInt32& nSecurityCount) +static tools::Long ImplGetNumber(sal_uInt8* &rBuf, sal_uInt32& nSecurityCount) { bool bValid = true; bool bNegative = false; - long nRetValue = 0; + tools::Long nRetValue = 0; while (nSecurityCount && (*rBuf == ' ' || *rBuf == 0x9)) { ++rBuf; @@ -466,7 +466,7 @@ static void CreateMtfReplacementAction( GDIMetaFile& rMtf, SvStream& rStrm, sal_ //there is no preview -> make a red box static void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead, - long nWidth, long nHeight, Graphic &rGraphic) + tools::Long nWidth, tools::Long nHeight, Graphic &rGraphic) { GDIMetaFile aMtf; ScopedVclPtrInstance< VirtualDevice > pVDev; @@ -664,15 +664,15 @@ ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* ) { pDest += 15; nSecurityCount = nRemainingBytes - 15; - long nWidth = ImplGetNumber(pDest, nSecurityCount); - long nHeight = ImplGetNumber(pDest, nSecurityCount); - long nBitDepth = ImplGetNumber(pDest, nSecurityCount); - long nScanLines = ImplGetNumber(pDest, nSecurityCount); + tools::Long nWidth = ImplGetNumber(pDest, nSecurityCount); + tools::Long nHeight = ImplGetNumber(pDest, nSecurityCount); + tools::Long nBitDepth = ImplGetNumber(pDest, nSecurityCount); + tools::Long nScanLines = ImplGetNumber(pDest, nSecurityCount); pDest = ImplSearchEntry(pDest, reinterpret_cast("%"), nSecurityCount, 1); // go to the first Scanline bOk = pDest && nWidth > 0 && nHeight > 0 && ( ( nBitDepth == 1 ) || ( nBitDepth == 8 ) ) && nScanLines; if (bOk) { - long nResult; + tools::Long nResult; bOk = !o3tl::checked_multiply(nWidth, nHeight, nResult) && nResult <= SAL_MAX_INT32/2/3; } if (bOk) @@ -684,10 +684,10 @@ ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* ) bool bIsValid = true; sal_uInt8 nDat = 0; char nByte; - for (long y = 0; bIsValid && y < nHeight; ++y) + for (tools::Long y = 0; bIsValid && y < nHeight; ++y) { int nBitsLeft = 0; - for (long x = 0; x < nWidth; ++x) + for (tools::Long x = 0; x < nWidth; ++x) { if ( --nBitsLeft < 0 ) { @@ -770,14 +770,14 @@ ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* ) { pDest += 14; nSecurityCount = std::min(nRemainingBytes - 14, 100); - long nNumb[4]; + tools::Long nNumb[4]; nNumb[0] = nNumb[1] = nNumb[2] = nNumb[3] = 0; for ( int i = 0; ( i < 4 ) && nSecurityCount; i++ ) { nNumb[ i ] = ImplGetNumber(pDest, nSecurityCount); } bool bFail = nSecurityCount == 0; - long nWidth(0), nHeight(0); + tools::Long nWidth(0), nHeight(0); if (!bFail) bFail = o3tl::checked_sub(nNumb[2], nNumb[0], nWidth) || o3tl::checked_add(nWidth, 1L, nWidth); if (!bFail) diff --git a/filter/source/graphicfilter/ipcd/ipcd.cxx b/filter/source/graphicfilter/ipcd/ipcd.cxx index 4aa33c116796..b2b585606286 100644 --- a/filter/source/graphicfilter/ipcd/ipcd.cxx +++ b/filter/source/graphicfilter/ipcd/ipcd.cxx @@ -184,7 +184,7 @@ void PCDReader::ReadOrientation() void PCDReader::ReadImage() { sal_uInt32 nx,ny,nW2,nH2,nYPair,ndy,nXPair; - long nL,nCb,nCr,nRed,nGreen,nBlue; + tools::Long nL,nCb,nCr,nRed,nGreen,nBlue; sal_uInt8 * pt; sal_uInt8 * pL0; // luminance for each pixel of the 1st row of the current pair of rows sal_uInt8 * pL1; // luminance for each pixel of the 2nd row of the current pair of rows @@ -271,31 +271,31 @@ void PCDReader::ReadImage() nXPair = nx >> 1; if ( ndy == 0 ) { - nL = static_cast(pL0[ nx ]); + nL = static_cast(pL0[ nx ]); if (( nx & 1 ) == 0 ) { - nCb = static_cast(pCb[ nXPair ]); - nCr = static_cast(pCr[ nXPair ]); + nCb = static_cast(pCb[ nXPair ]); + nCr = static_cast(pCr[ nXPair ]); } else { - nCb = ( static_cast(pCb[ nXPair ]) + static_cast(pCb[ nXPair + 1 ]) ) >> 1; - nCr = ( static_cast(pCr[ nXPair ]) + static_cast(pCr[ nXPair + 1 ]) ) >> 1; + nCb = ( static_cast(pCb[ nXPair ]) + static_cast(pCb[ nXPair + 1 ]) ) >> 1; + nCr = ( static_cast(pCr[ nXPair ]) + static_cast(pCr[ nXPair + 1 ]) ) >> 1; } } else { nL = pL1[ nx ]; if ( ( nx & 1 ) == 0 ) { - nCb = ( static_cast(pCb[ nXPair ]) + static_cast(pCbN[ nXPair ]) ) >> 1; - nCr = ( static_cast(pCr[ nXPair ]) + static_cast(pCrN[ nXPair ]) ) >> 1; + nCb = ( static_cast(pCb[ nXPair ]) + static_cast(pCbN[ nXPair ]) ) >> 1; + nCr = ( static_cast(pCr[ nXPair ]) + static_cast(pCrN[ nXPair ]) ) >> 1; } else { - nCb = ( static_cast(pCb[ nXPair ]) + static_cast(pCb[ nXPair + 1 ]) + - static_cast(pCbN[ nXPair ]) + static_cast(pCbN[ nXPair + 1 ]) ) >> 2; - nCr = ( static_cast(pCr[ nXPair ]) + static_cast(pCr[ nXPair + 1]) + - static_cast(pCrN[ nXPair ]) + static_cast(pCrN[ nXPair + 1 ]) ) >> 2; + nCb = ( static_cast(pCb[ nXPair ]) + static_cast(pCb[ nXPair + 1 ]) + + static_cast(pCbN[ nXPair ]) + static_cast(pCbN[ nXPair + 1 ]) ) >> 2; + nCr = ( static_cast(pCr[ nXPair ]) + static_cast(pCr[ nXPair + 1]) + + static_cast(pCrN[ nXPair ]) + static_cast(pCrN[ nXPair + 1 ]) ) >> 2; } } // conversion of nL,nCb,nCr in nRed,nGreen,nBlue: diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx index d494543fb1b4..43b872f09558 100644 --- a/filter/source/graphicfilter/ipict/ipict.cxx +++ b/filter/source/graphicfilter/ipict/ipict.cxx @@ -365,8 +365,8 @@ Point PictReader::ReadPoint() pPict->ReadInt16( ny ).ReadInt16( nx ); - Point aPoint( static_cast(nx) - aBoundingRect.Left(), - static_cast(ny) - aBoundingRect.Top() ); + Point aPoint( static_cast(nx) - aBoundingRect.Left(), + static_cast(ny) - aBoundingRect.Top() ); SAL_INFO("filter.pict", "ReadPoint: " << aPoint); return aPoint; @@ -378,7 +378,7 @@ Point PictReader::ReadDeltaH(Point aBase) pPict->ReadChar( reinterpret_cast(ndh) ); - return Point( aBase.X() + static_cast(ndh), aBase.Y() ); + return Point( aBase.X() + static_cast(ndh), aBase.Y() ); } Point PictReader::ReadDeltaV(Point aBase) @@ -387,7 +387,7 @@ Point PictReader::ReadDeltaV(Point aBase) pPict->ReadChar( reinterpret_cast(ndv) ); - return Point( aBase.X(), aBase.Y() + static_cast(ndv) ); + return Point( aBase.X(), aBase.Y() + static_cast(ndv) ); } Point PictReader::ReadUnsignedDeltaH(Point aBase) @@ -396,7 +396,7 @@ Point PictReader::ReadUnsignedDeltaH(Point aBase) pPict->ReadUChar( ndh ); - return Point( aBase.X() + static_cast(ndh), aBase.Y() ); + return Point( aBase.X() + static_cast(ndh), aBase.Y() ); } Point PictReader::ReadUnsignedDeltaV(Point aBase) @@ -405,7 +405,7 @@ Point PictReader::ReadUnsignedDeltaV(Point aBase) pPict->ReadUChar( ndv ); - return Point( aBase.X(), aBase.Y() + static_cast(ndv) ); + return Point( aBase.X(), aBase.Y() + static_cast(ndv) ); } Size PictReader::ReadSize() @@ -414,7 +414,7 @@ Size PictReader::ReadSize() pPict->ReadInt16( ny ).ReadInt16( nx ); - return Size( static_cast(nx), static_cast(ny) ); + return Size( static_cast(nx), static_cast(ny) ); } Color PictReader::ReadColor() @@ -1444,7 +1444,7 @@ sal_uInt64 PictReader::ReadData(sal_uInt16 nOpcode) case 0x000d: // TxSize { pPict->ReadUInt16( nUSHORT ); - aActFont.SetFontSize( Size( 0, static_cast(nUSHORT) ) ); + aActFont.SetFontSize( Size( 0, static_cast(nUSHORT) ) ); eActMethod = PictDrawingMethod::UNDEFINED; nDataSize=2; } diff --git a/filter/source/graphicfilter/ipict/shape.cxx b/filter/source/graphicfilter/ipict/shape.cxx index f058dcf5d87f..79643123639c 100644 --- a/filter/source/graphicfilter/ipict/shape.cxx +++ b/filter/source/graphicfilter/ipict/shape.cxx @@ -40,11 +40,11 @@ namespace PictReaderShapePrivate { when we draw a frame in wide length*/ static tools::Rectangle contractRectangle(bool drawFrame, tools::Rectangle const &rect, Size const &pSize) { if (!drawFrame) return rect; - long penSize=(pSize.Width()+pSize.Height())/2; + tools::Long penSize=(pSize.Width()+pSize.Height())/2; if (2*penSize > rect.Right()-rect.Left()) penSize = (rect.Right()-rect.Left()+1)/2; if (2*penSize > rect.Bottom()-rect.Top()) penSize = (rect.Bottom()-rect.Top()+1)/2; - long const X[2] = { rect.Left()+penSize/2, rect.Right()-(penSize+1)/2 }; - long const Y[2] = { rect.Top()+penSize/2, rect.Bottom()-(penSize+1)/2 }; + tools::Long const X[2] = { rect.Left()+penSize/2, rect.Right()-(penSize+1)/2 }; + tools::Long const Y[2] = { rect.Top()+penSize/2, rect.Bottom()-(penSize+1)/2 }; return tools::Rectangle(Point(X[0],Y[0]), Point(X[1], Y[1])); } } @@ -52,7 +52,7 @@ namespace PictReaderShapePrivate { namespace PictReaderShape { //--------- draws a horizontal/vertical/small line (by creating a "rectangle/polygon") --------- static bool drawLineHQ(VirtualDevice *dev, Point const &orig, Point const &dest, Size const &pSize) { - long dir[2] = { dest.X()-orig.X(), dest.Y()-orig.Y() }; + tools::Long dir[2] = { dest.X()-orig.X(), dest.Y()-orig.Y() }; bool vertic = dir[0] == 0; bool horiz = dir[1] == 0; if (!horiz && !vertic && dir[0]*dir[0]+dir[1]*dir[1] > 25) return false; @@ -60,7 +60,7 @@ namespace PictReaderShape { using namespace basegfx; B2DPolygon poly; if (horiz || vertic) { - long X[2]={ orig.X(), dest.X() }, Y[2] = { orig.Y(), dest.Y() }; + tools::Long X[2]={ orig.X(), dest.X() }, Y[2] = { orig.Y(), dest.Y() }; if (horiz) { if (X[0] < X[1]) X[1]+=pSize.Width(); else X[0]+=pSize.Width(); @@ -76,11 +76,11 @@ namespace PictReaderShape { poly.append(B2DPoint(X[0], Y[0])); } else { - long origPt[4][2] = { { orig.X(), orig.Y() }, { orig.X()+pSize.Width(), orig.Y() }, + tools::Long origPt[4][2] = { { orig.X(), orig.Y() }, { orig.X()+pSize.Width(), orig.Y() }, { orig.X()+pSize.Width(), orig.Y()+pSize.Height() }, { orig.X(), orig.Y()+pSize.Height() }}; int origAvoid = dir[0] > 0 ? (dir[1] > 0 ? 2 : 1) : (dir[1] > 0 ? 3 : 0); - long destPt[4][2] = { { dest.X(), dest.Y() }, { dest.X()+pSize.Width(), dest.Y() }, + tools::Long destPt[4][2] = { { dest.X(), dest.Y() }, { dest.X()+pSize.Width(), dest.Y() }, { dest.X()+pSize.Width(), dest.Y()+pSize.Height() }, { dest.X(), dest.Y()+pSize.Height() }}; for (int w = origAvoid+1; w < origAvoid+4; w++) { @@ -111,8 +111,8 @@ namespace PictReaderShape { void drawLine(VirtualDevice *dev, Point const &orig, Point const &dest, Size const &pSize) { if (drawLineHQ(dev,orig,dest,pSize)) return; - long penSize=(pSize.Width()+pSize.Height())/2; - long decal[2] = { pSize.Width()/2, pSize.Height()/2}; + tools::Long penSize=(pSize.Width()+pSize.Height())/2; + tools::Long decal[2] = { pSize.Width()/2, pSize.Height()/2}; using namespace basegfx; B2DPolygon poly; @@ -128,8 +128,8 @@ namespace PictReaderShape { void drawRectangle(VirtualDevice *dev, bool drawFrame, tools::Rectangle const &orig, Size const &pSize) { int penSize=(pSize.Width()+pSize.Height())/2; tools::Rectangle rect = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize); - long const X[2] = { rect.Left(), rect.Right() }; - long const Y[2] = { rect.Top(), rect.Bottom() }; + tools::Long const X[2] = { rect.Left(), rect.Right() }; + tools::Long const Y[2] = { rect.Top(), rect.Bottom() }; using namespace basegfx; B2DPolygon poly; @@ -148,8 +148,8 @@ namespace PictReaderShape { int penSize=(pSize.Width()+pSize.Height())/2; tools::Rectangle oval = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize); using namespace basegfx; - long const X[2] = { oval.Left(), oval.Right() }; - long const Y[2] = { oval.Top(), oval.Bottom() }; + tools::Long const X[2] = { oval.Left(), oval.Right() }; + tools::Long const Y[2] = { oval.Top(), oval.Bottom() }; B2DPoint center(0.5*(X[1]+X[0]), 0.5*(Y[1]+Y[0])); B2DPolygon poly = basegfx::utils::createPolygonFromEllipse(center, 0.5*(X[1]-X[0]), 0.5*(Y[1]-Y[0])); if (drawFrame) @@ -167,8 +167,8 @@ namespace PictReaderShape { // pict angle are CW with 0 at twelve o'clock (with Y-axis inverted)... double angl1 = angle1-M_PI_2; double angl2 = angle2-M_PI_2; - long const X[2] = { arc.Left(), arc.Right() }; - long const Y[2] = { arc.Top(), arc.Bottom() }; + tools::Long const X[2] = { arc.Left(), arc.Right() }; + tools::Long const Y[2] = { arc.Top(), arc.Bottom() }; B2DPoint center(0.5*(X[1]+X[0]), 0.5*(Y[1]+Y[0])); // We must have angl1 between 0 and F_2PI @@ -198,10 +198,10 @@ namespace PictReaderShape { tools::Rectangle oval = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize); int ovalW=ovalSize.Width(), ovalH=ovalSize.Height(); using namespace basegfx; - long const X[2] = { oval.Left(), oval.Right() }; - long const Y[2] = { oval.Top(), oval.Bottom() }; - long width = X[1] - X[0]; - long height = Y[1] - Y[0]; + tools::Long const X[2] = { oval.Left(), oval.Right() }; + tools::Long const Y[2] = { oval.Top(), oval.Bottom() }; + tools::Long width = X[1] - X[0]; + tools::Long height = Y[1] - Y[0]; if (ovalW > width) ovalW = static_cast< int >( width ); if (ovalH > height) ovalH = static_cast< int >( height ); @@ -217,7 +217,7 @@ namespace PictReaderShape { //-------------------- draws a polygon -------------------- void drawPolygon(VirtualDevice *dev, bool drawFrame, tools::Polygon const &orig, Size const &pSize) { int penSize=(pSize.Width()+pSize.Height())/2; - long decalTL[2] = {0, 0}, decalBR[2] = { pSize.Width(), pSize.Height()}; + tools::Long decalTL[2] = {0, 0}, decalBR[2] = { pSize.Width(), pSize.Height()}; if (drawFrame) { decalTL[0] += penSize/2; decalTL[1] += penSize/2; decalBR[0] -= (penSize+1)/2; decalBR[1] -= (penSize+1)/2; diff --git a/filter/source/graphicfilter/itga/itga.cxx b/filter/source/graphicfilter/itga/itga.cxx index ddf2db50f30d..beec1bc8781e 100644 --- a/filter/source/graphicfilter/itga/itga.cxx +++ b/filter/source/graphicfilter/itga/itga.cxx @@ -268,7 +268,7 @@ bool TGAReader::ImplReadBody() sal_uInt8 nRed, nGreen, nBlue, nRunCount, nDummy, nDepth; // this four variables match the image direction - long nY, nYAdd, nX, nXAdd, nXStart; + tools::Long nY, nYAdd, nX, nXAdd, nXStart; nX = nXStart = nY = 0; nXCount = nYCount = 0; diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx index 7d62e3f45500..370371ece4fe 100644 --- a/filter/source/graphicfilter/itiff/itiff.cxx +++ b/filter/source/graphicfilter/itiff/itiff.cxx @@ -124,9 +124,9 @@ private: bool HasAlphaChannel() const; - void SetPixel(long nY, long nX, sal_uInt8 cIndex); - void SetPixel(long nY, long nX, Color c); - void SetPixelAlpha(long nY, long nX, sal_uInt8 nAlpha); + void SetPixel(tools::Long nY, tools::Long nX, sal_uInt8 cIndex); + void SetPixel(tools::Long nY, tools::Long nX, Color c); + void SetPixelAlpha(tools::Long nY, tools::Long nX, sal_uInt8 nAlpha); public: @@ -825,13 +825,13 @@ sal_uInt32 TIFFReader::GetBits( const sal_uInt8 * pSrc, sal_uInt32 nBitsPos, sal return nRes; } -void TIFFReader::SetPixel(long nY, long nX, sal_uInt8 cIndex) +void TIFFReader::SetPixel(tools::Long nY, tools::Long nX, sal_uInt8 cIndex) { maBitmap[(maBitmapPixelSize.Width() * nY + nX) * (HasAlphaChannel() ? 4 : 3)] = cIndex; nLargestPixelIndex = std::max(nLargestPixelIndex, cIndex); } -void TIFFReader::SetPixel(long nY, long nX, Color c) +void TIFFReader::SetPixel(tools::Long nY, tools::Long nX, Color c) { auto p = maBitmap.data() + ((maBitmapPixelSize.Width() * nY + nX) * (HasAlphaChannel() ? 4 : 3)); *p = c.GetRed(); @@ -846,7 +846,7 @@ void TIFFReader::SetPixel(long nY, long nX, Color c) } } -void TIFFReader::SetPixelAlpha(long nY, long nX, sal_uInt8 nAlpha) +void TIFFReader::SetPixelAlpha(tools::Long nY, tools::Long nX, sal_uInt8 nAlpha) { assert(HasAlphaChannel()); maBitmap[((maBitmapPixelSize.Width() * nY + nX) * 4) + 3] = nAlpha; @@ -980,7 +980,7 @@ bool TIFFReader::ConvertScanline(sal_Int32 nY) nSamp[ ns ]= static_cast(GetBits( getMapData(ns), nx * nBitsPerSample, nBitsPerSample )); } } - const long nBlack = nSamp[ 3 ]; + const tools::Long nBlack = nSamp[ 3 ]; nRed = static_cast(std::max( 0L, 255L - ( ( static_cast(nSamp[ 0 ]) + nBlack - static_cast(nMinSampleValue << 1U ) ) * 255L/static_cast(nMaxSampleValue-nMinSampleValue) ) )); nGreen = static_cast(std::max( 0L, 255L - ( ( static_cast(nSamp[ 1 ]) + nBlack - static_cast(nMinSampleValue << 1U ) ) * diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index a32eed5a017d..31ec360272a5 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -1158,9 +1158,9 @@ static void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, S vcl::bitmap::RawBitmap aBitmap(aBitmapSizePixel, 24); - for ( long nY = 0; nY < aBitmapSizePixel.Height(); nY++ ) + for ( tools::Long nY = 0; nY < aBitmapSizePixel.Height(); nY++ ) { - for ( long nX = 0; nX < aBitmapSizePixel.Width(); nX++ ) + for ( tools::Long nX = 0; nX < aBitmapSizePixel.Width(); nX++ ) { double fX = static_cast< double >( nX ) / aBitmapSizePixel.Width(); double fY = static_cast< double >( nY ) / aBitmapSizePixel.Height(); @@ -1406,10 +1406,10 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co { Bitmap::ScopedReadAccess pRead(aBmp); - for (long y = 0; y < aResult.Height(); ++y) + for (tools::Long y = 0; y < aResult.Height(); ++y) { Scanline pScanlineRead = pRead->GetScanline( y ); - for (long x = 0; x < aResult.Width(); ++x) + for (tools::Long x = 0; x < aResult.Width(); ++x) { Color aReadColor; if (pRead->HasPalette()) @@ -3126,8 +3126,8 @@ sal_uInt32 SvxMSDffManager::ScalePt( sal_uInt32 nVal ) const { MapUnit eMap = pSdrModel->GetScaleUnit(); Fraction aFact( GetMapFactor( MapUnit::MapPoint, eMap ).X() ); - long aMul = aFact.GetNumerator(); - long aDiv = aFact.GetDenominator() * 65536; + tools::Long aMul = aFact.GetNumerator(); + tools::Long aDiv = aFact.GetDenominator() * 65536; aFact = Fraction( aMul, aDiv ); // try again to shorten it return BigMulDiv( nVal, aFact.GetNumerator(), aFact.GetDenominator() ); } @@ -3137,7 +3137,7 @@ sal_Int32 SvxMSDffManager::ScalePoint( sal_Int32 nVal ) const return BigMulDiv( nVal, nPntMul, nPntDiv ); }; -void SvxMSDffManager::SetModel(SdrModel* pModel, long nApplicationScale) +void SvxMSDffManager::SetModel(SdrModel* pModel, tools::Long nApplicationScale) { pSdrModel = pModel; if( pModel && (0 < nApplicationScale) ) @@ -3146,8 +3146,8 @@ void SvxMSDffManager::SetModel(SdrModel* pModel, long nApplicationScale) // WW on the other side uses twips, i.e. 1440DPI. MapUnit eMap = pSdrModel->GetScaleUnit(); Fraction aFact( GetMapFactor(MapUnit::MapInch, eMap).X() ); - long nMul=aFact.GetNumerator(); - long nDiv=aFact.GetDenominator()*nApplicationScale; + tools::Long nMul=aFact.GetNumerator(); + tools::Long nDiv=aFact.GetDenominator()*nApplicationScale; aFact=Fraction(nMul,nDiv); // try again to shorten it // For 100TH_MM -> 2540/576=635/144 // For Twip -> 1440/576=5/2 @@ -4077,8 +4077,8 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r sal_Int32 nHalfHeight = ( aClientRect.GetHeight() + 1 ) >> 1; Point aTopLeft( aClientRect.Left() + nHalfWidth - nHalfHeight, aClientRect.Top() + nHalfHeight - nHalfWidth ); - const long nRotatedWidth = aClientRect.GetHeight(); - const long nRotatedHeight = aClientRect.GetWidth(); + const tools::Long nRotatedWidth = aClientRect.GetHeight(); + const tools::Long nRotatedHeight = aClientRect.GetWidth(); Size aNewSize(nRotatedWidth, nRotatedHeight); tools::Rectangle aNewRect( aTopLeft, aNewSize ); aClientRect = aNewRect; @@ -4286,7 +4286,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r { // apply rotation to the BoundingBox BEFORE an object has been generated if( mnFix16Angle ) { - long nAngle = mnFix16Angle; + tools::Long nAngle = mnFix16Angle; if ( ( nAngle > 4500 && nAngle <= 13500 ) || ( nAngle > 22500 && nAngle <= 31500 ) ) { sal_Int32 nHalfWidth = ( aObjData.aBoundRect.GetWidth() + 1 ) >> 1; @@ -5258,7 +5258,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt, { case 9000: { - long nWidth = rTextRect.GetWidth(); + tools::Long nWidth = rTextRect.GetWidth(); rTextRect.SetRight( rTextRect.Left() + rTextRect.GetHeight() ); rTextRect.SetBottom( rTextRect.Top() + nWidth ); @@ -5275,7 +5275,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt, break; case 27000: { - long nWidth = rTextRect.GetWidth(); + tools::Long nWidth = rTextRect.GetWidth(); rTextRect.SetRight( rTextRect.Left() + rTextRect.GetHeight() ); rTextRect.SetBottom( rTextRect.Top() + nWidth ); @@ -5429,7 +5429,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt, if (nTextRotationAngle) { - long nMinWH = rTextRect.GetWidth() < rTextRect.GetHeight() ? + tools::Long nMinWH = rTextRect.GetWidth() < rTextRect.GetHeight() ? rTextRect.GetWidth() : rTextRect.GetHeight(); nMinWH /= 2; Point aPivot(rTextRect.TopLeft()); @@ -5677,7 +5677,7 @@ SvxMSDffManager::SvxMSDffManager(SvStream& rStCtrl_, sal_uInt32 nOffsDgg_, SvStream* pStData_, SdrModel* pSdrModel_,// see SetModel() below - long nApplicationScale, + tools::Long nApplicationScale, Color mnDefaultColor_, SvStream* pStData2_, bool bSkipImages ) @@ -6078,7 +6078,7 @@ bool SvxMSDffManager::GetShapeGroupContainerData( SvStream& rSt, sal_uInt16 nDrawingContainerId ) { sal_uInt8 nVer;sal_uInt16 nInst;sal_uInt16 nFbt;sal_uInt32 nLength; - long nStartShapeGroupCont = rSt.Tell(); + tools::Long nStartShapeGroupCont = rSt.Tell(); // We are now in a shape group container (conditionally multiple per page) // and we now have to iterate through all contained shape containers bool bFirst = !bPatriarch; @@ -6121,7 +6121,7 @@ bool SvxMSDffManager::GetShapeContainerData( SvStream& rSt, sal_uInt16 nDrawingContainerId ) { sal_uInt8 nVer;sal_uInt16 nInst;sal_uInt16 nFbt;sal_uInt32 nLength; - long nStartShapeCont = rSt.Tell(); + tools::Long nStartShapeCont = rSt.Tell(); // We are in a shape container (possibly more than one per shape group) and we now // have to fetch the shape id and file position (to be able to access them again later) diff --git a/filter/source/msfilter/mstoolbar.cxx b/filter/source/msfilter/mstoolbar.cxx index fee6cae04c2d..441b60c3ca98 100644 --- a/filter/source/msfilter/mstoolbar.cxx +++ b/filter/source/msfilter/mstoolbar.cxx @@ -31,7 +31,7 @@ using namespace com::sun::star; int TBBase::nIndent = 0; -void CustomToolBarImportHelper::ScaleImage( uno::Reference< graphic::XGraphic >& xGraphic, long nNewSize ) +void CustomToolBarImportHelper::ScaleImage( uno::Reference< graphic::XGraphic >& xGraphic, tools::Long nNewSize ) { Graphic aGraphic( xGraphic ); Size aSize = aGraphic.GetSizePixel(); diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 786c538e18ea..e63d8eb588b7 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -2512,7 +2512,7 @@ Size SdrPowerPointImport::GetPageSize() const { MapUnit eMap = pSdrModel->GetScaleUnit(); bool bInch = IsInch( eMap ); - long nInchMul = 1, nInchDiv = 1; + tools::Long nInchMul = 1, nInchDiv = 1; if ( bInch ) { // temporarily convert size (for rounding it) from inch to metric units Fraction aFact(GetMapFactor(eMap,MapUnit::Map100thMM).X()); @@ -5655,15 +5655,15 @@ void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, T if( pAcc ) { sal_uLong nRt = 0, nGn = 0, nBl = 0; - const long nWidth = aSize.Width(); - const long nHeight = aSize.Height(); + const tools::Long nWidth = aSize.Width(); + const tools::Long nHeight = aSize.Height(); if( pAcc->HasPalette() ) { - for( long nY = 0; nY < nHeight; nY++ ) + for( tools::Long nY = 0; nY < nHeight; nY++ ) { Scanline pScanline = pAcc->GetScanline( nY ); - for( long nX = 0; nX < nWidth; nX++ ) + for( tools::Long nX = 0; nX < nWidth; nX++ ) { const BitmapColor& rCol = pAcc->GetPaletteColor( pAcc->GetIndexFromData( pScanline, nX ) ); nRt+=rCol.GetRed(); nGn+=rCol.GetGreen(); nBl+=rCol.GetBlue(); @@ -5672,10 +5672,10 @@ void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, T } else { - for( long nY = 0; nY < nHeight; nY++ ) + for( tools::Long nY = 0; nY < nHeight; nY++ ) { Scanline pScanline = pAcc->GetScanline( nY ); - for( long nX = 0; nX < nWidth; nX++ ) + for( tools::Long nX = 0; nX < nWidth; nX++ ) { const BitmapColor aCol( pAcc->GetPixelFromData( pScanline, nX ) ); nRt+=aCol.GetRed(); nGn+=aCol.GetGreen(); nBl+=aCol.GetBlue(); diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx index 279b9e6856bd..52421c99f892 100644 --- a/filter/source/msfilter/util.cxx +++ b/filter/source/msfilter/util.cxx @@ -53,7 +53,7 @@ sal_uInt32 BGRToRGB(sal_uInt32 nColor) return nColor; } -DateTime DTTM2DateTime( long lDTTM ) +DateTime DTTM2DateTime( tools::Long lDTTM ) { /* mint short :6 0000003F minutes (0-59) diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 7fa83e05bc75..2abe9d372080 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -1113,7 +1113,7 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSi aFont.SetWidthType( WIDTH_NORMAL ); aFont.SetWeight( WEIGHT_NORMAL ); aFont.SetAlignment( ALIGN_BOTTOM ); - long nTextWidth = rPageSize.Width(); + tools::Long nTextWidth = rPageSize.Width(); if( rPageSize.Width() < rPageSize.Height() ) { nTextWidth = rPageSize.Height(); @@ -1130,7 +1130,7 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSi { if (w == 0) break; - long nNewHeight = aFont.GetFontHeight() * nTextWidth / w; + tools::Long nNewHeight = aFont.GetFontHeight() * nTextWidth / w; if( nNewHeight == aFont.GetFontHeight() ) { nNewHeight--; @@ -1140,7 +1140,7 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSi aFont.SetFontHeight( nNewHeight ); pDev->SetFont( aFont ); } - long nTextHeight = pDev->GetTextHeight(); + tools::Long nTextHeight = pDev->GetTextHeight(); // leave some maneuvering room for rounding issues, also // some fonts go a little outside ascent/descent nTextHeight += nTextHeight/20; @@ -1194,7 +1194,7 @@ void PDFExport::ImplWriteTiledWatermark( vcl::PDFWriter& rWriter, const Size& rP pDev->SetMapMode( MapMode( MapUnit::MapPoint ) ); int w = 0; int watermarkcount = ((rPageSize.Width()) / 200)+1; - long nTextWidth = rPageSize.Width() / (watermarkcount*1.5); + tools::Long nTextWidth = rPageSize.Width() / (watermarkcount*1.5); OUString oneLineText = watermark; if(watermark.getLength() > lineLength) @@ -1205,7 +1205,7 @@ void PDFExport::ImplWriteTiledWatermark( vcl::PDFWriter& rWriter, const Size& rP if(w==0) break; - long nNewHeight = aFont.GetFontHeight() * nTextWidth / w; + tools::Long nNewHeight = aFont.GetFontHeight() * nTextWidth / w; aFont.SetFontHeight(nNewHeight); pDev->SetFont( aFont ); } diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx index 41cd98e4dbf7..1d2d5110dc2a 100644 --- a/filter/source/svg/svgfilter.cxx +++ b/filter/source/svg/svgfilter.cxx @@ -326,7 +326,7 @@ bool SVGFilter::filterImpressOrDraw( const Sequence< PropertyValue >& rDescripto static_cast< double >(pTargetSdrPage->GetRightBorder()) / aPageSize.Width() + static_cast< double >(pTargetSdrPage->GetUpperBorder()) / aPageSize.Height() + static_cast< double >(pTargetSdrPage->GetLowerBorder()) / aPageSize.Height()) / 4.0); - const long nAllBorder(basegfx::fround((aGraphicSize.Width() + aGraphicSize.Height()) * fBorderRelation * 0.5)); + const tools::Long nAllBorder(basegfx::fround((aGraphicSize.Width() + aGraphicSize.Height()) * fBorderRelation * 0.5)); // Adapt PageSize and Border stuff. To get all MasterPages and PresObjs // correctly adapted, do not just use diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 37c301f2a3bf..f92204ac3442 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -812,12 +812,12 @@ void SVGTextWriter::addFontAttributes( bool bIsTextContainer ) return; const OUString& rsCurFontName = maCurrentFont.GetFamilyName(); - long int nCurFontSize = maCurrentFont.GetFontHeight(); + tools::Long nCurFontSize = maCurrentFont.GetFontHeight(); FontItalic eCurFontItalic = maCurrentFont.GetItalic(); FontWeight eCurFontWeight = maCurrentFont.GetWeight(); const OUString& rsParFontName = maParentFont.GetFamilyName(); - long int nParFontSize = maParentFont.GetFontHeight(); + tools::Long nParFontSize = maParentFont.GetFontHeight(); FontItalic eParFontItalic = maParentFont.GetItalic(); FontWeight eParFontWeight = maParentFont.GetWeight(); @@ -1743,7 +1743,7 @@ SVGActionWriter::~SVGActionWriter() } -long SVGActionWriter::ImplMap( sal_Int32 nVal ) const +tools::Long SVGActionWriter::ImplMap( sal_Int32 nVal ) const { Size aSz( nVal, nVal ); @@ -1810,7 +1810,7 @@ OUString SVGActionWriter::GetPathString( const tools::PolyPolygon& rPolyPoly, bo const OUString aComma( "," ); Point aPolyPoint; - for( long i = 0, nCount = rPolyPoly.Count(); i < nCount; i++ ) + for( tools::Long i = 0, nCount = rPolyPoly.Count(); i < nCount; i++ ) { const tools::Polygon& rPoly = rPolyPoly[ static_cast(i) ]; sal_uInt16 n = 1, nSize = rPoly.GetSize(); @@ -1908,7 +1908,7 @@ void SVGActionWriter::ImplWriteLine( const Point& rPt1, const Point& rPt2, } -void SVGActionWriter::ImplWriteRect( const tools::Rectangle& rRect, long nRadX, long nRadY ) +void SVGActionWriter::ImplWriteRect( const tools::Rectangle& rRect, tools::Long nRadX, tools::Long nRadY ) { tools::Rectangle aRect; @@ -1929,7 +1929,7 @@ void SVGActionWriter::ImplWriteRect( const tools::Rectangle& rRect, long nRadX, } -void SVGActionWriter::ImplWriteEllipse( const Point& rCenter, long nRadX, long nRadY ) +void SVGActionWriter::ImplWriteEllipse( const Point& rCenter, tools::Long nRadX, tools::Long nRadY ) { Point aCenter; @@ -2356,9 +2356,9 @@ void SVGActionWriter::ImplWriteGradientStop( const Color& rColor, double fOffset Color SVGActionWriter::ImplGetColorWithIntensity( const Color& rColor, sal_uInt16 nIntensity ) { - sal_uInt8 nNewRed = static_cast( static_cast(rColor.GetRed()) * nIntensity / 100 ); - sal_uInt8 nNewGreen = static_cast( static_cast(rColor.GetGreen()) * nIntensity / 100 ); - sal_uInt8 nNewBlue = static_cast( static_cast(rColor.GetBlue()) * nIntensity / 100 ); + sal_uInt8 nNewRed = static_cast( static_cast(rColor.GetRed()) * nIntensity / 100 ); + sal_uInt8 nNewGreen = static_cast( static_cast(rColor.GetGreen()) * nIntensity / 100 ); + sal_uInt8 nNewBlue = static_cast( static_cast(rColor.GetBlue()) * nIntensity / 100 ); return Color( nNewRed, nNewGreen, nNewBlue); } @@ -2367,16 +2367,16 @@ Color SVGActionWriter::ImplGetGradientColor( const Color& rStartColor, const Color& rEndColor, double fOffset ) { - long nRedStep = rEndColor.GetRed() - rStartColor.GetRed(); - long nNewRed = rStartColor.GetRed() + static_cast( nRedStep * fOffset ); + tools::Long nRedStep = rEndColor.GetRed() - rStartColor.GetRed(); + tools::Long nNewRed = rStartColor.GetRed() + static_cast( nRedStep * fOffset ); nNewRed = ( nNewRed < 0 ) ? 0 : ( nNewRed > 0xFF) ? 0xFF : nNewRed; - long nGreenStep = rEndColor.GetGreen() - rStartColor.GetGreen(); - long nNewGreen = rStartColor.GetGreen() + static_cast( nGreenStep * fOffset ); + tools::Long nGreenStep = rEndColor.GetGreen() - rStartColor.GetGreen(); + tools::Long nNewGreen = rStartColor.GetGreen() + static_cast( nGreenStep * fOffset ); nNewGreen = ( nNewGreen < 0 ) ? 0 : ( nNewGreen > 0xFF) ? 0xFF : nNewGreen; - long nBlueStep = rEndColor.GetBlue() - rStartColor.GetBlue(); - long nNewBlue = rStartColor.GetBlue() + static_cast( nBlueStep * fOffset ); + tools::Long nBlueStep = rEndColor.GetBlue() - rStartColor.GetBlue(); + tools::Long nNewBlue = rStartColor.GetBlue() + static_cast( nBlueStep * fOffset ); nNewBlue = ( nNewBlue < 0 ) ? 0 : ( nNewBlue > 0xFF) ? 0xFF : nNewBlue; return Color( static_cast(nNewRed), static_cast(nNewGreen), static_cast(nNewBlue) ); @@ -2443,7 +2443,7 @@ void SVGActionWriter::ImplWriteMask(GDIMetaFile& rMtf, const Point& rDestPt, con = aSrcSize.Width() ? static_cast(rDestSize.Width()) / aSrcSize.Width() : 1.0; const double fScaleY = aSrcSize.Height() ? static_cast(rDestSize.Height()) / aSrcSize.Height() : 1.0; - long nMoveX, nMoveY; + tools::Long nMoveX, nMoveY; if (fScaleX != 1.0 || fScaleY != 1.0) { @@ -2475,7 +2475,7 @@ void SVGActionWriter::ImplWriteMask(GDIMetaFile& rMtf, const Point& rDestPt, con void SVGActionWriter::ImplWriteText( const Point& rPos, const OUString& rText, - const long* pDXArray, long nWidth ) + const tools::Long* pDXArray, tools::Long nWidth ) { const FontMetric aMetric( mpVDev->GetFontMetric() ); @@ -2519,7 +2519,7 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const OUString& rText, { if( aMetric.IsShadow() ) { - long nOff = 1 + ((aMetric.GetLineHeight()-24)/24); + tools::Long nOff = 1 + ((aMetric.GetLineHeight()-24)/24); if ( aMetric.IsOutline() ) nOff += 6; @@ -2566,7 +2566,7 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const OUString& rText, void SVGActionWriter::ImplWriteText( const Point& rPos, const OUString& rText, - const long* pDXArray, long nWidth, + const tools::Long* pDXArray, tools::Long nWidth, Color aTextColor ) { sal_Int32 nLen = rText.getLength(); @@ -2594,7 +2594,7 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const OUString& rText, { aNormSize = Size( mpVDev->GetTextArray( rText, xTmpArray.get() ), 0 ); } - long* pDX = xTmpArray.get(); + tools::Long* pDX = xTmpArray.get(); // if text is rotated, set transform matrix at new g element if( rFont.GetOrientation() ) @@ -2646,7 +2646,7 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const OUString& rText, if( nWidth && aNormSize.Width() && ( nWidth != aNormSize.Width() ) ) { - long i; + tools::Long i; const double fFactor = static_cast(nWidth) / aNormSize.Width(); for( i = 0; i < ( nLen - 1 ); i++ ) @@ -2714,11 +2714,11 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const OUString& rText, return; tools::Polygon aPoly( 4 ); - const long nLineHeight = std::max( FRound( aMetric.GetLineHeight() * 0.05 ), 1 ); + const tools::Long nLineHeight = std::max( FRound( aMetric.GetLineHeight() * 0.05 ), 1 ); if( rFont.GetStrikeout() ) { - const long nYLinePos = aBaseLinePos.Y() - FRound( aMetric.GetAscent() * 0.26 ); + const tools::Long nYLinePos = aBaseLinePos.Y() - FRound( aMetric.GetAscent() * 0.26 ); aPoly[ 0 ].setX( aBaseLinePos.X() ); aPoly[ 0 ].setY( nYLinePos - ( nLineHeight >> 1 ) ); aPoly[ 1 ].setX( aBaseLinePos.X() + aNormSize.Width() - 1 ); aPoly[ 1 ].setY( aPoly[ 0 ].Y() ); @@ -2730,7 +2730,7 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const OUString& rText, if( rFont.GetUnderline() ) { - const long nYLinePos = aBaseLinePos.Y() + ( nLineHeight << 1 ); + const tools::Long nYLinePos = aBaseLinePos.Y() + ( nLineHeight << 1 ); aPoly[ 0 ].setX( aBaseLinePos.X() ); aPoly[ 0 ].setY( nYLinePos - ( nLineHeight >> 1 ) ); aPoly[ 1 ].setX( aBaseLinePos.X() + aNormSize.Width() - 1 ); aPoly[ 1 ].setY( aPoly[ 0 ].Y() ); diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx index b1c7954b7a21..f75f5d01e786 100644 --- a/filter/source/svg/svgwriter.hxx +++ b/filter/source/svg/svgwriter.hxx @@ -187,7 +187,7 @@ class GDIMetaFile; struct BulletListItemInfo { - long nFontSize; + tools::Long nFontSize; Color aColor; Point aPos; sal_Unicode cBulletChar; @@ -216,7 +216,7 @@ class SVGTextWriter final OUString maTextOpacity; sal_Int32 mnLeftTextPortionLength; Point maTextPos; - long int mnTextWidth; + tools::Long mnTextWidth; bool mbPositioningNeeded; bool mbIsNewListItem; sal_Int16 meNumberingType; @@ -315,7 +315,7 @@ private: bool mbIsPlaceholderShape; - long ImplMap( sal_Int32 nVal ) const; + tools::Long ImplMap( sal_Int32 nVal ) const; Point& ImplMap( const Point& rPt, Point& rDstPt ) const; Size& ImplMap( const Size& rSz, Size& rDstSz ) const; void ImplMap( const tools::Rectangle& rRect, tools::Rectangle& rDstRect ) const; @@ -323,8 +323,8 @@ private: tools::PolyPolygon& ImplMap( const tools::PolyPolygon& rPolyPoly, tools::PolyPolygon& rDstPolyPoly ) const; void ImplWriteLine( const Point& rPt1, const Point& rPt2, const Color* pLineColor = nullptr ); - void ImplWriteRect( const tools::Rectangle& rRect, long nRadX = 0, long nRadY = 0 ); - void ImplWriteEllipse( const Point& rCenter, long nRadX, long nRadY ); + void ImplWriteRect( const tools::Rectangle& rRect, tools::Long nRadX = 0, tools::Long nRadY = 0 ); + void ImplWriteEllipse( const Point& rCenter, tools::Long nRadX, tools::Long nRadY ); void ImplWritePattern( const tools::PolyPolygon& rPolyPoly, const Hatch* pHatch, const Gradient* pGradient, sal_uInt32 nWriteFlags ); void ImplAddLineAttr( const LineInfo &rAttrs ); void ImplWritePolyPolygon( const tools::PolyPolygon& rPolyPoly, bool bLineOnly, @@ -340,8 +340,8 @@ private: static Color ImplGetColorWithIntensity( const Color& rColor, sal_uInt16 nIntensity ); static Color ImplGetGradientColor( const Color& rStartColor, const Color& rEndColor, double fOffset ); void ImplWriteMask( GDIMetaFile& rMtf, const Point& rDestPt, const Size& rDestSize, const Gradient& rGradient, sal_uInt32 nWriteFlags ); - void ImplWriteText( const Point& rPos, const OUString& rText, const long* pDXArray, long nWidth ); - void ImplWriteText( const Point& rPos, const OUString& rText, const long* pDXArray, long nWidth, Color aTextColor ); + void ImplWriteText( const Point& rPos, const OUString& rText, const tools::Long* pDXArray, tools::Long nWidth ); + void ImplWriteText( const Point& rPos, const OUString& rText, const tools::Long* pDXArray, tools::Long nWidth, Color aTextColor ); void ImplWriteBmp( const BitmapEx& rBmpEx, const Point& rPt, const Size& rSz, const Point& rSrcPt, const Size& rSrcSz, const css::uno::Reference* pShape); void ImplWriteActions( const GDIMetaFile& rMtf, -- cgit