diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-19 15:18:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-20 08:04:53 +0200 |
commit | 1e822e401ea8fe950c7fb62172ac61d8396c98e9 (patch) | |
tree | 3a29227adfe1c5ec9209d7e7deb2035633104986 /sw/source/core/bastyp | |
parent | b225980d2d65694278c9ed89512fbe21b08febd6 (diff) |
use tools::Long in sw
Change-Id: I44be72b3a9b14823ec37a3c799cffb4fb4d6e1de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104527
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/bastyp')
-rw-r--r-- | sw/source/core/bastyp/bparr.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/bastyp/swrect.cxx | 88 | ||||
-rw-r--r-- | sw/source/core/bastyp/swregion.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/bastyp/tabcol.cxx | 4 |
4 files changed, 52 insertions, 52 deletions
diff --git a/sw/source/core/bastyp/bparr.cxx b/sw/source/core/bastyp/bparr.cxx index 1e8ecaa83a3b..6b7aa28edb44 100644 --- a/sw/source/core/bastyp/bparr.cxx +++ b/sw/source/core/bastyp/bparr.cxx @@ -18,7 +18,7 @@ */ #include <bparr.hxx> - +#include <tools/long.hxx> #include <limits.h> #include <string.h> @@ -413,7 +413,7 @@ sal_uInt16 BigPtrArray::Compress() sal_uInt16 nFirstChgPos = USHRT_MAX; // at which position was the 1st change? // convert fill percentage into number of remaining elements - short const nMax = MAXENTRY - long(MAXENTRY) * COMPRESSLVL / 100; + short const nMax = MAXENTRY - tools::Long(MAXENTRY) * COMPRESSLVL / 100; for( sal_uInt16 cur = 0; cur < m_nBlock; ++cur ) { diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx index d443c85d99c3..3809c2113c04 100644 --- a/sw/source/core/bastyp/swrect.cxx +++ b/sw/source/core/bastyp/swrect.cxx @@ -44,7 +44,7 @@ SwRect& SwRect::Union( const SwRect& rRect ) Top( rRect.Top() ); if ( Left() > rRect.Left() ) Left( rRect.Left() ); - long n = rRect.Right(); + tools::Long n = rRect.Right(); if ( Right() < n ) Right( n ); n = rRect.Bottom(); @@ -63,7 +63,7 @@ SwRect& SwRect::Intersection( const SwRect& rRect ) Left( rRect.Left() ); if ( Top() < rRect.Top() ) Top( rRect.Top() ); - long n = rRect.Right(); + tools::Long n = rRect.Right(); if ( Right() > n ) Right( n ); n = rRect.Bottom(); @@ -82,7 +82,7 @@ SwRect& SwRect::Intersection_( const SwRect& rOther ) // get smaller right and lower, and greater left and upper edge auto left = std::max( m_Point.X(), rOther.m_Point.X() ); auto top = std::max( m_Point.Y(), rOther.m_Point.Y() ); - long right = std::min( m_Point.X() + m_Size.Width(), rOther.m_Point.X() + rOther.m_Size.Width() ); + tools::Long right = std::min( m_Point.X() + m_Size.Width(), rOther.m_Point.X() + rOther.m_Size.Width() ); auto bottom = std::min( m_Point.Y() + m_Size.Height(), rOther.m_Point.Y() + rOther.m_Size.Height() ); *this = SwRect( left, top, right - left, bottom - top ); @@ -92,10 +92,10 @@ SwRect& SwRect::Intersection_( const SwRect& rOther ) bool SwRect::IsInside( const SwRect& rRect ) const { - const long nRight = Right(); - const long nBottom = Bottom(); - const long nrRight = rRect.Right(); - const long nrBottom= rRect.Bottom(); + const tools::Long nRight = Right(); + const tools::Long nBottom = Bottom(); + const tools::Long nrRight = rRect.Right(); + const tools::Long nrBottom= rRect.Bottom(); return (Left() <= rRect.Left()) && (rRect.Left()<= nRight) && (Left() <= nrRight) && (nrRight <= nRight) && (Top() <= rRect.Top()) && (rRect.Top() <= nBottom) && @@ -111,7 +111,7 @@ bool SwRect::IsInside( const Point& rPoint ) const } // mouse moving of table borders -bool SwRect::IsNear( const Point& rPoint, long nTolerance ) const +bool SwRect::IsNear( const Point& rPoint, tools::Long nTolerance ) const { bool bIsNearby = (((Left() - nTolerance) <= rPoint.X()) && ((Top() - nTolerance) <= rPoint.Y()) && @@ -143,30 +143,30 @@ void SwRect::Justify() } // Similar to the inline methods, but we need the function pointers -void SwRect::Width_( const long nNew ) { m_Size.setWidth(nNew); } -void SwRect::Height_( const long nNew ) { m_Size.setHeight(nNew); } -void SwRect::Left_( const long nLeft ){ m_Size.AdjustWidth(m_Point.getX() - nLeft ); m_Point.setX(nLeft); } -void SwRect::Right_( const long nRight ){ m_Size.setWidth(nRight - m_Point.getX()); } -void SwRect::Top_( const long nTop ){ m_Size.AdjustHeight(m_Point.getY() - nTop ); m_Point.setY(nTop); } -void SwRect::Bottom_( const long nBottom ){ m_Size.setHeight(nBottom - m_Point.getY()); } - -long SwRect::Width_() const{ return m_Size.getWidth(); } -long SwRect::Height_() const{ return m_Size.getHeight(); } -long SwRect::Left_() const{ return m_Point.getX(); } -long SwRect::Right_() const{ return m_Point.getX() + m_Size.getWidth(); } -long SwRect::Top_() const{ return m_Point.getY(); } -long SwRect::Bottom_() const{ return m_Point.getY() + m_Size.getHeight(); } - -void SwRect::AddWidth( const long nAdd ) { m_Size.AdjustWidth(nAdd ); } -void SwRect::AddHeight( const long nAdd ) { m_Size.AdjustHeight(nAdd ); } -void SwRect::AddLeft( const long nAdd ){ m_Size.AdjustWidth(-nAdd ); m_Point.setX(m_Point.getX() + nAdd); } -void SwRect::SubLeft( const long nSub ){ m_Size.AdjustWidth(nSub ); m_Point.setX(m_Point.getX() - nSub); } -void SwRect::AddRight( const long nAdd ){ m_Size.AdjustWidth(nAdd ); } -void SwRect::AddTop( const long nAdd ){ m_Size.AdjustHeight(-nAdd ); m_Point.setY(m_Point.getY() + nAdd); } -void SwRect::SubTop( const long nSub ){ m_Size.AdjustHeight(nSub ); m_Point.setY(m_Point.getY() - nSub); } -void SwRect::AddBottom( const long nAdd ){ m_Size.AdjustHeight(nAdd ); } -void SwRect::SetPosX( const long nNew ){ m_Point.setX(nNew); } -void SwRect::SetPosY( const long nNew ){ m_Point.setY(nNew); } +void SwRect::Width_( const tools::Long nNew ) { m_Size.setWidth(nNew); } +void SwRect::Height_( const tools::Long nNew ) { m_Size.setHeight(nNew); } +void SwRect::Left_( const tools::Long nLeft ){ m_Size.AdjustWidth(m_Point.getX() - nLeft ); m_Point.setX(nLeft); } +void SwRect::Right_( const tools::Long nRight ){ m_Size.setWidth(nRight - m_Point.getX()); } +void SwRect::Top_( const tools::Long nTop ){ m_Size.AdjustHeight(m_Point.getY() - nTop ); m_Point.setY(nTop); } +void SwRect::Bottom_( const tools::Long nBottom ){ m_Size.setHeight(nBottom - m_Point.getY()); } + +tools::Long SwRect::Width_() const{ return m_Size.getWidth(); } +tools::Long SwRect::Height_() const{ return m_Size.getHeight(); } +tools::Long SwRect::Left_() const{ return m_Point.getX(); } +tools::Long SwRect::Right_() const{ return m_Point.getX() + m_Size.getWidth(); } +tools::Long SwRect::Top_() const{ return m_Point.getY(); } +tools::Long SwRect::Bottom_() const{ return m_Point.getY() + m_Size.getHeight(); } + +void SwRect::AddWidth( const tools::Long nAdd ) { m_Size.AdjustWidth(nAdd ); } +void SwRect::AddHeight( const tools::Long nAdd ) { m_Size.AdjustHeight(nAdd ); } +void SwRect::AddLeft( const tools::Long nAdd ){ m_Size.AdjustWidth(-nAdd ); m_Point.setX(m_Point.getX() + nAdd); } +void SwRect::SubLeft( const tools::Long nSub ){ m_Size.AdjustWidth(nSub ); m_Point.setX(m_Point.getX() - nSub); } +void SwRect::AddRight( const tools::Long nAdd ){ m_Size.AdjustWidth(nAdd ); } +void SwRect::AddTop( const tools::Long nAdd ){ m_Size.AdjustHeight(-nAdd ); m_Point.setY(m_Point.getY() + nAdd); } +void SwRect::SubTop( const tools::Long nSub ){ m_Size.AdjustHeight(nSub ); m_Point.setY(m_Point.getY() - nSub); } +void SwRect::AddBottom( const tools::Long nAdd ){ m_Size.AdjustHeight(nAdd ); } +void SwRect::SetPosX( const tools::Long nNew ){ m_Point.setX(nNew); } +void SwRect::SetPosY( const tools::Long nNew ){ m_Point.setY(nNew); } Size SwRect::Size_() const { return SSize(); } Size SwRect::SwappedSize() const { return Size( m_Size.getHeight(), m_Size.getWidth() ); } @@ -177,36 +177,36 @@ Point SwRect::BottomLeft() const { return Point( m_Point.getX(), m_Point.getY() Point SwRect::BottomRight() const { return Point( m_Point.getX() + m_Size.getWidth(), m_Point.getY() + m_Size.getHeight() ); } -long SwRect::GetLeftDistance( long nLimit ) const { return m_Point.getX() - nLimit; } -long SwRect::GetBottomDistance( long nLim ) const { return nLim - m_Point.getY() - m_Size.getHeight();} -long SwRect::GetTopDistance( long nLimit ) const { return m_Point.getY() - nLimit; } -long SwRect::GetRightDistance( long nLim ) const { return nLim - m_Point.getX() - m_Size.getWidth(); } +tools::Long SwRect::GetLeftDistance( tools::Long nLimit ) const { return m_Point.getX() - nLimit; } +tools::Long SwRect::GetBottomDistance( tools::Long nLim ) const { return nLim - m_Point.getY() - m_Size.getHeight();} +tools::Long SwRect::GetTopDistance( tools::Long nLimit ) const { return m_Point.getY() - nLimit; } +tools::Long SwRect::GetRightDistance( tools::Long nLim ) const { return nLim - m_Point.getX() - m_Size.getWidth(); } -bool SwRect::OverStepLeft( long nLimit ) const +bool SwRect::OverStepLeft( tools::Long nLimit ) const { return nLimit > m_Point.getX() && m_Point.getX() + m_Size.getWidth() > nLimit; } -bool SwRect::OverStepBottom( long nLimit ) const +bool SwRect::OverStepBottom( tools::Long nLimit ) const { return nLimit > m_Point.getY() && m_Point.getY() + m_Size.getHeight() > nLimit; } -bool SwRect::OverStepTop( long nLimit ) const +bool SwRect::OverStepTop( tools::Long nLimit ) const { return nLimit > m_Point.getY() && m_Point.getY() + m_Size.getHeight() > nLimit; } -bool SwRect::OverStepRight( long nLimit ) const +bool SwRect::OverStepRight( tools::Long nLimit ) const { return nLimit > m_Point.getX() && m_Point.getX() + m_Size.getWidth() > nLimit; } -void SwRect::SetLeftAndWidth( long nLeft, long nNew ) +void SwRect::SetLeftAndWidth( tools::Long nLeft, tools::Long nNew ) { m_Point.setX(nLeft); m_Size.setWidth(nNew); } -void SwRect::SetTopAndHeight( long nTop, long nNew ) +void SwRect::SetTopAndHeight( tools::Long nTop, tools::Long nNew ) { m_Point.setY(nTop); m_Size.setHeight(nNew); } -void SwRect::SetRightAndWidth( long nRight, long nNew ) +void SwRect::SetRightAndWidth( tools::Long nRight, tools::Long nNew ) { m_Point.setX(nRight - nNew); m_Size.setWidth(nNew); } -void SwRect::SetBottomAndHeight( long nBottom, long nNew ) +void SwRect::SetBottomAndHeight( tools::Long nBottom, tools::Long nNew ) { m_Point.setY(nBottom - nNew); m_Size.setHeight(nNew); diff --git a/sw/source/core/bastyp/swregion.cxx b/sw/source/core/bastyp/swregion.cxx index f2fb006d9006..09e07757b236 100644 --- a/sw/source/core/bastyp/swregion.cxx +++ b/sw/source/core/bastyp/swregion.cxx @@ -74,10 +74,10 @@ void SwRegionRects::operator-=( const SwRect &rRect ) // now split; only those rectangles should be left over that are in // the "old" but not in the "new" area; hence, not in intersection. - long nTmp = aInter.Top() - aTmp.Top(); + tools::Long nTmp = aInter.Top() - aTmp.Top(); if ( 0 < nTmp ) { - const long nOldVal = aTmp.Height(); + const tools::Long nOldVal = aTmp.Height(); aTmp.Height(nTmp); InsertRect( aTmp, i, bDel ); aTmp.Height( nOldVal ); @@ -92,7 +92,7 @@ void SwRegionRects::operator-=( const SwRect &rRect ) nTmp = aInter.Left() - aTmp.Left(); if ( 0 < nTmp ) { - const long nOldVal = aTmp.Width(); + const tools::Long nOldVal = aTmp.Width(); aTmp.Width( nTmp ); InsertRect( aTmp, i, bDel ); aTmp.Width( nOldVal ); @@ -171,7 +171,7 @@ void SwRegionRects::Compress() // paints), the area of the union can be a little bit larger: // ( 9622 * 141.5 = 1361513 ~= a quarter (1/4) centimeter wider // than the width of an A4 page - const long nFuzzy = 1361513; + const tools::Long nFuzzy = 1361513; SwRect aUnion( (*this)[i] ); aUnion.Union( (*this)[j] ); SwRect aInter( (*this)[i] ); diff --git a/sw/source/core/bastyp/tabcol.cxx b/sw/source/core/bastyp/tabcol.cxx index 0ecbb10693fd..cb01a5e3c3ae 100644 --- a/sw/source/core/bastyp/tabcol.cxx +++ b/sw/source/core/bastyp/tabcol.cxx @@ -55,7 +55,7 @@ SwTabCols &SwTabCols::operator=( const SwTabCols& rCpy ) return *this; } -void SwTabCols::Insert( long nValue, long nMin, long nMax, +void SwTabCols::Insert( tools::Long nValue, tools::Long nMin, tools::Long nMax, bool bValue, size_t nPos ) { SwTabColsEntry aEntry; @@ -66,7 +66,7 @@ void SwTabCols::Insert( long nValue, long nMin, long nMax, m_aData.insert( m_aData.begin() + nPos, aEntry ); } -void SwTabCols::Insert( long nValue, bool bValue, size_t nPos ) +void SwTabCols::Insert( tools::Long nValue, bool bValue, size_t nPos ) { SwTabColsEntry aEntry; aEntry.nPos = nValue; |