summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2013-06-29 23:57:38 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2013-06-30 04:58:49 +0000
commit710f41b7aec8e7d35a0da8be332aa289f98942af (patch)
treeb894ef2d3f06a63a85f423b2713a654ea57f9c69 /include
parent1ca3beae12a7f222c987481e07a544845fc9fd46 (diff)
Clean String and sal_Bool in tools
Change-Id: I6a92196f33d7a5278c7dcc426112e9c56d582655 Reviewed-on: https://gerrit.libreoffice.org/4627 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/sfx2/docfilt.hxx8
-rw-r--r--include/sot/factory.hxx1
-rw-r--r--include/sot/storinfo.hxx1
-rw-r--r--include/svl/sfontitm.hxx1
-rw-r--r--include/svtools/ehdl.hxx6
-rw-r--r--include/svx/svdobj.hxx1
-rw-r--r--include/svx/svdpagv.hxx1
-rw-r--r--include/tools/b3dtrans.hxx12
-rw-r--r--include/tools/bigint.hxx48
-rw-r--r--include/tools/cachestr.hxx17
-rw-r--r--include/tools/color.hxx20
-rw-r--r--include/tools/config.hxx20
-rw-r--r--include/tools/date.hxx18
-rw-r--r--include/tools/datetime.hxx18
-rw-r--r--include/tools/debug.hxx4
-rw-r--r--include/tools/errinf.hxx12
-rw-r--r--include/tools/gen.hxx52
-rw-r--r--include/tools/globname.hxx21
-rw-r--r--include/tools/inetmime.hxx1
-rw-r--r--include/tools/inetmsg.hxx2
-rw-r--r--include/tools/inetstrm.hxx16
-rw-r--r--include/tools/line.hxx4
-rw-r--r--include/tools/link.hxx22
-rw-r--r--include/tools/multisel.hxx28
-rw-r--r--include/tools/poly.hxx26
-rw-r--r--include/tools/pstm.hxx6
-rw-r--r--include/tools/rc.hxx4
-rw-r--r--include/tools/resid.hxx6
-rw-r--r--include/tools/resmgr.hxx4
-rw-r--r--include/tools/stream.hxx188
-rw-r--r--include/tools/svborder.hxx6
-rw-r--r--include/tools/tempfile.hxx16
-rw-r--r--include/tools/time.hxx16
-rw-r--r--include/tools/vcompat.hxx2
-rw-r--r--include/tools/vector2d.hxx12
-rw-r--r--include/tools/weakbase.h10
-rw-r--r--include/tools/weakbase.hxx10
-rw-r--r--include/tools/wldcrd.hxx4
-rw-r--r--include/tools/zcodec.hxx8
-rw-r--r--include/unotools/ucblockbytes.hxx3
-rw-r--r--include/vcl/gfxlink.hxx1
41 files changed, 331 insertions, 325 deletions
diff --git a/include/sfx2/docfilt.hxx b/include/sfx2/docfilt.hxx
index cc6f6b8c1971..5b23b7192c82 100644
--- a/include/sfx2/docfilt.hxx
+++ b/include/sfx2/docfilt.hxx
@@ -19,9 +19,11 @@
#ifndef _SFX_DOCFILT_HACK_HXX
#define _SFX_DOCFILT_HACK_HXX
-#include "sal/config.h"
-#include "sfx2/dllapi.h"
-#include "sal/types.h"
+#include <sal/config.h>
+#include <sfx2/dllapi.h>
+#include <sal/types.h>
+#include <tools/solar.h>
+#include <tools/string.hxx>
#include <com/sun/star/plugin/PluginDescription.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/beans/UnknownPropertyException.hpp>
diff --git a/include/sot/factory.hxx b/include/sot/factory.hxx
index 726b24382756..406333df6f5a 100644
--- a/include/sot/factory.hxx
+++ b/include/sot/factory.hxx
@@ -21,6 +21,7 @@
#define _SOT_FACTORY_HXX
#include <tools/globname.hxx>
+#include <tools/string.hxx>
#include <tools/rtti.hxx>
#include "sot/sotdllapi.h"
#include <vector>
diff --git a/include/sot/storinfo.hxx b/include/sot/storinfo.hxx
index 5518d618bf36..08fc5ea7f6f6 100644
--- a/include/sot/storinfo.hxx
+++ b/include/sot/storinfo.hxx
@@ -21,6 +21,7 @@
#define _SOT_STORINFO_HXX
#include <tools/globname.hxx>
+#include <tools/string.hxx>
#include <vector>
#include "sot/sotdllapi.h"
diff --git a/include/svl/sfontitm.hxx b/include/svl/sfontitm.hxx
index f9bcbdc7f917..068eb93816c7 100644
--- a/include/svl/sfontitm.hxx
+++ b/include/svl/sfontitm.hxx
@@ -22,6 +22,7 @@
#include <tools/color.hxx>
#include <tools/gen.hxx>
+#include <tools/string.hxx>
#include <i18nlangtag/lang.h>
#include <svl/poolitem.hxx>
diff --git a/include/svtools/ehdl.hxx b/include/svtools/ehdl.hxx
index 4b06a6e9d781..6958eaf82f08 100644
--- a/include/svtools/ehdl.hxx
+++ b/include/svtools/ehdl.hxx
@@ -25,6 +25,7 @@
#include "svtools/svtdllapi.h"
#include <tools/errinf.hxx>
+#include <tools/string.hxx>
class Window;
class ResMgr;
@@ -38,7 +39,7 @@ public:
SfxErrorContext(
sal_uInt16 nCtxIdP, const String &aArg1, Window *pWin=0,
sal_uInt16 nResIdP=USHRT_MAX, ResMgr *pMgrP=0);
- virtual sal_Bool GetString(sal_uLong nErrId, OUString &rStr);
+ virtual bool GetString(sal_uLong nErrId, OUString &rStr);
private:
sal_uInt16 nCtxId;
@@ -66,8 +67,7 @@ private:
ResMgr *pFreeMgr;
SVT_DLLPRIVATE sal_Bool GetClassString(sal_uLong lErrId, String &) const;
- virtual sal_Bool CreateString(
- const ErrorInfo *, OUString &, sal_uInt16 &) const;
+ virtual bool CreateString( const ErrorInfo *, OUString &, sal_uInt16 &) const;
};
#endif
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index c4924d016fbb..ae32d08dd22f 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -24,6 +24,7 @@
#include <typeinfo>
#include <cppuhelper/weakref.hxx>
#include <vcl/mapmod.hxx>
+#include <tools/string.hxx>
#include <tools/weakbase.hxx>
#include <svl/lstner.hxx>
#include <vcl/timer.hxx>
diff --git a/include/svx/svdpagv.hxx b/include/svx/svdpagv.hxx
index b43db7da37ed..2a485be7a8fc 100644
--- a/include/svx/svdpagv.hxx
+++ b/include/svx/svdpagv.hxx
@@ -21,6 +21,7 @@
#define _SVDPAGV_HXX
#include <com/sun/star/awt/XControlContainer.hpp>
+#include <tools/string.hxx>
#include <svl/lstner.hxx>
#include <svx/svdhlpln.hxx>
#include <cppuhelper/implbase4.hxx>
diff --git a/include/tools/b3dtrans.hxx b/include/tools/b3dtrans.hxx
index c9e65950b1b6..5dace979b820 100644
--- a/include/tools/b3dtrans.hxx
+++ b/include/tools/b3dtrans.hxx
@@ -145,13 +145,13 @@ public:
// Parameters of ViewportTransformation
void SetDeviceRectangle(double fL=-1.0, double fR=1.0,
double fB=-1.0, double fT=1.0,
- sal_Bool bBroadCastChange=sal_True);
+ bool bBroadCastChange=true);
double GetDeviceRectangleWidth() const { return mfRightBound - mfLeftBound; }
double GetDeviceRectangleHeight() const { return mfTopBound - mfBottomBound; }
double GetFrontClippingPlane() { return mfNearBound; }
double GetBackClippingPlane() { return mfFarBound; }
- void SetPerspective(sal_Bool bNew);
- sal_Bool GetPerspective() { return mbPerspective; }
+ void SetPerspective(bool bNew);
+ bool GetPerspective() { return mbPerspective; }
void SetViewportRectangle(Rectangle& rRect, Rectangle& rVisible);
void SetViewportRectangle(Rectangle& rRect) { SetViewportRectangle(rRect, rRect); }
const Rectangle& GetViewportRectangle() { return maViewportRectangle; }
@@ -234,7 +234,7 @@ public:
const basegfx::B3DPoint& rPos = basegfx::B3DPoint(0.0, 0.0, 1.0),
const basegfx::B3DVector& rLkAt = basegfx::B3DVector(0.0, 0.0, 0.0),
double fFocLen = 35.0, double fBnkAng = 0.0,
- sal_Bool bUseFocLen = sal_False);
+ bool bUseFocLen = false);
virtual ~B3dCamera();
const basegfx::B3DPoint& GetPosition() const { return aPosition; }
@@ -245,11 +245,11 @@ public:
double GetBankAngle() const { return fBankAngle; }
- sal_Bool GetUseFocalLength() const { return (sal_Bool)bUseFocalLength; }
+ bool GetUseFocalLength() const { return (bool)bUseFocalLength; }
protected:
void CalcNewViewportValues();
- sal_Bool CalcFocalLength();
+ bool CalcFocalLength();
virtual void DeviceRectangleChange();
};
diff --git a/include/tools/bigint.hxx b/include/tools/bigint.hxx
index 0cf47ad4aaa0..95cd395ae912 100644
--- a/include/tools/bigint.hxx
+++ b/include/tools/bigint.hxx
@@ -49,13 +49,13 @@ private:
TOOLS_DLLPRIVATE void Normalize();
TOOLS_DLLPRIVATE void Mult(BigInt const &, sal_uInt16);
TOOLS_DLLPRIVATE void Div(sal_uInt16, sal_uInt16 &);
- TOOLS_DLLPRIVATE sal_Bool IsLess(BigInt const &) const;
+ TOOLS_DLLPRIVATE bool IsLess(BigInt const &) const;
TOOLS_DLLPRIVATE void AddLong(BigInt &, BigInt &);
TOOLS_DLLPRIVATE void SubLong(BigInt &, BigInt &);
TOOLS_DLLPRIVATE void MultLong(BigInt const &, BigInt &) const;
TOOLS_DLLPRIVATE void DivLong(BigInt const &, BigInt &) const;
TOOLS_DLLPRIVATE void ModLong(BigInt const &, BigInt &) const;
- TOOLS_DLLPRIVATE sal_Bool ABS_IsLess(BigInt const &) const;
+ TOOLS_DLLPRIVATE bool ABS_IsLess(BigInt const &) const;
public:
BigInt();
@@ -79,18 +79,18 @@ public:
operator sal_uInt16() const;
operator sal_uIntPtr() const;
- void Set( sal_Bool bSet ) { bIsSet = bSet; }
- OUString GetString() const;
+ void Set( bool bSet ) { bIsSet = bSet ? sal_True : sal_False; }
+ OUString GetString() const;
- sal_Bool IsSet() const { return bIsSet; }
- sal_Bool IsNeg() const;
- sal_Bool IsZero() const;
- sal_Bool IsOne() const;
- sal_Bool IsLong() const { return !bIsBig; }
+ bool IsSet() const { return (bool)bIsSet; }
+ bool IsNeg() const;
+ bool IsZero() const;
+ bool IsOne() const;
+ bool IsLong() const { return !((bool)bIsBig); }
void Abs();
#ifdef _TLBIGINT_INT64
- sal_Bool INT64 ( SbxINT64 *p ) const;
- sal_Bool UINT64( SbxUINT64 *p ) const;
+ bool INT64 ( SbxINT64 *p ) const;
+ bool UINT64( SbxUINT64 *p ) const;
#endif
BigInt& operator =( const BigInt& rVal );
@@ -111,12 +111,12 @@ public:
friend inline BigInt operator /( const BigInt& rVal1, const BigInt& rVal2 );
friend inline BigInt operator %( const BigInt& rVal1, const BigInt& rVal2 );
- TOOLS_DLLPUBLIC friend sal_Bool operator==( const BigInt& rVal1, const BigInt& rVal2 );
- friend inline sal_Bool operator!=( const BigInt& rVal1, const BigInt& rVal2 );
- TOOLS_DLLPUBLIC friend sal_Bool operator< ( const BigInt& rVal1, const BigInt& rVal2 );
- TOOLS_DLLPUBLIC friend sal_Bool operator> ( const BigInt& rVal1, const BigInt& rVal2 );
- friend inline sal_Bool operator<=( const BigInt& rVal1, const BigInt& rVal2 );
- friend inline sal_Bool operator>=( const BigInt& rVal1, const BigInt& rVal2 );
+ TOOLS_DLLPUBLIC friend bool operator==( const BigInt& rVal1, const BigInt& rVal2 );
+ friend inline bool operator!=( const BigInt& rVal1, const BigInt& rVal2 );
+ TOOLS_DLLPUBLIC friend bool operator< ( const BigInt& rVal1, const BigInt& rVal2 );
+ TOOLS_DLLPUBLIC friend bool operator> ( const BigInt& rVal1, const BigInt& rVal2 );
+ friend inline bool operator<=( const BigInt& rVal1, const BigInt& rVal2 );
+ friend inline bool operator>=( const BigInt& rVal1, const BigInt& rVal2 );
friend class Fraction;
};
@@ -224,15 +224,15 @@ inline BigInt& BigInt::operator =( const sal_uInt16 nValue )
return *this;
}
-inline sal_Bool BigInt::IsNeg() const
+inline bool BigInt::IsNeg() const
{
if ( !bIsBig )
return (nVal < 0);
else
- return (sal_Bool)bIsNeg;
+ return (bool)bIsNeg;
}
-inline sal_Bool BigInt::IsZero() const
+inline bool BigInt::IsZero() const
{
if ( bIsBig )
return sal_False;
@@ -240,7 +240,7 @@ inline sal_Bool BigInt::IsZero() const
return (nVal == 0);
}
-inline sal_Bool BigInt::IsOne() const
+inline bool BigInt::IsOne() const
{
if ( bIsBig )
return sal_False;
@@ -291,17 +291,17 @@ inline BigInt operator%( const BigInt &rVal1, const BigInt &rVal2 )
return aErg;
}
-inline sal_Bool operator!=( const BigInt& rVal1, const BigInt& rVal2 )
+inline bool operator!=( const BigInt& rVal1, const BigInt& rVal2 )
{
return !(rVal1 == rVal2);
}
-inline sal_Bool operator<=( const BigInt& rVal1, const BigInt& rVal2 )
+inline bool operator<=( const BigInt& rVal1, const BigInt& rVal2 )
{
return !( rVal1 > rVal2);
}
-inline sal_Bool operator>=( const BigInt& rVal1, const BigInt& rVal2 )
+inline bool operator>=( const BigInt& rVal1, const BigInt& rVal2 )
{
return !(rVal1 < rVal2);
}
diff --git a/include/tools/cachestr.hxx b/include/tools/cachestr.hxx
index 60c31e298cf8..6d980566a96a 100644
--- a/include/tools/cachestr.hxx
+++ b/include/tools/cachestr.hxx
@@ -20,7 +20,6 @@
#define _CACHESTR_HXX
#include <tools/stream.hxx>
-#include <tools/string.hxx>
#include "tools/toolsdllapi.h"
class TempFile;
@@ -28,9 +27,9 @@ class TempFile;
class TOOLS_DLLPUBLIC SvCacheStream : public SvStream
{
private:
- String aFileName;
+ OUString aFileName;
sal_uIntPtr nMaxSize;
- int bPersistent;
+ bool bPersistent;
SvStream* pSwapStream;
SvStream* pCurrentStream;
@@ -48,18 +47,16 @@ public:
SvCacheStream( sal_uIntPtr nMaxMemSize = 0 );
~SvCacheStream();
- void SetFilename( const String& rFN )
- { aFileName = rFN; } // call only from FilenameHdl
- const String& GetFilename() const { return aFileName; }
+ void SetFilename( const OUString& rFN ) { aFileName = rFN; } // call only from FilenameHdl
+ const OUString& GetFilename() const { return aFileName; }
void SwapOut();
const void* GetBuffer();
sal_uIntPtr GetSize();
- sal_Bool IsPersistent() { return bPersistent != 0; }
- void SetPersistence( sal_Bool b = sal_True ) { bPersistent = b; }
- void SetSwapStream( SvStream *p )
- { pSwapStream = p; } // call only from FilenameHdl
+ bool IsPersistent() { return bPersistent; }
+ void SetPersistence( bool b = true ) { bPersistent = b; }
+ void SetSwapStream( SvStream *p ) { pSwapStream = p; } // call only from FilenameHdl
};
#endif
diff --git a/include/tools/color.hxx b/include/tools/color.hxx
index 911088b9cad1..f992c32f01d7 100644
--- a/include/tools/color.hxx
+++ b/include/tools/color.hxx
@@ -138,11 +138,11 @@ public:
void Merge( const Color& rMergeColor, sal_uInt8 cTransparency );
- sal_Bool IsRGBEqual( const Color& rColor ) const;
+ bool IsRGBEqual( const Color& rColor ) const;
// comparison with luminance thresholds
- sal_Bool IsDark() const;
- sal_Bool IsBright() const;
+ bool IsDark() const;
+ bool IsBright() const;
// color space conversion tools
// the range for h/s/b is:
@@ -152,13 +152,13 @@ public:
static ColorData HSBtoRGB( sal_uInt16 nHue, sal_uInt16 nSat, sal_uInt16 nBri );
void RGBtoHSB( sal_uInt16& nHue, sal_uInt16& nSat, sal_uInt16& nBri ) const;
- sal_Bool operator==( const Color& rColor ) const
- { return (mnColor == rColor.mnColor); }
- sal_Bool operator!=( const Color& rColor ) const
- { return !(Color::operator==( rColor )); }
+ bool operator==( const Color& rColor ) const
+ { return (mnColor == rColor.mnColor); }
+ bool operator!=( const Color& rColor ) const
+ { return !(Color::operator==( rColor )); }
- SvStream& Read( SvStream& rIStm, sal_Bool bNewFormat = sal_True );
- SvStream& Write( SvStream& rOStm, sal_Bool bNewFormat = sal_True );
+ SvStream& Read( SvStream& rIStm, bool bNewFormat = true );
+ SvStream& Write( SvStream& rOStm, bool bNewFormat = true );
TOOLS_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStream, Color& rColor );
TOOLS_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStream, const Color& rColor );
@@ -191,7 +191,7 @@ inline void Color::SetTransparency( sal_uInt8 nTransparency )
mnColor |= ((sal_uInt32)nTransparency)<<24;
}
-inline sal_Bool Color::IsRGBEqual( const Color& rColor ) const
+inline bool Color::IsRGBEqual( const Color& rColor ) const
{
return (COLORDATA_RGB( mnColor ) == COLORDATA_RGB( rColor.mnColor ));
}
diff --git a/include/tools/config.hxx b/include/tools/config.hxx
index 64b690fda742..d19cc0dbbb55 100644
--- a/include/tools/config.hxx
+++ b/include/tools/config.hxx
@@ -28,17 +28,17 @@ struct ImplGroupData;
class TOOLS_DLLPUBLIC Config
{
private:
- OUString maFileName;
- OString maGroupName;
+ OUString maFileName;
+ OString maGroupName;
ImplConfigData* mpData;
ImplGroupData* mpActGroup;
sal_uIntPtr mnDataUpdateId;
sal_uInt16 mnLockCount;
- sal_Bool mbPersistence;
- sal_Bool mbDummy1;
+ bool mbPersistence;
+ bool mbDummy1;
- TOOLS_DLLPRIVATE sal_Bool ImplUpdateConfig() const;
- TOOLS_DLLPRIVATE ImplGroupData* ImplGetGroup() const;
+ TOOLS_DLLPRIVATE bool ImplUpdateConfig() const;
+ TOOLS_DLLPRIVATE ImplGroupData* ImplGetGroup() const;
public:
Config( const OUString& rFileName );
@@ -51,7 +51,7 @@ public:
void DeleteGroup(const OString& rGroup);
OString GetGroupName(sal_uInt16 nGroup) const;
sal_uInt16 GetGroupCount() const;
- sal_Bool HasGroup(const OString& rGroup) const;
+ bool HasGroup(const OString& rGroup) const;
OString ReadKey(const OString& rKey) const;
OUString ReadKey(const OString& rKey, rtl_TextEncoding eEncoding) const;
@@ -62,12 +62,12 @@ public:
OString ReadKey(sal_uInt16 nKey) const;
sal_uInt16 GetKeyCount() const;
- sal_Bool IsLocked() const { return (mnLockCount != 0); }
+ bool IsLocked() const { return (mnLockCount != 0); }
void Flush();
- void EnablePersistence( sal_Bool bPersistence = sal_True )
+ void EnablePersistence( bool bPersistence = true )
{ mbPersistence = bPersistence; }
- sal_Bool IsPersistenceEnabled() const { return mbPersistence; }
+ bool IsPersistenceEnabled() const { return mbPersistence; }
private:
TOOLS_DLLPRIVATE Config( const Config& rConfig );
diff --git a/include/tools/date.hxx b/include/tools/date.hxx
index 714a97b85727..5b451a39b002 100644
--- a/include/tools/date.hxx
+++ b/include/tools/date.hxx
@@ -110,13 +110,13 @@ public:
sal_uInt16 GetDaysInMonth() const;
sal_uInt16 GetDaysInYear() const { return (IsLeapYear()) ? 366 : 365; }
- sal_Bool IsLeapYear() const;
+ bool IsLeapYear() const;
/** If the represented date is valid (1<=month<=12, 1<=day<=(28,29,30,31)
depending on month/year) AND is of the Gregorian calendar (1582-10-15
<= date) (AND implicitly date <= 9999-12-31 due to internal
representation) */
- sal_Bool IsValidAndGregorian() const;
+ bool IsValidAndGregorian() const;
/** If the represented date is valid (1<=month<=12, 1<=day<=(28,29,30,31)
depending on month/year) */
@@ -136,21 +136,21 @@ public:
*/
bool Normalize();
- sal_Bool IsBetween( const Date& rFrom, const Date& rTo ) const
+ bool IsBetween( const Date& rFrom, const Date& rTo ) const
{ return ((nDate >= rFrom.nDate) &&
(nDate <= rTo.nDate)); }
- sal_Bool operator ==( const Date& rDate ) const
+ bool operator ==( const Date& rDate ) const
{ return (nDate == rDate.nDate); }
- sal_Bool operator !=( const Date& rDate ) const
+ bool operator !=( const Date& rDate ) const
{ return (nDate != rDate.nDate); }
- sal_Bool operator >( const Date& rDate ) const
+ bool operator >( const Date& rDate ) const
{ return (nDate > rDate.nDate); }
- sal_Bool operator <( const Date& rDate ) const
+ bool operator <( const Date& rDate ) const
{ return (nDate < rDate.nDate); }
- sal_Bool operator >=( const Date& rDate ) const
+ bool operator >=( const Date& rDate ) const
{ return (nDate >= rDate.nDate); }
- sal_Bool operator <=( const Date& rDate ) const
+ bool operator <=( const Date& rDate ) const
{ return (nDate <= rDate.nDate); }
Date& operator =( const Date& rDate )
diff --git a/include/tools/datetime.hxx b/include/tools/datetime.hxx
index 1de0f3d6432c..a8d732efc510 100644
--- a/include/tools/datetime.hxx
+++ b/include/tools/datetime.hxx
@@ -47,26 +47,26 @@ public:
DateTime( const Date& rDate, const Time& rTime ) :
Date( rDate ), Time( rTime ) {}
- sal_Bool IsBetween( const DateTime& rFrom,
+ bool IsBetween( const DateTime& rFrom,
const DateTime& rTo ) const;
- sal_Bool IsEqualIgnoreNanoSec( const DateTime& rDateTime ) const
+ bool IsEqualIgnoreNanoSec( const DateTime& rDateTime ) const
{
if ( Date::operator!=( rDateTime ) )
- return sal_False;
+ return false;
return Time::IsEqualIgnoreNanoSec( rDateTime );
}
- sal_Bool operator ==( const DateTime& rDateTime ) const
+ bool operator ==( const DateTime& rDateTime ) const
{ return (Date::operator==( rDateTime ) &&
Time::operator==( rDateTime )); }
- sal_Bool operator !=( const DateTime& rDateTime ) const
+ bool operator !=( const DateTime& rDateTime ) const
{ return (Date::operator!=( rDateTime ) ||
Time::operator!=( rDateTime )); }
- sal_Bool operator >( const DateTime& rDateTime ) const;
- sal_Bool operator <( const DateTime& rDateTime ) const;
- sal_Bool operator >=( const DateTime& rDateTime ) const;
- sal_Bool operator <=( const DateTime& rDateTime ) const;
+ bool operator >( const DateTime& rDateTime ) const;
+ bool operator <( const DateTime& rDateTime ) const;
+ bool operator >=( const DateTime& rDateTime ) const;
+ bool operator <=( const DateTime& rDateTime ) const;
long GetSecFromDateTime( const Date& rDate ) const;
diff --git a/include/tools/debug.hxx b/include/tools/debug.hxx
index 54160502257a..44be8f055a1b 100644
--- a/include/tools/debug.hxx
+++ b/include/tools/debug.hxx
@@ -182,9 +182,9 @@ typedef sal_uInt16 DbgChannelId;
*/
TOOLS_DLLPUBLIC DbgChannelId DbgRegisterUserChannel( DbgPrintLine pProc );
-inline sal_Bool DbgFilterMessage( const char* pMsg )
+inline bool DbgFilterMessage( const char* pMsg )
{
- return (sal_Bool)(long) DbgFunc( DBG_FUNC_FILTERMESSAGE, (void*)pMsg );
+ return (bool)(long) DbgFunc( DBG_FUNC_FILTERMESSAGE, (void*)pMsg );
}
inline int DbgIsAllErrorOut()
diff --git a/include/tools/errinf.hxx b/include/tools/errinf.hxx
index 815447b7372f..04f03671194b 100644
--- a/include/tools/errinf.hxx
+++ b/include/tools/errinf.hxx
@@ -23,9 +23,9 @@
#define _EINF_HXX
#include <limits.h>
+#include <rtl/ustring.hxx>
#include <tools/rtti.hxx>
#include <tools/errcode.hxx>
-#include <tools/string.hxx>
#include "tools/toolsdllapi.h"
class EDcr_Impl;
@@ -127,7 +127,7 @@ public:
ErrorContext(Window *pWin=0);
virtual ~ErrorContext();
- virtual sal_Bool GetString( sal_uIntPtr nErrId, OUString& rCtxStr ) = 0;
+ virtual bool GetString( sal_uIntPtr nErrId, OUString& rCtxStr ) = 0;
Window* GetParent() { return pWin; }
static ErrorContext* GetContext();
@@ -148,10 +148,10 @@ private:
static sal_uInt16 HandleError_Impl( sal_uIntPtr lId,
sal_uInt16 nFlags,
- sal_Bool bJustCreateString,
+ bool bJustCreateString,
OUString & rError);
protected:
- virtual sal_Bool CreateString( const ErrorInfo *,
+ virtual bool CreateString( const ErrorInfo *,
OUString &, sal_uInt16& nMask ) const = 0;
public:
@@ -159,7 +159,7 @@ public:
virtual ~ErrorHandler();
static sal_uInt16 HandleError ( sal_uIntPtr lId, sal_uInt16 nMask = USHRT_MAX );
- static sal_Bool GetErrorString( sal_uIntPtr lId, OUString& rStr );
+ static bool GetErrorString( sal_uIntPtr lId, OUString& rStr );
static void RegisterDisplay( BasicDisplayErrorFunc* );
static void RegisterDisplay( WindowDisplayErrorFunc* );
@@ -168,7 +168,7 @@ public:
class TOOLS_DLLPUBLIC SimpleErrorHandler : private ErrorHandler
{
protected:
- virtual sal_Bool CreateString( const ErrorInfo*, OUString &,
+ virtual bool CreateString( const ErrorInfo*, OUString &,
sal_uInt16 &nMask ) const;
public:
diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx
index c1a1e359bccc..fbfac95ec323 100644
--- a/include/tools/gen.hxx
+++ b/include/tools/gen.hxx
@@ -42,8 +42,8 @@ public:
long& A() { return nA; }
long& B() { return nB; }
- sal_Bool operator == ( const Pair& rPair ) const;
- sal_Bool operator != ( const Pair& rPair ) const;
+ bool operator == ( const Pair& rPair ) const;
+ bool operator != ( const Pair& rPair ) const;
TOOLS_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStream, Pair& rPair );
TOOLS_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStream, const Pair& rPair );
@@ -64,12 +64,12 @@ inline Pair::Pair( long _nA, long _nB )
Pair::nB = _nB;
}
-inline sal_Bool Pair::operator == ( const Pair& rPair ) const
+inline bool Pair::operator == ( const Pair& rPair ) const
{
return ((nA == rPair.nA) && (nB == rPair.nB));
}
-inline sal_Bool Pair::operator != ( const Pair& rPair ) const
+inline bool Pair::operator != ( const Pair& rPair ) const
{
return ((nA != rPair.nA) || (nB != rPair.nB));
}
@@ -89,10 +89,10 @@ public:
long& Y() { return nB; }
void Move( long nHorzMove, long nVertMove );
- sal_Bool IsAbove( const Point& rPoint ) const;
- sal_Bool IsBelow( const Point& rPoint ) const;
- sal_Bool IsLeft( const Point& rPoint ) const;
- sal_Bool IsRight( const Point& rPoint ) const;
+ bool IsAbove( const Point& rPoint ) const;
+ bool IsBelow( const Point& rPoint ) const;
+ bool IsLeft( const Point& rPoint ) const;
+ bool IsRight( const Point& rPoint ) const;
Point& operator += ( const Point& rPoint );
Point& operator -= ( const Point& rPoint );
@@ -124,22 +124,22 @@ inline void Point::Move( long nHorzMove, long nVertMove )
nB += nVertMove;
}
-inline sal_Bool Point::IsAbove( const Point& rPoint ) const
+inline bool Point::IsAbove( const Point& rPoint ) const
{
return (nB > rPoint.nB);
}
-inline sal_Bool Point::IsBelow( const Point& rPoint ) const
+inline bool Point::IsBelow( const Point& rPoint ) const
{
return (nB < rPoint.nB);
}
-inline sal_Bool Point::IsLeft( const Point& rPoint ) const
+inline bool Point::IsLeft( const Point& rPoint ) const
{
return (nA < rPoint.nA);
}
-inline sal_Bool Point::IsRight( const Point& rPoint ) const
+inline bool Point::IsRight( const Point& rPoint ) const
{
return (nA > rPoint.nA);
}
@@ -252,7 +252,7 @@ public:
long& Min() { return nA; }
long& Max() { return nB; }
- sal_Bool IsInside( long nIs ) const;
+ bool IsInside( long nIs ) const;
void Justify();
};
@@ -265,7 +265,7 @@ inline Range::Range( long nMin, long nMax ) : Pair( nMin, nMax )
{
}
-inline sal_Bool Range::IsInside( long nIs ) const
+inline bool Range::IsInside( long nIs ) const
{
return ((nA <= nIs) && (nIs <= nB ));
}
@@ -306,11 +306,11 @@ public:
long& Min() { return nA; }
long& Max() { return nB; }
- sal_Bool IsInside( long nIs ) const;
+ bool IsInside( long nIs ) const;
void Justify();
- sal_Bool operator !() const { return !Len(); }
+ bool operator !() const { return !Len(); }
long getMin() const { return Min(); }
long getMax() const { return Max(); }
@@ -331,7 +331,7 @@ inline Selection::Selection( long nMin, long nMax ) :
{
}
-inline sal_Bool Selection::IsInside( long nIs ) const
+inline bool Selection::IsInside( long nIs ) const
{
return ((nA <= nIs) && (nIs < nB ));
}
@@ -401,15 +401,15 @@ public:
void Justify();
- sal_Bool IsInside( const Point& rPOINT ) const;
- sal_Bool IsInside( const Rectangle& rRect ) const;
- sal_Bool IsOver( const Rectangle& rRect ) const;
+ bool IsInside( const Point& rPOINT ) const;
+ bool IsInside( const Rectangle& rRect ) const;
+ bool IsOver( const Rectangle& rRect ) const;
void SetEmpty() { nRight = nBottom = RECT_EMPTY; }
- inline sal_Bool IsEmpty() const;
+ inline bool IsEmpty() const;
- inline sal_Bool operator == ( const Rectangle& rRect ) const;
- inline sal_Bool operator != ( const Rectangle& rRect ) const;
+ inline bool operator == ( const Rectangle& rRect ) const;
+ inline bool operator != ( const Rectangle& rRect ) const;
inline Rectangle& operator += ( const Point& rPt );
inline Rectangle& operator -= ( const Point& rPt );
@@ -468,7 +468,7 @@ inline Rectangle::Rectangle( const Point& rLT, const Size& rSize )
nBottom = rSize.Height() ? nTop+rSize.Height()-1 : RECT_EMPTY;
}
-inline sal_Bool Rectangle::IsEmpty() const
+inline bool Rectangle::IsEmpty() const
{
return ((nRight == RECT_EMPTY) || (nBottom == RECT_EMPTY));
}
@@ -621,7 +621,7 @@ inline Rectangle Rectangle::GetIntersection( const Rectangle& rRect ) const
return aTmpRect.Intersection( rRect );
}
-inline sal_Bool Rectangle::operator == ( const Rectangle& rRect ) const
+inline bool Rectangle::operator == ( const Rectangle& rRect ) const
{
return ((nLeft == rRect.nLeft ) &&
(nTop == rRect.nTop ) &&
@@ -629,7 +629,7 @@ inline sal_Bool Rectangle::operator == ( const Rectangle& rRect ) const
(nBottom == rRect.nBottom ));
}
-inline sal_Bool Rectangle::operator != ( const Rectangle& rRect ) const
+inline bool Rectangle::operator != ( const Rectangle& rRect ) const
{
return ((nLeft != rRect.nLeft ) ||
(nTop != rRect.nTop ) ||
diff --git a/include/tools/globname.hxx b/include/tools/globname.hxx
index 2ea6850801d1..eb7b7e91bee2 100644
--- a/include/tools/globname.hxx
+++ b/include/tools/globname.hxx
@@ -23,7 +23,6 @@
#include "tools/toolsdllapi.h"
#include <com/sun/star/uno/Sequence.hxx>
-#include <tools/string.hxx>
struct ImpSvGlobalName
{
@@ -39,7 +38,7 @@ struct ImpSvGlobalName
ImpSvGlobalName( const ImpSvGlobalName & rObj );
ImpSvGlobalName( Empty );
- sal_Bool operator == ( const ImpSvGlobalName & rObj ) const;
+ bool operator == ( const ImpSvGlobalName & rObj ) const;
};
#ifdef WNT
@@ -82,17 +81,17 @@ public:
TOOLS_DLLPUBLIC friend SvStream & operator >> ( SvStream &, SvGlobalName & );
TOOLS_DLLPUBLIC friend SvStream & operator << ( SvStream &, const SvGlobalName & );
- sal_Bool operator < ( const SvGlobalName & rObj ) const;
- SvGlobalName & operator += ( sal_uInt32 );
- SvGlobalName & operator ++ () { return operator += ( 1 ); }
+ bool operator < ( const SvGlobalName & rObj ) const;
+ SvGlobalName& operator += ( sal_uInt32 );
+ SvGlobalName& operator ++ () { return operator += ( 1 ); }
- sal_Bool operator == ( const SvGlobalName & rObj ) const;
- sal_Bool operator != ( const SvGlobalName & rObj ) const
- { return !(*this == rObj); }
+ bool operator == ( const SvGlobalName & rObj ) const;
+ bool operator != ( const SvGlobalName & rObj ) const
+ { return !(*this == rObj); }
- void MakeFromMemory( void * pData );
- sal_Bool MakeId( const String & rId );
- String GetHexName() const;
+ void MakeFromMemory( void * pData );
+ bool MakeId( const OUString & rId );
+ OUString GetHexName() const;
SvGlobalName( const CLSID & rId );
const CLSID & GetCLSID() const { return *(CLSID *)pImp->szData; }
diff --git a/include/tools/inetmime.hxx b/include/tools/inetmime.hxx
index afe4247c6612..347bb78861fd 100644
--- a/include/tools/inetmime.hxx
+++ b/include/tools/inetmime.hxx
@@ -26,6 +26,7 @@
#include <rtl/character.hxx>
#include <rtl/string.hxx>
#include <rtl/strbuf.hxx>
+#include <rtl/ustring.hxx>
#include <rtl/tencinfo.h>
#include <tools/debug.hxx>
#include <tools/errcode.hxx>
diff --git a/include/tools/inetmsg.hxx b/include/tools/inetmsg.hxx
index 395286a04db2..fe05d635f4bc 100644
--- a/include/tools/inetmsg.hxx
+++ b/include/tools/inetmsg.hxx
@@ -408,7 +408,7 @@ class TOOLS_DLLPUBLIC INetMIMEMessage : public INetRFC822Message
void CleanupImp();
void CopyImp (const INetMIMEMessage& rMsg);
- void SetHeaderParsed() { bHeaderParsed = sal_True; }
+ void SetHeaderParsed() { bHeaderParsed = true; }
protected:
virtual SvStream& operator<< (SvStream& rStrm) const;
diff --git a/include/tools/inetstrm.hxx b/include/tools/inetstrm.hxx
index d7b4e149d798..dcf1ecd9fd97 100644
--- a/include/tools/inetstrm.hxx
+++ b/include/tools/inetstrm.hxx
@@ -21,7 +21,7 @@
#include "tools/toolsdllapi.h"
#include <sal/types.h>
-#include <tools/string.hxx>
+#include <rtl/ustring.hxx>
class INetMessage;
class INetMIMEMessage;
@@ -84,7 +84,7 @@ enum INetMessageStreamState
class INetMessageIStream : public INetIStream
{
INetMessage *pSourceMsg;
- sal_Bool bHeaderGenerated;
+ bool bHeaderGenerated;
sal_uIntPtr nBufSiz;
sal_Char *pBuffer;
@@ -112,15 +112,15 @@ public:
INetMessage *GetSourceMessage (void) const { return pSourceMsg; }
void SetSourceMessage (INetMessage *pMsg) { pSourceMsg = pMsg; }
- void GenerateHeader (sal_Bool bGen = sal_True) { bHeaderGenerated = !bGen; }
- sal_Bool IsHeaderGenerated (void) const { return bHeaderGenerated; }
+ void GenerateHeader (bool bGen = true) { bHeaderGenerated = !bGen; }
+ bool IsHeaderGenerated (void) const { return bHeaderGenerated; }
};
/// Message Parser Interface.
class INetMessageOStream : public INetOStream
{
INetMessage *pTargetMsg;
- sal_Bool bHeaderParsed;
+ bool bHeaderParsed;
INetMessageStreamState eOState;
@@ -142,8 +142,8 @@ public:
INetMessage *GetTargetMessage (void) const { return pTargetMsg; }
void SetTargetMessage (INetMessage *pMsg) { pTargetMsg = pMsg; }
- void ParseHeader (sal_Bool bParse = sal_True) { bHeaderParsed = !bParse; }
- sal_Bool IsHeaderParsed (void) const { return bHeaderParsed; }
+ void ParseHeader (bool bParse = true) { bHeaderParsed = !bParse; }
+ bool IsHeaderParsed (void) const { return bHeaderParsed; }
};
class INetMessageIOStream
@@ -182,7 +182,7 @@ class TOOLS_DLLPUBLIC INetMIMEMessageStream : public INetMessageIOStream
SvMemoryStream *pMsgBuffer;
static INetMessageEncoding GetMsgEncoding (
- const String& rContentType);
+ const OUString& rContentType);
// Not implemented.
INetMIMEMessageStream (const INetMIMEMessageStream& rStrm);
diff --git a/include/tools/line.hxx b/include/tools/line.hxx
index e1b62ffd00f8..eb3f3219aa2e 100644
--- a/include/tools/line.hxx
+++ b/include/tools/line.hxx
@@ -47,8 +47,8 @@ public:
double GetLength() const;
- sal_Bool Intersection( const Line& rLine, double& rIntersectionX, double& rIntersectionY ) const;
- sal_Bool Intersection( const Line& rLine, Point& rIntersection ) const;
+ bool Intersection( const Line& rLine, double& rIntersectionX, double& rIntersectionY ) const;
+ bool Intersection( const Line& rLine, Point& rIntersection ) const;
double GetDistance( const double& rPtX, const double& rPtY ) const;
double GetDistance( const Point& rPoint ) const { return( GetDistance( rPoint.X(), rPoint.Y() ) ); }
diff --git a/include/tools/link.hxx b/include/tools/link.hxx
index a06e8b9cdc08..279c7b7fed16 100644
--- a/include/tools/link.hxx
+++ b/include/tools/link.hxx
@@ -96,13 +96,13 @@ public:
sal_IntPtr Call( void* pCaller ) const;
- sal_Bool IsSet() const;
- sal_Bool operator !() const;
+ bool IsSet() const;
+ bool operator !() const;
- sal_Bool operator==( const Link& rLink ) const;
- sal_Bool operator!=( const Link& rLink ) const
+ bool operator==( const Link& rLink ) const;
+ bool operator!=( const Link& rLink ) const
{ return !(Link::operator==( rLink )); }
- sal_Bool operator<( const Link& rLink ) const
+ bool operator<( const Link& rLink ) const
{ return ((sal_uIntPtr)rLink.pFunc < (sal_uIntPtr)pFunc); }
};
@@ -123,20 +123,20 @@ inline sal_IntPtr Link::Call(void *pCaller) const
return pFunc ? (*pFunc)(pInst, pCaller) : 0;
}
-inline sal_Bool Link::IsSet() const
+inline bool Link::IsSet() const
{
if ( pFunc )
- return sal_True;
+ return true;
else
- return sal_False;
+ return false;
}
-inline sal_Bool Link::operator !() const
+inline bool Link::operator !() const
{
if ( !pFunc )
- return sal_True;
+ return true;
else
- return sal_False;
+ return false;
}
#endif
diff --git a/include/tools/multisel.hxx b/include/tools/multisel.hxx
index 8b5d434130fa..7e3d46325629 100644
--- a/include/tools/multisel.hxx
+++ b/include/tools/multisel.hxx
@@ -38,13 +38,13 @@ private:
sal_uIntPtr nCurSubSel; // index in aSels of current selected index
long nCurIndex; // current selected entry
sal_uIntPtr nSelCount; // number of selected indexes
- sal_Bool bInverseCur;// inverse cursor
- sal_Bool bCurValid; // are nCurIndex and nCurSubSel valid
- sal_Bool bSelectNew; // auto-select newly inserted indexes
+ bool bInverseCur;// inverse cursor
+ bool bCurValid; // are nCurIndex and nCurSubSel valid
+ bool bSelectNew; // auto-select newly inserted indexes
TOOLS_DLLPRIVATE void ImplClear();
TOOLS_DLLPRIVATE size_t ImplFindSubSelection( long nIndex ) const;
- TOOLS_DLLPRIVATE sal_Bool ImplMergeSubSelections( size_t nPos1, size_t nPos2 );
+ TOOLS_DLLPRIVATE bool ImplMergeSubSelections( size_t nPos1, size_t nPos2 );
TOOLS_DLLPRIVATE long ImplFwdUnselected();
public:
@@ -54,17 +54,17 @@ public:
~MultiSelection();
MultiSelection& operator= ( const MultiSelection& rOrig );
- sal_Bool operator== ( MultiSelection& rOrig );
- sal_Bool operator!= ( MultiSelection& rOrig )
+ bool operator== ( MultiSelection& rOrig );
+ bool operator!= ( MultiSelection& rOrig )
{ return !operator==( rOrig ); }
- sal_Bool operator !() const
+ bool operator !() const
{ return nSelCount == 0; }
- void SelectAll( sal_Bool bSelect = sal_True );
- sal_Bool Select( long nIndex, sal_Bool bSelect = sal_True );
- void Select( const Range& rIndexRange, sal_Bool bSelect = sal_True );
- sal_Bool IsSelected( long nIndex ) const;
- sal_Bool IsAllSelected() const
+ void SelectAll( bool bSelect = true );
+ bool Select( long nIndex, bool bSelect = true );
+ void Select( const Range& rIndexRange, bool bSelect = true );
+ bool IsSelected( long nIndex ) const;
+ bool IsAllSelected() const
{ return nSelCount == sal_uIntPtr(aTotRange.Len()); }
long GetSelectCount() const { return nSelCount; }
@@ -73,9 +73,9 @@ public:
void Remove( long nIndex );
const Range& GetTotalRange() const { return aTotRange; }
- sal_Bool IsCurValid() const { return bCurValid; }
+ bool IsCurValid() const { return bCurValid; }
long GetCurSelected() const { return nCurIndex; }
- long FirstSelected( sal_Bool bInverse = sal_False );
+ long FirstSelected( bool bInverse = false );
long LastSelected();
long NextSelected();
diff --git a/include/tools/poly.hxx b/include/tools/poly.hxx
index 4229195dc98a..b2d9b7112e2d 100644
--- a/include/tools/poly.hxx
+++ b/include/tools/poly.hxx
@@ -107,7 +107,7 @@ public:
Polygon( const Rectangle& rBound,
const Point& rStart, const Point& rEnd,
PolyStyle ePolyStyle = POLY_ARC,
- sal_Bool bWholeCircle = sal_False );
+ bool bWholeCircle = false );
Polygon( const Point& rBezPt1, const Point& rCtrlPt1,
const Point& rBezPt2, const Point& rCtrlPt2,
sal_uInt16 nPoints = 0 );
@@ -120,9 +120,9 @@ public:
void SetFlags( sal_uInt16 nPos, PolyFlags eFlags );
PolyFlags GetFlags( sal_uInt16 nPos ) const;
- sal_Bool HasFlags() const;
+ bool HasFlags() const;
- sal_Bool IsRect() const;
+ bool IsRect() const;
void SetSize( sal_uInt16 nNewSize );
sal_uInt16 GetSize() const;
@@ -131,10 +131,10 @@ public:
Rectangle GetBoundRect() const;
double GetSignedArea() const;
- sal_Bool IsInside( const Point& rPt ) const;
- sal_Bool IsRightOrientated() const;
+ bool IsInside( const Point& rPt ) const;
+ bool IsRightOrientated() const;
double CalcDistance( sal_uInt16 nPt1, sal_uInt16 nPt2 );
- void Clip( const Rectangle& rRect, sal_Bool bPolygon = sal_True );
+ void Clip( const Rectangle& rRect, bool bPolygon = true );
void Optimize( sal_uIntPtr nOptimizeFlags, const PolyOptimizeData* pData = NULL );
/** Adaptive subdivision of polygons with curves
@@ -170,10 +170,10 @@ public:
Point& operator[]( sal_uInt16 nPos );
Polygon& operator=( const Polygon& rPoly );
- sal_Bool operator==( const Polygon& rPoly ) const;
- sal_Bool operator!=( const Polygon& rPoly ) const
+ bool operator==( const Polygon& rPoly ) const;
+ bool operator!=( const Polygon& rPoly ) const
{ return !(Polygon::operator==( rPoly )); }
- sal_Bool IsEqual( const Polygon& rPoly ) const;
+ bool IsEqual( const Polygon& rPoly ) const;
// streaming a Polygon does ignore PolyFlags, so use the Write Or Read
// method to take care of PolyFlags
@@ -214,7 +214,7 @@ public:
void Replace( const Polygon& rPoly, sal_uInt16 nPos );
const Polygon& GetObject( sal_uInt16 nPos ) const;
- sal_Bool IsRect() const;
+ bool IsRect() const;
void Clear();
@@ -256,11 +256,11 @@ public:
Polygon& operator[]( sal_uInt16 nPos );
PolyPolygon& operator=( const PolyPolygon& rPolyPoly );
- sal_Bool operator==( const PolyPolygon& rPolyPoly ) const;
- sal_Bool operator!=( const PolyPolygon& rPolyPoly ) const
+ bool operator==( const PolyPolygon& rPolyPoly ) const;
+ bool operator!=( const PolyPolygon& rPolyPoly ) const
{ return !(PolyPolygon::operator==( rPolyPoly )); }
- sal_Bool IsEqual( const PolyPolygon& rPolyPoly ) const;
+ bool IsEqual( const PolyPolygon& rPolyPoly ) const;
TOOLS_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStream, PolyPolygon& rPolyPoly );
TOOLS_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStream, const PolyPolygon& rPolyPoly );
diff --git a/include/tools/pstm.hxx b/include/tools/pstm.hxx
index 6f971ca7014a..bb608a11867b 100644
--- a/include/tools/pstm.hxx
+++ b/include/tools/pstm.hxx
@@ -202,11 +202,11 @@ class TOOLS_DLLPUBLIC SvPersistStream : public SvStream
protected:
void WriteObj( sal_uInt8 nHdr, SvPersistBase * pObj );
- sal_uInt32 ReadObj( SvPersistBase * & rpObj, sal_Bool bRegister );
+ sal_uInt32 ReadObj( SvPersistBase * & rpObj, bool bRegister );
public:
- sal_Bool IsStreamed( SvPersistBase * pObj ) const
- { return 0 != GetIndex( pObj ); }
+ bool IsStreamed( SvPersistBase * pObj ) const
+ { return 0 != GetIndex( pObj ); }
virtual void ResetError();
SvPersistStream( SvClassManager &, SvStream * pStream,
diff --git a/include/tools/rc.hxx b/include/tools/rc.hxx
index a043db47d4d5..e89b91104849 100644
--- a/include/tools/rc.hxx
+++ b/include/tools/rc.hxx
@@ -30,8 +30,8 @@ protected:
ResMgr* m_pResMgr;
// check availability of Resource
- sal_Bool IsAvailableRes( const ResId& rId ) const
- { return m_pResMgr->IsAvailable( rId, this ); }
+ bool IsAvailableRes( const ResId& rId ) const
+ { return m_pResMgr->IsAvailable( rId, this ); }
// Load a Resource
void GetRes( const ResId& rResId );
diff --git a/include/tools/resid.hxx b/include/tools/resid.hxx
index 14c0a11915f7..89606c824658 100644
--- a/include/tools/resid.hxx
+++ b/include/tools/resid.hxx
@@ -132,7 +132,7 @@ public:
return *this;
}
- const ResId & SetAutoRelease(sal_Bool bRelease) const
+ const ResId & SetAutoRelease(bool bRelease) const
{
if( bRelease )
m_nResId &= ~RSC_DONTRELEASE;
@@ -141,8 +141,8 @@ public:
return *this;
}
- sal_Bool IsAutoRelease() const
- { return !(m_nResId & RSC_DONTRELEASE); }
+ bool IsAutoRelease() const
+ { return !(m_nResId & RSC_DONTRELEASE); }
sal_uInt32 GetId() const { return m_nResId & ~RSC_DONTRELEASE; }
RSHEADER_TYPE* GetpResource() const { return m_pResource; }
diff --git a/include/tools/resmgr.hxx b/include/tools/resmgr.hxx
index 603a2c7a2eb5..9f6b2d246534 100644
--- a/include/tools/resmgr.hxx
+++ b/include/tools/resmgr.hxx
@@ -143,11 +143,11 @@ public:
void TestStack( const Resource * );
/// Check whether resource is available
- sal_Bool IsAvailable( const ResId& rId,
+ bool IsAvailable( const ResId& rId,
const Resource* = NULL) const;
/// Search and load resource, given its ID
- sal_Bool GetResource( const ResId& rId, const Resource * = NULL );
+ bool GetResource( const ResId& rId, const Resource * = NULL );
static void * GetResourceSkipHeader( const ResId& rResId, ResMgr ** ppResMgr );
/// Free resource context
void PopContext( const Resource* = NULL );
diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx
index 78a0bc3df96f..3d9f36323920 100644
--- a/include/tools/stream.hxx
+++ b/include/tools/stream.hxx
@@ -22,7 +22,7 @@
#include <limits>
#include "tools/toolsdllapi.h"
#include <tools/solar.h>
-#include <tools/string.hxx>
+#include <tools/lineend.hxx>
#include <tools/errinf.hxx>
#include <tools/ref.hxx>
#include <tools/rtti.hxx>
@@ -79,10 +79,6 @@ typedef sal_uInt16 StreamMode;
#define COMPRESSMODE_ZBITMAP (sal_uInt16)0x0001
#define COMPRESSMODE_NATIVE (sal_uInt16)0x0010
-#define STREAM_IO_DONTKNOW 0
-#define STREAM_IO_READ 1
-#define STREAM_IO_WRITE 2
-
#define ID_STREAM 1
#define ID_FILESTREAM 2
#define ID_MEMORYSTREAM 3
@@ -112,8 +108,8 @@ enum SvLockBytesStatFlag { SVSTATFLAG_DEFAULT };
class TOOLS_DLLPUBLIC SvLockBytes: public virtual SvRefBase
{
SvStream * m_pStream;
- sal_Bool m_bOwner;
- sal_Bool m_bSync;
+ bool m_bOwner;
+ bool m_bSync;
protected:
void close();
@@ -121,17 +117,17 @@ protected:
public:
TYPEINFO();
- SvLockBytes() : m_pStream(0), m_bOwner(sal_False), m_bSync(sal_False) {}
+ SvLockBytes() : m_pStream(0), m_bOwner(false), m_bSync(false) {}
- SvLockBytes(SvStream * pTheStream, sal_Bool bTheOwner = sal_False) :
- m_pStream(pTheStream), m_bOwner(bTheOwner), m_bSync(sal_False) {}
+ SvLockBytes(SvStream * pTheStream, bool bTheOwner = false) :
+ m_pStream(pTheStream), m_bOwner(bTheOwner), m_bSync(false) {}
virtual ~SvLockBytes() { close(); }
virtual const SvStream * GetStream() const { return m_pStream; }
- virtual void SetSynchronMode(sal_Bool bTheSync = sal_True) { m_bSync = bTheSync; }
- virtual sal_Bool IsSynchronMode() const { return m_bSync; }
+ virtual void SetSynchronMode(bool bTheSync = true) { m_bSync = bTheSync; }
+ virtual bool IsSynchronMode() const { return m_bSync; }
virtual ErrCode ReadAt(sal_Size nPos, void * pBuffer, sal_Size nCount,
sal_Size * pRead) const;
@@ -154,8 +150,8 @@ class TOOLS_DLLPUBLIC SvOpenLockBytes: public SvLockBytes
public:
TYPEINFO();
- SvOpenLockBytes() : SvLockBytes(0, sal_False) {}
- SvOpenLockBytes(SvStream * pStream, sal_Bool bOwner):
+ SvOpenLockBytes() : SvLockBytes(0, false) {}
+ SvOpenLockBytes(SvStream * pStream, bool bOwner):
SvLockBytes(pStream, bOwner) {}
virtual ErrCode FillAppend(const void * pBuffer, sal_Size nCount,
@@ -165,7 +161,7 @@ public:
virtual sal_Size Seek(sal_Size nPos) = 0;
- virtual void Terminate() = 0;
+ virtual void Terminate() = 0;
};
SV_DECL_IMPL_REF(SvOpenLockBytes);
@@ -175,13 +171,13 @@ SV_DECL_IMPL_REF(SvOpenLockBytes);
class SvAsyncLockBytes: public SvOpenLockBytes
{
sal_Size m_nSize;
- sal_Bool m_bTerminated;
+ bool m_bTerminated;
public:
TYPEINFO();
- SvAsyncLockBytes(SvStream * pStream, sal_Bool bOwner):
- SvOpenLockBytes(pStream, bOwner), m_nSize(0), m_bTerminated(sal_False) {}
+ SvAsyncLockBytes(SvStream * pStream, bool bOwner):
+ SvOpenLockBytes(pStream, bOwner), m_nSize(0), m_bTerminated(false) {}
virtual ErrCode ReadAt(sal_Size nPos, void * pBuffer, sal_Size nCount,
sal_Size * pRead) const;
@@ -195,7 +191,7 @@ public:
virtual sal_Size Seek(sal_Size nPos);
- virtual void Terminate() { m_bTerminated = sal_True; }
+ virtual void Terminate() { m_bTerminated = true; }
};
SV_DECL_IMPL_REF(SvAsyncLockBytes);
@@ -206,32 +202,33 @@ class TOOLS_DLLPUBLIC SvStream
{
private:
// LockBytes Interface
- void* pImp; // unused
- SvLockBytesRef xLockBytes; // Default implementation
- sal_Size nActPos;
+ void* pImp; // unused
+ SvLockBytesRef xLockBytes; // Default implementation
+ sal_Size nActPos;
// Puffer-Verwaltung
- sal_uInt8* pRWBuf; // Points to read/write buffer
- sal_uInt8* pBufPos; // pRWBuf + nBufActualPos
- sal_uInt16 nBufSize; // Allocated size of buffer
- sal_uInt16 nBufActualLen; // Length of used segment of puffer
+ sal_uInt8* pRWBuf; // Points to read/write buffer
+ sal_uInt8* pBufPos; // pRWBuf + nBufActualPos
+ sal_uInt16 nBufSize; // Allocated size of buffer
+ sal_uInt16 nBufActualLen; // Length of used segment of puffer
// = nBufSize, if EOF did not occur
- sal_uInt16 nBufActualPos; // current position in buffer (0..nBufSize-1)
- sal_uInt16 nBufFree; // number of free slots in buffer to IO of type eIOMode
- unsigned int eIOMode : 2;// STREAM_IO_*
+ sal_uInt16 nBufActualPos; // current position in buffer (0..nBufSize-1)
+ sal_uInt16 nBufFree; // number of free slots in buffer to IO of type eIOMode
+ bool bIoRead;
+ bool bIoWrite;
// Error codes, conversion, compression, ...
- int bIsDirty : 1; // sal_True: Stream != buffer content
- int bIsConsistent : 1;// sal_False: Buffer contains data, which were
+ bool bIsDirty; // true: Stream != buffer content
+ bool bIsConsistent;// false: Buffer contains data, which were
// NOT allowed to be written by PutData
// into the derived stream (cf. PutBack)
- int bSwap : 1;
- int bIsEof : 1;
- sal_uInt32 nError;
- sal_uInt16 nNumberFormatInt;
- sal_uInt16 nCompressMode;
- LineEnd eLineDelimiter;
- CharSet eStreamCharSet;
+ bool bSwap;
+ bool bIsEof;
+ sal_uInt32 nError;
+ sal_uInt16 nNumberFormatInt;
+ sal_uInt16 nCompressMode;
+ LineEnd eLineDelimiter;
+ rtl_TextEncoding eStreamCharSet;
// Encryption
OString m_aCryptMaskKey;// aCryptMaskKey.getLength != 0 -> Encryption used
@@ -249,7 +246,7 @@ private:
protected:
sal_Size nBufFilePos;///< File position of pBuf[0]
sal_uInt16 eStreamMode;
- sal_Bool bIsWritable;
+ bool bIsWritable;
virtual sal_Size GetData( void* pData, sal_Size nSize );
virtual sal_Size PutData( const void* pData, sal_Size nSize );
@@ -262,7 +259,7 @@ protected:
// encrypt and write in blocks
sal_Size CryptAndWriteBuffer( const void* pStart, sal_Size nLen );
- sal_Bool EncryptBuffer( void* pStart, sal_Size nLen );
+ bool EncryptBuffer( void* pStart, sal_Size nLen );
void SyncSvStream( sal_Size nNewStreamPos ); ///< SvStream <- Medium
void SyncSysStream(); ///< SvStream -> Medium
@@ -274,8 +271,8 @@ public:
SvLockBytes* GetLockBytes() const { return xLockBytes; }
- sal_uInt32 GetError() const { return ERRCODE_TOERROR(nError); }
- sal_uInt32 GetErrorCode() const { return nError; }
+ sal_uInt32 GetError() const { return ERRCODE_TOERROR(nError); }
+ sal_uInt32 GetErrorCode() const { return nError; }
void SetError( sal_uInt32 nErrorCode );
virtual void ResetError();
@@ -283,9 +280,9 @@ public:
void SetNumberFormatInt( sal_uInt16 nNewFormat );
sal_uInt16 GetNumberFormatInt() const { return nNumberFormatInt; }
/// Enable/disable swapping of endians, may be needed for Unicode import/export
- inline void SetEndianSwap( sal_Bool bVal );
+ inline void SetEndianSwap( bool bVal );
/// returns status of endian swap flag
- sal_Bool IsEndianSwap() const { return 0 != bSwap; }
+ bool IsEndianSwap() const { return 0 != bSwap; }
void SetCompressMode( sal_uInt16 nNewMode )
{ nCompressMode = nNewMode; }
@@ -294,9 +291,9 @@ public:
void SetCryptMaskKey(const OString& rCryptMaskKey);
const OString& GetCryptMaskKey() const { return m_aCryptMaskKey; }
- void SetStreamCharSet( CharSet eCharSet )
+ void SetStreamCharSet( rtl_TextEncoding eCharSet )
{ eStreamCharSet = eCharSet; }
- CharSet GetStreamCharSet() const { return eStreamCharSet; }
+ rtl_TextEncoding GetStreamCharSet() const { return eStreamCharSet; }
void SetLineDelimiter( LineEnd eLineEnd )
{ eLineDelimiter = eLineEnd; }
@@ -324,7 +321,7 @@ public:
SvStream& operator<<( sal_Int64 nInt64 );
SvStream& operator<<( bool b )
- { return operator<<(static_cast< sal_Bool >(b)); }
+ { return operator<<(static_cast< sal_Bool >(b)); }
SvStream& operator<<( signed char nChar );
SvStream& operator<<( char nChar );
SvStream& operator<<( unsigned char nChar );
@@ -345,9 +342,9 @@ public:
// length between current (Tell()) pos and end of stream
virtual sal_Size remainingSize();
void Flush();
- sal_Bool IsEof() const { return bIsEof; }
+ bool IsEof() const { return bIsEof; }
// next Tell() <= nSize
- sal_Bool SetStreamSize( sal_Size nSize );
+ bool SetStreamSize( sal_Size nSize );
/** Read a line of bytes.
@@ -363,8 +360,8 @@ public:
@endcode
causing endless loops ...
*/
- sal_Bool ReadLine( OString& rStr, sal_Int32 nMaxBytesToRead = 0xFFFE );
- sal_Bool WriteLine( const OString& rStr );
+ bool ReadLine( OString& rStr, sal_Int32 nMaxBytesToRead = 0xFFFE );
+ bool WriteLine( const OString& rStr );
/** Read a line of bytes.
@@ -380,13 +377,12 @@ public:
@endcode
causing endless loops ...
*/
- sal_Bool ReadByteStringLine( OUString& rStr, rtl_TextEncoding eSrcCharSet,
+ bool ReadByteStringLine( OUString& rStr, rtl_TextEncoding eSrcCharSet,
sal_Int32 nMaxBytesToRead = 0xFFFE );
- sal_Bool ReadByteStringLine( String& rStr, rtl_TextEncoding eSrcCharSet );
- sal_Bool WriteByteStringLine( const String& rStr, rtl_TextEncoding eDestCharSet );
+ bool WriteByteStringLine( const OUString& rStr, rtl_TextEncoding eDestCharSet );
/// Switch to no endian swapping and write 0xfeff
- sal_Bool StartWritingUnicodeText();
+ bool StartWritingUnicodeText();
/** If eReadBomCharSet==RTL_TEXTENCODING_DONTKNOW: read 16bit, if 0xfeff do
nothing (UTF-16), if 0xfffe switch endian swapping (UTF-16), if 0xefbb
@@ -397,7 +393,7 @@ public:
If eReadBomCharSet!=RTL_TEXTENCODING_DONTKNOW: only read a BOM of that
encoding and switch endian swapping if UTF-16 and 0xfffe. */
- sal_Bool StartReadingUnicodeText( rtl_TextEncoding eReadBomCharSet );
+ bool StartReadingUnicodeText( rtl_TextEncoding eReadBomCharSet );
/** Read a line of Unicode.
@@ -413,11 +409,11 @@ public:
@endcode
causing endless loops ...
*/
- sal_Bool ReadUniStringLine( OUString& rStr, sal_Int32 nMaxCodepointsToRead = 0xFFFE );
+ bool ReadUniStringLine( OUString& rStr, sal_Int32 nMaxCodepointsToRead = 0xFFFE );
/** Read a 32bit length prefixed sequence of utf-16 if
eSrcCharSet==RTL_TEXTENCODING_UNICODE, otherwise read a 16bit length
prefixed sequence of bytes and convert from eSrcCharSet */
- OUString ReadUniOrByteString(rtl_TextEncoding eSrcCharSet);
+ OUString ReadUniOrByteString(rtl_TextEncoding eSrcCharSet);
/** Write a 32bit length prefixed sequence of utf-16 if
eSrcCharSet==RTL_TEXTENCODING_UNICODE, otherwise convert to eSrcCharSet
and write a 16bit length prefixed sequence of bytes */
@@ -438,13 +434,13 @@ public:
@endcode
causing endless loops ...
*/
- sal_Bool ReadUniOrByteStringLine( OUString& rStr, rtl_TextEncoding eSrcCharSet,
+ bool ReadUniOrByteStringLine( OUString& rStr, rtl_TextEncoding eSrcCharSet,
sal_Int32 nMaxCodepointsToRead = 0xFFFE );
/** Write a sequence of Unicode characters if
eDestCharSet==RTL_TEXTENCODING_UNICODE, otherwise write a sequence of
Bytecodes converted to eDestCharSet */
- sal_Bool WriteUnicodeOrByteText( const String& rStr, rtl_TextEncoding eDestCharSet );
- sal_Bool WriteUnicodeOrByteText( const String& rStr )
+ bool WriteUnicodeOrByteText( const OUString& rStr, rtl_TextEncoding eDestCharSet );
+ bool WriteUnicodeOrByteText( const OUString& rStr )
{ return WriteUnicodeOrByteText( rStr, GetStreamCharSet() ); }
/** Write a Unicode character if eDestCharSet==RTL_TEXTENCODING_UNICODE,
@@ -452,19 +448,19 @@ public:
This may result in more than one byte being written if a multi byte
encoding (e.g. UTF7, UTF8) is chosen. */
- sal_Bool WriteUniOrByteChar( sal_Unicode ch, rtl_TextEncoding eDestCharSet );
- sal_Bool WriteUniOrByteChar( sal_Unicode ch )
+ bool WriteUniOrByteChar( sal_Unicode ch, rtl_TextEncoding eDestCharSet );
+ bool WriteUniOrByteChar( sal_Unicode ch )
{ return WriteUniOrByteChar( ch, GetStreamCharSet() ); }
void SetBufferSize( sal_uInt16 nBufSize );
- sal_uInt16 GetBufferSize() const { return nBufSize; }
+ sal_uInt16 GetBufferSize() const { return nBufSize; }
void RefreshBuffer();
SvStream& PutBack( char aCh );
- sal_Bool IsWritable() const { return bIsWritable; }
+ bool IsWritable() const { return bIsWritable; }
StreamMode GetStreamMode() const { return eStreamMode; }
- virtual sal_uInt16 IsA() const;
+ virtual sal_uInt16 IsA() const;
long GetVersion() { return nVersion; }
void SetVersion( long n ) { nVersion = n; }
@@ -472,10 +468,10 @@ public:
friend SvStream& operator<<( SvStream& rStr, SvStrPtr f ); // for Manips
/// end of input seen during previous i/o operation
- bool eof() const { return bIsEof; }
+ bool eof() const { return bIsEof; }
/// stream is broken
- bool bad() const { return GetError() != 0; }
+ bool bad() const { return GetError() != 0; }
/** Get state
@@ -499,7 +495,7 @@ inline SvStream& operator<<( SvStream& rStr, SvStrPtr f )
return rStr;
}
-inline void SvStream::SetEndianSwap( sal_Bool bVal )
+inline void SvStream::SetEndianSwap( bool bVal )
{
#ifdef OSL_BIGENDIAN
SetNumberFormatInt( bVal ? NUMBERFORMAT_INT_LITTLEENDIAN : NUMBERFORMAT_INT_BIGENDIAN );
@@ -579,8 +575,9 @@ namespace streamdetail
/// Attempt to write a pascal-style length (of type prefix) prefixed sequence
/// of 16bit units from an OUString, returned value is number of bytes written
/// (including byte-count of prefix)
-template<typename prefix> sal_Size write_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm,
- const OUString &rStr)
+template<typename prefix>
+sal_Size write_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm,
+ const OUString &rStr)
{
return streamdetail::write_lenPrefixed_seq_From_str<prefix, OUString, write_uInt16s_FromOUString>(rStrm, rStr);
}
@@ -611,7 +608,7 @@ OString read_lenPrefixed_uInt8s_ToOString(SvStream& rStrm)
/// 8bit units to an OUString
template<typename prefix>
OUString read_lenPrefixed_uInt8s_ToOUString(SvStream& rStrm,
- rtl_TextEncoding eEnc)
+ rtl_TextEncoding eEnc)
{
return OStringToOUString(read_lenPrefixed_uInt8s_ToOString<prefix>(rStrm), eEnc);
}
@@ -619,7 +616,7 @@ OUString read_lenPrefixed_uInt8s_ToOUString(SvStream& rStrm,
/// Attempt to write a prefixed sequence of nUnits 8bit units from an OString,
/// returned value is number of bytes written
TOOLS_DLLPUBLIC inline sal_Size write_uInt8s_FromOString(SvStream& rStrm, const OString& rStr,
- sal_Size nUnits)
+ sal_Size nUnits)
{
return rStrm.Write(rStr.getStr(), nUnits);
}
@@ -632,8 +629,9 @@ TOOLS_DLLPUBLIC inline sal_Size write_uInt8s_FromOString(SvStream& rStrm, const
/// Attempt to write a pascal-style length (of type prefix) prefixed sequence
/// of 8bit units from an OString, returned value is number of bytes written
/// (including byte-count of prefix)
-template<typename prefix> sal_Size write_lenPrefixed_uInt8s_FromOString(SvStream& rStrm,
- const OString &rStr)
+template<typename prefix>
+sal_Size write_lenPrefixed_uInt8s_FromOString(SvStream& rStrm,
+ const OString &rStr)
{
return streamdetail::write_lenPrefixed_seq_From_str<prefix, OString, write_uInt8s_FromOString>(rStrm, rStr);
}
@@ -641,8 +639,10 @@ template<typename prefix> sal_Size write_lenPrefixed_uInt8s_FromOString(SvStream
/// Attempt to write a pascal-style length (of type prefix) prefixed sequence
/// of 8bit units from an OUString, returned value is number of bytes written
/// (including byte-count of prefix)
-template<typename prefix> sal_Size write_lenPrefixed_uInt8s_FromOUString(SvStream& rStrm,
- const OUString &rStr, rtl_TextEncoding eEnc)
+template<typename prefix>
+sal_Size write_lenPrefixed_uInt8s_FromOUString(SvStream& rStrm,
+ const OUString &rStr,
+ rtl_TextEncoding eEnc)
{
return write_lenPrefixed_uInt8s_FromOString<prefix>(rStrm, OUStringToOString(rStr, eEnc));
}
@@ -653,9 +653,9 @@ class TOOLS_DLLPUBLIC SvFileStream : public SvStream
{
private:
StreamData* pInstanceData;
- String aFilename;
+ OUString aFilename;
sal_uInt16 nLockCounter;
- sal_Bool bIsOpen;
+ bool bIsOpen;
#ifdef UNX
sal_uInt32 GetFileHandle() const;
#endif
@@ -663,10 +663,10 @@ private:
SvFileStream (const SvFileStream&);
SvFileStream & operator= (const SvFileStream&);
- sal_Bool LockRange( sal_Size nByteOffset, sal_Size nBytes );
- sal_Bool UnlockRange( sal_Size nByteOffset, sal_Size nBytes );
- sal_Bool LockFile();
- sal_Bool UnlockFile();
+ bool LockRange( sal_Size nByteOffset, sal_Size nBytes );
+ bool UnlockRange( sal_Size nByteOffset, sal_Size nBytes );
+ bool LockFile();
+ bool UnlockFile();
protected:
virtual sal_Size GetData( void* pData, sal_Size nSize );
@@ -677,19 +677,19 @@ protected:
public:
// Switches to Read StreamMode on failed attempt of Write opening
- SvFileStream( const String& rFileName, StreamMode eOpenMode );
+ SvFileStream( const OUString& rFileName, StreamMode eOpenMode );
SvFileStream();
~SvFileStream();
virtual void ResetError();
- void Open( const String& rFileName, StreamMode eOpenMode );
+ void Open( const OUString& rFileName, StreamMode eOpenMode );
void Close();
- sal_Bool IsOpen() const { return bIsOpen; }
- sal_Bool IsLocked() const { return ( nLockCounter!=0 ); }
+ bool IsOpen() const { return bIsOpen; }
+ bool IsLocked() const { return ( nLockCounter!=0 ); }
virtual sal_uInt16 IsA() const;
- const String& GetFileName() const { return aFilename; }
+ const OUString& GetFileName() const { return aFilename; }
};
// MemoryStream
@@ -709,7 +709,7 @@ protected:
sal_Size nPos;
sal_Size nEndOfData;
sal_uInt8* pBuf;
- sal_Bool bOwnsData;
+ bool bOwnsData;
virtual sal_Size GetData( void* pData, sal_Size nSize );
virtual sal_Size PutData( const void* pData, sal_Size nSize );
@@ -719,7 +719,7 @@ protected:
/// AllocateMemory must update pBuf accordingly
/// - pBuf: Address of new block
- virtual sal_Bool AllocateMemory( sal_Size nSize );
+ virtual bool AllocateMemory( sal_Size nSize );
/// ReAllocateMemory must update the following variables:
/// - pBuf: Address of new block
@@ -727,7 +727,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
- virtual sal_Bool ReAllocateMemory( long nDiff );
+ virtual bool ReAllocateMemory( long nDiff );
/// Is called when this stream allocated the buffer or the buffer is
/// resized. FreeMemory may need to NULLify handles in derived classes.
@@ -749,10 +749,10 @@ public:
void* SwitchBuffer( sal_Size nInitSize=512, sal_Size nResize=64 );
void* SetBuffer( void* pBuf, sal_Size nSize,
- sal_Bool bOwnsData=sal_True, sal_Size nEOF=0 );
+ bool bOwnsData=true, sal_Size nEOF=0 );
- void ObjectOwnsMemory( sal_Bool bOwn ) { bOwnsData = bOwn; }
- sal_Bool IsObjectMemoryOwner() { return bOwnsData; }
+ void ObjectOwnsMemory( bool bOwn ) { bOwnsData = bOwn; }
+ bool IsObjectMemoryOwner() { return bOwnsData; }
void SetResizeOffset( sal_Size nNewResize ) { nResize = nNewResize; }
sal_Size GetResizeOffset() const { return nResize; }
virtual sal_Size remainingSize() { return GetSize() - Tell(); }
diff --git a/include/tools/svborder.hxx b/include/tools/svborder.hxx
index de4a8666cbd8..0fc87a9b7f0f 100644
--- a/include/tools/svborder.hxx
+++ b/include/tools/svborder.hxx
@@ -44,12 +44,12 @@ public:
nRight = nRightP;
nBottom = nBottomP;
}
- sal_Bool operator == ( const SvBorder & rObj ) const
+ bool operator == ( const SvBorder & rObj ) const
{
return nTop == rObj.nTop && nRight == rObj.nRight &&
nBottom == rObj.nBottom && nLeft == rObj.nLeft;
}
- sal_Bool operator != ( const SvBorder & rObj ) const
+ bool operator != ( const SvBorder & rObj ) const
{ return !(*this == rObj); }
SvBorder & operator = ( const SvBorder & rBorder )
{
@@ -75,7 +75,7 @@ public:
Bottom() -= rBorder.Bottom();
return *this;
}
- sal_Bool IsInside( const SvBorder & rInside )
+ bool IsInside( const SvBorder & rInside )
{
return nTop >= rInside.nTop && nRight >= rInside.nRight &&
nBottom >= rInside.nBottom && nLeft >= rInside.nLeft;
diff --git a/include/tools/tempfile.hxx b/include/tools/tempfile.hxx
index 8ef8c574cf7c..8d43c18a6df9 100644
--- a/include/tools/tempfile.hxx
+++ b/include/tools/tempfile.hxx
@@ -19,14 +19,14 @@
#ifndef _TOOLS_TEMPFILE_HXX
#define _TOOLS_TEMPFILE_HXX
-#include <tools/string.hxx>
+#include <rtl/ustring.hxx>
#include "tools/toolsdllapi.h"
struct TempFile_Impl;
class TOOLS_DLLPUBLIC TempFile
{
TempFile_Impl* pImp;
- sal_Bool bKillingFileEnabled;
+ bool bKillingFileEnabled;
public:
/** Create a temporary file in the default tempfile folder. */
@@ -40,25 +40,25 @@ public:
The extension string may be f.e. ".txt" or "", if no extension string is
given, ".tmp" is used.
*/
- TempFile( const String& rLeadingChars, const String* pExtension=NULL );
+ TempFile( const OUString& rLeadingChars, const OUString* pExtension=NULL );
/** TempFile will be removed from disk in dtor if EnableKillingTempFile was
called before. TempDirs will be removed recursively in that case. */
~TempFile();
- sal_Bool IsValid() const;
+ bool IsValid() const;
/** Returns the real name of the tempfile in file URL scheme. */
- String GetName() const;
+ OUString GetName() const;
/** If enabled the file will be removed from disk when the dtor is called
(default is not enabled) */
- void EnableKillingFile( sal_Bool bEnable=sal_True ) { bKillingFileEnabled = bEnable; }
+ void EnableKillingFile( bool bEnable=true ) { bKillingFileEnabled = bEnable; }
- sal_Bool IsKillingFileEnabled() const { return bKillingFileEnabled; }
+ bool IsKillingFileEnabled() const { return bKillingFileEnabled; }
/** Only create a name for a temporary file that would be valid at that moment. */
- static String CreateTempName();
+ static OUString CreateTempName();
};
#endif
diff --git a/include/tools/time.hxx b/include/tools/time.hxx
index 64751af42284..31a8f94d23b9 100644
--- a/include/tools/time.hxx
+++ b/include/tools/time.hxx
@@ -98,22 +98,22 @@ public:
/// 12 hours == 0.5 days
double GetTimeInDays() const;
- sal_Bool IsBetween( const Time& rFrom, const Time& rTo ) const
+ bool IsBetween( const Time& rFrom, const Time& rTo ) const
{ return ((nTime >= rFrom.nTime) && (nTime <= rTo.nTime)); }
- sal_Bool IsEqualIgnoreNanoSec( const Time& rTime ) const;
+ bool IsEqualIgnoreNanoSec( const Time& rTime ) const;
- sal_Bool operator ==( const Time& rTime ) const
+ bool operator ==( const Time& rTime ) const
{ return (nTime == rTime.nTime); }
- sal_Bool operator !=( const Time& rTime ) const
+ bool operator !=( const Time& rTime ) const
{ return (nTime != rTime.nTime); }
- sal_Bool operator >( const Time& rTime ) const
+ bool operator >( const Time& rTime ) const
{ return (nTime > rTime.nTime); }
- sal_Bool operator <( const Time& rTime ) const
+ bool operator <( const Time& rTime ) const
{ return (nTime < rTime.nTime); }
- sal_Bool operator >=( const Time& rTime ) const
+ bool operator >=( const Time& rTime ) const
{ return (nTime >= rTime.nTime); }
- sal_Bool operator <=( const Time& rTime ) const
+ bool operator <=( const Time& rTime ) const
{ return (nTime <= rTime.nTime); }
static Time GetUTCOffset();
diff --git a/include/tools/vcompat.hxx b/include/tools/vcompat.hxx
index cb3c29701e36..0f97b583bb5c 100644
--- a/include/tools/vcompat.hxx
+++ b/include/tools/vcompat.hxx
@@ -41,7 +41,7 @@ class TOOLS_DLLPUBLIC VersionCompat
VersionCompat() {}
VersionCompat( const VersionCompat& ) {}
VersionCompat& operator=( const VersionCompat& ) { return *this; }
- sal_Bool operator==( const VersionCompat& ) { return sal_False; }
+ bool operator==( const VersionCompat& ) { return false; }
public:
diff --git a/include/tools/vector2d.hxx b/include/tools/vector2d.hxx
index d3d1c5c0c805..bd4795cb0319 100644
--- a/include/tools/vector2d.hxx
+++ b/include/tools/vector2d.hxx
@@ -75,8 +75,8 @@ public:
inline Vector2D& operator/=(double t) { mfX /= t; mfY /= t; return *this; }
inline Vector2D operator/(double t) const { Vector2D aNew(*this); aNew /= t; return aNew; }
- inline sal_Bool operator==( const Vector2D& rVec ) const { return( mfX == rVec.mfX && mfY == rVec.mfY ); }
- inline sal_Bool operator!=( const Vector2D& rVec ) const { return !( *this == rVec ); }
+ inline bool operator==( const Vector2D& rVec ) const { return( mfX == rVec.mfX && mfY == rVec.mfY ); }
+ inline bool operator!=( const Vector2D& rVec ) const { return !( *this == rVec ); }
inline Vector2D& operator=( const Vector2D& rVec ) { mfX = rVec.mfX, mfY = rVec.mfY; return *this; }
inline Vector2D& operator=( const Pair& rPair ) { mfX = rPair.A(), mfY = rPair.B(); return *this; }
@@ -85,11 +85,11 @@ public:
inline Vector2D& operator*=( const Pair& rPair ) { mfX *= rPair.A(), mfY *= rPair.B(); return *this; }
inline Vector2D& operator/=( const Pair& rPair ) { mfX /= rPair.A(), mfY /= rPair.B(); return *this; }
- inline sal_Bool operator==( const Pair& rPair ) const { return( mfX == rPair.A() && mfY == rPair.B() ); }
- inline sal_Bool operator!=( const Pair& rPair ) const { return !( *this == rPair ); }
+ inline bool operator==( const Pair& rPair ) const { return( mfX == rPair.A() && mfY == rPair.B() ); }
+ inline bool operator!=( const Pair& rPair ) const { return !( *this == rPair ); }
- inline sal_Bool IsPositive( Vector2D& rVec ) const { return( ( mfX * rVec.mfY - mfY * rVec.mfX ) >= 0.0 ); }
- inline sal_Bool IsNegative( Vector2D& rVec ) const { return !IsPositive( rVec ); }
+ inline bool IsPositive( Vector2D& rVec ) const { return( ( mfX * rVec.mfY - mfY * rVec.mfX ) >= 0.0 ); }
+ inline bool IsNegative( Vector2D& rVec ) const { return !IsPositive( rVec ); }
};
inline Vector2D& Vector2D::Normalize()
diff --git a/include/tools/weakbase.h b/include/tools/weakbase.h
index a4ce1d0962e8..d37a3fd98ce3 100644
--- a/include/tools/weakbase.h
+++ b/include/tools/weakbase.h
@@ -95,19 +95,19 @@ public:
inline reference_type * operator->() const;
/** returns true if this instance references pReferenceObject */
- inline sal_Bool operator== (const reference_type * pReferenceObject) const;
+ inline bool operator== (const reference_type * pReferenceObject) const;
/** returns true if this instance and the given weakref reference the same object */
- inline sal_Bool operator== (const WeakReference<reference_type> & handle) const;
+ inline bool operator== (const WeakReference<reference_type> & handle) const;
/** only needed for using this class with stl containers */
- inline sal_Bool operator!= (const WeakReference<reference_type> & handle) const;
+ inline bool operator!= (const WeakReference<reference_type> & handle) const;
/** only needed for using this class with stl containers */
- inline sal_Bool operator< (const WeakReference<reference_type> & handle) const;
+ inline bool operator< (const WeakReference<reference_type> & handle) const;
/** only needed for using this class with stl containers */
- inline sal_Bool operator> (const WeakReference<reference_type> & handle) const;
+ inline bool operator> (const WeakReference<reference_type> & handle) const;
/** the assignment operator */
inline WeakReference<reference_type>& operator= (const WeakReference<reference_type> & handle);
diff --git a/include/tools/weakbase.hxx b/include/tools/weakbase.hxx
index 08e85e17d69b..05498e50a8fc 100644
--- a/include/tools/weakbase.hxx
+++ b/include/tools/weakbase.hxx
@@ -91,31 +91,31 @@ inline reference_type * WeakReference< reference_type >::operator->() const
}
template< class reference_type >
-inline sal_Bool WeakReference< reference_type >::operator==(const reference_type * pReferenceObject) const
+inline bool WeakReference< reference_type >::operator==(const reference_type * pReferenceObject) const
{
return mpWeakConnection->mpReference == pReferenceObject;
}
template< class reference_type >
-inline sal_Bool WeakReference< reference_type >::operator==(const WeakReference<reference_type> & handle) const
+inline bool WeakReference< reference_type >::operator==(const WeakReference<reference_type> & handle) const
{
return mpWeakConnection == handle.mpWeakConnection;
}
template< class reference_type >
-inline sal_Bool WeakReference< reference_type >::operator!=(const WeakReference<reference_type> & handle) const
+inline bool WeakReference< reference_type >::operator!=(const WeakReference<reference_type> & handle) const
{
return mpWeakConnection != handle.mpWeakConnection;
}
template< class reference_type >
-inline sal_Bool WeakReference< reference_type >::operator<(const WeakReference<reference_type> & handle) const
+inline bool WeakReference< reference_type >::operator<(const WeakReference<reference_type> & handle) const
{
return mpWeakConnection->mpReference < handle.mpWeakConnection->mpReference;
}
template< class reference_type >
-inline sal_Bool WeakReference< reference_type >::operator>(const WeakReference<reference_type> & handle) const
+inline bool WeakReference< reference_type >::operator>(const WeakReference<reference_type> & handle) const
{
return mpWeakConnection->mpReference > handle.mpWeakConnection->mpReference;
}
diff --git a/include/tools/wldcrd.hxx b/include/tools/wldcrd.hxx
index 8991b8882474..9b143b7ae91b 100644
--- a/include/tools/wldcrd.hxx
+++ b/include/tools/wldcrd.hxx
@@ -20,8 +20,8 @@
#define _WLDCRD_HXX
#include "tools/toolsdllapi.h"
-#include <tools/string.hxx>
#include <osl/thread.h>
+#include <rtl/ustring.hxx>
class TOOLS_DLLPUBLIC WildCard
{
@@ -54,7 +54,7 @@ public:
aWildString = OUStringToOString(rString, osl_getThreadTextEncoding());
}
- sal_Bool Matches( const String& rStr ) const;
+ bool Matches( const OUString& rStr ) const;
};
#endif
diff --git a/include/tools/zcodec.hxx b/include/tools/zcodec.hxx
index 185cb1d9ecb0..b8b86fea2aa1 100644
--- a/include/tools/zcodec.hxx
+++ b/include/tools/zcodec.hxx
@@ -56,8 +56,8 @@ class TOOLS_DLLPUBLIC ZCodec
{
private:
sal_uIntPtr mbInit;
- sal_Bool mbStatus;
- sal_Bool mbFinish;
+ bool mbStatus;
+ bool mbFinish;
sal_uIntPtr mnMemUsage;
SvStream* mpIStm;
sal_uInt8* mpInBuf;
@@ -71,7 +71,7 @@ private:
sal_uIntPtr mnCompressMethod;
void* mpsC_Stream;
- void ImplInitBuf( sal_Bool nIOFlag );
+ void ImplInitBuf( bool nIOFlag );
void ImplWriteBack( void );
public:
@@ -81,7 +81,7 @@ public:
virtual void BeginCompression( sal_uIntPtr nCompressMethod = ZCODEC_DEFAULT );
virtual long EndCompression();
- sal_Bool IsFinished () const { return mbFinish; }
+ bool IsFinished () const { return mbFinish; }
long Compress( SvStream& rIStm, SvStream& rOStm );
long Decompress( SvStream& rIStm, SvStream& rOStm );
diff --git a/include/unotools/ucblockbytes.hxx b/include/unotools/ucblockbytes.hxx
index cf5d98b93583..acd79928e3a8 100644
--- a/include/unotools/ucblockbytes.hxx
+++ b/include/unotools/ucblockbytes.hxx
@@ -32,6 +32,7 @@
#include <tools/link.hxx>
#include <tools/errcode.hxx>
#include <tools/datetime.hxx>
+#include <tools/string.hxx>
namespace com
{
@@ -130,7 +131,7 @@ public:
static UcbLockBytesRef CreateLockBytes( const ::com::sun::star::uno::Reference < ::com::sun::star::io::XStream >& xContent );
// SvLockBytes
- virtual void SetSynchronMode (sal_Bool bSynchron);
+ virtual void SetSynchronMode (bool bSynchron);
virtual ErrCode ReadAt ( sal_uLong nPos, void *pBuffer, sal_uLong nCount, sal_uLong *pRead) const;
virtual ErrCode WriteAt ( sal_uLong, const void*, sal_uLong, sal_uLong *pWritten);
virtual ErrCode Flush (void) const;
diff --git a/include/vcl/gfxlink.hxx b/include/vcl/gfxlink.hxx
index 380298b500b8..efc9c0930a01 100644
--- a/include/vcl/gfxlink.hxx
+++ b/include/vcl/gfxlink.hxx
@@ -23,6 +23,7 @@
#include <vcl/dllapi.h>
#include <tools/solar.h>
#include <vcl/mapmod.hxx>
+#include <tools/string.hxx>
#include <tools/stream.hxx>
// -------------