summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/tools/bigint.hxx5
-rw-r--r--include/tools/fract.hxx3
-rw-r--r--include/tools/gen.hxx203
-rw-r--r--include/tools/helpers.hxx13
-rw-r--r--include/tools/long.hxx33
-rw-r--r--include/tools/poly.hxx6
-rw-r--r--include/tools/stream.hxx3
-rw-r--r--include/tools/svborder.hxx21
-rw-r--r--include/tools/zcodec.hxx9
9 files changed, 168 insertions, 128 deletions
diff --git a/include/tools/bigint.hxx b/include/tools/bigint.hxx
index 66ce1dd3b1b8..f80d64fe87c3 100644
--- a/include/tools/bigint.hxx
+++ b/include/tools/bigint.hxx
@@ -21,6 +21,7 @@
#include <rtl/ustring.hxx>
#include <tools/toolsdllapi.h>
+#include <tools/long.hxx>
#define MAX_DIGITS 8
@@ -88,7 +89,7 @@ public:
operator sal_uInt32() const;
operator double() const;
#if SAL_TYPES_SIZEOFLONG == 8
- operator long() const;
+ operator tools::Long() const;
#endif
bool IsSet() const { return bIsSet; }
@@ -156,7 +157,7 @@ inline BigInt::operator sal_uInt32() const
}
#if SAL_TYPES_SIZEOFLONG == 8
-inline BigInt::operator long() const
+inline BigInt::operator tools::Long() const
{
// Clamp to int32 since long is int32 on Windows.
if (!bIsBig)
diff --git a/include/tools/fract.hxx b/include/tools/fract.hxx
index 7caf9c6a93f5..79f5b525aed4 100644
--- a/include/tools/fract.hxx
+++ b/include/tools/fract.hxx
@@ -21,6 +21,7 @@
#include <sal/types.h>
#include <tools/toolsdllapi.h>
+#include <tools/long.hxx>
#include <ostream>
#include <type_traits>
@@ -53,7 +54,7 @@ public:
explicit operator sal_Int32() const;
#if SAL_TYPES_SIZEOFLONG == 8
- explicit operator long() const { return sal_Int32(*this); }
+ explicit operator ::tools::Long() const { return sal_Int32(*this); }
#endif
explicit operator double() const;
diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx
index 4f6927c62f0b..b357d2198de1 100644
--- a/include/tools/gen.hxx
+++ b/include/tools/gen.hxx
@@ -21,6 +21,7 @@
#include <tools/toolsdllapi.h>
+#include <tools/long.hxx>
#include <limits.h>
#include <algorithm>
#include <ostream>
@@ -40,19 +41,19 @@ class SAL_WARN_UNUSED Pair
{
public:
Pair() : nA(0), nB(0) {}
- Pair( long _nA, long _nB ) : nA(_nA), nB(_nB) {}
+ Pair( tools::Long _nA, tools::Long _nB ) : nA(_nA), nB(_nB) {}
- long A() const { return nA; }
- long B() const { return nB; }
+ tools::Long A() const { return nA; }
+ tools::Long B() const { return nB; }
- long& A() { return nA; }
- long& B() { return nB; }
+ tools::Long& A() { return nA; }
+ tools::Long& B() { return nB; }
TOOLS_DLLPUBLIC rtl::OString toString() const;
protected:
- long nA;
- long nB;
+ tools::Long nA;
+ tools::Long nB;
};
namespace tools::detail {
@@ -72,33 +73,33 @@ class SAL_WARN_UNUSED UNLESS_MERGELIBS(SAL_DLLPUBLIC_EXPORT) Point final : prote
{
public:
Point() {}
- Point( long nX, long nY ) : Pair( nX, nY ) {}
+ Point( tools::Long nX, tools::Long nY ) : Pair( nX, nY ) {}
- long X() const { return nA; }
- long Y() const { return nB; }
+ tools::Long X() const { return nA; }
+ tools::Long Y() const { return nB; }
- void Move( long nHorzMove, long nVertMove );
+ void Move( tools::Long nHorzMove, tools::Long nVertMove );
void Move( Size const & s );
- long AdjustX( long nHorzMove ) { nA += nHorzMove; return nA; }
- long AdjustY( long nVertMove ) { nB += nVertMove; return nB; }
+ tools::Long AdjustX( tools::Long nHorzMove ) { nA += nHorzMove; return nA; }
+ tools::Long AdjustY( tools::Long nVertMove ) { nB += nVertMove; return nB; }
- void RotateAround( long& rX, long& rY, short nOrientation ) const;
+ void RotateAround( tools::Long& rX, tools::Long& rY, short nOrientation ) const;
void RotateAround( Point&, short nOrientation ) const;
Point& operator += ( const Point& rPoint );
Point& operator -= ( const Point& rPoint );
- Point& operator *= ( const long nVal );
- Point& operator /= ( const long nVal );
+ Point& operator *= ( const tools::Long nVal );
+ Point& operator /= ( const tools::Long nVal );
friend inline Point operator+( const Point &rVal1, const Point &rVal2 );
friend inline Point operator-( const Point &rVal1, const Point &rVal2 );
- friend inline Point operator*( const Point &rVal1, const long nVal2 );
- friend inline Point operator/( const Point &rVal1, const long nVal2 );
+ friend inline Point operator*( const Point &rVal1, const tools::Long nVal2 );
+ friend inline Point operator/( const Point &rVal1, const tools::Long nVal2 );
- long getX() const { return X(); }
- long getY() const { return Y(); }
- void setX(long nX) { nA = nX; }
- void setY(long nY) { nB = nY; }
+ tools::Long getX() const { return X(); }
+ tools::Long getY() const { return Y(); }
+ void setX(tools::Long nX) { nA = nX; }
+ void setY(tools::Long nY) { nB = nY; }
Pair const & toPair() const { return *this; }
Pair & toPair() { return *this; }
@@ -106,7 +107,7 @@ public:
using Pair::toString;
};
-inline void Point::Move( long nHorzMove, long nVertMove )
+inline void Point::Move( tools::Long nHorzMove, tools::Long nVertMove )
{
nA += nHorzMove;
nB += nVertMove;
@@ -126,14 +127,14 @@ inline Point& Point::operator -= ( const Point& rPoint )
return *this;
}
-inline Point& Point::operator *= ( const long nVal )
+inline Point& Point::operator *= ( const tools::Long nVal )
{
nA *= nVal;
nB *= nVal;
return *this;
}
-inline Point& Point::operator /= ( const long nVal )
+inline Point& Point::operator /= ( const tools::Long nVal )
{
nA /= nVal;
nB /= nVal;
@@ -150,12 +151,12 @@ inline Point operator-( const Point &rVal1, const Point &rVal2 )
return Point( rVal1.nA-rVal2.nA, rVal1.nB-rVal2.nB );
}
-inline Point operator*( const Point &rVal1, const long nVal2 )
+inline Point operator*( const Point &rVal1, const tools::Long nVal2 )
{
return Point( rVal1.nA*nVal2, rVal1.nB*nVal2 );
}
-inline Point operator/( const Point &rVal1, const long nVal2 )
+inline Point operator/( const Point &rVal1, const tools::Long nVal2 )
{
return Point( rVal1.nA/nVal2, rVal1.nB/nVal2 );
}
@@ -183,22 +184,22 @@ class SAL_WARN_UNUSED Size final : protected Pair
{
public:
Size() {}
- Size( long nWidth, long nHeight ) : Pair( nWidth, nHeight ) {}
+ Size( tools::Long nWidth, tools::Long nHeight ) : Pair( nWidth, nHeight ) {}
- long Width() const { return nA; }
- long Height() const { return nB; }
+ tools::Long Width() const { return nA; }
+ tools::Long Height() const { return nB; }
- long AdjustWidth( long n ) { nA += n; return nA; }
- long AdjustHeight( long n ) { nB += n; return nB; }
+ tools::Long AdjustWidth( tools::Long n ) { nA += n; return nA; }
+ tools::Long AdjustHeight( tools::Long n ) { nB += n; return nB; }
- long getWidth() const { return Width(); }
- long getHeight() const { return Height(); }
- void setWidth(long nWidth) { nA = nWidth; }
- void setHeight(long nHeight) { nB = nHeight; }
+ tools::Long getWidth() const { return Width(); }
+ tools::Long getHeight() const { return Height(); }
+ void setWidth(tools::Long nWidth) { nA = nWidth; }
+ void setHeight(tools::Long nHeight) { nB = nHeight; }
bool IsEmpty() const { return nA <= 0 || nB <= 0; }
- void extendBy(long x, long y)
+ void extendBy(tools::Long x, tools::Long y)
{
nA += x;
nB += y;
@@ -241,16 +242,16 @@ class SAL_WARN_UNUSED Range final : protected Pair
{
public:
Range() {}
- Range( long nMin, long nMax ) : Pair( nMin, nMax ) {}
+ Range( tools::Long nMin, tools::Long nMax ) : Pair( nMin, nMax ) {}
- long Min() const { return nA; }
- long Max() const { return nB; }
- long Len() const { return nB - nA + 1; }
+ tools::Long Min() const { return nA; }
+ tools::Long Max() const { return nB; }
+ tools::Long Len() const { return nB - nA + 1; }
- long& Min() { return nA; }
- long& Max() { return nB; }
+ tools::Long& Min() { return nA; }
+ tools::Long& Max() { return nB; }
- bool IsInside( long nIs ) const;
+ bool IsInside( tools::Long nIs ) const;
void Justify();
@@ -260,7 +261,7 @@ public:
using Pair::toString;
};
-inline bool Range::IsInside( long nIs ) const
+inline bool Range::IsInside( tools::Long nIs ) const
{
return ((nA <= nIs) && (nIs <= nB ));
}
@@ -269,7 +270,7 @@ inline void Range::Justify()
{
if ( nA > nB )
{
- long nHelp = nA;
+ tools::Long nHelp = nA;
nA = nB;
nB = nHelp;
}
@@ -301,25 +302,25 @@ class SAL_WARN_UNUSED Selection final : protected Pair
{
public:
Selection() {}
- Selection( long nPos ) : Pair( nPos, nPos ) {}
- Selection( long nMin, long nMax ) : Pair( nMin, nMax ) {}
+ Selection( tools::Long nPos ) : Pair( nPos, nPos ) {}
+ Selection( tools::Long nMin, tools::Long nMax ) : Pair( nMin, nMax ) {}
- long Min() const { return nA; }
- long Max() const { return nB; }
- long Len() const { return nB - nA; }
+ tools::Long Min() const { return nA; }
+ tools::Long Max() const { return nB; }
+ tools::Long Len() const { return nB - nA; }
- long& Min() { return nA; }
- long& Max() { return nB; }
+ tools::Long& Min() { return nA; }
+ tools::Long& Max() { return nB; }
- bool IsInside( long nIs ) const;
+ bool IsInside( tools::Long nIs ) const;
void Justify();
bool operator !() const { return !Len(); }
- long getMin() const { return Min(); }
- void setMin(long nMin) { Min() = nMin; }
- void setMax(long nMax) { Max() = nMax; }
+ tools::Long getMin() const { return Min(); }
+ void setMin(tools::Long nMin) { Min() = nMin; }
+ void setMax(tools::Long nMax) { Max() = nMax; }
Pair const & toPair() const { return *this; }
Pair & toPair() { return *this; }
@@ -327,7 +328,7 @@ public:
using Pair::toString;
};
-inline bool Selection::IsInside( long nIs ) const
+inline bool Selection::IsInside( tools::Long nIs ) const
{
return ((nA <= nIs) && (nIs < nB ));
}
@@ -336,7 +337,7 @@ inline void Selection::Justify()
{
if ( nA > nB )
{
- long nHelp = nA;
+ tools::Long nHelp = nA;
nA = nB;
nB = nHelp;
}
@@ -380,23 +381,23 @@ class SAL_WARN_UNUSED TOOLS_DLLPUBLIC Rectangle final
public:
Rectangle();
Rectangle( const Point& rLT, const Point& rRB );
- Rectangle( long nLeft, long nTop,
- long nRight, long nBottom );
+ Rectangle( tools::Long nLeft, tools::Long nTop,
+ tools::Long nRight, tools::Long nBottom );
/// Constructs an empty Rectangle, with top/left at the specified params
- Rectangle( long nLeft, long nTop );
+ Rectangle( tools::Long nLeft, tools::Long nTop );
Rectangle( const Point& rLT, const Size& rSize );
static Rectangle Justify( const Point& rLT, const Point& rRB );
- long Left() const { return nLeft; }
- long Right() const;
- long Top() const { return nTop; }
- long Bottom() const;
+ tools::Long Left() const { return nLeft; }
+ tools::Long Right() const;
+ tools::Long Top() const { return nTop; }
+ tools::Long Bottom() const;
- void SetLeft(long v) { nLeft = v; }
- void SetRight(long v) { nRight = v; }
- void SetTop(long v) { nTop = v; }
- void SetBottom(long v) { nBottom = v; }
+ void SetLeft(tools::Long v) { nLeft = v; }
+ void SetRight(tools::Long v) { nRight = v; }
+ void SetTop(tools::Long v) { nTop = v; }
+ void SetBottom(tools::Long v) { nBottom = v; }
inline Point TopLeft() const;
inline Point TopRight() const;
@@ -409,20 +410,20 @@ public:
inline Point Center() const;
/// Move the top and left edges by a delta, preserving width and height
- inline void Move( long nHorzMoveDelta, long nVertMoveDelta );
+ inline void Move( tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta );
void Move( Size const & s ) { Move(s.Width(), s.Height()); }
- long AdjustLeft( long nHorzMoveDelta ) { nLeft += nHorzMoveDelta; return nLeft; }
- long AdjustRight( long nHorzMoveDelta );
- long AdjustTop( long nVertMoveDelta ) { nTop += nVertMoveDelta; return nTop; }
- long AdjustBottom( long nVertMoveDelta );
+ tools::Long AdjustLeft( tools::Long nHorzMoveDelta ) { nLeft += nHorzMoveDelta; return nLeft; }
+ tools::Long AdjustRight( tools::Long nHorzMoveDelta );
+ tools::Long AdjustTop( tools::Long nVertMoveDelta ) { nTop += nVertMoveDelta; return nTop; }
+ tools::Long AdjustBottom( tools::Long nVertMoveDelta );
inline void SetPos( const Point& rPoint );
void SetSize( const Size& rSize );
inline Size GetSize() const;
/// Returns the difference between right and left, assuming the range is inclusive.
- inline long GetWidth() const;
+ inline tools::Long GetWidth() const;
/// Returns the difference between bottom and top, assuming the range is inclusive.
- inline long GetHeight() const;
+ inline tools::Long GetHeight() const;
tools::Rectangle& Union( const tools::Rectangle& rRect );
tools::Rectangle& Intersection( const tools::Rectangle& rRect );
@@ -452,39 +453,39 @@ public:
friend inline tools::Rectangle operator - ( const tools::Rectangle& rRect, const Point& rPt );
// ONE
- long getX() const { return nLeft; }
- long getY() const { return nTop; }
+ tools::Long getX() const { return nLeft; }
+ tools::Long getY() const { return nTop; }
/// Returns the difference between right and left, assuming the range includes one end, but not the other.
- long getWidth() const;
+ tools::Long getWidth() const;
/// Returns the difference between bottom and top, assuming the range includes one end, but not the other.
- long getHeight() const;
+ tools::Long getHeight() const;
/// Set the left edge of the rectangle to x, preserving the width
- void setX( long x );
+ void setX( tools::Long x );
/// Set the top edge of the rectangle to y, preserving the height
- void setY( long y );
- void setWidth( long n ) { nRight = nLeft + n; }
- void setHeight( long n ) { nBottom = nTop + n; }
+ void setY( tools::Long y );
+ void setWidth( tools::Long n ) { nRight = nLeft + n; }
+ void setHeight( tools::Long n ) { nBottom = nTop + n; }
/// Returns the string representation of the rectangle, format is "x, y, width, height".
rtl::OString toString() const;
/**
* Expands the rectangle in all directions by the input value.
*/
- void expand(long nExpandBy);
- void shrink(long nShrinkBy);
+ void expand(tools::Long nExpandBy);
+ void shrink(tools::Long nShrinkBy);
/**
* Sanitizing variants for handling data from the outside
*/
void SaturatingSetSize(const Size& rSize);
- void SaturatingSetX(long x);
- void SaturatingSetY(long y);
+ void SaturatingSetX(tools::Long x);
+ void SaturatingSetY(tools::Long y);
private:
- long nLeft;
- long nTop;
- long nRight;
- long nBottom;
+ tools::Long nLeft;
+ tools::Long nTop;
+ tools::Long nRight;
+ tools::Long nBottom;
};
}
@@ -502,8 +503,8 @@ inline tools::Rectangle::Rectangle( const Point& rLT, const Point& rRB )
nBottom = rRB.Y();
}
-inline tools::Rectangle::Rectangle( long _nLeft, long _nTop,
- long _nRight, long _nBottom )
+inline tools::Rectangle::Rectangle( tools::Long _nLeft, tools::Long _nTop,
+ tools::Long _nRight, tools::Long _nBottom )
{
nLeft = _nLeft;
nTop = _nTop;
@@ -511,7 +512,7 @@ inline tools::Rectangle::Rectangle( long _nLeft, long _nTop,
nBottom = _nBottom;
}
-inline tools::Rectangle::Rectangle( long _nLeft, long _nTop )
+inline tools::Rectangle::Rectangle( tools::Long _nLeft, tools::Long _nTop )
{
nLeft = _nLeft;
nTop = _nTop;
@@ -594,7 +595,7 @@ inline Point tools::Rectangle::Center() const
return Point( nLeft+(nRight-nLeft)/2 , nTop+(nBottom-nTop)/2 );
}
-inline void tools::Rectangle::Move( long nHorzMove, long nVertMove )
+inline void tools::Rectangle::Move( tools::Long nHorzMove, tools::Long nVertMove )
{
nLeft += nHorzMove;
nTop += nVertMove;
@@ -614,9 +615,9 @@ inline void tools::Rectangle::SetPos( const Point& rPoint )
nTop = rPoint.Y();
}
-inline long tools::Rectangle::GetWidth() const
+inline tools::Long tools::Rectangle::GetWidth() const
{
- long n;
+ tools::Long n;
if ( nRight == RECT_EMPTY )
n = 0;
else
@@ -631,9 +632,9 @@ inline long tools::Rectangle::GetWidth() const
return n;
}
-inline long tools::Rectangle::GetHeight() const
+inline tools::Long tools::Rectangle::GetHeight() const
{
- long n;
+ tools::Long n;
if ( nBottom == RECT_EMPTY )
n = 0;
else
diff --git a/include/tools/helpers.hxx b/include/tools/helpers.hxx
index 1d00bad7112e..e105ed355b66 100644
--- a/include/tools/helpers.hxx
+++ b/include/tools/helpers.hxx
@@ -11,6 +11,7 @@
#include <sal/config.h>
#include <sal/types.h>
+#include <tools/long.hxx>
#include <o3tl/safeint.hxx>
#include <cassert>
#include <type_traits>
@@ -19,13 +20,13 @@ template<typename T>
inline
typename std::enable_if<
std::is_signed<T>::value || std::is_floating_point<T>::value, long >::type
-MinMax(T nVal, long nMin, long nMax)
+MinMax(T nVal, tools::Long nMin, tools::Long nMax)
{
assert(nMin <= nMax);
if (nVal >= nMin)
{
if (nVal <= nMax)
- return static_cast<long>(nVal);
+ return static_cast<tools::Long>(nVal);
else
return nMax;
}
@@ -39,7 +40,7 @@ template<typename T>
inline
typename std::enable_if<
std::is_unsigned<T>::value, long >::type
-MinMax(T nVal, long nMin, long nMax)
+MinMax(T nVal, tools::Long nMin, tools::Long nMax)
{
assert(nMin <= nMax);
if (nMax < 0)
@@ -51,7 +52,7 @@ MinMax(T nVal, long nMin, long nMax)
if (nMin < 0 || nVal >= static_cast<unsigned long>(nMin))
{
if (nVal <= static_cast<unsigned long>(nMax))
- return static_cast<long>(nVal);
+ return static_cast<tools::Long>(nVal);
else
return nMax;
}
@@ -71,9 +72,9 @@ inline sal_uInt32 AlignedWidth4Bytes(sal_uInt32 nWidthBits)
return (nWidthBits >> 5) << 2;
}
-inline long FRound( double fVal )
+inline tools::Long FRound( double fVal )
{
- return fVal > 0.0 ? static_cast<long>( fVal + 0.5 ) : -static_cast<long>( -fVal + 0.5 );
+ return fVal > 0.0 ? static_cast<tools::Long>( fVal + 0.5 ) : -static_cast<tools::Long>( -fVal + 0.5 );
}
//valid range: (-180,180]
diff --git a/include/tools/long.hxx b/include/tools/long.hxx
new file mode 100644
index 000000000000..0a633e0f23cc
--- /dev/null
+++ b/include/tools/long.hxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+#pragma once
+
+#include <sal/types.h>
+
+/**
+ * We have an unfortunate problem in that, on Windows (both 32 and 64-bit), long is always 32-bit.
+ * But on Linux (64-bit) long is 64-bit. Which leads to nasty situations where things that work
+ * on Linux, fail on Windows.
+ * So.....,
+ * (1) introduce a typedef that will replace all usage of long in our codebase.
+ * (2) to start with, that typedef acts that same as the long it replaces
+ * (3) once the replacement is complete, this typedef will, on windows, become 64-bit.
+ * (4) and once the fallout from (3) is fixed, we can start replacing tools::Long with things
+ * like sal_Int64.
+ */
+namespace tools
+{
+typedef long Long;
+typedef unsigned long ULong;
+// stage 3:
+//typedef sal_Int64 Long;
+//typedef sal_uInt64 ULong;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/include/tools/poly.hxx b/include/tools/poly.hxx
index 12194c64c752..d9f39fb080f4 100644
--- a/include/tools/poly.hxx
+++ b/include/tools/poly.hxx
@@ -88,7 +88,7 @@ public:
Polygon( const tools::Rectangle& rRect,
sal_uInt32 nHorzRound, sal_uInt32 nVertRound );
Polygon( const Point& rCenter,
- long nRadX, long nRadY );
+ tools::Long nRadX, tools::Long nRadY );
Polygon( const tools::Rectangle& rBound,
const Point& rStart, const Point& rEnd,
PolyStyle ePolyStyle = PolyStyle::Arc );
@@ -141,7 +141,7 @@ public:
void AdaptiveSubdivide( tools::Polygon& rResult, const double d = 1.0 ) const;
static Polygon SubdivideBezier( const Polygon& rPoly );
- void Move( long nHorzMove, long nVertMove );
+ void Move( tools::Long nHorzMove, tools::Long nVertMove );
void Translate( const Point& rTrans );
void Scale( double fScaleX, double fScaleY );
void Rotate( const Point& rCenter, double fSin, double fCos );
@@ -232,7 +232,7 @@ public:
void GetIntersection( const tools::PolyPolygon& rPolyPoly, tools::PolyPolygon& rResult ) const;
void GetUnion( const tools::PolyPolygon& rPolyPoly, tools::PolyPolygon& rResult ) const;
- void Move( long nHorzMove, long nVertMove );
+ void Move( tools::Long nHorzMove, tools::Long nVertMove );
void Translate( const Point& rTrans );
void Scale( double fScaleX, double fScaleY );
void Rotate( const Point& rCenter, double fSin, double fCos );
diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx
index 4cbe1a3e930c..0d88c014da65 100644
--- a/include/tools/stream.hxx
+++ b/include/tools/stream.hxx
@@ -21,6 +21,7 @@
#include <tools/toolsdllapi.h>
#include <tools/lineend.hxx>
+#include <tools/long.hxx>
#include <tools/ref.hxx>
#include <vcl/errcode.hxx>
#include <rtl/string.hxx>
@@ -638,7 +639,7 @@ protected:
/// Set to 0 , if new block size is 0 bytes
/// - nSize: New block size
/// - nPos: Set to 0 if position outside of block
- bool ReAllocateMemory( long nDiff );
+ bool ReAllocateMemory( tools::Long nDiff );
/// Is called when this stream allocated the buffer or the buffer is
/// resized. FreeMemory may need to NULLify handles in derived classes.
diff --git a/include/tools/svborder.hxx b/include/tools/svborder.hxx
index 61e1270e1ccd..92f779cac344 100644
--- a/include/tools/svborder.hxx
+++ b/include/tools/svborder.hxx
@@ -21,19 +21,20 @@
#define INCLUDED_TOOLS_SVBORDER_HXX
#include <tools/toolsdllapi.h>
+#include <tools/long.hxx>
namespace tools { class Rectangle; }
class SAL_WARN_UNUSED TOOLS_DLLPUBLIC SvBorder
{
- long nTop, nRight, nBottom, nLeft;
+ tools::Long nTop, nRight, nBottom, nLeft;
public:
SvBorder()
{
nTop = nRight = nBottom = nLeft = 0;
}
- SvBorder( long nLeftP, long nTopP, long nRightP, long nBottomP )
+ SvBorder( tools::Long nLeftP, tools::Long nTopP, tools::Long nRightP, tools::Long nBottomP )
{
nLeft = nLeftP;
nTop = nTopP;
@@ -55,14 +56,14 @@ public:
Bottom() += rBorder.Bottom();
return *this;
}
- long & Top() { return nTop; }
- long & Right() { return nRight; }
- long & Bottom() { return nBottom; }
- long & Left() { return nLeft; }
- long Top() const { return nTop; }
- long Right() const { return nRight; }
- long Bottom() const { return nBottom; }
- long Left() const { return nLeft; }
+ tools::Long & Top() { return nTop; }
+ tools::Long & Right() { return nRight; }
+ tools::Long & Bottom() { return nBottom; }
+ tools::Long & Left() { return nLeft; }
+ tools::Long Top() const { return nTop; }
+ tools::Long Right() const { return nRight; }
+ tools::Long Bottom() const { return nBottom; }
+ tools::Long Left() const { return nLeft; }
};
TOOLS_DLLPUBLIC tools::Rectangle & operator += ( tools::Rectangle & rRect, const SvBorder & rBorder );
diff --git a/include/tools/zcodec.hxx b/include/tools/zcodec.hxx
index 23922e197f91..f8bdc44451dc 100644
--- a/include/tools/zcodec.hxx
+++ b/include/tools/zcodec.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_TOOLS_ZCODEC_HXX
#include <tools/toolsdllapi.h>
+#include <tools/long.hxx>
#define ZCODEC_NO_COMPRESSION 0
#define ZCODEC_DEFAULT_COMPRESSION 6
@@ -59,15 +60,15 @@ public:
~ZCodec();
void BeginCompression( int nCompressLevel = ZCODEC_DEFAULT_COMPRESSION, bool gzLib = false );
- long EndCompression();
+ tools::Long EndCompression();
void Compress( SvStream& rIStm, SvStream& rOStm );
- long Decompress( SvStream& rIStm, SvStream& rOStm );
+ tools::Long Decompress( SvStream& rIStm, SvStream& rOStm );
bool AttemptDecompression( SvStream& rIStm, SvStream& rOStm );
void Write( SvStream& rOStm, const sal_uInt8* pData, sal_uInt32 nSize );
- long Read( SvStream& rIStm, sal_uInt8* pData, sal_uInt32 nSize );
- long ReadAsynchron( SvStream& rIStm, sal_uInt8* pData, sal_uInt32 nSize );
+ tools::Long Read( SvStream& rIStm, sal_uInt8* pData, sal_uInt32 nSize );
+ tools::Long ReadAsynchron( SvStream& rIStm, sal_uInt8* pData, sal_uInt32 nSize );
void SetBreak( size_t );
size_t GetBreak() const;