summaryrefslogtreecommitdiff
path: root/tools/source
diff options
context:
space:
mode:
Diffstat (limited to 'tools/source')
-rw-r--r--tools/source/communi/geninfo.cxx44
-rw-r--r--tools/source/communi/makefile.mk50
-rw-r--r--tools/source/communi/parser.cxx56
-rw-r--r--tools/source/datetime/datetime.cxx54
-rw-r--r--tools/source/datetime/makefile.mk50
-rw-r--r--tools/source/datetime/tdate.cxx158
-rw-r--r--tools/source/datetime/ttime.cxx48
-rw-r--r--tools/source/debug/debug.cxx238
-rw-r--r--tools/source/debug/makefile.mk53
-rw-r--r--tools/source/debug/stcktree.cxx62
-rwxr-xr-x[-rw-r--r--]tools/source/fsys/comdep.hxx16
-rwxr-xr-x[-rw-r--r--]tools/source/fsys/dirent.cxx202
-rwxr-xr-x[-rw-r--r--]tools/source/fsys/filecopy.cxx10
-rwxr-xr-x[-rw-r--r--]tools/source/fsys/fstat.cxx65
-rw-r--r--tools/source/fsys/makefile.mk67
-rwxr-xr-x[-rw-r--r--]tools/source/fsys/tdir.cxx84
-rw-r--r--tools/source/fsys/unx.cxx80
-rw-r--r--tools/source/fsys/urlobj.cxx7
-rwxr-xr-x[-rw-r--r--]tools/source/fsys/wldcrd.cxx12
-rwxr-xr-x[-rw-r--r--]tools/source/fsys/wntmsc.cxx102
-rwxr-xr-x[-rw-r--r--]tools/source/fsys/wntmsc.hxx4
-rw-r--r--tools/source/generic/bigint.cxx4
-rw-r--r--tools/source/generic/color.cxx112
-rw-r--r--tools/source/generic/config.cxx156
-rw-r--r--tools/source/generic/fract.cxx8
-rw-r--r--tools/source/generic/gen.cxx54
-rw-r--r--tools/source/generic/line.cxx34
-rw-r--r--tools/source/generic/link.cxx10
-rw-r--r--tools/source/generic/makefile.mk71
-rw-r--r--tools/source/generic/poly.cxx304
-rw-r--r--tools/source/generic/poly2.cxx102
-rw-r--r--tools/source/generic/svborder.cxx2
-rw-r--r--tools/source/inet/inetmsg.cxx134
-rw-r--r--tools/source/inet/inetstrm.cxx124
-rw-r--r--tools/source/inet/makefile.mk45
-rw-r--r--tools/source/makefile.mk58
-rwxr-xr-x[-rw-r--r--]tools/source/memtools/contnr.cxx116
-rw-r--r--tools/source/memtools/makefile.mk56
-rwxr-xr-x[-rw-r--r--]tools/source/memtools/mempool.cxx2
-rwxr-xr-x[-rw-r--r--]tools/source/memtools/multisel.cxx100
-rwxr-xr-x[-rw-r--r--]tools/source/memtools/table.cxx82
-rwxr-xr-x[-rw-r--r--]tools/source/memtools/unqidx.cxx60
-rw-r--r--tools/source/misc/makefile.mk47
-rw-r--r--tools/source/misc/pathutils.cxx1
-rw-r--r--tools/source/rc/makefile.mk53
-rw-r--r--tools/source/rc/rc.cxx18
-rw-r--r--tools/source/rc/resmgr.cxx308
-rw-r--r--tools/source/ref/errinf.cxx84
-rwxr-xr-x[-rw-r--r--]tools/source/ref/globname.cxx70
-rw-r--r--tools/source/ref/makefile.mk53
-rw-r--r--tools/source/ref/pstm.cxx218
-rw-r--r--tools/source/reversemap/Makefile (renamed from tools/source/reversemap/makefile.mk)31
-rw-r--r--tools/source/reversemap/bestreversemap.cxx3
-rw-r--r--tools/source/solar/makefile.mk63
-rw-r--r--tools/source/solar/solar.c520
-rw-r--r--tools/source/stream/cachestr.cxx32
-rw-r--r--tools/source/stream/makefile.mk58
-rwxr-xr-x[-rw-r--r--]tools/source/stream/stream.cxx170
-rw-r--r--tools/source/stream/strmos2.cxx90
-rw-r--r--tools/source/stream/strmwnt.cxx82
-rw-r--r--tools/source/stream/vcompat.cxx6
-rw-r--r--tools/source/string/makefile.mk89
-rw-r--r--tools/source/string/strascii.cxx14
-rw-r--r--tools/source/string/strcvt.cxx12
-rw-r--r--tools/source/string/strimp.cxx32
-rw-r--r--tools/source/string/tenccvt.cxx4
-rw-r--r--tools/source/string/tstring.cxx30
-rw-r--r--tools/source/testtoolloader/makefile.mk45
-rw-r--r--tools/source/testtoolloader/testtoolloader.cxx4
-rw-r--r--tools/source/zcodec/makefile.mk47
-rw-r--r--tools/source/zcodec/zcodec.cxx82
71 files changed, 1998 insertions, 3364 deletions
diff --git a/tools/source/communi/geninfo.cxx b/tools/source/communi/geninfo.cxx
index 988816111def..bc05827ab622 100644
--- a/tools/source/communi/geninfo.cxx
+++ b/tools/source/communi/geninfo.cxx
@@ -56,7 +56,7 @@ GenericInformation::GenericInformation( const ByteString &rKey,
/*****************************************************************************/
GenericInformation::GenericInformation( const GenericInformation& rInf,
- BOOL bCopySubs)
+ sal_Bool bCopySubs)
/*****************************************************************************/
: ByteString( rInf ),
sValue( rInf.sValue ),
@@ -81,15 +81,15 @@ GenericInformation::~GenericInformation()
}
/*****************************************************************************/
-BOOL GenericInformation::InsertSubInfo( GenericInformation *pInfo )
+sal_Bool GenericInformation::InsertSubInfo( GenericInformation *pInfo )
/*****************************************************************************/
{
return ( pInfoList && pInfoList->InsertInfo( pInfo ));
}
/*****************************************************************************/
-BOOL GenericInformation::InsertSubInfo( const ByteString &rPathKey, const ByteString &rValue,
- BOOL bSearchByPath, BOOL bNewPath )
+sal_Bool GenericInformation::InsertSubInfo( const ByteString &rPathKey, const ByteString &rValue,
+ sal_Bool bSearchByPath, sal_Bool bNewPath )
/*****************************************************************************/
{
return (pInfoList && pInfoList->InsertInfo( rPathKey, rValue, bSearchByPath, bNewPath ));
@@ -97,7 +97,7 @@ BOOL GenericInformation::InsertSubInfo( const ByteString &rPathKey, const ByteSt
/*****************************************************************************/
void GenericInformation::RemoveSubInfo( GenericInformation *pInfo,
- BOOL bDelete )
+ sal_Bool bDelete )
/*****************************************************************************/
{
pInfoList->RemoveInfo( pInfo, bDelete );
@@ -105,8 +105,8 @@ void GenericInformation::RemoveSubInfo( GenericInformation *pInfo,
/*****************************************************************************/
GenericInformation *GenericInformation::GetSubInfo( ByteString &rKey,
- BOOL bSearchByPath,
- BOOL bCreatePath )
+ sal_Bool bSearchByPath,
+ sal_Bool bCreatePath )
/*****************************************************************************/
{
if ( !pInfoList && bCreatePath )
@@ -142,7 +142,7 @@ GenericInformationList::GenericInformationList(
for( size_t i = 0; i < rList.size(); i++ )
{
pTemp = rList[ i ];
- pWork = new GenericInformation( *pTemp, TRUE );
+ pWork = new GenericInformation(*pTemp,sal_True);
maList.push_back( pWork );
}
@@ -203,8 +203,8 @@ GenericInformation *GenericInformationList::Search(
/*****************************************************************************/
GenericInformation *GenericInformationList::GetInfo( ByteString &rKey,
- BOOL bSearchByPath,
- BOOL bCreatePath )
+ sal_Bool bSearchByPath,
+ sal_Bool bCreatePath )
/*****************************************************************************/
{
@@ -226,7 +226,7 @@ GenericInformation *GenericInformationList::GetInfo( ByteString &rKey,
* wenn searchpath gesetzt kein returninfo vorhanden und newpath gesetzt,
* mache neues Verzeichniss
*/
- USHORT nTokenCount = rKey.GetTokenCount('/');
+ sal_uInt16 nTokenCount = rKey.GetTokenCount('/');
// search for next key of path in next level of tree
if ( bSearchByPath && (nTokenCount > 1)) {
ByteString sPath = ByteString(rKey.Copy( sKey.Len() + 1 ));
@@ -236,7 +236,7 @@ GenericInformation *GenericInformationList::GetInfo( ByteString &rKey,
pReturnInfo = new GenericInformation( sKey, "", this, NULL);
pReturnInfo->SetSubList( new GenericInformationList( pReturnInfo ));
}
- return pReturnInfo->GetSubInfo( sPath, TRUE, bCreatePath );
+ return pReturnInfo->GetSubInfo( sPath, sal_True, bCreatePath );
}
if ( !pReturnInfo && bCreatePath ) {
pReturnInfo = new GenericInformation ( sKey, "", this, NULL);
@@ -248,7 +248,7 @@ GenericInformation *GenericInformationList::GetInfo( ByteString &rKey,
/*****************************************************************************/
size_t GenericInformationList::InsertSorted(
GenericInformation *pInfo,
- BOOL bOverwrite,
+ sal_Bool bOverwrite,
size_t nStart,
size_t nEnd
)
@@ -346,21 +346,21 @@ size_t GenericInformationList::InsertSorted(
}
/*****************************************************************************/
-BOOL GenericInformationList::InsertInfo( GenericInformation *pInfo,
- BOOL bOverwrite )
+sal_Bool GenericInformationList::InsertInfo( GenericInformation *pInfo,
+ sal_Bool bOverwrite )
/*****************************************************************************/
{
if ( !pInfo->Len())
- return FALSE;
+ return sal_False;
InsertSorted( pInfo, bOverwrite, 0, maList.size() - 1 );
- return TRUE;
+ return sal_True;
}
/*****************************************************************************/
-BOOL GenericInformationList::InsertInfo( const ByteString &rPathKey, const ByteString &rValue,
- BOOL bSearchByPath, BOOL bNewPath )
+sal_Bool GenericInformationList::InsertInfo( const ByteString &rPathKey, const ByteString &rValue,
+ sal_Bool bSearchByPath, sal_Bool bNewPath )
/*****************************************************************************/
{
GenericInformation *pInfo;
@@ -372,14 +372,14 @@ BOOL GenericInformationList::InsertInfo( const ByteString &rPathKey, const ByteS
if ( pInfo ) {
pInfo->SetValue( rValue );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*****************************************************************************/
void GenericInformationList::RemoveInfo( GenericInformation *pInfo,
- BOOL bDelete )
+ sal_Bool bDelete )
/*****************************************************************************/
{
for (
diff --git a/tools/source/communi/makefile.mk b/tools/source/communi/makefile.mk
deleted file mode 100644
index 1795081a9ec5..000000000000
--- a/tools/source/communi/makefile.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=TOOLS
-TARGET=communi
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-OBJFILES= \
- $(OBJ)$/parser.obj \
- $(OBJ)$/geninfo.obj \
-
-SLOFILES= \
- $(SLO)$/parser.obj \
- $(SLO)$/geninfo.obj \
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/source/communi/parser.cxx b/tools/source/communi/parser.cxx
index bd2c87846aaf..f0e3534a8dce 100644
--- a/tools/source/communi/parser.cxx
+++ b/tools/source/communi/parser.cxx
@@ -43,9 +43,9 @@
#define cKeyLevelChar '\t'
/*****************************************************************************/
-InformationParser::InformationParser( BOOL bReplace )
+InformationParser::InformationParser( sal_Bool bReplace )
/*****************************************************************************/
- : bRecover( FALSE ),
+ : bRecover( sal_False ),
sOldLine( "" ),
bReplaceVariables( bReplace ),
nLevel( 0 ),
@@ -72,24 +72,24 @@ ByteString &InformationParser::ReadLine()
ByteString sLine;
if ( bRecover ) {
- bRecover = FALSE;
+ bRecover = sal_False;
}
else {
if ( !pActStream->IsEof()) {
pActStream->ReadLine( sLine );
xub_StrLen nStart = 0;
xub_StrLen nEnd = sLine.Len();
- BOOL bCopy = FALSE;
+ sal_Bool bCopy = sal_False;
while ( nStart < nEnd && ( sLine.GetChar( nStart ) == ' ' || sLine.GetChar( nStart ) == 0x09 ) )
{
nStart++;
- bCopy = TRUE;
+ bCopy = sal_True;
}
while ( nStart < nEnd && ( sLine.GetChar( nEnd-1 ) == ' ' || sLine.GetChar( nEnd-1 ) == 0x09 ) )
{
nEnd--;
- bCopy = TRUE;
+ bCopy = sal_True;
}
if ( bCopy )
@@ -163,7 +163,7 @@ GenericInformation *InformationParser::ReadKey(
sCurrentComment = "";
// key separated from value by tab?
- USHORT nWSPos = sLine.Search( ' ' );
+ sal_uInt16 nWSPos = sLine.Search( ' ' );
if ( sLine.Search( '\t' ) < nWSPos ) {
nWSPos = sLine.Search( '\t' );
sLine.SearchAndReplace( "\t", " " );
@@ -212,17 +212,17 @@ GenericInformation *InformationParser::ReadKey(
void InformationParser::Recover()
/*****************************************************************************/
{
- bRecover = TRUE;
+ bRecover = sal_True;
}
/*****************************************************************************/
-BOOL InformationParser::Save( SvStream &rOutStream,
+sal_Bool InformationParser::Save( SvStream &rOutStream,
const GenericInformationList *pSaveList,
- USHORT level, BOOL bStripped )
+ sal_uInt16 level, sal_Bool bStripped )
/*****************************************************************************/
{
- USHORT i;
- ULONG nInfoListCount;
+ sal_uInt16 i;
+ sal_uIntPtr nInfoListCount;
ByteString sTmpStr;
GenericInformation *pGenericInfo;
GenericInformationList *pGenericInfoList;
@@ -249,7 +249,7 @@ BOOL InformationParser::Save( SvStream &rOutStream,
sTmpStr += ' ';
sTmpStr += pGenericInfo->GetValue();
if ( !rOutStream.WriteLine( sTmpStr ) )
- return FALSE;
+ return sal_False;
// wenn vorhanden, bearbeite recursive die Sublisten
if (( pGenericInfoList = pGenericInfo->GetSubList() ) != NULL ) {
@@ -259,20 +259,20 @@ BOOL InformationParser::Save( SvStream &rOutStream,
sTmpStr.Append( aKeyLevel.GetBuffer(), level );
sTmpStr += '{';
if ( !rOutStream.WriteLine( sTmpStr ) )
- return FALSE;
+ return sal_False;
// recursiv die sublist abarbeiten
if ( !Save( rOutStream, pGenericInfoList, level+1, bStripped ) )
- return FALSE;
+ return sal_False;
// schliessende Klammer
sTmpStr = "";
if ( !bStripped && level )
sTmpStr.Append( aKeyLevel.GetBuffer(), level );
sTmpStr += '}';
if ( !rOutStream.WriteLine( sTmpStr ) )
- return FALSE;
+ return sal_False;
}
}
- return TRUE;
+ return sal_True;
}
/*****************************************************************************/
@@ -372,7 +372,7 @@ GenericInformationList *InformationParser::Execute( Dir &rDir,
else
pList = new GenericInformationList();
- for ( USHORT i = 0; i < rDir.Count(); i++ ) {
+ for ( sal_uInt16 i = 0; i < rDir.Count(); i++ ) {
// execute this dir
UniString sNextFile( rDir[i].GetFull());
@@ -396,33 +396,33 @@ GenericInformationList *InformationParser::Execute( Dir &rDir,
}
/*****************************************************************************/
-BOOL InformationParser::Save( SvFileStream &rSourceStream,
+sal_Bool InformationParser::Save( SvFileStream &rSourceStream,
const GenericInformationList *pSaveList )
/*****************************************************************************/
{
- if ( !rSourceStream.IsOpen() || !Save( (SvStream &)rSourceStream, pSaveList, 0, FALSE ))
+ if ( !rSourceStream.IsOpen() || !Save( (SvStream &)rSourceStream, pSaveList, 0, sal_False ))
{
printf( "ERROR saving file \"%s\"\n",ByteString( rSourceStream.GetFileName(), gsl_getSystemTextEncoding()).GetBuffer() );
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
/*****************************************************************************/
-BOOL InformationParser::Save( SvMemoryStream &rSourceStream,
+sal_Bool InformationParser::Save( SvMemoryStream &rSourceStream,
const GenericInformationList *pSaveList )
/*****************************************************************************/
{
Time a;
- BOOL bRet = Save( (SvStream &)rSourceStream, pSaveList, 0, TRUE );
+ sal_Bool bRet = Save( (SvStream &)rSourceStream, pSaveList, 0, sal_True );
Time b;
b = b - a;
return bRet;
}
/*****************************************************************************/
-BOOL InformationParser::Save( const UniString &rSourceFile,
+sal_Bool InformationParser::Save( const UniString &rSourceFile,
const GenericInformationList *pSaveList )
/*****************************************************************************/
{
@@ -430,14 +430,14 @@ BOOL InformationParser::Save( const UniString &rSourceFile,
if ( !Save( *pOutFile, pSaveList )) {
delete pOutFile;
- return FALSE;
+ return sal_False;
}
delete pOutFile;
- return TRUE;
+ return sal_True;
}
/*****************************************************************************/
-USHORT InformationParser::GetErrorCode()
+sal_uInt16 InformationParser::GetErrorCode()
/*****************************************************************************/
{
return nErrorCode;
diff --git a/tools/source/datetime/datetime.cxx b/tools/source/datetime/datetime.cxx
index 593d709626d3..05d25edd91b9 100644
--- a/tools/source/datetime/datetime.cxx
+++ b/tools/source/datetime/datetime.cxx
@@ -38,13 +38,13 @@
|*
*************************************************************************/
-BOOL DateTime::IsBetween( const DateTime& rFrom,
+sal_Bool DateTime::IsBetween( const DateTime& rFrom,
const DateTime& rTo ) const
{
if ( (*this >= rFrom) && (*this <= rTo) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -53,13 +53,13 @@ BOOL DateTime::IsBetween( const DateTime& rFrom,
|*
*************************************************************************/
-BOOL DateTime::operator >( const DateTime& rDateTime ) const
+sal_Bool DateTime::operator >( const DateTime& rDateTime ) const
{
if ( (Date::operator>( rDateTime )) ||
(Date::operator==( rDateTime ) && Time::operator>( rDateTime )) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -68,13 +68,13 @@ BOOL DateTime::operator >( const DateTime& rDateTime ) const
|*
*************************************************************************/
-BOOL DateTime::operator <( const DateTime& rDateTime ) const
+sal_Bool DateTime::operator <( const DateTime& rDateTime ) const
{
if ( (Date::operator<( rDateTime )) ||
(Date::operator==( rDateTime ) && Time::operator<( rDateTime )) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -83,13 +83,13 @@ BOOL DateTime::operator <( const DateTime& rDateTime ) const
|*
*************************************************************************/
-BOOL DateTime::operator >=( const DateTime& rDateTime ) const
+sal_Bool DateTime::operator >=( const DateTime& rDateTime ) const
{
if ( (Date::operator>( rDateTime )) ||
(Date::operator==( rDateTime ) && Time::operator>=( rDateTime )) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -98,13 +98,13 @@ BOOL DateTime::operator >=( const DateTime& rDateTime ) const
|*
*************************************************************************/
-BOOL DateTime::operator <=( const DateTime& rDateTime ) const
+sal_Bool DateTime::operator <=( const DateTime& rDateTime ) const
{
if ( (Date::operator<( rDateTime )) ||
(Date::operator==( rDateTime ) && Time::operator<=( rDateTime )) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -134,14 +134,14 @@ long DateTime::GetSecFromDateTime( const Date& rDate ) const
|*
*************************************************************************/
-void DateTime::MakeDateTimeFromSec( const Date& rDate, ULONG nSec )
+void DateTime::MakeDateTimeFromSec( const Date& rDate, sal_uIntPtr nSec )
{
long nDays = nSec / (24UL*60*60);
((Date*)this)->operator=( rDate );
nSec -= nDays * (24UL*60*60);
- USHORT nMin = (USHORT)(nSec / 60);
+ sal_uInt16 nMin = (sal_uInt16)(nSec / 60);
nSec -= nMin * 60;
- ((Time*)this)->operator=( Time( 0, nMin, (USHORT)nSec ) );
+ ((Time*)this)->operator=( Time( 0, nMin, (sal_uInt16)nSec ) );
operator+=( nDays );
}
@@ -155,7 +155,7 @@ DateTime& DateTime::operator +=( const Time& rTime )
{
Time aTime = *this;
aTime += rTime;
- USHORT nHours = aTime.GetHour();
+ sal_uInt16 nHours = aTime.GetHour();
if ( aTime.GetTime() > 0 )
{
while ( nHours >= 24 )
@@ -190,7 +190,7 @@ DateTime& DateTime::operator -=( const Time& rTime )
{
Time aTime = *this;
aTime -= rTime;
- USHORT nHours = aTime.GetHour();
+ sal_uInt16 nHours = aTime.GetHour();
if ( aTime.GetTime() > 0 )
{
while ( nHours >= 24 )
@@ -370,22 +370,22 @@ DateTime DateTime::CreateFromWin32FileDateTime( const sal_uInt32 & rLower, const
( nDays / ( 400 * 365 ) ) ) / 365;
nDays -= nYears * 365 + nYears / 4 - nYears / 100 + nYears / 400;
- USHORT nMonths = 0;
+ sal_uInt16 nMonths = 0;
for( sal_Int64 nDaysCount = nDays; nDaysCount >= 0; )
{
nDays = nDaysCount;
nMonths ++;
nDaysCount -= Date(
- 1, nMonths, sal::static_int_cast< USHORT >(1601 + nYears) ).
+ 1, nMonths, sal::static_int_cast< sal_uInt16 >(1601 + nYears) ).
GetDaysInMonth();
}
Date _aDate(
- (USHORT)( nDays + 1 ), nMonths,
- sal::static_int_cast< USHORT >(nYears + 1601) );
- Time _aTime( ULONG( ( aTime / ( a100nPerSecond * 60 * 60 ) ) % sal_Int64( 24 ) ),
- ULONG( ( aTime / ( a100nPerSecond * 60 ) ) % sal_Int64( 60 ) ),
- ULONG( ( aTime / ( a100nPerSecond ) ) % sal_Int64( 60 ) ) );
+ (sal_uInt16)( nDays + 1 ), nMonths,
+ sal::static_int_cast< sal_uInt16 >(nYears + 1601) );
+ Time _aTime( sal_uIntPtr( ( aTime / ( a100nPerSecond * 60 * 60 ) ) % sal_Int64( 24 ) ),
+ sal_uIntPtr( ( aTime / ( a100nPerSecond * 60 ) ) % sal_Int64( 60 ) ),
+ sal_uIntPtr( ( aTime / ( a100nPerSecond ) ) % sal_Int64( 60 ) ) );
return DateTime( _aDate, _aTime );
}
diff --git a/tools/source/datetime/makefile.mk b/tools/source/datetime/makefile.mk
deleted file mode 100644
index 3d46cc6ce1b0..000000000000
--- a/tools/source/datetime/makefile.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=datetime
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(SLO)$/tdate.obj \
- $(SLO)$/ttime.obj \
- $(SLO)$/datetime.obj
-
-OBJFILES= $(OBJ)$/tdate.obj \
- $(OBJ)$/ttime.obj \
- $(OBJ)$/datetime.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/source/datetime/tdate.cxx b/tools/source/datetime/tdate.cxx
index eca1ab40b49e..fcd739bfda68 100644
--- a/tools/source/datetime/tdate.cxx
+++ b/tools/source/datetime/tdate.cxx
@@ -54,14 +54,14 @@ struct tm *localtime_r(const time_t *timep, struct tm *buffer);
// =======================================================================
-static USHORT aDaysInMonth[12] = { 31, 28, 31, 30, 31, 30,
+static sal_uInt16 aDaysInMonth[12] = { 31, 28, 31, 30, 31, 30,
31, 31, 30, 31, 30, 31 };
#define MAX_DAYS 3636532
// =======================================================================
-inline BOOL ImpIsLeapYear( USHORT nYear )
+inline sal_Bool ImpIsLeapYear( sal_uInt16 nYear )
{
return (
( ((nYear % 4) == 0) && ((nYear % 100) != 0) ) ||
@@ -71,7 +71,7 @@ inline BOOL ImpIsLeapYear( USHORT nYear )
// -----------------------------------------------------------------------
-inline USHORT DaysInMonth( USHORT nMonth, USHORT nYear )
+inline sal_uInt16 DaysInMonth( sal_uInt16 nMonth, sal_uInt16 nYear )
{
if ( nMonth != 2 )
return aDaysInMonth[nMonth-1];
@@ -86,13 +86,13 @@ inline USHORT DaysInMonth( USHORT nMonth, USHORT nYear )
// -----------------------------------------------------------------------
-long Date::DateToDays( USHORT nDay, USHORT nMonth, USHORT nYear )
+long Date::DateToDays( sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear )
{
long nDays;
- nDays = ((ULONG)nYear-1) * 365;
+ nDays = ((sal_uIntPtr)nYear-1) * 365;
nDays += ((nYear-1) / 4) - ((nYear-1) / 100) + ((nYear-1) / 400);
- for( USHORT i = 1; i < nMonth; i++ )
+ for( sal_uInt16 i = 1; i < nMonth; i++ )
nDays += DaysInMonth(i,nYear);
nDays += nDay;
return nDays;
@@ -101,23 +101,23 @@ long Date::DateToDays( USHORT nDay, USHORT nMonth, USHORT nYear )
// -----------------------------------------------------------------------
static void DaysToDate( long nDays,
- USHORT& rDay, USHORT& rMonth, USHORT& rYear )
+ sal_uInt16& rDay, sal_uInt16& rMonth, sal_uInt16& rYear )
{
long nTempDays;
long i = 0;
- BOOL bCalc;
+ sal_Bool bCalc;
do
{
nTempDays = (long)nDays;
- rYear = (USHORT)((nTempDays / 365) - i);
- nTempDays -= ((ULONG)rYear-1) * 365;
+ rYear = (sal_uInt16)((nTempDays / 365) - i);
+ nTempDays -= ((sal_uIntPtr)rYear-1) * 365;
nTempDays -= ((rYear-1) / 4) - ((rYear-1) / 100) + ((rYear-1) / 400);
- bCalc = FALSE;
+ bCalc = sal_False;
if ( nTempDays < 1 )
{
i++;
- bCalc = TRUE;
+ bCalc = sal_True;
}
else
{
@@ -126,7 +126,7 @@ static void DaysToDate( long nDays,
if ( (nTempDays != 366) || !ImpIsLeapYear( rYear ) )
{
i--;
- bCalc = TRUE;
+ bCalc = sal_True;
}
}
}
@@ -134,12 +134,12 @@ static void DaysToDate( long nDays,
while ( bCalc );
rMonth = 1;
- while ( (ULONG)nTempDays > DaysInMonth( rMonth, rYear ) )
+ while ( (sal_uIntPtr)nTempDays > DaysInMonth( rMonth, rYear ) )
{
nTempDays -= DaysInMonth( rMonth, rYear );
rMonth++;
}
- rDay = (USHORT)nTempDays;
+ rDay = (sal_uInt16)nTempDays;
}
// =======================================================================
@@ -151,17 +151,17 @@ Date::Date()
DosGetDateTime( &aDateTime );
// Datum zusammenbauen
- nDate = ((ULONG)aDateTime.day) +
- (((ULONG)aDateTime.month)*100) +
- (((ULONG)aDateTime.year)*10000);
+ nDate = ((sal_uIntPtr)aDateTime.day) +
+ (((sal_uIntPtr)aDateTime.month)*100) +
+ (((sal_uIntPtr)aDateTime.year)*10000);
#elif defined WNT
SYSTEMTIME aDateTime;
GetLocalTime( &aDateTime );
// Datum zusammenbauen
- nDate = ((ULONG)aDateTime.wDay) +
- (((ULONG)aDateTime.wMonth)*100) +
- (((ULONG)aDateTime.wYear)*10000);
+ nDate = ((sal_uIntPtr)aDateTime.wDay) +
+ (((sal_uIntPtr)aDateTime.wMonth)*100) +
+ (((sal_uIntPtr)aDateTime.wYear)*10000);
#else
time_t nTmpTime;
struct tm aTime;
@@ -172,65 +172,65 @@ Date::Date()
// Datum zusammenbauen
if ( localtime_r( &nTmpTime, &aTime ) )
{
- nDate = ((ULONG)aTime.tm_mday) +
- (((ULONG)(aTime.tm_mon+1))*100) +
- (((ULONG)(aTime.tm_year+1900))*10000);
+ nDate = ((sal_uIntPtr)aTime.tm_mday) +
+ (((sal_uIntPtr)(aTime.tm_mon+1))*100) +
+ (((sal_uIntPtr)(aTime.tm_year+1900))*10000);
}
else
- nDate = 1 + 100 + (((ULONG)1900)*10000);
+ nDate = 1 + 100 + (((sal_uIntPtr)1900)*10000);
#endif
}
// -----------------------------------------------------------------------
-void Date::SetDay( USHORT nNewDay )
+void Date::SetDay( sal_uInt16 nNewDay )
{
- ULONG nMonth = GetMonth();
- ULONG nYear = GetYear();
+ sal_uIntPtr nMonth = GetMonth();
+ sal_uIntPtr nYear = GetYear();
- nDate = ((ULONG)(nNewDay%100)) + (nMonth*100) + (nYear*10000);
+ nDate = ((sal_uIntPtr)(nNewDay%100)) + (nMonth*100) + (nYear*10000);
}
// -----------------------------------------------------------------------
-void Date::SetMonth( USHORT nNewMonth )
+void Date::SetMonth( sal_uInt16 nNewMonth )
{
- ULONG nDay = GetDay();
- ULONG nYear = GetYear();
+ sal_uIntPtr nDay = GetDay();
+ sal_uIntPtr nYear = GetYear();
- nDate = nDay + (((ULONG)(nNewMonth%100))*100) + (nYear*10000);
+ nDate = nDay + (((sal_uIntPtr)(nNewMonth%100))*100) + (nYear*10000);
}
// -----------------------------------------------------------------------
-void Date::SetYear( USHORT nNewYear )
+void Date::SetYear( sal_uInt16 nNewYear )
{
- ULONG nDay = GetDay();
- ULONG nMonth = GetMonth();
+ sal_uIntPtr nDay = GetDay();
+ sal_uIntPtr nMonth = GetMonth();
- nDate = nDay + (nMonth*100) + (((ULONG)(nNewYear%10000))*10000);
+ nDate = nDay + (nMonth*100) + (((sal_uIntPtr)(nNewYear%10000))*10000);
}
// -----------------------------------------------------------------------
DayOfWeek Date::GetDayOfWeek() const
{
- return (DayOfWeek)((ULONG)(DateToDays( GetDay(), GetMonth(), GetYear() )-1) % 7);
+ return (DayOfWeek)((sal_uIntPtr)(DateToDays( GetDay(), GetMonth(), GetYear() )-1) % 7);
}
// -----------------------------------------------------------------------
-USHORT Date::GetDayOfYear() const
+sal_uInt16 Date::GetDayOfYear() const
{
- USHORT nDay = GetDay();
- for( USHORT i = 1; i < GetMonth(); i++ )
+ sal_uInt16 nDay = GetDay();
+ for( sal_uInt16 i = 1; i < GetMonth(); i++ )
nDay = nDay + ::DaysInMonth( i, GetYear() ); // += yields a warning on MSVC, so don't use it
return nDay;
}
// -----------------------------------------------------------------------
-USHORT Date::GetWeekOfYear( DayOfWeek eStartDay,
+sal_uInt16 Date::GetWeekOfYear( DayOfWeek eStartDay,
sal_Int16 nMinimumNumberOfDaysInWeek ) const
{
short nWeek;
@@ -308,76 +308,76 @@ USHORT Date::GetWeekOfYear( DayOfWeek eStartDay,
// == noch gleiche Woche
long nTempDays = DateToDays( GetDay(), GetMonth(), GetYear() );
nTempDays += 6 - (GetDayOfWeek()+(7-(short)eStartDay)) % 7;
- USHORT nDay;
- USHORT nMonth;
- USHORT nYear;
+ sal_uInt16 nDay;
+ sal_uInt16 nMonth;
+ sal_uInt16 nYear;
DaysToDate( nTempDays, nDay, nMonth, nYear );
nWeek = Date( nDay, nMonth, nYear ).GetWeekOfYear( eStartDay, nMinimumNumberOfDaysInWeek );
}
}
}
- return (USHORT)nWeek;
+ return (sal_uInt16)nWeek;
}
// -----------------------------------------------------------------------
-USHORT Date::GetDaysInMonth() const
+sal_uInt16 Date::GetDaysInMonth() const
{
return DaysInMonth( GetMonth(), GetYear() );
}
// -----------------------------------------------------------------------
-BOOL Date::IsLeapYear() const
+sal_Bool Date::IsLeapYear() const
{
- USHORT nYear = GetYear();
+ sal_uInt16 nYear = GetYear();
return ImpIsLeapYear( nYear );
}
// -----------------------------------------------------------------------
-BOOL Date::IsValid() const
+sal_Bool Date::IsValid() const
{
- USHORT nDay = GetDay();
- USHORT nMonth = GetMonth();
- USHORT nYear = GetYear();
+ sal_uInt16 nDay = GetDay();
+ sal_uInt16 nMonth = GetMonth();
+ sal_uInt16 nYear = GetYear();
if ( !nMonth || (nMonth > 12) )
- return FALSE;
+ return sal_False;
if ( !nDay || (nDay > DaysInMonth( nMonth, nYear )) )
- return FALSE;
+ return sal_False;
else if ( nYear <= 1582 )
{
if ( nYear < 1582 )
- return FALSE;
+ return sal_False;
else if ( nMonth < 10 )
- return FALSE;
+ return sal_False;
else if ( (nMonth == 10) && (nDay < 15) )
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
Date& Date::operator +=( long nDays )
{
- USHORT nDay;
- USHORT nMonth;
- USHORT nYear;
+ sal_uInt16 nDay;
+ sal_uInt16 nMonth;
+ sal_uInt16 nYear;
long nTempDays = DateToDays( GetDay(), GetMonth(), GetYear() );
nTempDays += nDays;
if ( nTempDays > MAX_DAYS )
- nDate = 31 + (12*100) + (((ULONG)9999)*10000);
+ nDate = 31 + (12*100) + (((sal_uIntPtr)9999)*10000);
else if ( nTempDays <= 0 )
nDate = 1 + 100;
else
{
DaysToDate( nTempDays, nDay, nMonth, nYear );
- nDate = ((ULONG)nDay) + (((ULONG)nMonth)*100) + (((ULONG)nYear)*10000);
+ nDate = ((sal_uIntPtr)nDay) + (((sal_uIntPtr)nMonth)*100) + (((sal_uIntPtr)nYear)*10000);
}
return *this;
@@ -387,20 +387,20 @@ Date& Date::operator +=( long nDays )
Date& Date::operator -=( long nDays )
{
- USHORT nDay;
- USHORT nMonth;
- USHORT nYear;
+ sal_uInt16 nDay;
+ sal_uInt16 nMonth;
+ sal_uInt16 nYear;
long nTempDays = DateToDays( GetDay(), GetMonth(), GetYear() );
nTempDays -= nDays;
if ( nTempDays > MAX_DAYS )
- nDate = 31 + (12*100) + (((ULONG)9999)*10000);
+ nDate = 31 + (12*100) + (((sal_uIntPtr)9999)*10000);
else if ( nTempDays <= 0 )
nDate = 1 + 100;
else
{
DaysToDate( nTempDays, nDay, nMonth, nYear );
- nDate = ((ULONG)nDay) + (((ULONG)nMonth)*100) + (((ULONG)nYear)*10000);
+ nDate = ((sal_uIntPtr)nDay) + (((sal_uIntPtr)nMonth)*100) + (((sal_uIntPtr)nYear)*10000);
}
return *this;
@@ -410,16 +410,16 @@ Date& Date::operator -=( long nDays )
Date& Date::operator ++()
{
- USHORT nDay;
- USHORT nMonth;
- USHORT nYear;
+ sal_uInt16 nDay;
+ sal_uInt16 nMonth;
+ sal_uInt16 nYear;
long nTempDays = DateToDays( GetDay(), GetMonth(), GetYear() );
if ( nTempDays < MAX_DAYS )
{
nTempDays++;
DaysToDate( nTempDays, nDay, nMonth, nYear );
- nDate = ((ULONG)nDay) + (((ULONG)nMonth)*100) + (((ULONG)nYear)*10000);
+ nDate = ((sal_uIntPtr)nDay) + (((sal_uIntPtr)nMonth)*100) + (((sal_uIntPtr)nYear)*10000);
}
return *this;
@@ -429,16 +429,16 @@ Date& Date::operator ++()
Date& Date::operator --()
{
- USHORT nDay;
- USHORT nMonth;
- USHORT nYear;
+ sal_uInt16 nDay;
+ sal_uInt16 nMonth;
+ sal_uInt16 nYear;
long nTempDays = DateToDays( GetDay(), GetMonth(), GetYear() );
if ( nTempDays > 1 )
{
nTempDays--;
DaysToDate( nTempDays, nDay, nMonth, nYear );
- nDate = ((ULONG)nDay) + (((ULONG)nMonth)*100) + (((ULONG)nYear)*10000);
+ nDate = ((sal_uIntPtr)nDay) + (((sal_uIntPtr)nMonth)*100) + (((sal_uIntPtr)nYear)*10000);
}
return *this;
}
@@ -487,9 +487,9 @@ Date operator -( const Date& rDate, long nDays )
long operator -( const Date& rDate1, const Date& rDate2 )
{
- ULONG nTempDays1 = Date::DateToDays( rDate1.GetDay(), rDate1.GetMonth(),
+ sal_uIntPtr nTempDays1 = Date::DateToDays( rDate1.GetDay(), rDate1.GetMonth(),
rDate1.GetYear() );
- ULONG nTempDays2 = Date::DateToDays( rDate2.GetDay(), rDate2.GetMonth(),
+ sal_uIntPtr nTempDays2 = Date::DateToDays( rDate2.GetDay(), rDate2.GetMonth(),
rDate2.GetYear() );
return nTempDays1 - nTempDays2;
}
diff --git a/tools/source/datetime/ttime.cxx b/tools/source/datetime/ttime.cxx
index 44a626284456..a7efa63c9290 100644
--- a/tools/source/datetime/ttime.cxx
+++ b/tools/source/datetime/ttime.cxx
@@ -146,7 +146,7 @@ Time::Time( const Time& rTime )
// -----------------------------------------------------------------------
-Time::Time( ULONG nHour, ULONG nMin, ULONG nSec, ULONG n100Sec )
+Time::Time( sal_uIntPtr nHour, sal_uIntPtr nMin, sal_uIntPtr nSec, sal_uIntPtr n100Sec )
{
// Zeit normalisieren
nSec += n100Sec / 100;
@@ -162,7 +162,7 @@ Time::Time( ULONG nHour, ULONG nMin, ULONG nSec, ULONG n100Sec )
// -----------------------------------------------------------------------
-void Time::SetHour( USHORT nNewHour )
+void Time::SetHour( sal_uInt16 nNewHour )
{
short nSign = (nTime >= 0) ? +1 : -1;
sal_Int32 nMin = GetMin();
@@ -175,7 +175,7 @@ void Time::SetHour( USHORT nNewHour )
// -----------------------------------------------------------------------
-void Time::SetMin( USHORT nNewMin )
+void Time::SetMin( sal_uInt16 nNewMin )
{
short nSign = (nTime >= 0) ? +1 : -1;
sal_Int32 nHour = GetHour();
@@ -191,7 +191,7 @@ void Time::SetMin( USHORT nNewMin )
// -----------------------------------------------------------------------
-void Time::SetSec( USHORT nNewSec )
+void Time::SetSec( sal_uInt16 nNewSec )
{
short nSign = (nTime >= 0) ? +1 : -1;
sal_Int32 nHour = GetHour();
@@ -207,7 +207,7 @@ void Time::SetSec( USHORT nNewSec )
// -----------------------------------------------------------------------
-void Time::Set100Sec( USHORT nNew100Sec )
+void Time::Set100Sec( sal_uInt16 nNew100Sec )
{
short nSign = (nTime >= 0) ? +1 : -1;
sal_Int32 nHour = GetHour();
@@ -308,7 +308,7 @@ Time operator -( const Time& rTime1, const Time& rTime2 )
// -----------------------------------------------------------------------
-BOOL Time::IsEqualIgnore100Sec( const Time& rTime ) const
+sal_Bool Time::IsEqualIgnore100Sec( const Time& rTime ) const
{
sal_Int32 n1 = (nTime < 0 ? -Get100Sec() : Get100Sec() );
sal_Int32 n2 = (rTime.nTime < 0 ? -rTime.Get100Sec() : rTime.Get100Sec() );
@@ -328,7 +328,7 @@ Time Time::GetUTCOffset()
if ( aDateTime.timezone != -1 )
{
short nTempTime = (short)Abs( aDateTime.timezone );
- Time aTime( 0, (USHORT)nTempTime );
+ Time aTime( 0, (sal_uInt16)nTempTime );
if ( aDateTime.timezone > 0 )
aTime = -aTime;
return aTime;
@@ -344,14 +344,14 @@ Time Time::GetUTCOffset()
nTempTime += aTimeZone.StandardBias;
else if ( nTimeZoneRet == TIME_ZONE_ID_DAYLIGHT )
nTempTime += aTimeZone.DaylightBias;
- Time aTime( 0, (USHORT)Abs( nTempTime ) );
+ Time aTime( 0, (sal_uInt16)Abs( nTempTime ) );
if ( nTempTime > 0 )
aTime = -aTime;
return aTime;
#else
- static ULONG nCacheTicks = 0;
+ static sal_uIntPtr nCacheTicks = 0;
static sal_Int32 nCacheSecOffset = -1;
- ULONG nTicks = Time::GetSystemTicks();
+ sal_uIntPtr nTicks = Time::GetSystemTicks();
time_t nTime;
tm aTM;
sal_Int32 nLocalTime;
@@ -383,7 +383,7 @@ Time Time::GetUTCOffset()
}
nTempTime = (short)Abs( nCacheSecOffset );
- Time aTime( 0, (USHORT)nTempTime );
+ Time aTime( 0, (sal_uInt16)nTempTime );
if ( nCacheSecOffset < 0 )
aTime = -aTime;
return aTime;
@@ -393,14 +393,14 @@ Time Time::GetUTCOffset()
// -----------------------------------------------------------------------
-ULONG Time::GetSystemTicks()
+sal_uIntPtr Time::GetSystemTicks()
{
#if defined WNT
- return (ULONG)GetTickCount();
+ return (sal_uIntPtr)GetTickCount();
#elif defined( OS2 )
- ULONG nClock;
+ sal_uIntPtr nClock;
DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT, &nClock, sizeof( nClock ) );
- return (ULONG)nClock;
+ return (sal_uIntPtr)nClock;
#else
timeval tv;
gettimeofday (&tv, 0);
@@ -410,38 +410,38 @@ ULONG Time::GetSystemTicks()
fTicks += ((tv.tv_usec + 500) / 1000);
fTicks = fmod (fTicks, double(ULONG_MAX));
- return ULONG(fTicks);
+ return sal_uIntPtr(fTicks);
#endif
}
// -----------------------------------------------------------------------
-ULONG Time::GetProcessTicks()
+sal_uIntPtr Time::GetProcessTicks()
{
#if defined WNT
- return (ULONG)GetTickCount();
+ return (sal_uIntPtr)GetTickCount();
#elif defined( OS2 )
- ULONG nClock;
+ sal_uIntPtr nClock;
DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT, &nClock, sizeof( nClock ) );
- return (ULONG)nClock;
+ return (sal_uIntPtr)nClock;
#else
- static ULONG nImplTicksPerSecond = 0;
+ static sal_uIntPtr nImplTicksPerSecond = 0;
static double dImplTicksPerSecond;
static double dImplTicksULONGMAX;
- ULONG nTicks = (ULONG)clock();
+ sal_uIntPtr nTicks = (sal_uIntPtr)clock();
if ( !nImplTicksPerSecond )
{
nImplTicksPerSecond = CLOCKS_PER_SEC;
dImplTicksPerSecond = nImplTicksPerSecond;
- dImplTicksULONGMAX = (double)(ULONG)ULONG_MAX;
+ dImplTicksULONGMAX = (double)(sal_uIntPtr)ULONG_MAX;
}
double fTicks = nTicks;
fTicks *= 1000;
fTicks /= dImplTicksPerSecond;
fTicks = fmod (fTicks, dImplTicksULONGMAX);
- return (ULONG)fTicks;
+ return (sal_uIntPtr)fTicks;
#endif
}
diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx
index 7564e1d76594..c65745e65be0 100644
--- a/tools/source/debug/debug.cxx
+++ b/tools/source/debug/debug.cxx
@@ -96,7 +96,7 @@ static sal_Char const DbgTrace_LeaveMeth[] = "Leave method from class ";
struct PBlock
{
void* aData[PBLOCKCOUNT];
- USHORT nCount;
+ sal_uInt16 nCount;
PBlock* pPrev;
PBlock* pNext;
};
@@ -106,18 +106,18 @@ class PointerList
private:
PBlock* pFirst;
PBlock* pLast;
- ULONG nCount;
+ sal_uIntPtr nCount;
public:
PointerList() { pFirst = NULL; pLast = NULL; nCount = 0; }
~PointerList();
void Add( const void* p );
- BOOL Remove( const void* p );
+ sal_Bool Remove( const void* p );
- const void* Get( ULONG nPos ) const;
- BOOL IsIn( const void* p ) const;
- ULONG Count() const { return nCount; }
+ const void* Get( sal_uIntPtr nPos ) const;
+ sal_Bool IsIn( const void* p ) const;
+ sal_uIntPtr Count() const { return nCount; }
};
// --- Datentypen ---
@@ -126,31 +126,31 @@ public:
struct ProfType
{
- ULONG nCount;
- ULONG nTime;
- ULONG nMinTime;
- ULONG nMaxTime;
- ULONG nStart;
- ULONG nContinueTime;
- ULONG nContinueStart;
+ sal_uIntPtr nCount;
+ sal_uIntPtr nTime;
+ sal_uIntPtr nMinTime;
+ sal_uIntPtr nMaxTime;
+ sal_uIntPtr nStart;
+ sal_uIntPtr nContinueTime;
+ sal_uIntPtr nContinueStart;
sal_Char aName[DBG_MAXNAME+1];
};
struct XtorType
{
- ULONG nCtorCalls;
- ULONG nDtorCalls;
- ULONG nMaxCount;
- ULONG nStatics;
+ sal_uIntPtr nCtorCalls;
+ sal_uIntPtr nDtorCalls;
+ sal_uIntPtr nMaxCount;
+ sal_uIntPtr nStatics;
sal_Char aName[DBG_MAXNAME+1];
- BOOL bTest;
+ sal_Bool bTest;
PointerList aThisList;
};
struct DebugData
{
DbgData aDbgData;
- USHORT bInit;
+ sal_uInt16 bInit;
DbgPrintLine pDbgPrintMsgBox;
DbgPrintLine pDbgPrintWindow;
DbgPrintLine pDbgPrintTestTool;
@@ -164,8 +164,8 @@ struct DebugData
bool bOslIsHooked;
DebugData()
- :bInit( FALSE )
- ,pDbgPrintMsgBox( FALSE )
+ :bInit( sal_False )
+ ,pDbgPrintMsgBox( sal_False )
,pDbgPrintWindow( NULL )
,pDbgPrintTestTool( NULL )
,pProfList( NULL )
@@ -175,7 +175,7 @@ struct DebugData
,bOslIsHooked( false )
{
aDbgData.nTestFlags = DBG_TEST_RESOURCE | DBG_TEST_MEM_INIT;
- aDbgData.bOverwrite = TRUE;
+ aDbgData.bOverwrite = sal_True;
aDbgData.nTraceOut = DBG_OUT_NULL;
aDbgData.nWarningOut = DBG_OUT_NULL;
#ifdef UNX
@@ -186,7 +186,7 @@ struct DebugData
aDbgData.bMemInit = 0x77;
aDbgData.bMemBound = 0x55;
aDbgData.bMemFree = 0x33;
- aDbgData.bHookOSLAssert = TRUE;
+ aDbgData.bHookOSLAssert = sal_True;
aDbgData.aDebugName[0] = 0;
aDbgData.aInclFilter[0] = 0;
aDbgData.aExclFilter[0] = 0;
@@ -207,7 +207,7 @@ static DebugData aDebugData;
static sal_Char aCurPath[260];
-static int bDbgImplInMain = FALSE;
+static int bDbgImplInMain = sal_False;
// =======================================================================
@@ -216,7 +216,7 @@ static CRITICAL_SECTION aImplCritDbgSection;
#elif defined( OS2 )
static HMTX hImplCritDbgSection = 0;
#endif
-static BOOL bImplCritDbgSectionInit = FALSE;
+static sal_Bool bImplCritDbgSectionInit = sal_False;
// -----------------------------------------------------------------------
@@ -225,9 +225,9 @@ void ImplDbgInitLock()
#if defined( WNT )
InitializeCriticalSection( &aImplCritDbgSection );
#elif defined( OS2 )
- DosCreateMutexSem( NULL, &hImplCritDbgSection, 0, FALSE );
+ DosCreateMutexSem( NULL, &hImplCritDbgSection, 0, sal_False );
#endif
- bImplCritDbgSectionInit = TRUE;
+ bImplCritDbgSectionInit = sal_True;
}
// -----------------------------------------------------------------------
@@ -239,7 +239,7 @@ void ImplDbgDeInitLock()
#elif defined( OS2 )
DosCloseMutexSem( hImplCritDbgSection );
#endif
- bImplCritDbgSectionInit = FALSE;
+ bImplCritDbgSectionInit = sal_False;
}
// -----------------------------------------------------------------------
@@ -285,7 +285,7 @@ void DbgImpMemoryInfo( sal_Char* pBuf );
// =======================================================================
-static BOOL ImplActivateDebugger( const sal_Char* pMsg )
+static sal_Bool ImplActivateDebugger( const sal_Char* pMsg )
{
#if defined( WNT )
static sal_Char aImplDbgOutBuf[DBG_BUF_MAXLEN];
@@ -293,16 +293,16 @@ static BOOL ImplActivateDebugger( const sal_Char* pMsg )
strcat( aImplDbgOutBuf, "\r\n" );
OutputDebugString( aImplDbgOutBuf );
DebugBreak();
- return TRUE;
+ return sal_True;
#else
(void) pMsg; // avoid warning about unused parameter
- return FALSE;
+ return sal_False;
#endif
}
// -----------------------------------------------------------------------
-static BOOL ImplCoreDump()
+static sal_Bool ImplCoreDump()
{
#if defined( WNT )
DebugBreak();
@@ -310,23 +310,23 @@ static BOOL ImplCoreDump()
long* pTemp = 0;
*pTemp = 0xCCCC;
#endif
- return TRUE;
+ return sal_True;
}
// =======================================================================
-static ULONG ImplGetPerfTime()
+static sal_uIntPtr ImplGetPerfTime()
{
#if defined( WNT )
- return (ULONG)GetTickCount();
+ return (sal_uIntPtr)GetTickCount();
#elif defined( OS2 )
- ULONG nClock;
+ sal_uIntPtr nClock;
DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT, &nClock, sizeof( nClock ) );
- return (ULONG)nClock;
+ return (sal_uIntPtr)nClock;
#else
- static ULONG nImplTicksPerSecond = 0;
+ static sal_uIntPtr nImplTicksPerSecond = 0;
static double dImplTicksPerSecond;
- ULONG nTicks = (ULONG)clock();
+ sal_uIntPtr nTicks = (sal_uIntPtr)clock();
if ( !nImplTicksPerSecond )
{
@@ -337,7 +337,7 @@ static ULONG ImplGetPerfTime()
double fTicks = nTicks;
fTicks *= 1000;
fTicks /= dImplTicksPerSecond;
- return (ULONG)fTicks;
+ return (sal_uIntPtr)fTicks;
#endif
}
@@ -417,12 +417,12 @@ namespace
lcl_writeConfigString( _pFile, _pKeyName, _bValue ? "1" : "0" );
}
- void lcl_writeConfigFlag( FILETYPE _pFile, const sal_Char* _pKeyName, ULONG _nAllFlags, ULONG _nCheckFlag )
+ void lcl_writeConfigFlag( FILETYPE _pFile, const sal_Char* _pKeyName, sal_uIntPtr _nAllFlags, sal_uIntPtr _nCheckFlag )
{
lcl_writeConfigBoolean( _pFile, _pKeyName, ( _nAllFlags & _nCheckFlag ) != 0 );
}
- void lcl_writeConfigOutChannel( FILETYPE _pFile, const sal_Char* _pKeyName, ULONG _nValue )
+ void lcl_writeConfigOutChannel( FILETYPE _pFile, const sal_Char* _pKeyName, sal_uIntPtr _nValue )
{
const sal_Char* names[ DBG_OUT_COUNT ] =
{
@@ -430,7 +430,7 @@ namespace
};
lcl_writeConfigString( _pFile, _pKeyName, names[ _nValue ] );
}
- void lcl_writeHexByte( FILETYPE _pFile, const sal_Char* _pKeyName, BYTE _nValue )
+ void lcl_writeHexByte( FILETYPE _pFile, const sal_Char* _pKeyName, sal_uInt8 _nValue )
{
sal_Char buf[RTL_STR_MAX_VALUEOFINT32];
rtl_String* stringData = NULL;
@@ -470,14 +470,14 @@ namespace
_pValue[ ( _nValueLen > nValueLen ) ? nValueLen : _nValueLen - 1 ] = 0;
return strlen( _pValue );
}
- void lcl_tryReadConfigBoolean( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, ULONG* _out_pnValue )
+ void lcl_tryReadConfigBoolean( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uIntPtr* _out_pnValue )
{
sal_Char aBuf[2];
size_t nValueLen = lcl_tryReadConfigString( _pLine, _nLineLen, _pKeyName, aBuf, sizeof( aBuf ) );
if ( nValueLen )
- *_out_pnValue = strcmp( aBuf, "1" ) == 0 ? TRUE : FALSE;
+ *_out_pnValue = strcmp( aBuf, "1" ) == 0 ? sal_True : sal_False;
}
- void lcl_tryReadOutputChannel( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, ULONG* _out_pnValue )
+ void lcl_tryReadOutputChannel( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uIntPtr* _out_pnValue )
{
const sal_Char* names[ DBG_OUT_COUNT ] =
{
@@ -487,7 +487,7 @@ namespace
size_t nValueLen = lcl_tryReadConfigString( _pLine, _nLineLen, _pKeyName, aBuf, sizeof( aBuf ) );
if ( nValueLen )
{
- for ( ULONG name = 0; name < SAL_N_ELEMENTS( names ); ++name )
+ for ( size_t name = 0; name < SAL_N_ELEMENTS( names ); ++name )
{
if ( strcmp( aBuf, names[ name ] ) == 0 )
{
@@ -497,7 +497,7 @@ namespace
}
}
}
- void lcl_tryReadConfigFlag( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, ULONG* _out_pnAllFlags, ULONG _nCheckFlag )
+ void lcl_tryReadConfigFlag( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uIntPtr* _out_pnAllFlags, sal_uIntPtr _nCheckFlag )
{
sal_Char aBuf[2];
size_t nValueLen = lcl_tryReadConfigString( _pLine, _nLineLen, _pKeyName, aBuf, sizeof( aBuf ) );
@@ -509,12 +509,12 @@ namespace
*_out_pnAllFlags &= ~_nCheckFlag;
}
}
- void lcl_tryReadHexByte( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, BYTE* _out_pnValue )
+ void lcl_tryReadHexByte( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uInt8* _out_pnValue )
{
sal_Char aBuf[3];
size_t nValueLen = lcl_tryReadConfigString( _pLine, _nLineLen, _pKeyName, aBuf, sizeof( aBuf ) );
if ( nValueLen )
- *_out_pnValue = (BYTE)rtl_str_toInt32( aBuf, 16 );
+ *_out_pnValue = (sal_uInt8)rtl_str_toInt32( aBuf, 16 );
}
}
@@ -560,7 +560,7 @@ void PointerList::Add( const void* p )
pLast = pBlock;
}
- USHORT i = 0;
+ sal_uInt16 i = 0;
while ( pBlock->aData[i] )
i++;
@@ -571,18 +571,18 @@ void PointerList::Add( const void* p )
// -----------------------------------------------------------------------
-BOOL PointerList::Remove( const void* p )
+sal_Bool PointerList::Remove( const void* p )
{
if ( !p )
- return FALSE;
+ return sal_False;
PBlock* pBlock = pFirst;
while ( pBlock )
{
- USHORT i = 0;
+ sal_uInt16 i = 0;
while ( i < PBLOCKCOUNT )
{
- if ( ((ULONG)p) == ((ULONG)pBlock->aData[i]) )
+ if ( ((sal_uIntPtr)p) == ((sal_uIntPtr)pBlock->aData[i]) )
{
pBlock->aData[i] = NULL;
pBlock->nCount--;
@@ -601,7 +601,7 @@ BOOL PointerList::Remove( const void* p )
delete pBlock;
}
- return TRUE;
+ return sal_True;
}
i++;
}
@@ -609,21 +609,21 @@ BOOL PointerList::Remove( const void* p )
pBlock = pBlock->pNext;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
-const void* PointerList::Get( ULONG nPos ) const
+const void* PointerList::Get( sal_uIntPtr nPos ) const
{
if ( nCount <= nPos )
return NULL;
PBlock* pBlock = pFirst;
- ULONG nStart = 0;
+ sal_uIntPtr nStart = 0;
while ( pBlock )
{
- USHORT i = 0;
+ sal_uInt16 i = 0;
while ( i < PBLOCKCOUNT )
{
if ( pBlock->aData[i] )
@@ -644,26 +644,26 @@ const void* PointerList::Get( ULONG nPos ) const
// -----------------------------------------------------------------------
-BOOL PointerList::IsIn( const void* p ) const
+sal_Bool PointerList::IsIn( const void* p ) const
{
if ( !p )
- return FALSE;
+ return sal_False;
PBlock* pBlock = pFirst;
while ( pBlock )
{
- USHORT i = 0;
+ sal_uInt16 i = 0;
while ( i < PBLOCKCOUNT )
{
- if ( ((ULONG)p) == ((ULONG)pBlock->aData[i]) )
- return TRUE;
+ if ( ((sal_uIntPtr)p) == ((sal_uIntPtr)pBlock->aData[i]) )
+ return sal_True;
i++;
}
pBlock = pBlock->pNext;
}
- return FALSE;
+ return sal_False;
}
@@ -731,7 +731,7 @@ static DebugData* GetDebugData()
{
if ( !aDebugData.bInit )
{
- aDebugData.bInit = TRUE;
+ aDebugData.bInit = sal_True;
// Default Debug-Namen setzen
DbgGetLogFileName( aDebugData.aDbgData.aDebugName );
@@ -745,7 +745,7 @@ static DebugData* GetDebugData()
ConfigSection eCurrentSection = eUnknown;
// no sophisticated algorithm here, assume that the whole file fits into aBuf ...
- ULONG nReallyRead = FileRead( aBuf, 1, sizeof( aBuf ) / sizeof( sal_Char ) - 1, pIniFile );
+ sal_uIntPtr nReallyRead = FileRead( aBuf, 1, sizeof( aBuf ) / sizeof( sal_Char ) - 1, pIniFile );
aBuf[ nReallyRead ] = 0;
const sal_Char* pLine = aBuf;
while ( const sal_Char* pNextLine = strstr( pLine, FILE_LINEEND ) )
@@ -846,7 +846,7 @@ inline DebugData* ImplGetDebugData()
static FILETYPE ImplDbgInitFile()
{
- static BOOL bFileInit = FALSE;
+ static sal_Bool bFileInit = sal_False;
sal_Char aBuf[4096];
getcwd( aBuf, sizeof( aBuf ) );
@@ -857,7 +857,7 @@ static FILETYPE ImplDbgInitFile()
if ( !bFileInit )
{
- bFileInit = TRUE;
+ bFileInit = sal_True;
if ( pData->aDbgData.bOverwrite )
pDebugFile = FileOpen( pData->aDbgData.aDebugName, "w" );
@@ -936,7 +936,7 @@ static int ImplDbgFilter( const sal_Char* pFilter, const sal_Char* pMsg,
if ( pTok[nTok] == ';' )
{
if ( nTok && ImplStrSearch( pTok, nTok, pMsg, nMsgLen ) )
- return TRUE;
+ return sal_True;
pTok += nTok+1;
nTok = 0;
@@ -946,9 +946,9 @@ static int ImplDbgFilter( const sal_Char* pFilter, const sal_Char* pMsg,
}
if ( nTok && ImplStrSearch( pTok, nTok, pMsg, nMsgLen ) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -956,14 +956,14 @@ static int ImplDbgFilter( const sal_Char* pFilter, const sal_Char* pMsg,
extern "C"
void SAL_CALL dbg_printOslDebugMessage( const sal_Char * pszFileName, sal_Int32 nLine, const sal_Char * pszMessage )
{
- DbgOut( pszMessage ? pszMessage : "assertion failed!", DBG_OUT_ERROR, pszFileName, (USHORT)nLine );
+ DbgOut( pszMessage ? pszMessage : "assertion failed!", DBG_OUT_ERROR, pszFileName, (sal_uInt16)nLine );
}
// -----------------------------------------------------------------------
static void DebugInit()
{
- bDbgImplInMain = TRUE;
+ bDbgImplInMain = sal_True;
ImplDbgInitLock();
DebugData* pData = GetDebugData();
@@ -979,14 +979,14 @@ static void DebugInit()
static void DebugDeInit()
{
DebugData* pData = GetDebugData();
- ULONG i;
- ULONG nCount;
- ULONG nOldOut;
+ sal_uIntPtr i;
+ sal_uIntPtr nCount;
+ sal_uIntPtr nOldOut;
if( pData->bOslIsHooked )
{
osl_setDetailedDebugMessageFunc( pData->pOldDebugMessageFunc );
- pData->bOslIsHooked = FALSE;
+ pData->bOslIsHooked = sal_False;
}
// Statistik-Ausgaben immer in File
@@ -1034,7 +1034,7 @@ static void DebugDeInit()
pData->pXtorList = NULL;
}
- // Alles auf FALSE setzen, damit globale Variablen nicht das
+ // Alles auf sal_False setzen, damit globale Variablen nicht das
// System zum Abstuerzen bringt. Dabei muessen aber die
// Memory-Flags erhalten bleiben, da sonst new/delete in globalen
// Variablen abstuerzen, da die Pointeranpassung dann nicht mehr richtig
@@ -1053,9 +1053,9 @@ static void DebugDeInit()
static void DebugGlobalDeInit()
{
DebugData* pData = GetDebugData();
- ULONG i;
- ULONG nCount;
- ULONG nOldOut;
+ sal_uIntPtr i;
+ sal_uIntPtr nCount;
+ sal_uIntPtr nOldOut;
// Statistik-Ausgaben immer in File
nOldOut = pData->aDbgData.nTraceOut;
@@ -1073,7 +1073,7 @@ static void DebugGlobalDeInit()
for( i = 0, nCount = pData->pProfList->Count(); i < nCount; i++ )
{
ProfType* pProfData = (ProfType*)pData->pProfList->Get( i );
- ULONG nAve = pProfData->nTime / pProfData->nCount;
+ sal_uIntPtr nAve = pProfData->nTime / pProfData->nCount;
DbgOutf( "%-25s : %9lu : %6lu : %6lu : %6lu : %9lu :",
pProfData->aName, pProfData->nTime,
pProfData->nMinTime, pProfData->nMaxTime, nAve,
@@ -1123,8 +1123,8 @@ void ImpDbgOutfBuf( sal_Char* pBuf, const sal_Char* pFStr, ... )
static void DebugXTorInfo( sal_Char* pBuf )
{
DebugData* pData = GetDebugData();
- ULONG i;
- ULONG nCount;
+ sal_uIntPtr i;
+ sal_uIntPtr nCount;
// Xtor-Liste ausgeben
if ( pData->pXtorList && pData->pXtorList->Count() &&
@@ -1153,19 +1153,19 @@ static void DebugXTorInfo( sal_Char* pBuf )
}
// -----------------------------------------------------------------------
-BOOL ImplDbgFilterMessage( const sal_Char* pMsg )
+sal_Bool ImplDbgFilterMessage( const sal_Char* pMsg )
{
DebugData* pData = GetDebugData();
- if ( !ImplDbgFilter( pData->aDbgData.aInclFilter, pMsg, TRUE ) )
- return TRUE;
- if ( ImplDbgFilter( pData->aDbgData.aExclFilter, pMsg, FALSE ) )
- return TRUE;
- return FALSE;
+ if ( !ImplDbgFilter( pData->aDbgData.aInclFilter, pMsg, sal_True ) )
+ return sal_True;
+ if ( ImplDbgFilter( pData->aDbgData.aExclFilter, pMsg, sal_False ) )
+ return sal_True;
+ return sal_False;
}
// -----------------------------------------------------------------------
-void* DbgFunc( USHORT nAction, void* pParam )
+void* DbgFunc( sal_uInt16 nAction, void* pParam )
{
DebugData* pDebugData = ImplGetDebugData();
@@ -1291,7 +1291,7 @@ void* DbgFunc( USHORT nAction, void* pParam )
break;
case DBG_FUNC_ALLERROROUT:
- return (void*)(ULONG)TRUE;
+ return (void*)(sal_uIntPtr)sal_True;
case DBG_FUNC_SETTESTSOLARMUTEX:
pDebugData->pDbgTestSolarMutex = (DbgTestSolarMutexProc)(long)pParam;
@@ -1312,12 +1312,12 @@ void* DbgFunc( USHORT nAction, void* pParam )
if( pDebugData->bOslIsHooked && ! pData->bHookOSLAssert )
{
osl_setDetailedDebugMessageFunc( pDebugData->pOldDebugMessageFunc );
- pDebugData->bOslIsHooked = FALSE;
+ pDebugData->bOslIsHooked = sal_False;
}
else if( ! pDebugData->bOslIsHooked && pData->bHookOSLAssert )
{
pDebugData->pOldDebugMessageFunc = osl_setDetailedDebugMessageFunc( &dbg_printOslDebugMessage );
- pDebugData->bOslIsHooked = TRUE;
+ pDebugData->bOslIsHooked = sal_True;
}
}
break;
@@ -1338,7 +1338,7 @@ DbgChannelId DbgRegisterUserChannel( DbgPrintLine pProc )
// -----------------------------------------------------------------------
-void DbgProf( USHORT nAction, DbgDataType* pDbgData )
+void DbgProf( sal_uInt16 nAction, DbgDataType* pDbgData )
{
// Ueberhaupt Profiling-Test an
DebugData* pData = ImplGetDebugData();
@@ -1348,7 +1348,7 @@ void DbgProf( USHORT nAction, DbgDataType* pDbgData )
sal_Char aBuf[DBG_BUF_MAXLEN];
ProfType* pProfData = (ProfType*)pDbgData->pData;
- ULONG nTime;
+ sal_uIntPtr nTime;
if ( (nAction != DBG_PROF_START) && !pProfData )
{
strcpy( aBuf, DbgError_ProfEnd1 );
@@ -1431,7 +1431,7 @@ void DbgProf( USHORT nAction, DbgDataType* pDbgData )
// -----------------------------------------------------------------------
-void DbgXtor( DbgDataType* pDbgData, USHORT nAction, const void* pThis,
+void DbgXtor( DbgDataType* pDbgData, sal_uInt16 nAction, const void* pThis,
DbgUsr fDbgUsr )
{
DebugData* pData = ImplGetDebugData();
@@ -1457,19 +1457,19 @@ void DbgXtor( DbgDataType* pDbgData, USHORT nAction, const void* pThis,
pXtorData->nDtorCalls = 0;
pXtorData->nMaxCount = 0;
pXtorData->nStatics = 0;
- pXtorData->bTest = TRUE;
+ pXtorData->bTest = sal_True;
pData->pXtorList->Add( (void*)pXtorData );
- if ( !ImplDbgFilter( pData->aDbgData.aInclClassFilter, pXtorData->aName, TRUE ) )
- pXtorData->bTest = FALSE;
- if ( ImplDbgFilter( pData->aDbgData.aExclClassFilter, pXtorData->aName, FALSE ) )
- pXtorData->bTest = FALSE;
+ if ( !ImplDbgFilter( pData->aDbgData.aInclClassFilter, pXtorData->aName, sal_True ) )
+ pXtorData->bTest = sal_False;
+ if ( ImplDbgFilter( pData->aDbgData.aExclClassFilter, pXtorData->aName, sal_False ) )
+ pXtorData->bTest = sal_False;
}
if ( !pXtorData->bTest )
return;
sal_Char aBuf[DBG_BUF_MAXLEN];
- USHORT nAct = nAction & ~DBG_XTOR_DTOROBJ;
+ sal_uInt16 nAct = nAction & ~DBG_XTOR_DTOROBJ;
// Trace (Enter)
if ( (pData->aDbgData.nTestFlags & DBG_TEST_XTOR_TRACE) &&
@@ -1616,16 +1616,16 @@ void DbgXtor( DbgDataType* pDbgData, USHORT nAction, const void* pThis,
// -----------------------------------------------------------------------
-void DbgOut( const sal_Char* pMsg, USHORT nDbgOut, const sal_Char* pFile, USHORT nLine )
+void DbgOut( const sal_Char* pMsg, sal_uInt16 nDbgOut, const sal_Char* pFile, sal_uInt16 nLine )
{
- static BOOL bIn = FALSE;
+ static sal_Bool bIn = sal_False;
if ( bIn )
return;
- bIn = TRUE;
+ bIn = sal_True;
DebugData* pData = GetDebugData();
sal_Char const * pStr;
- ULONG nOut;
+ sal_uIntPtr nOut;
int nBufLen = 0;
if ( nDbgOut == DBG_OUT_ERROR )
@@ -1648,13 +1648,13 @@ void DbgOut( const sal_Char* pMsg, USHORT nDbgOut, const sal_Char* pFile, USHORT
if ( nOut == DBG_OUT_NULL )
{
- bIn = FALSE;
+ bIn = sal_False;
return;
}
if ( ImplDbgFilterMessage( pMsg ) )
{
- bIn = FALSE;
+ bIn = sal_False;
return;
}
@@ -1692,7 +1692,7 @@ void DbgOut( const sal_Char* pMsg, USHORT nDbgOut, const sal_Char* pFile, USHORT
// Line in String umwandeln und dranhaengen
sal_Char aLine[9];
sal_Char* pLine = &aLine[7];
- USHORT i;
+ sal_uInt16 i;
memset( aLine, 0, sizeof( aLine ) );
do
{
@@ -1762,7 +1762,7 @@ void DbgOut( const sal_Char* pMsg, USHORT nDbgOut, const sal_Char* pFile, USHORT
ImplDbgUnlock();
- bIn = FALSE;
+ bIn = sal_False;
}
void DbgPrintShell(char const * message) {
@@ -1774,7 +1774,7 @@ void DbgPrintShell(char const * message) {
// -----------------------------------------------------------------------
-void DbgOutTypef( USHORT nDbgOut, const sal_Char* pFStr, ... )
+void DbgOutTypef( sal_uInt16 nDbgOut, const sal_Char* pFStr, ... )
{
va_list pList;
@@ -1804,13 +1804,13 @@ void DbgOutf( const sal_Char* pFStr, ... )
#else
-void* DbgFunc( USHORT, void* ) { return NULL; }
+void* DbgFunc( sal_uInt16, void* ) { return NULL; }
-void DbgProf( USHORT, DbgDataType* ) {}
-void DbgXtor( DbgDataType*, USHORT, const void*, DbgUsr ) {}
+void DbgProf( sal_uInt16, DbgDataType* ) {}
+void DbgXtor( DbgDataType*, sal_uInt16, const void*, DbgUsr ) {}
-void DbgOut( const sal_Char*, USHORT, const sal_Char*, USHORT ) {}
-void DbgOutTypef( USHORT, const sal_Char*, ... ) {}
+void DbgOut( const sal_Char*, sal_uInt16, const sal_Char*, sal_uInt16 ) {}
+void DbgOutTypef( sal_uInt16, const sal_Char*, ... ) {}
void DbgOutf( const sal_Char*, ... ) {}
#endif
diff --git a/tools/source/debug/makefile.mk b/tools/source/debug/makefile.mk
deleted file mode 100644
index 925ae90f333d..000000000000
--- a/tools/source/debug/makefile.mk
+++ /dev/null
@@ -1,53 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=debug
-
-ENABLE_EXCEPTIONS := TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-CXXFILES= debug.cxx \
- stcktree.cxx
-
-SLOFILES= $(SLO)$/debug.obj \
- $(SLO)$/stcktree.obj
-
-OBJFILES= $(OBJ)$/debug.obj \
- $(OBJ)$/stcktree.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/source/debug/stcktree.cxx b/tools/source/debug/stcktree.cxx
index aa32a26c0184..d2dcbc5fb7a8 100644
--- a/tools/source/debug/stcktree.cxx
+++ b/tools/source/debug/stcktree.cxx
@@ -43,32 +43,32 @@ struct ImpDbgStackTree
ImpDbgStackTree* pRight_;
ImpDbgStackTree* pCaller_;
ImpDbgStackTree* pSub_;
- ULONG nIP_;
- ULONG nBytesLeak_;
- ULONG nBytesPeak_;
- ULONG nBytes_;
- ULONG nCountLeak_;
- ULONG nCountPeak_;
- ULONG nCount_;
- ULONG nMax_;
- ULONG nMin_;
-
- ImpDbgStackTree( ImpDbgStackTree* pSub, ULONG nIP );
+ sal_uIntPtr nIP_;
+ sal_uIntPtr nBytesLeak_;
+ sal_uIntPtr nBytesPeak_;
+ sal_uIntPtr nBytes_;
+ sal_uIntPtr nCountLeak_;
+ sal_uIntPtr nCountPeak_;
+ sal_uIntPtr nCount_;
+ sal_uIntPtr nMax_;
+ sal_uIntPtr nMin_;
+
+ ImpDbgStackTree( ImpDbgStackTree* pSub, sal_uIntPtr nIP );
~ImpDbgStackTree();
- ImpDbgStackTree* Add( ULONG nAlloc, ULONG* pBP, ULONG nIP );
- void Print( int nLevel, ULONG nCount, ULONG nCountLeak );
+ ImpDbgStackTree* Add( sal_uIntPtr nAlloc, sal_uIntPtr* pBP, sal_uIntPtr nIP );
+ void Print( int nLevel, sal_uIntPtr nCount, sal_uIntPtr nCountLeak );
void Print( int nLevel );
};
static ImpDbgStackTree* pImpDbgStackTreeRoot = NULL;
-static ULONG* pImpDbgStackTreeBP = NULL;
-static ULONG nImpDbgStackTreeMain = 0;
+static sal_uIntPtr* pImpDbgStackTreeBP = NULL;
+static sal_uIntPtr nImpDbgStackTreeMain = 0;
static int nImpDbgStackTreeSem = 0;
// -----------------------------------------------------------------------
-ImpDbgStackTree::ImpDbgStackTree( ImpDbgStackTree* pSub, ULONG nIP )
+ImpDbgStackTree::ImpDbgStackTree( ImpDbgStackTree* pSub, sal_uIntPtr nIP )
{
pSub_ = pSub;
nIP_ = nIP;
@@ -91,7 +91,7 @@ ImpDbgStackTree::~ImpDbgStackTree()
// -----------------------------------------------------------------------
-void ImpDbgStackTree::Print( int nLevel, ULONG nCount, ULONG nCountLeak )
+void ImpDbgStackTree::Print( int nLevel, sal_uIntPtr nCount, sal_uIntPtr nCountLeak )
{
if ( pLeft_ )
pLeft_->Print( nLevel, nCount, nCountLeak );
@@ -100,7 +100,7 @@ void ImpDbgStackTree::Print( int nLevel, ULONG nCount, ULONG nCountLeak )
{
if ( nMax_ == nMin_ )
{
- ULONG nTemp = nCountLeak_ * nMin_;
+ sal_uIntPtr nTemp = nCountLeak_ * nMin_;
DbgOutf( "%*c%08lx Count=%lu/%lu/%lu Bytes=%lu/%lu/%lu Size=%lu",
nLevel, ' ', nIP_,
nCount_, nCountPeak_, nCountLeak_,
@@ -138,7 +138,7 @@ void ImpDbgStackTree::Print( int nLevel )
// -----------------------------------------------------------------------
-ImpDbgStackTree* ImpDbgStackTree::Add( ULONG nAlloc, ULONG *pBP, ULONG nIP )
+ImpDbgStackTree* ImpDbgStackTree::Add( sal_uIntPtr nAlloc, sal_uIntPtr *pBP, sal_uIntPtr nIP )
{
if ( nIP < nIP_ )
{
@@ -168,9 +168,9 @@ ImpDbgStackTree* ImpDbgStackTree::Add( ULONG nAlloc, ULONG *pBP, ULONG nIP )
else if ( nMin_ > nAlloc )
nMin_ = nAlloc;
- if ( !(pBP[0] & 3) && (ULONG)pBP < pBP[0] && pBP[0] < (ULONG)pImpDbgStackTreeBP )
+ if ( !(pBP[0] & 3) && (sal_uIntPtr)pBP < pBP[0] && pBP[0] < (sal_uIntPtr)pImpDbgStackTreeBP )
{
- pBP = (ULONG*)pBP[0];
+ pBP = (sal_uIntPtr*)pBP[0];
nIP = pBP[1];
if ( 0x01100000 <= nIP && nIP < 0x20000000 && nIP != nImpDbgStackTreeMain )
{
@@ -191,10 +191,10 @@ void DbgStartStackTree()
{
if ( !nImpDbgStackTreeMain )
{
- ULONG* pBP;
+ sal_uIntPtr* pBP;
__asm mov pBP, ebp;
- pImpDbgStackTreeBP = (ULONG*)pBP[0];
+ pImpDbgStackTreeBP = (sal_uIntPtr*)pBP[0];
nImpDbgStackTreeMain = pImpDbgStackTreeBP[1];
}
}
@@ -210,7 +210,7 @@ void DbgEndStackTree()
{
// Ausgaben ins File umleiten
DbgData* pData = DbgGetData();
- ULONG nOldOut = pData->nTraceOut;
+ sal_uIntPtr nOldOut = pData->nTraceOut;
pData->nTraceOut = DBG_OUT_FILE;
DbgOutf( "Leak-Report" );
@@ -239,7 +239,7 @@ void DbgEndStackTree()
// -----------------------------------------------------------------------
-void* DbgGetStackTree( ULONG nAlloc )
+void* DbgGetStackTree( sal_uIntPtr nAlloc )
{
ImpDbgStackTree* pReturn = NULL;
@@ -247,10 +247,10 @@ void* DbgGetStackTree( ULONG nAlloc )
{
nImpDbgStackTreeSem++;
- ULONG* pBP;
+ sal_uIntPtr* pBP;
__asm mov pBP, ebp;
- ULONG nIP = pBP[1];
+ sal_uIntPtr nIP = pBP[1];
if ( !pImpDbgStackTreeRoot )
pImpDbgStackTreeRoot = new ImpDbgStackTree( NULL, nIP );
pReturn = pImpDbgStackTreeRoot->Add( nAlloc, pBP, nIP );
@@ -262,7 +262,7 @@ void* DbgGetStackTree( ULONG nAlloc )
// -----------------------------------------------------------------------
-void DbgFreeStackTree( void* pVoid, ULONG nAlloc )
+void DbgFreeStackTree( void* pVoid, sal_uIntPtr nAlloc )
{
ImpDbgStackTree* p = (ImpDbgStackTree*)pVoid;
@@ -298,7 +298,7 @@ void DbgPrintStackTree( void* pVoid )
{
// Ausgaben ins File umleiten
DbgData* pData = DbgGetData();
- ULONG nOldOut = pData->nTraceOut;
+ sal_uIntPtr nOldOut = pData->nTraceOut;
pData->nTraceOut = DBG_OUT_FILE;
DbgOutf( "Mem-StackTree:" );
@@ -314,8 +314,8 @@ void DbgPrintStackTree( void* pVoid )
void DbgStartStackTree() {}
void DbgEndStackTree() {}
-void* DbgGetStackTree( ULONG ) { return NULL; }
-void DbgFreeStackTree( void*, ULONG ) {}
+void* DbgGetStackTree( sal_uIntPtr ) { return NULL; }
+void DbgFreeStackTree( void*, sal_uIntPtr ) {}
void DbgPrintStackTree( void* ) {}
#endif
diff --git a/tools/source/fsys/comdep.hxx b/tools/source/fsys/comdep.hxx
index bcb3d6b89e00..895216f8f3da 100644..100755
--- a/tools/source/fsys/comdep.hxx
+++ b/tools/source/fsys/comdep.hxx
@@ -75,16 +75,16 @@ struct DirReader_Impl
DirEntry* pParent;
String aPath;
ByteString aBypass;
- BOOL bReady;
- BOOL bInUse;
+ sal_Bool bReady;
+ sal_Bool bInUse;
DirReader_Impl( Dir &rDir )
: pDir( &rDir ),
pDosEntry( 0 ),
pParent( 0 ),
aPath( GUI2FSYS(rDir.GetFull()) ),
- bReady ( FALSE ),
- bInUse( FALSE )
+ bReady ( sal_False ),
+ bInUse( sal_False )
{
#ifndef BOOTSTRAP
// Redirection
@@ -112,8 +112,8 @@ struct DirReader_Impl
{ if( pDosDir ) closedir( pDosDir ); }
// die folgenden sind systemabh"angig implementiert
- USHORT Init(); // initialisiert, liest ggf. devices
- USHORT Read(); // liest 1 Eintrag, F2ugt ein falls ok
+ sal_uInt16 Init(); // initialisiert, liest ggf. devices
+ sal_uInt16 Read(); // liest 1 Eintrag, F2ugt ein falls ok
};
//--------------------------------------------------------------------
@@ -146,9 +146,9 @@ struct FileCopier_Impl
//--------------------------------------------------------------------
#if defined WNT || defined OS2
-BOOL IsRedirectable_Impl( const ByteString &rPath );
+sal_Bool IsRedirectable_Impl( const ByteString &rPath );
#else
-#define IsRedirectable_Impl( rPath ) TRUE
+#define IsRedirectable_Impl( rPath ) sal_True
#endif
//--------------------------------------------------------------------
diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx
index 6dde67ce186b..edfd1c2a055f 100644..100755
--- a/tools/source/fsys/dirent.cxx
+++ b/tools/source/fsys/dirent.cxx
@@ -128,11 +128,11 @@ int Sys2SolarError_Impl( int nSysErr )
#ifndef BOOTSTRAP
FSysRedirector* FSysRedirector::_pRedirector = 0;
-BOOL FSysRedirector::_bEnabled = TRUE;
+sal_Bool FSysRedirector::_bEnabled = sal_True;
#ifdef UNX
-BOOL bInRedirection = TRUE;
+sal_Bool bInRedirection = sal_True;
#else
-BOOL bInRedirection = FALSE;
+sal_Bool bInRedirection = sal_False;
#endif
static osl::Mutex* pRedirectMutex = 0;
@@ -170,7 +170,7 @@ void FSysRedirector::DoRedirect( String &rPath )
return;
// dont redirect on nested calls
- bInRedirection = TRUE;
+ bInRedirection = sal_True;
// convert to URL
#ifndef UNX
@@ -184,7 +184,7 @@ void FSysRedirector::DoRedirect( String &rPath )
// do redirection
Redirector();
- bInRedirection = FALSE;
+ bInRedirection = sal_False;
return;
}
@@ -279,12 +279,12 @@ const char* ImpCheckDirEntry( const void* p )
|*
*************************************************************************/
-ByteString ImplCutPath( const ByteString& rStr, USHORT nMax, char cAccDel )
+ByteString ImplCutPath( const ByteString& rStr, sal_uInt16 nMax, char cAccDel )
{
- USHORT nMaxPathLen = nMax;
+ sal_uInt16 nMaxPathLen = nMax;
ByteString aCutPath( rStr );
- BOOL bInsertPrefix = FALSE;
- USHORT nBegin = aCutPath.Search( cAccDel );
+ sal_Bool bInsertPrefix = sal_False;
+ sal_uInt16 nBegin = aCutPath.Search( cAccDel );
if( nBegin == STRING_NOTFOUND )
nBegin = 0;
@@ -293,14 +293,14 @@ ByteString ImplCutPath( const ByteString& rStr, USHORT nMax, char cAccDel )
while( aCutPath.Len() > nMaxPathLen )
{
- USHORT nEnd = aCutPath.Search( cAccDel, nBegin + 1 );
- USHORT nCount;
+ sal_uInt16 nEnd = aCutPath.Search( cAccDel, nBegin + 1 );
+ sal_uInt16 nCount;
if ( nEnd != STRING_NOTFOUND )
{
nCount = nEnd - nBegin;
aCutPath.Erase( nBegin, nCount );
- bInsertPrefix = TRUE;
+ bInsertPrefix = sal_True;
}
else
break;
@@ -308,7 +308,7 @@ ByteString ImplCutPath( const ByteString& rStr, USHORT nMax, char cAccDel )
if ( aCutPath.Len() > nMaxPathLen )
{
- for ( USHORT n = nMaxPathLen; n > nMaxPathLen/2; --n )
+ for ( sal_uInt16 n = nMaxPathLen; n > nMaxPathLen/2; --n )
if ( !ByteString(aCutPath.GetChar(n)).IsAlphaNumericAscii() )
{
aCutPath.Erase( n );
@@ -348,7 +348,7 @@ FSysError DirEntry::ImpParseOs2Name( const ByteString& rPfad, FSysPathStyle eSty
// der Rest immer ohne die fuehrenden '\\'.
// ein ":" trennt ebenfalls, gehoert aber zum Namen
// den ersten '\\', '/' oder ':' suchen
- USHORT nPos;
+ sal_uInt16 nPos;
for ( nPos = 0;
nPos < aPfad.Len() && //?O
aPfad.GetChar(nPos) != '\\' && aPfad.GetChar(nPos) != '/' && //?O
@@ -485,7 +485,7 @@ FSysError DirEntry::ImpParseOs2Name( const ByteString& rPfad, FSysPathStyle eSty
}
while ( aPfad.Len() );
- ULONG nErr = ERRCODE_NONE;
+ sal_uIntPtr nErr = ERRCODE_NONE;
// Haupt-Entry (selbst) zuweisen
if ( aStack.Count() == 0 )
{
@@ -615,7 +615,7 @@ void DirEntry::ImpTrim( FSysPathStyle eStyle )
{
case FSYS_STYLE_FAT:
{
- USHORT nPunktPos = aName.Search( '.' );
+ sal_uInt16 nPunktPos = aName.Search( '.' );
if ( nPunktPos == STRING_NOTFOUND )
{
if ( aName.Len() > 8 )
@@ -930,7 +930,7 @@ DirEntry* DirEntry::ImpGetTopPtr()
|*
*************************************************************************/
-DirEntry* DirEntry::ImpChangeParent( DirEntry* pNewParent, BOOL bNormalize )
+DirEntry* DirEntry::ImpChangeParent( DirEntry* pNewParent, sal_Bool bNormalize )
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
@@ -953,14 +953,14 @@ DirEntry* DirEntry::ImpChangeParent( DirEntry* pNewParent, BOOL bNormalize )
|*
*************************************************************************/
-BOOL DirEntry::Exists( FSysAccess nAccess ) const
+sal_Bool DirEntry::Exists( FSysAccess nAccess ) const
{
#ifndef BOOTSTRAP
static osl::Mutex aLocalMutex;
osl::MutexGuard aGuard( aLocalMutex );
#endif
if ( !IsValid() )
- return FALSE;
+ return sal_False;
#if defined WNT || defined OS2
// spezielle Filenamen sind vom System da
@@ -976,14 +976,14 @@ BOOL DirEntry::Exists( FSysAccess nAccess ) const
aName.CompareIgnoreCaseToAscii("LPT3") == COMPARE_EQUAL ||
aName.CompareIgnoreCaseToAscii("NUL") == COMPARE_EQUAL ||
aName.CompareIgnoreCaseToAscii("PRN") == COMPARE_EQUAL ) )
- return TRUE;
+ return sal_True;
#endif
FSysFailOnErrorImpl();
DirEntryKind eKind = FileStat( *this, nAccess ).GetKind();
if ( eKind & ( FSYS_KIND_FILE | FSYS_KIND_DIR ) )
{
- return TRUE;
+ return sal_True;
}
#if defined WNT || defined OS2
@@ -1002,7 +1002,7 @@ BOOL DirEntry::Exists( FSysAccess nAccess ) const
|*
*************************************************************************/
-BOOL DirEntry::First()
+sal_Bool DirEntry::First()
{
FSysFailOnErrorImpl();
@@ -1032,12 +1032,12 @@ BOOL DirEntry::First()
{
aName = aFound;
closedir( pDir );
- return TRUE;
+ return sal_True;
}
}
closedir( pDir );
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -1046,8 +1046,8 @@ BOOL DirEntry::First()
|*
*************************************************************************/
-String DirEntry::GetFull( FSysPathStyle eStyle, BOOL bWithDelimiter,
- USHORT nMaxChars ) const
+String DirEntry::GetFull( FSysPathStyle eStyle, sal_Bool bWithDelimiter,
+ sal_uInt16 nMaxChars ) const
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
@@ -1341,18 +1341,18 @@ StringCompare DirEntry::NameCompare( const DirEntry &rWith ) const
|*
*************************************************************************/
-BOOL DirEntry::operator==( const DirEntry& rEntry ) const
+sal_Bool DirEntry::operator==( const DirEntry& rEntry ) const
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
// test wheather the contents are textual the same
if ( nError && ( nError == rEntry.nError ) )
- return TRUE;
+ return sal_True;
if ( nError || rEntry.nError ||
( eFlag == FSYS_FLAG_INVALID ) ||
( rEntry.eFlag == FSYS_FLAG_INVALID ) )
- return FALSE;
+ return sal_False;
#ifndef OS2
const
@@ -1417,10 +1417,10 @@ DirEntry DirEntry::operator+( const DirEntry& rEntry ) const
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
#ifdef DBG_UTIL
- static BOOL bTested = FALSE;
+ static sal_Bool bTested = sal_False;
if ( !bTested )
{
- bTested = TRUE;
+ bTested = sal_True;
FSysTest();
}
#endif
@@ -1442,7 +1442,7 @@ DirEntry DirEntry::operator+( const DirEntry& rEntry ) const
(eFlag == FSYS_FLAG_RELROOT && !aName.Len()) ||
(
(pEntryTop->aName.Len() ||
- ((rEntry.Level()>1)?(rEntry[rEntry.Level()-2].aName.CompareIgnoreCaseToAscii(RFS_IDENTIFIER)==COMPARE_EQUAL):FALSE))
+ ((rEntry.Level()>1)?(rEntry[rEntry.Level()-2].aName.CompareIgnoreCaseToAscii(RFS_IDENTIFIER)==COMPARE_EQUAL):sal_False))
&&
(pEntryTop->eFlag == FSYS_FLAG_ABSROOT ||
pEntryTop->eFlag == FSYS_FLAG_RELROOT ||
@@ -1613,23 +1613,23 @@ void DirEntry::SetName( const String& rName, FSysPathStyle eFormatter )
|* DirEntry::Find()
|*
*************************************************************************/
-BOOL DirEntry::Find( const String& rPfad, char cDelim )
+sal_Bool DirEntry::Find( const String& rPfad, char cDelim )
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
if ( ImpGetTopPtr()->eFlag == FSYS_FLAG_ABSROOT )
- return TRUE;
+ return sal_True;
- BOOL bWild = aName.Search( '*' ) != STRING_NOTFOUND ||
+ sal_Bool bWild = aName.Search( '*' ) != STRING_NOTFOUND ||
aName.Search( '?' ) != STRING_NOTFOUND;
if ( !cDelim )
cDelim = SEARCHDELIM(DEFSTYLE)[0];
- USHORT nTokenCount = rPfad.GetTokenCount( cDelim );
- USHORT nIndex = 0;
+ sal_uInt16 nTokenCount = rPfad.GetTokenCount( cDelim );
+ sal_uInt16 nIndex = 0;
ByteString aThis = ACCESSDELIM(DEFSTYLE);
aThis += ByteString(GetFull(), osl_getThreadTextEncoding());
- for ( USHORT nToken = 0; nToken < nTokenCount; ++nToken )
+ for ( sal_uInt16 nToken = 0; nToken < nTokenCount; ++nToken )
{
ByteString aPath = ByteString(rPfad, osl_getThreadTextEncoding()).GetToken( 0, cDelim, nIndex );
@@ -1643,11 +1643,11 @@ BOOL DirEntry::Find( const String& rPfad, char cDelim )
( ( !bWild && aEntry.Exists() ) || ( bWild && aEntry.First() ) ) )
{
(*this) = aEntry;
- return TRUE;
+ return sal_True;
}
}
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -1656,7 +1656,7 @@ BOOL DirEntry::Find( const String& rPfad, char cDelim )
|*
*************************************************************************/
-BOOL DirEntry::ImpToRel( String aCurStr )
+sal_Bool DirEntry::ImpToRel( String aCurStr )
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
@@ -1673,7 +1673,7 @@ BOOL DirEntry::ImpToRel( String aCurStr )
}
// "Ubereinstimmung pr"ufen
- USHORT nPos = aThisCompareStr.Match( aCurCompareStr );
+ sal_uInt16 nPos = aThisCompareStr.Match( aCurCompareStr );
if ( nPos == STRING_MATCH && aThisStr.Len() != aCurStr.Len() )
nPos = Min( aThisStr.Len(), aCurStr.Len() );
@@ -1682,7 +1682,7 @@ BOOL DirEntry::ImpToRel( String aCurStr )
{
// dann ist der relative Pfad das aktuelle Verzeichnis
*this = DirEntry();
- return TRUE;
+ return sal_True;
}
// Sonderfall, die DirEntries sind total verschieden
@@ -1690,7 +1690,7 @@ BOOL DirEntry::ImpToRel( String aCurStr )
{
// dann ist der relativste Pfad absolut
*this = aThis;
- return FALSE;
+ return sal_False;
}
// sonst nehmen wir die identischen Einzelteile vorne weg
@@ -1706,7 +1706,7 @@ BOOL DirEntry::ImpToRel( String aCurStr )
// das ist dann unser relativer Pfad
*this = DirEntry( aThisStr, FSYS_STYLE_HPFS );
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -1715,7 +1715,7 @@ BOOL DirEntry::ImpToRel( String aCurStr )
|*
*************************************************************************/
-USHORT DirEntry::CutRelParents()
+sal_uInt16 DirEntry::CutRelParents()
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
@@ -1729,7 +1729,7 @@ USHORT DirEntry::CutRelParents()
pDir = pPar;
// '..' zaehlen
- USHORT nParCount = 0;
+ sal_uInt16 nParCount = 0;
while ( pPar && pPar->eFlag == FSYS_FLAG_PARENT )
{
++nParCount;
@@ -1751,7 +1751,7 @@ USHORT DirEntry::CutRelParents()
|*
*************************************************************************/
-BOOL DirEntry::ToRel()
+sal_Bool DirEntry::ToRel()
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
@@ -1766,7 +1766,7 @@ BOOL DirEntry::ToRel()
|*
*************************************************************************/
-BOOL DirEntry::ToRel( const DirEntry& rStart )
+sal_Bool DirEntry::ToRel( const DirEntry& rStart )
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
@@ -1846,7 +1846,7 @@ String DirEntry::GetSearchDelimiter( FSysPathStyle eFormatter )
|*
*************************************************************************/
-USHORT DirEntry::GetMaxNameLen( FSysPathStyle eFormatter )
+sal_uInt16 DirEntry::GetMaxNameLen( FSysPathStyle eFormatter )
{
eFormatter = GetStyle( eFormatter );
switch ( eFormatter )
@@ -1889,7 +1889,7 @@ const DirEntry& DirEntry::SetTempNameBase( const String &rBase )
{
// Create the directory and only on success give all rights to
// everyone. Use mkdir instead of DirEntry::MakeDir because
- // this returns TRUE even if directory already exists.
+ // this returns sal_True even if directory already exists.
if ( !mkdir( aName.GetBuffer(), S_IRWXU | S_IRWXG | S_IRWXO ) )
chmod( aName.GetBuffer(), S_IRWXU | S_IRWXG | S_IRWXO );
@@ -2066,7 +2066,7 @@ DirEntry DirEntry::TempName( DirEntryKind eKind ) const
|*
*************************************************************************/
-const DirEntry &DirEntry::operator[]( USHORT nParentLevel ) const
+const DirEntry &DirEntry::operator[]( sal_uInt16 nParentLevel ) const
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
@@ -2098,7 +2098,7 @@ FSysError DirEntry::ImpParseUnixName( const ByteString& rPfad, FSysPathStyle eSt
// falls '/' am Anfang, ist der Name '/',
// der Rest immer ohne die fuehrenden '/'.
// den ersten '/' suchen
- USHORT nPos;
+ sal_uInt16 nPos;
for ( nPos = 0;
nPos < aPfad.Len() && aPfad.GetChar(nPos) != '/';
nPos++ )
@@ -2124,8 +2124,8 @@ FSysError DirEntry::ImpParseUnixName( const ByteString& rPfad, FSysPathStyle eSt
else if ( aName == "~" )
{
DirEntry aHome( String( (const char *) getenv( "HOME" ), osl_getThreadTextEncoding()) );
- for ( USHORT n = aHome.Level(); n; --n )
- aStack.Push( new DirEntry( aHome[ (USHORT) n-1 ] ) );
+ for ( sal_uInt16 n = aHome.Level(); n; --n )
+ aStack.Push( new DirEntry( aHome[ (sal_uInt16) n-1 ] ) );
}
#endif
@@ -2226,11 +2226,11 @@ ErrCode CreateEntry_Impl( const DirEntry &rPath, DirEntryKind eKind )
return eErr;
}
-BOOL IsValidEntry_Impl( const DirEntry &rPath,
+sal_Bool IsValidEntry_Impl( const DirEntry &rPath,
const String &rLongName,
DirEntryKind eKind,
- BOOL bIsShortened,
- BOOL bUseDelim )
+ sal_Bool bIsShortened,
+ sal_Bool bUseDelim )
{
// Parameter-Pr"uefung
DBG_ASSERT( eKind == FSYS_KIND_NONE || eKind == FSYS_KIND_ALL ||
@@ -2244,16 +2244,16 @@ BOOL IsValidEntry_Impl( const DirEntry &rPath,
DirEntry aPath(rPath);
DirEntry aName(rLongName, eStyle);
if ( !aName.IsValid() || aName.Level() != 1 )
- return FALSE;
+ return sal_False;
aPath += aName;
if ( 1 == aPath.Level() )
- return FALSE;
+ return sal_False;
if ( eStyle == FSYS_STYLE_FAT || eStyle == FSYS_STYLE_NWFS ||
eStyle == FSYS_STYLE_UNKNOWN )
{
DirEntry aDosEntry( rLongName, FSYS_STYLE_FAT );
if ( !aDosEntry.IsValid() )
- return FALSE;
+ return sal_False;
}
// Pfad-Trenner sind nicht erlaubt (bei ungek"urzten auch nicht FSYS_SHORTNAME_DELIMITER)
@@ -2263,12 +2263,12 @@ BOOL IsValidEntry_Impl( const DirEntry &rPath,
(!bIsShortened && rLongName.Search(cDelim) != STRING_NOTFOUND)
)
{
- return FALSE;
+ return sal_False;
}
// MI: Abfrage nach 'CON:' etc. wird jetzt in Exists() mitgemacht
if ( aPath.Exists() )
- return FALSE;
+ return sal_False;
return (ERRCODE_NONE == CreateEntry_Impl( aPath, eKind ));
}
@@ -2287,8 +2287,8 @@ BOOL IsValidEntry_Impl( const DirEntry &rPath,
#define MAX_LEN_MAX 255
#define INVALID_CHARS_DEF "\\/\"':|^<>?*"
-BOOL DirEntry::MakeShortName( const String& rLongName, DirEntryKind eKind,
- BOOL bUseDelim, FSysPathStyle eStyle )
+sal_Bool DirEntry::MakeShortName( const String& rLongName, DirEntryKind eKind,
+ sal_Bool bUseDelim, FSysPathStyle eStyle )
{
String aLongName(rLongName);
@@ -2308,14 +2308,14 @@ BOOL DirEntry::MakeShortName( const String& rLongName, DirEntryKind eKind,
}
// ist der Langname direkt verwendbar?
- if ( IsValidEntry_Impl( *this, aLongName, eKind, FALSE, bUseDelim ) )
+ if ( IsValidEntry_Impl( *this, aLongName, eKind, sal_False, bUseDelim ) )
{
operator+=( DirEntry(aLongName) );
- return TRUE;
+ return sal_True;
}
// max L"angen feststellen
- USHORT nMaxExt, nMaxLen;
+ sal_uInt16 nMaxExt, nMaxLen;
if ( FSYS_STYLE_DETECT == eStyle )
eStyle = DirEntry::GetPathStyle( GetDevice().GetName() );
ByteString aInvalidChars;
@@ -2387,11 +2387,11 @@ BOOL DirEntry::MakeShortName( const String& rLongName, DirEntryKind eKind,
operator+=( DirEntry(String(aNewName, osl_getThreadTextEncoding())) );
if ( FSYS_KIND_ALL == eKind && CMP_LOWER(aName) == aOldName )
if ( FSYS_KIND_ALL == eKind && CMP_LOWER(ByteString(GetName(), osl_getThreadTextEncoding())) == aOldName )
- return TRUE;
+ return sal_True;
// kann der gek"urzte Name direkt verwendet werden?
if ( !Exists() && (ERRCODE_NONE == CreateEntry_Impl( *this, eKind )) )
- return TRUE;
+ return sal_True;
// darf '?##' verwendet werden, um eindeutigen Name zu erzeugen?
if ( bUseDelim )
@@ -2422,7 +2422,7 @@ BOOL DirEntry::MakeShortName( const String& rLongName, DirEntryKind eKind,
// keine ## mehr frei / ?## soll nicht verwendet werden
nError = ERRCODE_IO_ALREADYEXISTS;
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -2431,34 +2431,34 @@ BOOL DirEntry::MakeShortName( const String& rLongName, DirEntryKind eKind,
|*
*************************************************************************/
-BOOL DirEntry::MakeDir( BOOL bSloppy ) const
+sal_Bool DirEntry::MakeDir( sal_Bool bSloppy ) const
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
// Schnellpruefung, ob vorhanden
if ( FileStat( *this ).IsKind( FSYS_KIND_DIR ) )
- return TRUE;
+ return sal_True;
if ( bSloppy && pParent )
if ( FileStat( *pParent ).IsKind( FSYS_KIND_DIR ) )
- return TRUE;
+ return sal_True;
const DirEntry *pNewDir = bSloppy ? pParent : this;
if ( pNewDir )
{
// den Path zum Dir erzeugen
- if ( pNewDir->pParent && !pNewDir->pParent->MakeDir(FALSE) )
- return FALSE;
+ if ( pNewDir->pParent && !pNewDir->pParent->MakeDir(sal_False) )
+ return sal_False;
// das Dir selbst erzeugen
if ( pNewDir->eFlag == FSYS_FLAG_ABSROOT ||
pNewDir->eFlag == FSYS_FLAG_ABSROOT ||
pNewDir->eFlag == FSYS_FLAG_VOLUME )
- return TRUE;
+ return sal_True;
else
{
//? nError = ???
if ( FileStat( *pNewDir ).IsKind( FSYS_KIND_DIR ) )
- return TRUE;
+ return sal_True;
else
{
FSysFailOnErrorImpl();
@@ -2472,7 +2472,7 @@ BOOL DirEntry::MakeDir( BOOL bSloppy ) const
#ifdef WIN32
SetLastError(0);
#endif
- BOOL bResult = (0 == _mkdir( (char*) bDirName.GetBuffer() ));
+ sal_Bool bResult = (0 == _mkdir( (char*) bDirName.GetBuffer() ));
if ( !bResult )
{
// Wer hat diese Methode const gemacht ?
@@ -2487,7 +2487,7 @@ BOOL DirEntry::MakeDir( BOOL bSloppy ) const
}
}
}
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -2591,7 +2591,7 @@ FSysError DirEntry::MoveTo( const DirEntry& rNewName ) const
// ja, also intra-device-move mit MoveFile
MoveFile( bFrom.GetBuffer(), bTo.GetBuffer() );
// MoveFile ist buggy bei cross-device operationen.
- // Der R?ckgabewert ist auch dann TRUE, wenn nur ein Teil der Operation geklappt hat.
+ // Der R?ckgabewert ist auch dann sal_True, wenn nur ein Teil der Operation geklappt hat.
// Zudem zeigt MoveFile unterschiedliches Verhalten bei unterschiedlichen NT-Versionen.
return Sys2SolarError_Impl( GetLastError() );
}
@@ -2709,10 +2709,10 @@ FSysError DirEntry::Kill( FSysAction nActions ) const
pName[bTmpName.Len()+1] = (char) 0;
//read-only files sollen auch geloescht werden koennen
- BOOL isReadOnly = FileStat::GetReadOnlyFlag(*this);
+ sal_Bool isReadOnly = FileStat::GetReadOnlyFlag(*this);
if (isReadOnly)
{
- FileStat::SetReadOnlyFlag(*this, FALSE);
+ FileStat::SetReadOnlyFlag(*this, sal_False);
}
// directory?
@@ -2722,7 +2722,7 @@ FSysError DirEntry::Kill( FSysAction nActions ) const
if ( FSYS_ACTION_RECURSIVE == (nActions & FSYS_ACTION_RECURSIVE) )
{
Dir aDir( *this, FSYS_KIND_DIR|FSYS_KIND_FILE );
- for ( USHORT n = 0; eError == FSYS_ERR_OK && n < aDir.Count(); ++n )
+ for ( sal_uInt16 n = 0; eError == FSYS_ERR_OK && n < aDir.Count(); ++n )
{
const DirEntry &rSubDir = aDir[n];
DirEntryFlag flag = rSubDir.GetFlag();
@@ -2823,20 +2823,20 @@ FSysError DirEntry::Kill( FSysAction nActions ) const
|*
*************************************************************************/
-BOOL DirEntry::Contains( const DirEntry &rSubEntry ) const
+sal_Bool DirEntry::Contains( const DirEntry &rSubEntry ) const
{
DBG_ASSERT( IsAbs() && rSubEntry.IsAbs(), "must be absolute entries" );
- USHORT nThisLevel = Level();
- USHORT nSubLevel = rSubEntry.Level();
+ sal_uInt16 nThisLevel = Level();
+ sal_uInt16 nSubLevel = rSubEntry.Level();
if ( nThisLevel < nSubLevel )
{
for ( ; nThisLevel; --nThisLevel, --nSubLevel )
if ( (*this)[nThisLevel-1] != rSubEntry[nSubLevel-1] )
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -2845,11 +2845,11 @@ BOOL DirEntry::Contains( const DirEntry &rSubEntry ) const
|*
*************************************************************************/
-USHORT DirEntry::Level() const
+sal_uInt16 DirEntry::Level() const
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
- USHORT nLevel = 0;
+ sal_uInt16 nLevel = 0;
const DirEntry *pRes = this;
while ( pRes )
{
@@ -2888,7 +2888,7 @@ String DirEntry::ConvertSystemToName( const String &rName )
|*
*************************************************************************/
-BOOL DirEntry::IsValid() const
+sal_Bool DirEntry::IsValid() const
{
return (nError == FSYS_ERR_OK);
}
@@ -2899,9 +2899,9 @@ BOOL DirEntry::IsValid() const
|*
*************************************************************************/
-BOOL DirEntry::IsRFSAvailable()
+sal_Bool DirEntry::IsRFSAvailable()
{
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -2914,18 +2914,18 @@ BOOL DirEntry::IsRFSAvailable()
|*
*************************************************************************/
-BOOL DirEntry::IsLongNameOnFAT() const
+sal_Bool DirEntry::IsLongNameOnFAT() const
{
// FAT-System?
DirEntry aTempDirEntry(*this);
aTempDirEntry.ToAbs();
if (DirEntry::GetPathStyle(aTempDirEntry.GetDevice().GetName().GetChar(0)) != FSYS_STYLE_FAT)
{
- return FALSE; // nein, also false
+ return sal_False; // nein, also false
}
// DirEntry-Kette auf lange Dateinamen pr?fen
- for( USHORT iLevel = this->Level(); iLevel > 0; iLevel-- )
+ for( sal_uInt16 iLevel = this->Level(); iLevel > 0; iLevel-- )
{
const DirEntry& rEntry = (const DirEntry&) (*this)[iLevel-1];
String aBase( rEntry.GetBase() );
@@ -2933,15 +2933,15 @@ BOOL DirEntry::IsLongNameOnFAT() const
if (aBase.Len()>8) // Name > 8?
{
- return TRUE;
+ return sal_True;
}
if (aExtension.Len()>3) // Extension > 3?
{
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
//========================================================================
diff --git a/tools/source/fsys/filecopy.cxx b/tools/source/fsys/filecopy.cxx
index 3a7787c93159..82f776b5854a 100644..100755
--- a/tools/source/fsys/filecopy.cxx
+++ b/tools/source/fsys/filecopy.cxx
@@ -143,14 +143,14 @@ FileCopier& FileCopier::operator = ( const FileCopier &rCopier )
|*
*************************************************************************/
-BOOL FileCopier::Progress()
+sal_Bool FileCopier::Progress()
{
if ( !aProgressLink )
- return TRUE;
+ return sal_True;
else
{
if ( aProgressLink.Call( this ) )
- return TRUE;
+ return sal_True;
return ( 0 == Error( ERRCODE_ABORT, 0, 0 ) );
}
}
@@ -224,7 +224,7 @@ FSysError FileCopier::DoCopy_Impl(
// HPFS->FAT?
FSysPathStyle eSourceStyle = DirEntry::GetPathStyle( rSource.ImpGetTopPtr()->GetName() );
FSysPathStyle eTargetStyle = DirEntry::GetPathStyle( rTarget.ImpGetTopPtr()->GetName() );
- BOOL bMakeShortNames = ( eSourceStyle == FSYS_STYLE_HPFS && eTargetStyle == FSYS_STYLE_FAT );
+ sal_Bool bMakeShortNames = ( eSourceStyle == FSYS_STYLE_HPFS && eTargetStyle == FSYS_STYLE_FAT );
// Zieldateiname ggf. kuerzen
DirEntry aTgt;
@@ -296,7 +296,7 @@ FSysError FileCopier::DoCopy_Impl(
// recursive copy
eRet = Error( aTgt.MakeDir() ? FSYS_ERR_OK : FSYS_ERR_UNKNOWN, 0, &aTgt );
Dir aSourceDir( rSource, FSYS_KIND_DIR|FSYS_KIND_FILE );
- for ( USHORT n = 0; ERRCODE_TOERROR(eRet) == FSYS_ERR_OK && n < aSourceDir.Count(); ++n )
+ for ( sal_uInt16 n = 0; ERRCODE_TOERROR(eRet) == FSYS_ERR_OK && n < aSourceDir.Count(); ++n )
{
const DirEntry &rSubSource = aSourceDir[n];
DirEntryFlag eFlag = rSubSource.GetFlag();
diff --git a/tools/source/fsys/fstat.cxx b/tools/source/fsys/fstat.cxx
index 60b45bd8ebdd..221ed2c0377b 100644..100755
--- a/tools/source/fsys/fstat.cxx
+++ b/tools/source/fsys/fstat.cxx
@@ -29,11 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_tools.hxx"
-#if defined( WIN)
-#include <stdio.h>
-#include <dos.h>
-#endif
-
#ifdef UNX
#include <errno.h>
#endif
@@ -52,12 +47,12 @@
FileStat::FileStat()
: // don't use Default-Ctors!
- aDateCreated( ULONG(0) ),
- aTimeCreated( ULONG(0) ),
- aDateModified( ULONG(0) ),
- aTimeModified( ULONG(0) ),
- aDateAccessed( ULONG(0) ),
- aTimeAccessed( ULONG(0) )
+ aDateCreated( sal_uIntPtr(0) ),
+ aTimeCreated( sal_uIntPtr(0) ),
+ aDateModified( sal_uIntPtr(0) ),
+ aTimeModified( sal_uIntPtr(0) ),
+ aDateAccessed( sal_uIntPtr(0) ),
+ aTimeAccessed( sal_uIntPtr(0) )
{
nSize = 0;
nKindFlags = FSYS_KIND_UNKNOWN;
@@ -72,15 +67,15 @@ FileStat::FileStat()
FileStat::FileStat( const DirEntry& rDirEntry, FSysAccess nAccess )
: // don't use Default-Ctors!
- aDateCreated( ULONG(0) ),
- aTimeCreated( ULONG(0) ),
- aDateModified( ULONG(0) ),
- aTimeModified( ULONG(0) ),
- aDateAccessed( ULONG(0) ),
- aTimeAccessed( ULONG(0) )
+ aDateCreated( sal_uIntPtr(0) ),
+ aTimeCreated( sal_uIntPtr(0) ),
+ aDateModified( sal_uIntPtr(0) ),
+ aTimeModified( sal_uIntPtr(0) ),
+ aDateAccessed( sal_uIntPtr(0) ),
+ aTimeAccessed( sal_uIntPtr(0) )
{
- BOOL bCached = FSYS_ACCESS_CACHED == (nAccess & FSYS_ACCESS_CACHED);
- BOOL bFloppy = FSYS_ACCESS_FLOPPY == (nAccess & FSYS_ACCESS_FLOPPY);
+ sal_Bool bCached = FSYS_ACCESS_CACHED == (nAccess & FSYS_ACCESS_CACHED);
+ sal_Bool bFloppy = FSYS_ACCESS_FLOPPY == (nAccess & FSYS_ACCESS_FLOPPY);
#ifdef FEAT_FSYS_DOUBLESPEED
const FileStat *pStatFromDir = bCached ? rDirEntry.ImpGetStat() : 0;
@@ -109,18 +104,18 @@ FileStat::FileStat( const DirEntry& rDirEntry, FSysAccess nAccess )
|*
*************************************************************************/
-// TRUE wenn die Instanz j"unger als rIsOlder ist.
-// FALSE wenn die Instanz "alter oder gleich alt wie rIsOlder ist.
+// sal_True wenn die Instanz j"unger als rIsOlder ist.
+// sal_False wenn die Instanz "alter oder gleich alt wie rIsOlder ist.
-BOOL FileStat::IsYounger( const FileStat& rIsOlder ) const
+sal_Bool FileStat::IsYounger( const FileStat& rIsOlder ) const
{
if ( aDateModified > rIsOlder.aDateModified )
- return TRUE;
+ return sal_True;
if ( ( aDateModified == rIsOlder.aDateModified ) &&
( aTimeModified > rIsOlder.aTimeModified ) )
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -129,9 +124,9 @@ BOOL FileStat::IsYounger( const FileStat& rIsOlder ) const
|*
*************************************************************************/
-BOOL FileStat::IsKind( DirEntryKind nKind ) const
+sal_Bool FileStat::IsKind( DirEntryKind nKind ) const
{
- BOOL bRet = ( ( nKind == FSYS_KIND_UNKNOWN ) &&
+ sal_Bool bRet = ( ( nKind == FSYS_KIND_UNKNOWN ) &&
( nKindFlags == FSYS_KIND_UNKNOWN ) ) ||
( ( nKindFlags & nKind ) == nKind );
return bRet;
@@ -143,12 +138,12 @@ BOOL FileStat::IsKind( DirEntryKind nKind ) const
|*
*************************************************************************/
-BOOL FileStat::HasReadOnlyFlag()
+sal_Bool FileStat::HasReadOnlyFlag()
{
#if defined WNT || defined UNX || defined OS2
- return TRUE;
+ return sal_True;
#else
- return FALSE;
+ return sal_False;
#endif
}
@@ -158,7 +153,7 @@ BOOL FileStat::HasReadOnlyFlag()
|*
*************************************************************************/
-BOOL FileStat::GetReadOnlyFlag( const DirEntry &rEntry )
+sal_Bool FileStat::GetReadOnlyFlag( const DirEntry &rEntry )
{
ByteString aFPath(rEntry.GetFull(), osl_getThreadTextEncoding());
@@ -174,17 +169,17 @@ BOOL FileStat::GetReadOnlyFlag( const DirEntry &rEntry )
case NO_ERROR:
return FILE_READONLY == ( aFileStat.attrFile & FILE_READONLY );
default:
- return FALSE;
+ return sal_False;
}
#elif defined UNX
/* could we stat the object? */
struct stat aBuf;
if (stat(aFPath.GetBuffer(), &aBuf))
- return FALSE;
+ return sal_False;
/* jupp, is writable for user? */
return((aBuf.st_mode & S_IWUSR) != S_IWUSR);
#else
- return FALSE;
+ return sal_False;
#endif
}
@@ -194,7 +189,7 @@ BOOL FileStat::GetReadOnlyFlag( const DirEntry &rEntry )
|*
*************************************************************************/
-ULONG FileStat::SetReadOnlyFlag( const DirEntry &rEntry, BOOL bRO )
+sal_uIntPtr FileStat::SetReadOnlyFlag( const DirEntry &rEntry, sal_Bool bRO )
{
ByteString aFPath(rEntry.GetFull(), osl_getThreadTextEncoding());
diff --git a/tools/source/fsys/makefile.mk b/tools/source/fsys/makefile.mk
deleted file mode 100644
index b1d34d6347f3..000000000000
--- a/tools/source/fsys/makefile.mk
+++ /dev/null
@@ -1,67 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=fsys
-ENABLE_EXCEPTIONS=true
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-.IF "$(COM)"=="GCC"
-CFLAGSCXX+=-fexceptions
-.ENDIF
-
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/tempfile.obj \
- $(SLO)$/wldcrd.obj \
- $(SLO)$/fstat.obj \
- $(SLO)$/comdep.obj \
- $(SLO)$/filecopy.obj \
- $(SLO)$/dirent.obj \
- $(SLO)$/tdir.obj \
- $(SLO)$/urlobj.obj
-
-OBJFILES= $(OBJ)$/wldcrd.obj \
- $(OBJ)$/fstat.obj \
- $(OBJ)$/comdep.obj \
- $(OBJ)$/filecopy.obj \
- $(OBJ)$/dirent.obj \
- $(OBJ)$/tdir.obj \
- $(OBJ)$/urlobj.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/tools/source/fsys/tdir.cxx b/tools/source/fsys/tdir.cxx
index cf9bd901abc4..575d2c492c5b 100644..100755
--- a/tools/source/fsys/tdir.cxx
+++ b/tools/source/fsys/tdir.cxx
@@ -41,7 +41,7 @@
DBG_NAME( Dir )
-#define APPEND (USHORT) 65535
+#define APPEND (sal_uInt16) 65535
/*************************************************************************
|*
@@ -51,7 +51,7 @@ DBG_NAME( Dir )
|*
*************************************************************************/
-BOOL Dir::ImpInsertPointReached( const DirEntry& rNewEntry,
+sal_Bool Dir::ImpInsertPointReached( const DirEntry& rNewEntry,
const FileStat& rNewStat,
size_t nCurPos, size_t nSortIndex ) const
{
@@ -61,7 +61,7 @@ BOOL Dir::ImpInsertPointReached( const DirEntry& rNewEntry,
// einfache Dinge erfordern einfache Loesungen
if ( pLst->empty() )
- return TRUE;
+ return sal_True;
FSysSort nSort = (*pSortLst)[ nSortIndex ];
FileStat *pOldStat = NULL;
@@ -74,121 +74,121 @@ BOOL Dir::ImpInsertPointReached( const DirEntry& rNewEntry,
case FSYS_SORT_NAME:
case (FSYS_SORT_NAME | FSYS_SORT_ASCENDING):
if ( pCurLstObj->aName > rNewEntry.aName )
- return TRUE;
+ return sal_True;
if ( !(pCurLstObj->aName == rNewEntry.aName) )
- return FALSE;
+ return sal_False;
break;
case (FSYS_SORT_NAME | FSYS_SORT_DESCENDING):
if ( pCurLstObj->aName < rNewEntry.aName )
- return TRUE;
+ return sal_True;
if ( !(pCurLstObj->aName == rNewEntry.aName) )
- return FALSE;
+ return sal_False;
break;
case FSYS_SORT_EXT:
case (FSYS_SORT_EXT | FSYS_SORT_ASCENDING):
{
if ( pCurLstObj->GetExtension() > rNewEntry.GetExtension() )
- return TRUE;
+ return sal_True;
if ( !(pCurLstObj->GetExtension() == rNewEntry.GetExtension()) )
- return FALSE;
+ return sal_False;
break;
}
case (FSYS_SORT_EXT | FSYS_SORT_DESCENDING):
{
if ( pCurLstObj->GetExtension() < rNewEntry.GetExtension() )
- return TRUE;
+ return sal_True;
if ( !(pCurLstObj->GetExtension() == rNewEntry.GetExtension()) )
- return FALSE;
+ return sal_False;
break;
}
case FSYS_SORT_KIND:
case (FSYS_SORT_KIND | FSYS_SORT_ASCENDING ):
if ( VALUE(pOldStat->nKindFlags) > VALUE(rNewStat.nKindFlags) )
- return TRUE;
+ return sal_True;
if ( !(VALUE(pOldStat->nKindFlags) == VALUE(rNewStat.nKindFlags)) )
- return FALSE;
+ return sal_False;
break;
case (FSYS_SORT_KIND | FSYS_SORT_DESCENDING):
if ( VALUE(pOldStat->nKindFlags) < VALUE(rNewStat.nKindFlags) )
- return TRUE;
+ return sal_True;
if ( !(VALUE(pOldStat->nKindFlags) == VALUE(rNewStat.nKindFlags)) )
- return FALSE;
+ return sal_False;
break;
case FSYS_SORT_SIZE:
case (FSYS_SORT_SIZE | FSYS_SORT_ASCENDING):
if ( pOldStat->nSize > rNewStat.nSize )
- return TRUE;
+ return sal_True;
if ( !(pOldStat->nSize == rNewStat.nSize) )
- return FALSE;
+ return sal_False;
break;
case (FSYS_SORT_SIZE | FSYS_SORT_DESCENDING):
if ( pOldStat->nSize < rNewStat.nSize )
- return TRUE;
+ return sal_True;
if ( !(pOldStat->nSize == rNewStat.nSize) )
- return FALSE;
+ return sal_False;
break;
case FSYS_SORT_MODIFYED:
case (FSYS_SORT_MODIFYED | FSYS_SORT_ASCENDING):
if ( (pOldStat->aDateModified >= rNewStat.aDateModified) &&
(pOldStat->aTimeModified > rNewStat.aTimeModified) )
- return TRUE;
+ return sal_True;
if ( !((pOldStat->aDateModified == rNewStat.aDateModified) &&
(pOldStat->aTimeModified == rNewStat.aTimeModified)) )
- return FALSE;
+ return sal_False;
break;
case (FSYS_SORT_MODIFYED | FSYS_SORT_DESCENDING):
if ( (pOldStat->aDateModified <= rNewStat.aDateModified) &&
(pOldStat->aTimeModified < rNewStat.aTimeModified) )
- return TRUE;
+ return sal_True;
if ( !((pOldStat->aDateModified == rNewStat.aDateModified) &&
(pOldStat->aTimeModified == rNewStat.aTimeModified)) )
- return FALSE;
+ return sal_False;
break;
case FSYS_SORT_CREATED:
case (FSYS_SORT_CREATED | FSYS_SORT_ASCENDING):
if ( (pOldStat->aDateCreated >= rNewStat.aDateCreated) &&
(pOldStat->aTimeCreated > rNewStat.aTimeCreated) )
- return TRUE;
+ return sal_True;
if ( !((pOldStat->aDateCreated == rNewStat.aDateCreated) &&
(pOldStat->aTimeCreated == rNewStat.aTimeCreated)) )
- return FALSE;
+ return sal_False;
break;
case (FSYS_SORT_CREATED | FSYS_SORT_DESCENDING):
if ( (pOldStat->aDateCreated <= rNewStat.aDateCreated) &&
(pOldStat->aTimeCreated < rNewStat.aTimeCreated) )
- return TRUE;
+ return sal_True;
if ( !((pOldStat->aDateCreated == rNewStat.aDateCreated) &&
(pOldStat->aTimeCreated == rNewStat.aTimeCreated)) )
- return FALSE;
+ return sal_False;
break;
case FSYS_SORT_ACCESSED:
case (FSYS_SORT_ACCESSED | FSYS_SORT_ASCENDING):
if ( (pOldStat->aDateAccessed >= rNewStat.aDateAccessed) &&
(pOldStat->aTimeAccessed > rNewStat.aTimeAccessed) )
- return TRUE;
+ return sal_True;
if ( !((pOldStat->aDateAccessed == rNewStat.aDateAccessed) &&
(pOldStat->aTimeAccessed == rNewStat.aTimeAccessed)) )
- return FALSE;
+ return sal_False;
break;
case (FSYS_SORT_ACCESSED | FSYS_SORT_DESCENDING):
if ( (pOldStat->aDateAccessed <= rNewStat.aDateAccessed) &&
(pOldStat->aTimeAccessed < rNewStat.aTimeAccessed) )
- return TRUE;
+ return sal_True;
if ( !((pOldStat->aDateAccessed == rNewStat.aDateAccessed) &&
(pOldStat->aTimeAccessed == rNewStat.aTimeAccessed)) )
- return FALSE;
+ return sal_False;
break;
default: /* Kann nicht sein */;
}
if ( nSortIndex == ( pSortLst->size() - 1 ) )
- return TRUE;
+ return sal_True;
else
//Rekursion
return ImpInsertPointReached( rNewEntry, rNewStat,
@@ -272,7 +272,7 @@ void Dir::Construct( DirEntryKind nKindFlags )
|*
*************************************************************************/
-BOOL Dir::Update()
+sal_Bool Dir::Update()
{
Reset();
return Scan( USHRT_MAX ) > 0;
@@ -350,10 +350,10 @@ void Dir::Reset()
|*
*************************************************************************/
-USHORT Dir::Scan( USHORT nCount )
+sal_uInt16 Dir::Scan( sal_uInt16 nCount )
{
- USHORT nRead = 0; // Anzahl in dieser Runde gelesener Eintr"age
+ sal_uInt16 nRead = 0; // Anzahl in dieser Runde gelesener Eintr"age
FSysFailOnErrorImpl();
// noch nicht fertig gewesen
@@ -363,7 +363,7 @@ USHORT Dir::Scan( USHORT nCount )
if ( pLst->empty() )
{
// dann ggf. Laufwerke scannen
- pReader->bInUse = TRUE;
+ pReader->bInUse = sal_True;
nRead = pReader->Init();
}
@@ -484,7 +484,7 @@ Dir::~Dir()
FSysError Dir::ImpSetSort( std::va_list pArgs, int nFirstSort )
{
- BOOL bLast;
+ sal_Bool bLast;
FSysSort aSort;
FSysSortList *pNewSortLst = new FSysSortList;
@@ -495,8 +495,8 @@ FSysError Dir::ImpSetSort( std::va_list pArgs, int nFirstSort )
bLast = FSYS_SORT_END == (aSort & FSYS_SORT_END);
aSort &= ~FSYS_SORT_END;
- FSysSort nSort = aSort & ~(USHORT)FSYS_SORT_ASCENDING
- & ~(USHORT)FSYS_SORT_DESCENDING;
+ FSysSort nSort = aSort & ~(sal_uInt16)FSYS_SORT_ASCENDING
+ & ~(sal_uInt16)FSYS_SORT_DESCENDING;
// g"utliges Sortierkriterium?
if ( ( nSort == FSYS_SORT_NAME ) ||
@@ -630,7 +630,7 @@ Dir& Dir::operator+=( const Dir& rDir )
pLst = new DirEntryList();
//Verlangen die Sortierkriterien FileStat's?
- BOOL bStat = FALSE;
+ sal_Bool bStat = sal_False;
if ( pSortLst ) {
for ( size_t i = 0, n = pSortLst->size(); i < n && !bStat; ++i ) {
if ( (*pSortLst)[ i ]
@@ -638,7 +638,7 @@ Dir& Dir::operator+=( const Dir& rDir )
| FSYS_SORT_ACCESSED | FSYS_SORT_KIND
)
) {
- bStat = TRUE;
+ bStat = sal_True;
}
}
}
@@ -664,7 +664,7 @@ Dir& Dir::operator+=( const Dir& rDir )
*************************************************************************/
-size_t Dir::Count( BOOL bUpdated ) const
+size_t Dir::Count( sal_Bool bUpdated ) const
{
// ggf. erst den Rest lesen
if ( bUpdated && pReader )
diff --git a/tools/source/fsys/unx.cxx b/tools/source/fsys/unx.cxx
index 471d1275ab64..53d319800319 100644
--- a/tools/source/fsys/unx.cxx
+++ b/tools/source/fsys/unx.cxx
@@ -86,18 +86,18 @@ struct mymnttab
#if defined(NETBSD) || defined(FREEBSD) || defined(MACOSX) || \
defined(OPENBSD) || defined(DRAGONFLY)
-BOOL GetMountEntry(dev_t /* dev */, struct mymnttab * /* mytab */ )
+sal_Bool GetMountEntry(dev_t /* dev */, struct mymnttab * /* mytab */ )
{
DBG_WARNING( "Sorry, not implemented: GetMountEntry" );
- return FALSE;
+ return sal_False;
}
#elif defined AIX
-BOOL GetMountEntry(dev_t dev, struct mymnttab *mytab)
+sal_Bool GetMountEntry(dev_t dev, struct mymnttab *mytab)
{
int bufsize;
if (mntctl (MCTL_QUERY, sizeof bufsize, (char*) &bufsize))
- return FALSE;
+ return sal_False;
char* buffer = (char *)malloc( bufsize * sizeof(char) );
if (mntctl (MCTL_QUERY, bufsize, buffer) != -1)
@@ -118,34 +118,34 @@ BOOL GetMountEntry(dev_t dev, struct mymnttab *mytab)
+= vmt2dataptr((struct vmount*)vmt, VMT_OBJECT);
mytab->mountdevice = dev;
free( buffer );
- return TRUE;
+ return sal_True;
}
}
free( buffer );
- return FALSE;
+ return sal_False;
}
#else
-static BOOL GetMountEntry(dev_t dev, struct mymnttab *mytab)
+static sal_Bool GetMountEntry(dev_t dev, struct mymnttab *mytab)
{
#if defined SOLARIS
FILE *fp = fopen (MNTTAB, "r");
if (! fp)
- return FALSE;
+ return sal_False;
struct mnttab mnt[1];
while (getmntent (fp, mnt) != -1)
#elif defined AIX
FILE *fp = NULL;
if (! fp)
- return FALSE;
+ return sal_False;
struct mnttab mnt[1];
while ( 0 )
#else
FILE *fp = setmntent (MOUNTED, "r");
if (! fp)
- return FALSE;
+ return sal_False;
struct mnttab *mnt;
while ((mnt = getmntent (fp)) != NULL)
#endif
@@ -178,7 +178,7 @@ static BOOL GetMountEntry(dev_t dev, struct mymnttab *mytab)
mytab->mountdevice = dev;
mytab->mymnttab_filesystem = mnt->MOUNTFS;
- return TRUE;
+ return sal_True;
}
# ifdef LINUX
/* #61624# dito */
@@ -186,7 +186,7 @@ static BOOL GetMountEntry(dev_t dev, struct mymnttab *mytab)
# else
fclose (fp);
# endif
- return FALSE;
+ return sal_False;
}
#endif
@@ -197,13 +197,13 @@ static BOOL GetMountEntry(dev_t dev, struct mymnttab *mytab)
|*
*************************************************************************/
-BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
+sal_Bool DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
{
if (eFormatter==FSYS_STYLE_HOST)
{
#if defined(NETBSD) || defined(DRAGONFLY)
- return TRUE;
+ return sal_True;
#else
struct stat buf;
DirEntry aPath(*this);
@@ -213,7 +213,7 @@ BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
{
if (aPath.Level() == 1)
{
- return TRUE; // ich bin unter UNIX, also ist der default im Zweifelsfall case sensitiv
+ return sal_True; // ich bin unter UNIX, also ist der default im Zweifelsfall case sensitiv
}
aPath = aPath [1];
}
@@ -227,17 +227,17 @@ BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
(fsmnt.mymnttab_filesystem.CompareTo("smb") ==COMPARE_EQUAL) ||
(fsmnt.mymnttab_filesystem.CompareTo("ncpfs")==COMPARE_EQUAL))
{
- return FALSE;
+ return sal_False;
}
else
{
- return TRUE;
+ return sal_True;
}
#endif
}
else
{
- BOOL isCaseSensitive = TRUE; // ich bin unter UNIX, also ist der default im Zweifelsfall case sensitiv
+ sal_Bool isCaseSensitive = sal_True; // ich bin unter UNIX, also ist der default im Zweifelsfall case sensitiv
switch ( eFormatter )
{
case FSYS_STYLE_MAC:
@@ -247,19 +247,19 @@ BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
case FSYS_STYLE_NWFS:
case FSYS_STYLE_HPFS:
{
- isCaseSensitive = FALSE;
+ isCaseSensitive = sal_False;
break;
}
case FSYS_STYLE_SYSV:
case FSYS_STYLE_BSD:
case FSYS_STYLE_DETECT:
{
- isCaseSensitive = TRUE;
+ isCaseSensitive = sal_True;
break;
}
default:
{
- isCaseSensitive = TRUE; // ich bin unter UNIX, also ist der default im Zweifelsfall case sensitiv
+ isCaseSensitive = sal_True; // ich bin unter UNIX, also ist der default im Zweifelsfall case sensitiv
break;
}
}
@@ -273,16 +273,16 @@ BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
|*
*************************************************************************/
-BOOL DirEntry::ToAbs()
+sal_Bool DirEntry::ToAbs()
{
if ( FSYS_FLAG_VOLUME == eFlag )
{
eFlag = FSYS_FLAG_ABSROOT;
- return TRUE;
+ return sal_True;
}
if ( IsAbs() )
- return TRUE;
+ return sal_True;
char sBuf[MAXPATHLEN + 1];
*this = DirEntry( String( getcwd( sBuf, MAXPATHLEN ), osl_getThreadTextEncoding() ) ) + *this;
@@ -345,7 +345,7 @@ DirEntry DirEntry::GetDevice() const
|*
*************************************************************************/
-BOOL DirEntry::SetCWD( BOOL bSloppy ) const
+sal_Bool DirEntry::SetCWD( sal_Bool bSloppy ) const
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
@@ -353,31 +353,31 @@ BOOL DirEntry::SetCWD( BOOL bSloppy ) const
ByteString aPath( GetFull(), osl_getThreadTextEncoding());
if ( !chdir( aPath.GetBuffer() ) )
{
- return TRUE;
+ return sal_True;
}
else
{
if ( bSloppy && !chdir(aPath.GetBuffer()) )
{
- return TRUE;
+ return sal_True;
}
else
{
- return FALSE;
+ return sal_False;
}
}
}
//-------------------------------------------------------------------------
-USHORT DirReader_Impl::Init()
+sal_uInt16 DirReader_Impl::Init()
{
return 0;
}
//-------------------------------------------------------------------------
-USHORT DirReader_Impl::Read()
+sal_uInt16 DirReader_Impl::Read()
{
if (!pDosDir)
{
@@ -386,7 +386,7 @@ USHORT DirReader_Impl::Read()
if (!pDosDir)
{
- bReady = TRUE;
+ bReady = sal_True;
return 0;
}
@@ -403,7 +403,7 @@ USHORT DirReader_Impl::Read()
: FSYS_FLAG_NORMAL;
DirEntry *pTemp = new DirEntry( ByteString(pDosEntry->d_name), eFlag, FSYS_STYLE_UNX );
if ( pParent )
- pTemp->ImpChangeParent( new DirEntry( *pParent ), FALSE);
+ pTemp->ImpChangeParent( new DirEntry( *pParent ), sal_False);
FileStat aStat( *pTemp );
if ( ( ( ( pDir->eAttrMask & FSYS_KIND_DIR ) &&
( aStat.IsKind( FSYS_KIND_DIR ) ) ) ||
@@ -423,7 +423,7 @@ USHORT DirReader_Impl::Read()
}
}
else
- bReady = TRUE;
+ bReady = sal_True;
return 0;
}
@@ -448,7 +448,7 @@ FileStat::FileStat( const void *, const void * ):
|* FileStat::Update()
|*
*************************************************************************/
-BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL )
+sal_Bool FileStat::Update( const DirEntry& rDirEntry, sal_Bool )
{
nSize = 0;
@@ -465,7 +465,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL )
if ( !rDirEntry.IsValid() )
{
nError = FSYS_ERR_NOTEXISTS;
- return FALSE;
+ return sal_False;
}
// Sonderbehandlung falls es sich um eine Root handelt
@@ -473,7 +473,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL )
{
nKindFlags = FSYS_KIND_DIR;
nError = FSYS_ERR_OK;
- return TRUE;
+ return sal_True;
}
struct stat aStat;
@@ -494,11 +494,11 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL )
{
nKindFlags = FSYS_KIND_WILD;
nError = FSYS_ERR_OK;
- return TRUE;
+ return sal_True;
}
nError = FSYS_ERR_NOTEXISTS;
- return FALSE;
+ return sal_False;
}
nError = FSYS_ERR_OK;
@@ -520,7 +520,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL )
Unx2DateAndTime( aStat.st_mtime, aTimeModified, aDateModified );
Unx2DateAndTime( aStat.st_atime, aTimeAccessed, aDateAccessed );
- return TRUE;
+ return sal_True;
}
//====================================================================
@@ -605,7 +605,7 @@ ErrCode FileStat::QueryDiskSpace( const String &, BigInt &, BigInt & )
//=========================================================================
-void FSysEnableSysErrorBox( BOOL )
+void FSysEnableSysErrorBox( sal_Bool )
{
}
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 91e4e6936bf5..57531aa4b05e 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -426,6 +426,8 @@ static INetURLObject::SchemeInfo const aSchemeInfoMap[INET_PROT_END]
{ "", "", 0, false, false, false, false, true, true, true, false },
{ "smb", "smb://", 139, true, true, false, true, true, true, true,
true },
+ { "hid", "hid:", 0, false, false, false, false, false, false,
+ false, true },
{ "sftp", "sftp://", 22, true, true, false, true, true, true, true,
true } };
@@ -2136,6 +2138,8 @@ INetURLObject::getPrefix(sal_Unicode const *& rBegin,
{ "db:", "staroffice.db:", INET_PROT_DB, PrefixInfo::INTERNAL },
{ "file:", 0, INET_PROT_FILE, PrefixInfo::OFFICIAL },
{ "ftp:", 0, INET_PROT_FTP, PrefixInfo::OFFICIAL },
+ { "hid:", "staroffice.hid:", INET_PROT_HID,
+ PrefixInfo::INTERNAL },
{ "http:", 0, INET_PROT_HTTP, PrefixInfo::OFFICIAL },
{ "https:", 0, INET_PROT_HTTPS, PrefixInfo::OFFICIAL },
{ "imap:", 0, INET_PROT_IMAP, PrefixInfo::OFFICIAL },
@@ -2171,6 +2175,8 @@ INetURLObject::getPrefix(sal_Unicode const *& rBegin,
INET_PROT_PRIV_SOFFICE, PrefixInfo::EXTERNAL },
{ "staroffice.helpid:", "private:helpid/", INET_PROT_PRIV_SOFFICE,
PrefixInfo::EXTERNAL },
+ { "staroffice.hid:", "hid:", INET_PROT_HID,
+ PrefixInfo::EXTERNAL },
{ "staroffice.java:", "private:java/", INET_PROT_PRIV_SOFFICE,
PrefixInfo::EXTERNAL },
{ "staroffice.macro:", "macro:", INET_PROT_MACRO,
@@ -3164,6 +3170,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
case INET_PROT_PRIV_SOFFICE:
case INET_PROT_SLOT:
+ case INET_PROT_HID:
case INET_PROT_MACRO:
case INET_PROT_UNO:
case INET_PROT_COMPONENT:
diff --git a/tools/source/fsys/wldcrd.cxx b/tools/source/fsys/wldcrd.cxx
index e391dd5020c3..acc1ce9a2071 100644..100755
--- a/tools/source/fsys/wldcrd.cxx
+++ b/tools/source/fsys/wldcrd.cxx
@@ -45,7 +45,7 @@
*
*/
-USHORT WildCard::ImpMatch( const char *pWild, const char *pStr ) const
+sal_uInt16 WildCard::ImpMatch( const char *pWild, const char *pStr ) const
{
int pos=0;
int flag=0;
@@ -110,12 +110,12 @@ USHORT WildCard::ImpMatch( const char *pWild, const char *pStr ) const
|*
*************************************************************************/
-BOOL WildCard::Matches( const String& rString ) const
+sal_Bool WildCard::Matches( const String& rString ) const
{
ByteString aTmpWild = aWildString;
ByteString aString(rString, osl_getThreadTextEncoding());
- USHORT nSepPos;
+ sal_uInt16 nSepPos;
if ( cSepSymbol != '\0' )
{
@@ -123,16 +123,16 @@ BOOL WildCard::Matches( const String& rString ) const
{
// alle getrennten WildCard's pruefen
if ( ImpMatch( aTmpWild.Copy( 0, nSepPos ).GetBuffer(), aString.GetBuffer() ) )
- return TRUE;
+ return sal_True;
aTmpWild.Erase( 0, nSepPos + 1 ); // Trennsymbol entfernen
}
// und noch den hinter dem letzen Trennsymbol bzw. den einzigen
}
if ( ImpMatch( aTmpWild.GetBuffer(), aString.GetBuffer() ) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/fsys/wntmsc.cxx b/tools/source/fsys/wntmsc.cxx
index 21cf379ed031..cfe64bea12f8 100644..100755
--- a/tools/source/fsys/wntmsc.cxx
+++ b/tools/source/fsys/wntmsc.cxx
@@ -48,7 +48,7 @@
int Sys2SolarError_Impl( int nSysErr );
-static BOOL bLastCaseSensitive = FALSE;
+static sal_Bool bLastCaseSensitive = sal_False;
//--------------------------------------------------------------------
@@ -99,7 +99,7 @@ struct dirent *readdir( DIR *pDir )
int closedir( DIR *pDir )
{
- BOOL bOk = FALSE;
+ sal_Bool bOk = sal_False;
if ( pDir )
{
bOk = 0 != pDir->p || FindClose( pDir->h );
@@ -128,7 +128,7 @@ ErrCode GetPathStyle_Impl( const String &rDevice, FSysPathStyle &rStyle )
// Windows95 hat VFAT, WindowsNT nicht
DWORD nVer = GetVersion();
- BOOL bW95 = ( nVer & 0xFF ) >= 4;
+ sal_Bool bW95 = ( nVer & 0xFF ) >= 4;
FSysFailOnErrorImpl();
rStyle = FSYS_STYLE_UNKNOWN;
@@ -173,7 +173,7 @@ FSysPathStyle DirEntry::GetPathStyle( const String &rDevice )
|*
*************************************************************************/
-BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
+sal_Bool DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
{
if (eFormatter==FSYS_STYLE_HOST)
@@ -182,7 +182,7 @@ BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
DirEntry aRoot(*this);
aRoot.ToAbs();
aRoot = aRoot[Level()-1];
- String aRootDir = aRoot.GetFull(FSYS_STYLE_HOST, TRUE);
+ String aRootDir = aRoot.GetFull(FSYS_STYLE_HOST, sal_True);
char sVolumeName[256];
DWORD nVolumeSerial;
@@ -199,30 +199,30 @@ BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
sFileSysName,
16 ))
{
- return (nFlags & FS_CASE_SENSITIVE) ? TRUE : FALSE;
+ return (nFlags & FS_CASE_SENSITIVE) ? sal_True : sal_False;
}
else
{
- return FALSE;
+ return sal_False;
}
*/
//
// guter versuch, aber FS_CASE_SENSITIVE ist D?nnsinn in T?ten:
//
// sFileSysName FS_CASE_SENSITIVE
- // FAT FALSE
- // NTFS TRUE !!!
- // NWCompat FALSE
- // Samba FALSE
+ // FAT sal_False
+ // NTFS sal_True !!!
+ // NWCompat sal_False
+ // Samba sal_False
//
// NT spricht auch NTFS lediglich case preserving an, also ist unter NT alles case insensitiv
//
- return FALSE;
+ return sal_False;
}
else
{
- BOOL isCaseSensitive = FALSE; // ich bin unter win32, also ist der default case insensitiv
+ sal_Bool isCaseSensitive = sal_False; // ich bin unter win32, also ist der default case insensitiv
switch ( eFormatter )
{
case FSYS_STYLE_MAC:
@@ -233,18 +233,18 @@ BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
case FSYS_STYLE_HPFS:
case FSYS_STYLE_DETECT:
{
- isCaseSensitive = FALSE;
+ isCaseSensitive = sal_False;
break;
}
case FSYS_STYLE_SYSV:
case FSYS_STYLE_BSD:
{
- isCaseSensitive = TRUE;
+ isCaseSensitive = sal_True;
break;
}
default:
{
- isCaseSensitive = FALSE; // ich bin unter win32, also ist der default case insensitiv
+ isCaseSensitive = sal_False; // ich bin unter win32, also ist der default case insensitiv
break;
}
}
@@ -258,19 +258,19 @@ BOOL DirEntry::IsCaseSensitive( FSysPathStyle eFormatter ) const
|*
*************************************************************************/
-BOOL DirEntry::ToAbs()
+sal_Bool DirEntry::ToAbs()
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
if ( FSYS_FLAG_VOLUME == eFlag )
{
eFlag = FSYS_FLAG_ABSROOT;
- return TRUE;
+ return sal_True;
}
if ( IsAbs() )
{
- return TRUE;
+ return sal_True;
}
@@ -279,10 +279,10 @@ BOOL DirEntry::ToAbs()
ByteString aFullName( GetFull(), osl_getThreadTextEncoding() );
FSysFailOnErrorImpl();
if ( GetFullPathName((char*)aFullName.GetBuffer(),256,sBuf,&pOld) > 511 )
- return FALSE;
+ return sal_False;
*this = DirEntry( String(sBuf, osl_getThreadTextEncoding() ));
- return TRUE;
+ return sal_True;
}
@@ -340,27 +340,27 @@ String DirEntry::GetVolume() const
|*
*************************************************************************/
-BOOL DirEntry::SetCWD( BOOL bSloppy ) const
+sal_Bool DirEntry::SetCWD( sal_Bool bSloppy ) const
{
DBG_CHKTHIS( DirEntry, ImpCheckDirEntry );
FSysFailOnErrorImpl();
if ( eFlag == FSYS_FLAG_CURRENT && !aName.Len() )
- return TRUE;
+ return sal_True;
if ( SetCurrentDirectory(ByteString(GetFull(), osl_getThreadTextEncoding()).GetBuffer()) )
{
- return TRUE;
+ return sal_True;
}
if ( bSloppy && pParent &&
SetCurrentDirectory(ByteString(pParent->GetFull(), osl_getThreadTextEncoding()).GetBuffer()) )
{
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
//-------------------------------------------------------------------------
@@ -420,7 +420,7 @@ USHORT DirReader_Impl::Read()
CharLowerBuff( (char*) aLowerName.GetBuffer(), aLowerName.Len() );
// Flags pruefen
- BOOL bIsDirAndWantsDir =
+ sal_Bool bIsDirAndWantsDir =
( ( pDir->eAttrMask & FSYS_KIND_DIR ) &&
#ifdef ICC
( pDosEntry->d_type & ( strcmp(pDosEntry->d_name,".") ||
@@ -428,7 +428,7 @@ USHORT DirReader_Impl::Read()
#else
( pDosEntry->d_type & DOS_DIRECT ) );
#endif
- BOOL bIsFileAndWantsFile =
+ sal_Bool bIsFileAndWantsFile =
( ( pDir->eAttrMask & FSYS_KIND_FILE ) &&
#ifdef ICC
!( pDosEntry->d_type & ( strcmp(pDosEntry->d_name,".") ||
@@ -437,8 +437,8 @@ USHORT DirReader_Impl::Read()
!( pDosEntry->d_type & DOS_DIRECT ) &&
#endif
!( pDosEntry->d_type & DOS_VOLUMEID ) );
- BOOL bIsHidden = (pDosEntry->d_type & _A_HIDDEN) != 0;
- BOOL bWantsHidden = 0 == ( pDir->eAttrMask & FSYS_KIND_VISIBLE );
+ sal_Bool bIsHidden = (pDosEntry->d_type & _A_HIDDEN) != 0;
+ sal_Bool bWantsHidden = 0 == ( pDir->eAttrMask & FSYS_KIND_VISIBLE );
if ( ( bIsDirAndWantsDir || bIsFileAndWantsFile ) &&
( bWantsHidden || !bIsHidden ) &&
pDir->aNameMask.Matches( String(aLowerName, osl_getThreadTextEncoding()) ) )
@@ -459,7 +459,7 @@ USHORT DirReader_Impl::Read()
pTemp->ImpSetStat( new FileStat( (void*) pDosDir, (void*) 0 ) );
#endif
if ( pParent )
- pTemp->ImpChangeParent( new DirEntry( *pParent ), FALSE );
+ pTemp->ImpChangeParent( new DirEntry( *pParent ), sal_False );
if ( pDir->pStatLst ) //Status fuer Sort gewuenscht?
{
FileStat *pNewStat = new FileStat( (void*) pDosDir, (void*) 0 );
@@ -478,7 +478,7 @@ USHORT DirReader_Impl::Read()
}
else
- bReady = TRUE;
+ bReady = sal_True;
return 0;
}
@@ -567,9 +567,7 @@ FileStat::FileStat( const void *pInfo, // struct dirent
#pragma warning(push, 1)
#pragma warning(disable: 4917)
#endif
-#define ULONG WIN_ULONG
#include <shlobj.h>
-#undef ULONG
#ifdef _MSC_VER
#pragma warning(pop)
#endif
@@ -608,7 +606,7 @@ HRESULT SHGetIDListFromPath( HWND hwndOwner, LPCTSTR pszPath, LPITEMIDLIST *ppid
if ( FAILED(hResult) )
return hResult;
- WIN_ULONG chEaten = lstrlen( pszPath );
+ ULONG chEaten = lstrlen( pszPath );
DWORD dwAttributes = FILE_ATTRIBUTE_DIRECTORY;
#ifdef UNICODE
@@ -761,13 +759,13 @@ HRESULT SHResolvePath( HWND hwndOwner, LPCTSTR pszPath, LPITEMIDLIST *ppidl )
// The Wrapper
//---------------------------------------------------------------------------
-BOOL Exists_Impl( const ByteString & crPath )
+sal_Bool Exists_Impl( const ByteString & crPath )
{
// We do not know if OLE was initialized for this thread
CoInitialize( NULL );
- BOOL bSuccess = SUCCEEDED( SHResolvePath(NULL, crPath.GetBuffer(), NULL) );
+ sal_Bool bSuccess = SUCCEEDED( SHResolvePath(NULL, crPath.GetBuffer(), NULL) );
CoUninitialize();
@@ -776,7 +774,7 @@ BOOL Exists_Impl( const ByteString & crPath )
//---------------------------------------------------------------------------
-BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
+sal_Bool FileStat::Update( const DirEntry& rDirEntry, sal_Bool bForceAccess )
{
nSize = 0;
nKindFlags = 0;
@@ -793,7 +791,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
{
nError = FSYS_ERR_UNKNOWN;
nKindFlags = 0;
- return FALSE;
+ return sal_False;
}
// Sonderbehandlung falls es sich um eine Root ohne Laufwerk handelt
@@ -802,7 +800,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
{
nKindFlags = FSYS_KIND_DIR;
nError = FSYS_ERR_OK;
- return TRUE;
+ return sal_True;
}
// keine Error-Boxen anzeigen
@@ -817,7 +815,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
// ist ein Medium im Laufwerk?
HACK("wie?")
- BOOL bAccess = TRUE;
+ sal_Bool bAccess = sal_True;
const DirEntry *pTop = aDirEntry.ImpGetTopPtr();
ByteString aName = ByteString(pTop->aName).ToLowerAscii();
if ( !bForceAccess &&
@@ -825,7 +823,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
pTop->eFlag == FSYS_FLAG_RELROOT ||
pTop->eFlag == FSYS_FLAG_VOLUME ) )
if ( aName == "a:" || aName == "b:" )
- bAccess = FALSE;
+ bAccess = sal_False;
else
OSL_TRACE( "FSys: will access removable device!" );
if ( bAccess && ( aName == "a:" || aName == "b:" ) ) {
@@ -849,7 +847,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
nKindFlags |= FSYS_KIND_REMOVEABLE;
nError = FSYS_ERR_NOTEXISTS;
nKindFlags = 0;
- return FALSE;
+ return sal_False;
}
ByteString aRootDir = aDirEntry.aName;
@@ -859,7 +857,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
{
nError = FSYS_ERR_NOTEXISTS;
nKindFlags = 0;
- return FALSE;
+ return sal_False;
}
if ( aDirEntry.eFlag == FSYS_FLAG_VOLUME )
@@ -873,7 +871,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
nError = ERRCODE_NONE;
- return TRUE;
+ return sal_True;
}
// Statusinformation vom Betriebssystem holen
@@ -913,7 +911,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
{
nKindFlags = FSYS_KIND_UNKNOWN;
nError = FSYS_ERR_NOTEXISTS;
- return FALSE;
+ return sal_False;
}
// UNC-Volume?
@@ -927,13 +925,13 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
{
nKindFlags = FSYS_KIND_DIR|FSYS_KIND_REMOTE;
nError = FSYS_ERR_OK;
- return TRUE;
+ return sal_True;
}
else
{
nKindFlags = FSYS_KIND_UNKNOWN;
nError = FSYS_ERR_NOTEXISTS;
- return FALSE;
+ return sal_False;
}
}
}
@@ -952,7 +950,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
{
nKindFlags = FSYS_KIND_WILD;
nError = FSYS_ERR_OK;
- return TRUE;
+ return sal_True;
}
if ( bAccess )
@@ -976,7 +974,7 @@ BOOL FileStat::Update( const DirEntry& rDirEntry, BOOL bForceAccess )
}
-BOOL IsRedirectable_Impl( const ByteString &rPath )
+sal_Bool IsRedirectable_Impl( const ByteString &rPath )
{
if ( rPath.Len() >= 3 && ':' == rPath.GetBuffer()[1] )
{
@@ -985,7 +983,7 @@ BOOL IsRedirectable_Impl( const ByteString &rPath )
SetLastError( ERROR_SUCCESS );
return DRIVE_FIXED != nType;
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -1033,7 +1031,7 @@ ErrCode FileStat::QueryDiskSpace( const String &rPath,
//=========================================================================
-void FSysEnableSysErrorBox( BOOL bEnable )
+void FSysEnableSysErrorBox( sal_Bool bEnable )
{ // Preserve other Bits!!
sal_uInt32 nErrorMode = SetErrorMode( bEnable ? 0 : SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX );
if ( bEnable )
diff --git a/tools/source/fsys/wntmsc.hxx b/tools/source/fsys/wntmsc.hxx
index a50498bb0fd9..beeac31ef6fe 100644..100755
--- a/tools/source/fsys/wntmsc.hxx
+++ b/tools/source/fsys/wntmsc.hxx
@@ -52,7 +52,7 @@
//--------------------------------------------------------------------
-#define FSYS_UNIX FALSE
+#define FSYS_UNIX sal_False
#define DOS_DIRECT _A_SUBDIR
#define DOS_VOLUMEID 0x08
@@ -80,7 +80,7 @@ typedef struct
#define START_DRV 'a'
-inline BOOL DRIVE_EXISTS(char c)
+inline sal_Bool DRIVE_EXISTS(char c)
{
ByteString aDriveRoot( c );
aDriveRoot += ":\\";
diff --git a/tools/source/generic/bigint.cxx b/tools/source/generic/bigint.cxx
index ae99ab7ed886..724ec724748b 100644
--- a/tools/source/generic/bigint.cxx
+++ b/tools/source/generic/bigint.cxx
@@ -50,7 +50,7 @@ static const long MY_MINSHORT = -MY_MAXSHORT;
* sind diese Algorithmen im Kapitel 4.3.1. The Classical Algorithms.
*/
-// Muss auf UINT16/INT16/UINT32/INT32 umgestellt werden !!! W.P.
+// Muss auf sal_uInt16/INT16/sal_uInt32/sal_Int32 umgestellt werden !!! W.P.
// -----------------------------------------------------------------------
@@ -645,7 +645,7 @@ BigInt::BigInt( sal_uInt32 nValue )
// -----------------------------------------------------------------------
-BigInt::operator ULONG() const
+BigInt::operator sal_uIntPtr() const
{
if ( !bIsBig )
return (sal_uInt32)nVal;
diff --git a/tools/source/generic/color.cxx b/tools/source/generic/color.cxx
index 88bfda6a1a04..9a209b38f754 100644
--- a/tools/source/generic/color.cxx
+++ b/tools/source/generic/color.cxx
@@ -61,10 +61,10 @@ Color::Color( const ResId& rResId )
pResMgr->Increment( sizeof( RSHEADER_TYPE ) );
// Daten laden
- USHORT nRed = pResMgr->ReadShort();
- USHORT nGreen = pResMgr->ReadShort();
- USHORT nBlue = pResMgr->ReadShort();
- // one more historical ULONG
+ sal_uInt16 nRed = pResMgr->ReadShort();
+ sal_uInt16 nGreen = pResMgr->ReadShort();
+ sal_uInt16 nBlue = pResMgr->ReadShort();
+ // one more historical sal_uIntPtr
pResMgr->ReadLong();
// RGB-Farbe
@@ -75,60 +75,60 @@ Color::Color( const ResId& rResId )
mnColor = RGB_COLORDATA( 0, 0, 0 );
}
}
-UINT8 Color::GetColorError( const Color& rCompareColor ) const
+sal_uInt8 Color::GetColorError( const Color& rCompareColor ) const
{
const long nErrAbs = labs( (long) rCompareColor.GetRed() - GetRed() ) +
labs( (long) rCompareColor.GetGreen() - GetGreen() ) +
labs( (long) rCompareColor.GetBlue() - GetBlue() );
- return (UINT8) _FRound( nErrAbs * 0.3333333333 );
+ return (sal_uInt8) _FRound( nErrAbs * 0.3333333333 );
}
// -----------------------------------------------------------------------
-void Color::IncreaseLuminance( UINT8 cLumInc )
+void Color::IncreaseLuminance( sal_uInt8 cLumInc )
{
- SetRed( (UINT8) SAL_BOUND( (long) COLORDATA_RED( mnColor ) + cLumInc, 0L, 255L ) );
- SetGreen( (UINT8) SAL_BOUND( (long) COLORDATA_GREEN( mnColor ) + cLumInc, 0L, 255L ) );
- SetBlue( (UINT8) SAL_BOUND( (long) COLORDATA_BLUE( mnColor ) + cLumInc, 0L, 255L ) );
+ SetRed( (sal_uInt8) SAL_BOUND( (long) COLORDATA_RED( mnColor ) + cLumInc, 0L, 255L ) );
+ SetGreen( (sal_uInt8) SAL_BOUND( (long) COLORDATA_GREEN( mnColor ) + cLumInc, 0L, 255L ) );
+ SetBlue( (sal_uInt8) SAL_BOUND( (long) COLORDATA_BLUE( mnColor ) + cLumInc, 0L, 255L ) );
}
// -----------------------------------------------------------------------
-void Color::DecreaseLuminance( UINT8 cLumDec )
+void Color::DecreaseLuminance( sal_uInt8 cLumDec )
{
- SetRed( (UINT8) SAL_BOUND( (long) COLORDATA_RED( mnColor ) - cLumDec, 0L, 255L ) );
- SetGreen( (UINT8) SAL_BOUND( (long) COLORDATA_GREEN( mnColor ) - cLumDec, 0L, 255L ) );
- SetBlue( (UINT8) SAL_BOUND( (long) COLORDATA_BLUE( mnColor ) - cLumDec, 0L, 255L ) );
+ SetRed( (sal_uInt8) SAL_BOUND( (long) COLORDATA_RED( mnColor ) - cLumDec, 0L, 255L ) );
+ SetGreen( (sal_uInt8) SAL_BOUND( (long) COLORDATA_GREEN( mnColor ) - cLumDec, 0L, 255L ) );
+ SetBlue( (sal_uInt8) SAL_BOUND( (long) COLORDATA_BLUE( mnColor ) - cLumDec, 0L, 255L ) );
}
// -----------------------------------------------------------------------
-void Color::IncreaseContrast( UINT8 cContInc )
+void Color::IncreaseContrast( sal_uInt8 cContInc )
{
if( cContInc)
{
const double fM = 128.0 / ( 128.0 - 0.4985 * cContInc );
const double fOff = 128.0 - fM * 128.0;
- SetRed( (UINT8) SAL_BOUND( _FRound( COLORDATA_RED( mnColor ) * fM + fOff ), 0L, 255L ) );
- SetGreen( (UINT8) SAL_BOUND( _FRound( COLORDATA_GREEN( mnColor ) * fM + fOff ), 0L, 255L ) );
- SetBlue( (UINT8) SAL_BOUND( _FRound( COLORDATA_BLUE( mnColor ) * fM + fOff ), 0L, 255L ) );
+ SetRed( (sal_uInt8) SAL_BOUND( _FRound( COLORDATA_RED( mnColor ) * fM + fOff ), 0L, 255L ) );
+ SetGreen( (sal_uInt8) SAL_BOUND( _FRound( COLORDATA_GREEN( mnColor ) * fM + fOff ), 0L, 255L ) );
+ SetBlue( (sal_uInt8) SAL_BOUND( _FRound( COLORDATA_BLUE( mnColor ) * fM + fOff ), 0L, 255L ) );
}
}
// -----------------------------------------------------------------------
-void Color::DecreaseContrast( UINT8 cContDec )
+void Color::DecreaseContrast( sal_uInt8 cContDec )
{
if( cContDec )
{
const double fM = ( 128.0 - 0.4985 * cContDec ) / 128.0;
const double fOff = 128.0 - fM * 128.0;
- SetRed( (UINT8) SAL_BOUND( _FRound( COLORDATA_RED( mnColor ) * fM + fOff ), 0L, 255L ) );
- SetGreen( (UINT8) SAL_BOUND( _FRound( COLORDATA_GREEN( mnColor ) * fM + fOff ), 0L, 255L ) );
- SetBlue( (UINT8) SAL_BOUND( _FRound( COLORDATA_BLUE( mnColor ) * fM + fOff ), 0L, 255L ) );
+ SetRed( (sal_uInt8) SAL_BOUND( _FRound( COLORDATA_RED( mnColor ) * fM + fOff ), 0L, 255L ) );
+ SetGreen( (sal_uInt8) SAL_BOUND( _FRound( COLORDATA_GREEN( mnColor ) * fM + fOff ), 0L, 255L ) );
+ SetBlue( (sal_uInt8) SAL_BOUND( _FRound( COLORDATA_BLUE( mnColor ) * fM + fOff ), 0L, 255L ) );
}
}
@@ -143,14 +143,14 @@ void Color::Invert()
// -----------------------------------------------------------------------
-BOOL Color::IsDark() const
+sal_Bool Color::IsDark() const
{
return GetLuminance() <= 38;
}
// -----------------------------------------------------------------------
-BOOL Color::IsBright() const
+sal_Bool Color::IsBright() const
{
return GetLuminance() >= 245;
}
@@ -159,10 +159,10 @@ BOOL Color::IsBright() const
// color space conversion
// -----------------------------------------------------------------------
-void Color::RGBtoHSB( USHORT& nHue, USHORT& nSat, USHORT& nBri ) const
+void Color::RGBtoHSB( sal_uInt16& nHue, sal_uInt16& nSat, sal_uInt16& nBri ) const
{
- UINT8 c[3];
- UINT8 cMax, cMin;
+ sal_uInt8 c[3];
+ sal_uInt8 cMax, cMin;
c[0] = GetRed();
c[1] = GetGreen();
@@ -183,7 +183,7 @@ void Color::RGBtoHSB( USHORT& nHue, USHORT& nSat, USHORT& nBri ) const
if( c[2] < cMin )
cMin = c[2];
- UINT8 cDelta = cMax - cMin;
+ sal_uInt8 cDelta = cMax - cMin;
// Saturation = max - min / max
if( nBri > 0 )
@@ -214,14 +214,14 @@ void Color::RGBtoHSB( USHORT& nHue, USHORT& nSat, USHORT& nBri ) const
if( dHue < 0.0 )
dHue += 360.0;
- nHue = (UINT16) dHue;
+ nHue = (sal_uInt16) dHue;
}
}
-ColorData Color::HSBtoRGB( USHORT nHue, USHORT nSat, USHORT nBri )
+ColorData Color::HSBtoRGB( sal_uInt16 nHue, sal_uInt16 nSat, sal_uInt16 nBri )
{
- UINT8 cR=0,cG=0,cB=0;
- UINT8 nB = (UINT8) ( nBri * 255 / 100 );
+ sal_uInt8 cR=0,cG=0,cB=0;
+ sal_uInt8 nB = (sal_uInt8) ( nBri * 255 / 100 );
if( nSat == 0 )
{
@@ -233,17 +233,17 @@ ColorData Color::HSBtoRGB( USHORT nHue, USHORT nSat, USHORT nBri )
{
double dH = nHue;
double f;
- UINT16 n;
+ sal_uInt16 n;
if( dH == 360.0 )
dH = 0.0;
dH /= 60.0;
- n = (UINT16) dH;
+ n = (sal_uInt16) dH;
f = dH - n;
- UINT8 a = (UINT8) ( nB * ( 100 - nSat ) / 100 );
- UINT8 b = (UINT8) ( nB * ( 100 - ( (double)nSat * f + 0.5 ) ) / 100 );
- UINT8 c = (UINT8) ( nB * ( 100 - ( (double)nSat * ( 1.0 - f ) + 0.5 ) ) / 100 );
+ sal_uInt8 a = (sal_uInt8) ( nB * ( 100 - nSat ) / 100 );
+ sal_uInt8 b = (sal_uInt8) ( nB * ( 100 - ( (double)nSat * f ) ) / 100 );
+ sal_uInt8 c = (sal_uInt8) ( nB * ( 100 - ( (double)nSat * ( 1.0 - f ) ) ) / 100 );
switch( n )
{
@@ -261,7 +261,7 @@ ColorData Color::HSBtoRGB( USHORT nHue, USHORT nSat, USHORT nBri )
// -----------------------------------------------------------------------
-SvStream& Color::Read( SvStream& rIStm, BOOL bNewFormat )
+SvStream& Color::Read( SvStream& rIStm, sal_Bool bNewFormat )
{
if ( bNewFormat )
rIStm >> mnColor;
@@ -273,7 +273,7 @@ SvStream& Color::Read( SvStream& rIStm, BOOL bNewFormat )
// -----------------------------------------------------------------------
-SvStream& Color::Write( SvStream& rOStm, BOOL bNewFormat )
+SvStream& Color::Write( SvStream& rOStm, sal_Bool bNewFormat )
{
if ( bNewFormat )
rOStm << mnColor;
@@ -285,13 +285,13 @@ SvStream& Color::Write( SvStream& rOStm, BOOL bNewFormat )
// -----------------------------------------------------------------------
-#define COL_NAME_USER ((USHORT)0x8000)
-#define COL_RED_1B ((USHORT)0x0001)
-#define COL_RED_2B ((USHORT)0x0002)
-#define COL_GREEN_1B ((USHORT)0x0010)
-#define COL_GREEN_2B ((USHORT)0x0020)
-#define COL_BLUE_1B ((USHORT)0x0100)
-#define COL_BLUE_2B ((USHORT)0x0200)
+#define COL_NAME_USER ((sal_uInt16)0x8000)
+#define COL_RED_1B ((sal_uInt16)0x0001)
+#define COL_RED_2B ((sal_uInt16)0x0002)
+#define COL_GREEN_1B ((sal_uInt16)0x0010)
+#define COL_GREEN_2B ((sal_uInt16)0x0020)
+#define COL_BLUE_1B ((sal_uInt16)0x0100)
+#define COL_BLUE_2B ((sal_uInt16)0x0200)
// -----------------------------------------------------------------------
@@ -299,10 +299,10 @@ SvStream& operator>>( SvStream& rIStream, Color& rColor )
{
DBG_ASSERTWARNING( rIStream.GetVersion(), "Color::>> - Solar-Version not set on rIStream" );
- USHORT nColorName;
- USHORT nRed;
- USHORT nGreen;
- USHORT nBlue;
+ sal_uInt16 nColorName;
+ sal_uInt16 nRed;
+ sal_uInt16 nGreen;
+ sal_uInt16 nBlue;
rIStream >> nColorName;
@@ -311,7 +311,7 @@ SvStream& operator>>( SvStream& rIStream, Color& rColor )
if ( rIStream.GetCompressMode() == COMPRESSMODE_FULL )
{
unsigned char cAry[6];
- USHORT i = 0;
+ sal_uInt16 i = 0;
nRed = 0;
nGreen = 0;
@@ -437,10 +437,10 @@ SvStream& operator<<( SvStream& rOStream, const Color& rColor )
{
DBG_ASSERTWARNING( rOStream.GetVersion(), "Color::<< - Solar-Version not set on rOStream" );
- USHORT nColorName = COL_NAME_USER;
- USHORT nRed = rColor.GetRed();
- USHORT nGreen = rColor.GetGreen();
- USHORT nBlue = rColor.GetBlue();
+ sal_uInt16 nColorName = COL_NAME_USER;
+ sal_uInt16 nRed = rColor.GetRed();
+ sal_uInt16 nGreen = rColor.GetGreen();
+ sal_uInt16 nBlue = rColor.GetBlue();
nRed = (nRed<<8) + nRed;
nGreen = (nGreen<<8) + nGreen;
nBlue = (nBlue<<8) + nBlue;
@@ -448,7 +448,7 @@ SvStream& operator<<( SvStream& rOStream, const Color& rColor )
if ( rOStream.GetCompressMode() == COMPRESSMODE_FULL )
{
unsigned char cAry[6];
- USHORT i = 0;
+ sal_uInt16 i = 0;
if ( nRed & 0x00FF )
{
diff --git a/tools/source/generic/config.cxx b/tools/source/generic/config.cxx
index b0c9eaf9ddae..6c533459f2a7 100644
--- a/tools/source/generic/config.cxx
+++ b/tools/source/generic/config.cxx
@@ -57,7 +57,7 @@ struct ImplKeyData
ImplKeyData* mpNext;
ByteString maKey;
ByteString maValue;
- BOOL mbIsComment;
+ sal_Bool mbIsComment;
};
struct ImplGroupData
@@ -65,20 +65,20 @@ struct ImplGroupData
ImplGroupData* mpNext;
ImplKeyData* mpFirstKey;
ByteString maGroupName;
- USHORT mnEmptyLines;
+ sal_uInt16 mnEmptyLines;
};
struct ImplConfigData
{
ImplGroupData* mpFirstGroup;
XubString maFileName;
- ULONG mnDataUpdateId;
- ULONG mnTimeStamp;
+ sal_uIntPtr mnDataUpdateId;
+ sal_uIntPtr mnTimeStamp;
LineEnd meLineEnd;
- USHORT mnRefCount;
- BOOL mbModified;
- BOOL mbRead;
- BOOL mbIsUTF8BOM;
+ sal_uInt16 mnRefCount;
+ sal_Bool mbModified;
+ sal_Bool mbRead;
+ sal_Bool mbIsUTF8BOM;
};
// =======================================================================
@@ -104,9 +104,9 @@ static String toUncPath( const String& rPath )
return aFileURL;
}
-static ULONG ImplSysGetConfigTimeStamp( const XubString& rFileName )
+static sal_uIntPtr ImplSysGetConfigTimeStamp( const XubString& rFileName )
{
- ULONG nTimeStamp = 0;
+ sal_uIntPtr nTimeStamp = 0;
::osl::DirectoryItem aItem;
::osl::FileStatus aStatus( osl_FileStatus_Mask_ModifyTime );
@@ -122,10 +122,10 @@ static ULONG ImplSysGetConfigTimeStamp( const XubString& rFileName )
// -----------------------------------------------------------------------
-static BYTE* ImplSysReadConfig( const XubString& rFileName,
- sal_uInt64& rRead, BOOL& rbRead, BOOL& rbIsUTF8BOM, ULONG& rTimeStamp )
+static sal_uInt8* ImplSysReadConfig( const XubString& rFileName,
+ sal_uInt64& rRead, sal_Bool& rbRead, sal_Bool& rbIsUTF8BOM, sal_uIntPtr& rTimeStamp )
{
- BYTE* pBuf = NULL;
+ sal_uInt8* pBuf = NULL;
::osl::File aFile( rFileName );
if( aFile.open( osl_File_OpenFlag_Read ) == ::osl::FileBase::E_None )
@@ -137,7 +137,7 @@ static BYTE* ImplSysReadConfig( const XubString& rFileName,
aFile.close();
return 0;
}
- pBuf = new BYTE[static_cast< std::size_t >(nPos)];
+ pBuf = new sal_uInt8[static_cast< std::size_t >(nPos)];
sal_uInt64 nRead = 0;
if( aFile.read( pBuf, nPos, nRead ) == ::osl::FileBase::E_None && nRead == nPos )
{
@@ -146,12 +146,12 @@ static BYTE* ImplSysReadConfig( const XubString& rFileName,
if (nRead > 2 && memcmp(pBuf, BOM, 3) == 0)
{
nRead -= 3;
- rtl_moveMemory(pBuf, pBuf + 3, sal::static_int_cast<sal_Size>(nRead * sizeof(BYTE)) );
- rbIsUTF8BOM = TRUE;
+ rtl_moveMemory(pBuf, pBuf + 3, sal::static_int_cast<sal_Size>(nRead * sizeof(sal_uInt8)) );
+ rbIsUTF8BOM = sal_True;
}
rTimeStamp = ImplSysGetConfigTimeStamp( rFileName );
- rbRead = TRUE;
+ rbRead = sal_True;
rRead = nRead;
}
else
@@ -168,11 +168,11 @@ static BYTE* ImplSysReadConfig( const XubString& rFileName,
// -----------------------------------------------------------------------
-static BOOL ImplSysWriteConfig( const XubString& rFileName,
- const BYTE* pBuf, ULONG nBufLen, BOOL rbIsUTF8BOM, ULONG& rTimeStamp )
+static sal_Bool ImplSysWriteConfig( const XubString& rFileName,
+ const sal_uInt8* pBuf, sal_uIntPtr nBufLen, sal_Bool rbIsUTF8BOM, sal_uIntPtr& rTimeStamp )
{
- BOOL bSuccess = FALSE;
- BOOL bUTF8BOMSuccess = FALSE;
+ sal_Bool bSuccess = sal_False;
+ sal_Bool bUTF8BOMSuccess = sal_False;
::osl::File aFile( rFileName );
::osl::FileBase::RC eError = aFile.open( osl_File_OpenFlag_Write | osl_File_OpenFlag_Create );
@@ -191,13 +191,13 @@ static BOOL ImplSysWriteConfig( const XubString& rFileName,
sal_uInt64 nUTF8BOMWritten;
if( aFile.write( BOM, 3, nUTF8BOMWritten ) == ::osl::FileBase::E_None && 3 == nUTF8BOMWritten )
{
- bUTF8BOMSuccess = TRUE;
+ bUTF8BOMSuccess = sal_True;
}
}
if( aFile.write( pBuf, nBufLen, nWritten ) == ::osl::FileBase::E_None && nWritten == nBufLen )
{
- bSuccess = TRUE;
+ bSuccess = sal_True;
}
if ( rbIsUTF8BOM ? bSuccess && bUTF8BOMSuccess : bSuccess )
{
@@ -260,7 +260,7 @@ static String ImplMakeConfigName( const XubString* pFileName,
namespace {
-ByteString makeByteString(BYTE const * p, sal_uInt64 n) {
+ByteString makeByteString(sal_uInt8 const * p, sal_uInt64 n) {
if (n > STRING_MAXLEN) {
#ifdef WNT
abort();
@@ -276,7 +276,7 @@ ByteString makeByteString(BYTE const * p, sal_uInt64 n) {
}
static void ImplMakeConfigList( ImplConfigData* pData,
- const BYTE* pBuf, sal_uInt64 nLen )
+ const sal_uInt8* pBuf, sal_uInt64 nLen )
{
// kein Buffer, keine Daten
if ( !nLen )
@@ -288,7 +288,7 @@ static void ImplMakeConfigList( ImplConfigData* pData,
xub_StrLen nNameLen;
xub_StrLen nKeyLen;
sal_uInt64 i;
- const BYTE* pLine;
+ const sal_uInt8* pLine;
ImplKeyData* pPrevKey = NULL;
ImplKeyData* pKey;
ImplGroupData* pPrevGroup = NULL;
@@ -382,7 +382,7 @@ static void ImplMakeConfigList( ImplConfigData* pData,
while ( pGroup->mnEmptyLines )
{
pKey = new ImplKeyData;
- pKey->mbIsComment = TRUE;
+ pKey->mbIsComment = sal_True;
pPrevKey->mpNext = pKey;
pPrevKey = pKey;
pGroup->mnEmptyLines--;
@@ -400,11 +400,11 @@ static void ImplMakeConfigList( ImplConfigData* pData,
if ( pLine[0] == ';' )
{
pKey->maValue = makeByteString(pLine, nLineLen);
- pKey->mbIsComment = TRUE;
+ pKey->mbIsComment = sal_True;
}
else
{
- pKey->mbIsComment = FALSE;
+ pKey->mbIsComment = sal_False;
nNameLen = 0;
while ( (nNameLen < nLineLen) && (pLine[nNameLen] != '=') )
nNameLen++;
@@ -451,17 +451,17 @@ static void ImplMakeConfigList( ImplConfigData* pData,
// -----------------------------------------------------------------------
-static BYTE* ImplGetConfigBuffer( const ImplConfigData* pData, ULONG& rLen )
+static sal_uInt8* ImplGetConfigBuffer( const ImplConfigData* pData, sal_uIntPtr& rLen )
{
- BYTE* pWriteBuf;
- BYTE* pBuf;
- BYTE aLineEndBuf[2] = {0, 0};
+ sal_uInt8* pWriteBuf;
+ sal_uInt8* pBuf;
+ sal_uInt8 aLineEndBuf[2] = {0, 0};
ImplKeyData* pKey;
ImplGroupData* pGroup;
unsigned int nBufLen;
- USHORT nValueLen;
- USHORT nKeyLen;
- USHORT nLineEndLen;
+ sal_uInt16 nValueLen;
+ sal_uInt16 nKeyLen;
+ sal_uInt16 nLineEndLen;
if ( pData->meLineEnd == LINEEND_CR )
{
@@ -514,7 +514,7 @@ static BYTE* ImplGetConfigBuffer( const ImplConfigData* pData, ULONG& rLen )
rLen = nBufLen;
if ( !nBufLen )
{
- pWriteBuf = new BYTE[nLineEndLen];
+ pWriteBuf = new sal_uInt8[nLineEndLen];
if ( pWriteBuf )
{
pWriteBuf[0] = aLineEndBuf[0];
@@ -527,7 +527,7 @@ static BYTE* ImplGetConfigBuffer( const ImplConfigData* pData, ULONG& rLen )
}
// Schreibbuffer anlegen (wird vom Aufrufer zerstoert)
- pWriteBuf = new BYTE[nBufLen];
+ pWriteBuf = new sal_uInt8[nBufLen];
if ( !pWriteBuf )
return 0;
@@ -584,7 +584,7 @@ static BYTE* ImplGetConfigBuffer( const ImplConfigData* pData, ULONG& rLen )
}
// Leerzeile nach jeder Gruppe auch wieder speichern
- USHORT nEmptyLines = pGroup->mnEmptyLines;
+ sal_uInt16 nEmptyLines = pGroup->mnEmptyLines;
while ( nEmptyLines )
{
*pBuf = aLineEndBuf[0]; pBuf++;
@@ -606,11 +606,11 @@ static BYTE* ImplGetConfigBuffer( const ImplConfigData* pData, ULONG& rLen )
static void ImplReadConfig( ImplConfigData* pData )
{
- ULONG nTimeStamp = 0;
+ sal_uIntPtr nTimeStamp = 0;
sal_uInt64 nRead = 0;
- BOOL bRead = FALSE;
- BOOL bIsUTF8BOM =FALSE;
- BYTE* pBuf = ImplSysReadConfig( pData->maFileName, nRead, bRead, bIsUTF8BOM, nTimeStamp );
+ sal_Bool bRead = sal_False;
+ sal_Bool bIsUTF8BOM =sal_False;
+ sal_uInt8* pBuf = ImplSysReadConfig( pData->maFileName, nRead, bRead, bIsUTF8BOM, nTimeStamp );
// Aus dem Buffer die Config-Verwaltungsliste aufbauen
if ( pBuf )
@@ -619,11 +619,11 @@ static void ImplReadConfig( ImplConfigData* pData )
delete[] pBuf;
}
pData->mnTimeStamp = nTimeStamp;
- pData->mbModified = FALSE;
+ pData->mbModified = sal_False;
if ( bRead )
- pData->mbRead = TRUE;
+ pData->mbRead = sal_True;
if ( bIsUTF8BOM )
- pData->mbIsUTF8BOM = TRUE;
+ pData->mbIsUTF8BOM = sal_True;
}
// -----------------------------------------------------------------------
@@ -641,16 +641,16 @@ static void ImplWriteConfig( ImplConfigData* pData )
#endif
// Aus der Config-Liste einen Buffer zusammenbauen
- ULONG nBufLen;
- BYTE* pBuf = ImplGetConfigBuffer( pData, nBufLen );
+ sal_uIntPtr nBufLen;
+ sal_uInt8* pBuf = ImplGetConfigBuffer( pData, nBufLen );
if ( pBuf )
{
if ( ImplSysWriteConfig( pData->maFileName, pBuf, nBufLen, pData->mbIsUTF8BOM, pData->mnTimeStamp ) )
- pData->mbModified = FALSE;
+ pData->mbModified = sal_False;
delete[] pBuf;
}
else
- pData->mbModified = FALSE;
+ pData->mbModified = sal_False;
}
// -----------------------------------------------------------------------
@@ -694,8 +694,8 @@ static ImplConfigData* ImplGetConfigData( const XubString& rFileName )
pData->mnDataUpdateId = 0;
pData->meLineEnd = LINEEND_CRLF;
pData->mnRefCount = 0;
- pData->mbRead = FALSE;
- pData->mbIsUTF8BOM = FALSE;
+ pData->mbRead = sal_False;
+ pData->mbIsUTF8BOM = sal_False;
ImplReadConfig( pData );
return pData;
@@ -711,7 +711,7 @@ static void ImplFreeConfigData( ImplConfigData* pDelData )
// =======================================================================
-BOOL Config::ImplUpdateConfig() const
+sal_Bool Config::ImplUpdateConfig() const
{
// Wenn sich TimeStamp unterscheidet, dann Datei neu einlesen
if ( mpData->mnTimeStamp != ImplSysGetConfigTimeStamp( maFileName ) )
@@ -719,10 +719,10 @@ BOOL Config::ImplUpdateConfig() const
ImplDeleteConfigData( mpData );
ImplReadConfig( mpData );
mpData->mnDataUpdateId++;
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -776,7 +776,7 @@ Config::Config()
mpActGroup = NULL;
mnDataUpdateId = 0;
mnLockCount = 1;
- mbPersistence = TRUE;
+ mbPersistence = sal_True;
#ifdef DBG_UTIL
OSL_TRACE( "Config::Config()" );
@@ -793,7 +793,7 @@ Config::Config( const XubString& rFileName )
mpActGroup = NULL;
mnDataUpdateId = 0;
mnLockCount = 1;
- mbPersistence = TRUE;
+ mbPersistence = sal_True;
#ifdef DBG_UTIL
ByteString aTraceStr( "Config::Config( " );
@@ -856,7 +856,7 @@ void Config::DeleteGroup( const ByteString& rGroup )
if ( !mnLockCount || !mpData->mbRead )
{
ImplUpdateConfig();
- mpData->mbRead = TRUE;
+ mpData->mbRead = sal_True;
}
ImplGroupData* pPrevGroup = NULL;
@@ -894,7 +894,7 @@ void Config::DeleteGroup( const ByteString& rGroup )
ImplWriteConfig( mpData );
else
{
- mpData->mbModified = TRUE;
+ mpData->mbModified = sal_True;
}
// Gruppen auf ungluetig setzen
@@ -905,14 +905,14 @@ void Config::DeleteGroup( const ByteString& rGroup )
// -----------------------------------------------------------------------
-ByteString Config::GetGroupName( USHORT nGroup ) const
+ByteString Config::GetGroupName( sal_uInt16 nGroup ) const
{
// Config-Daten evt. updaten
if ( !mnLockCount )
ImplUpdateConfig();
ImplGroupData* pGroup = mpData->mpFirstGroup;
- USHORT nGroupCount = 0;
+ sal_uInt16 nGroupCount = 0;
ByteString aGroupName;
while ( pGroup )
{
@@ -931,14 +931,14 @@ ByteString Config::GetGroupName( USHORT nGroup ) const
// -----------------------------------------------------------------------
-USHORT Config::GetGroupCount() const
+sal_uInt16 Config::GetGroupCount() const
{
// Config-Daten evt. updaten
if ( !mnLockCount )
ImplUpdateConfig();
ImplGroupData* pGroup = mpData->mpFirstGroup;
- USHORT nGroupCount = 0;
+ sal_uInt16 nGroupCount = 0;
while ( pGroup )
{
nGroupCount++;
@@ -950,20 +950,20 @@ USHORT Config::GetGroupCount() const
// -----------------------------------------------------------------------
-BOOL Config::HasGroup( const ByteString& rGroup ) const
+sal_Bool Config::HasGroup( const ByteString& rGroup ) const
{
// Config-Daten evt. updaten
if ( !mnLockCount )
ImplUpdateConfig();
ImplGroupData* pGroup = mpData->mpFirstGroup;
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
while( pGroup )
{
if( pGroup->maGroupName.EqualsIgnoreCaseAscii( rGroup ) )
{
- bRet = TRUE;
+ bRet = sal_True;
break;
}
@@ -1045,7 +1045,7 @@ void Config::WriteKey( const ByteString& rKey, const ByteString& rStr )
if ( !mnLockCount || !mpData->mbRead )
{
ImplUpdateConfig();
- mpData->mbRead = TRUE;
+ mpData->mbRead = sal_True;
}
// Key suchen und Value setzen
@@ -1063,18 +1063,18 @@ void Config::WriteKey( const ByteString& rKey, const ByteString& rStr )
pKey = pKey->mpNext;
}
- BOOL bNewValue;
+ sal_Bool bNewValue;
if ( !pKey )
{
pKey = new ImplKeyData;
pKey->mpNext = NULL;
pKey->maKey = rKey;
- pKey->mbIsComment = FALSE;
+ pKey->mbIsComment = sal_False;
if ( pPrevKey )
pPrevKey->mpNext = pKey;
else
pGroup->mpFirstKey = pKey;
- bNewValue = TRUE;
+ bNewValue = sal_True;
}
else
bNewValue = pKey->maValue != rStr;
@@ -1087,7 +1087,7 @@ void Config::WriteKey( const ByteString& rKey, const ByteString& rStr )
ImplWriteConfig( mpData );
else
{
- mpData->mbModified = TRUE;
+ mpData->mbModified = sal_True;
}
}
}
@@ -1110,7 +1110,7 @@ void Config::DeleteKey( const ByteString& rKey )
if ( !mnLockCount || !mpData->mbRead )
{
ImplUpdateConfig();
- mpData->mbRead = TRUE;
+ mpData->mbRead = sal_True;
}
// Key suchen und Value setzen
@@ -1142,7 +1142,7 @@ void Config::DeleteKey( const ByteString& rKey )
ImplWriteConfig( mpData );
else
{
- mpData->mbModified = TRUE;
+ mpData->mbModified = sal_True;
}
}
}
@@ -1150,7 +1150,7 @@ void Config::DeleteKey( const ByteString& rKey )
// -----------------------------------------------------------------------
-USHORT Config::GetKeyCount() const
+sal_uInt16 Config::GetKeyCount() const
{
#ifdef DBG_UTIL
ByteString aTraceStr( "Config::GetKeyCount()" );
@@ -1166,7 +1166,7 @@ USHORT Config::GetKeyCount() const
ImplUpdateConfig();
// Key suchen und Value zurueckgeben
- USHORT nCount = 0;
+ sal_uInt16 nCount = 0;
ImplGroupData* pGroup = ImplGetGroup();
if ( pGroup )
{
@@ -1185,7 +1185,7 @@ USHORT Config::GetKeyCount() const
// -----------------------------------------------------------------------
-ByteString Config::GetKeyName( USHORT nKey ) const
+ByteString Config::GetKeyName( sal_uInt16 nKey ) const
{
#ifdef DBG_UTIL
ByteString aTraceStr( "Config::GetKeyName( " );
@@ -1220,7 +1220,7 @@ ByteString Config::GetKeyName( USHORT nKey ) const
// -----------------------------------------------------------------------
-ByteString Config::ReadKey( USHORT nKey ) const
+ByteString Config::ReadKey( sal_uInt16 nKey ) const
{
#ifdef DBG_UTIL
ByteString aTraceStr( "Config::ReadKey( " );
@@ -1277,7 +1277,7 @@ void Config::LeaveLock()
// -----------------------------------------------------------------------
-BOOL Config::Update()
+sal_Bool Config::Update()
{
return ImplUpdateConfig();
}
diff --git a/tools/source/generic/fract.cxx b/tools/source/generic/fract.cxx
index 7dbdbaf3f419..104662b4ff7b 100644
--- a/tools/source/generic/fract.cxx
+++ b/tools/source/generic/fract.cxx
@@ -49,7 +49,7 @@
// Die Funktion GetGGT berechnet den groessten gemeinsamen Teiler der
// beiden als Parameter uebergebenen Werte nVal1 und nVal2 nach dem
// Algorithmus von Euklid. Hat einer der beiden Parameter den Wert 0 oder
-// 1, so wird als Ergebnis der Wert 1 zurŸckgegeben. Da der Algorithmus
+// 1, so wird als Ergebnis der Wert 1 zur�ckgegeben. Da der Algorithmus
// nur mit positiven Zahlen arbeitet, werden die beiden Parameter
// entsprechend umgewandelt.
// Zum Algorithmus: die beiden Parameter werden solange ducheinander
@@ -594,7 +594,7 @@ void Fraction::ReduceInaccurate( unsigned nSignificantBits )
bool operator == ( const Fraction& rVal1, const Fraction& rVal2 )
{
if ( !rVal1.IsValid() || !rVal2.IsValid() )
- return FALSE;
+ return false;
return rVal1.nNumerator == rVal2.nNumerator
&& rVal1.nDenominator == rVal2.nDenominator;
@@ -616,7 +616,7 @@ bool operator == ( const Fraction& rVal1, const Fraction& rVal2 )
bool operator < ( const Fraction& rVal1, const Fraction& rVal2 )
{
if ( !rVal1.IsValid() || !rVal2.IsValid() )
- return FALSE;
+ return false;
BigInt nN( rVal1.nNumerator );
nN *= BigInt( rVal2.nDenominator );
@@ -642,7 +642,7 @@ bool operator < ( const Fraction& rVal1, const Fraction& rVal2 )
bool operator > ( const Fraction& rVal1, const Fraction& rVal2 )
{
if ( !rVal1.IsValid() || !rVal2.IsValid() )
- return FALSE;
+ return false;
BigInt nN( rVal1.nNumerator );
nN *= BigInt( rVal2.nDenominator );
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx
index 591873558ca5..8d72b1ab4cff 100644
--- a/tools/source/generic/gen.cxx
+++ b/tools/source/generic/gen.cxx
@@ -45,7 +45,7 @@ SvStream& operator>>( SvStream& rIStream, Pair& rPair )
int i;
int i1;
int i2;
- UINT32 nNum;
+ sal_uInt32 nNum;
rIStream >> cId;
i1 = (cId & 0x70) >> 4;
@@ -62,7 +62,7 @@ SvStream& operator>>( SvStream& rIStream, Pair& rPair )
}
if ( cId & 0x80 )
nNum ^= 0xFFFFFFFF;
- rPair.nA = (INT32)nNum;
+ rPair.nA = (sal_Int32)nNum;
nNum = 0;
i = i1+i2;
@@ -74,7 +74,7 @@ SvStream& operator>>( SvStream& rIStream, Pair& rPair )
}
if ( cId & 0x08 )
nNum ^= 0xFFFFFFFF;
- rPair.nB = (INT32)nNum;
+ rPair.nB = (sal_Int32)nNum;
}
else
{
@@ -94,11 +94,11 @@ SvStream& operator<<( SvStream& rOStream, const Pair& rPair )
{
unsigned char cAry[9];
int i = 1;
- UINT32 nNum;
+ sal_uInt32 nNum;
cAry[0] = 0;
- nNum = (UINT32)(INT32)rPair.nA;
+ nNum = (sal_uInt32)(sal_Int32)rPair.nA;
if ( rPair.nA < 0 )
{
cAry[0] |= 0x80;
@@ -139,7 +139,7 @@ SvStream& operator<<( SvStream& rOStream, const Pair& rPair )
cAry[0] |= 0x10;
}
- nNum = (UINT32)(INT32)rPair.nB;
+ nNum = (sal_uInt32)(sal_Int32)rPair.nB;
if ( rPair.nB < 0 )
{
cAry[0] |= 0x08;
@@ -304,31 +304,31 @@ void Rectangle::Justify()
|*
*************************************************************************/
-BOOL Rectangle::IsInside( const Point& rPoint ) const
+sal_Bool Rectangle::IsInside( const Point& rPoint ) const
{
if ( IsEmpty() )
- return FALSE;
+ return sal_False;
- BOOL bRet = TRUE;
+ sal_Bool bRet = sal_True;
if ( nLeft <= nRight )
{
if ( (rPoint.X() < nLeft) || (rPoint.X() > nRight) )
- bRet = FALSE;
+ bRet = sal_False;
}
else
{
if ( (rPoint.X() > nLeft) || (rPoint.X() < nRight) )
- bRet = FALSE;
+ bRet = sal_False;
}
if ( nTop <= nBottom )
{
if ( (rPoint.Y() < nTop) || (rPoint.Y() > nBottom) )
- bRet = FALSE;
+ bRet = sal_False;
}
else
{
if ( (rPoint.Y() > nTop) || (rPoint.Y() < nBottom) )
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
}
@@ -339,12 +339,12 @@ BOOL Rectangle::IsInside( const Point& rPoint ) const
|*
*************************************************************************/
-BOOL Rectangle::IsInside( const Rectangle& rRect ) const
+sal_Bool Rectangle::IsInside( const Rectangle& rRect ) const
{
if ( IsInside( rRect.TopLeft() ) && IsInside( rRect.BottomRight() ) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -353,7 +353,7 @@ BOOL Rectangle::IsInside( const Rectangle& rRect ) const
|*
*************************************************************************/
-BOOL Rectangle::IsOver( const Rectangle& rRect ) const
+sal_Bool Rectangle::IsOver( const Rectangle& rRect ) const
{
// Wenn sie sich nicht schneiden, ueberlappen sie auch nicht
return !GetIntersection( rRect ).IsEmpty();
@@ -375,7 +375,7 @@ SvStream& operator>>( SvStream& rIStream, Rectangle& rRect )
int i2;
int i3;
int i4;
- UINT32 nNum;
+ sal_uInt32 nNum;
rIStream.Read( cIdAry, 2 );
i1 = (cIdAry[0] & 0x70) >> 4;
@@ -396,7 +396,7 @@ SvStream& operator>>( SvStream& rIStream, Rectangle& rRect )
iLast = i1;
if ( cIdAry[0] & 0x80 )
nNum ^= 0xFFFFFFFF;
- rRect.nLeft = (INT32)nNum;
+ rRect.nLeft = (sal_Int32)nNum;
nNum = 0;
i = iLast+i2;
@@ -409,7 +409,7 @@ SvStream& operator>>( SvStream& rIStream, Rectangle& rRect )
iLast += i2;
if ( cIdAry[0] & 0x08 )
nNum ^= 0xFFFFFFFF;
- rRect.nTop = (INT32)nNum;
+ rRect.nTop = (sal_Int32)nNum;
nNum = 0;
i = iLast+i3;
@@ -422,7 +422,7 @@ SvStream& operator>>( SvStream& rIStream, Rectangle& rRect )
iLast += i3;
if ( cIdAry[1] & 0x80 )
nNum ^= 0xFFFFFFFF;
- rRect.nRight = (INT32)nNum;
+ rRect.nRight = (sal_Int32)nNum;
nNum = 0;
i = iLast+i4;
@@ -434,7 +434,7 @@ SvStream& operator>>( SvStream& rIStream, Rectangle& rRect )
}
if ( cIdAry[1] & 0x08 )
nNum ^= 0xFFFFFFFF;
- rRect.nBottom = (INT32)nNum;
+ rRect.nBottom = (sal_Int32)nNum;
}
else
{
@@ -454,12 +454,12 @@ SvStream& operator<<( SvStream& rOStream, const Rectangle& rRect )
{
unsigned char cAry[18];
int i = 2;
- UINT32 nNum;
+ sal_uInt32 nNum;
cAry[0] = 0;
cAry[1] = 0;
- nNum = (UINT32)(INT32)rRect.nLeft;
+ nNum = (sal_uInt32)(sal_Int32)rRect.nLeft;
if ( rRect.nLeft < 0 )
{
cAry[0] |= 0x80;
@@ -500,7 +500,7 @@ SvStream& operator<<( SvStream& rOStream, const Rectangle& rRect )
cAry[0] |= 0x10;
}
- nNum = (UINT32)(INT32)rRect.nTop;
+ nNum = (sal_uInt32)(sal_Int32)rRect.nTop;
if ( rRect.nTop < 0 )
{
cAry[0] |= 0x08;
@@ -541,7 +541,7 @@ SvStream& operator<<( SvStream& rOStream, const Rectangle& rRect )
cAry[0] |= 0x01;
}
- nNum = (UINT32)(INT32)rRect.nRight;
+ nNum = (sal_uInt32)(sal_Int32)rRect.nRight;
if ( rRect.nRight < 0 )
{
cAry[1] |= 0x80;
@@ -582,7 +582,7 @@ SvStream& operator<<( SvStream& rOStream, const Rectangle& rRect )
cAry[1] |= 0x10;
}
- nNum = (UINT32)(INT32)rRect.nBottom;
+ nNum = (sal_uInt32)(sal_Int32)rRect.nBottom;
if ( rRect.nBottom < 0 )
{
cAry[1] |= 0x08;
diff --git a/tools/source/generic/line.cxx b/tools/source/generic/line.cxx
index 54422858a995..c8558b7bf949 100644
--- a/tools/source/generic/line.cxx
+++ b/tools/source/generic/line.cxx
@@ -48,50 +48,50 @@ double Line::GetLength() const
// ------------------------------------------------------------------------
-BOOL Line::Intersection( const Line& rLine, Point& rIntersection ) const
+sal_Bool Line::Intersection( const Line& rLine, Point& rIntersection ) const
{
double fX, fY;
- BOOL bRet;
+ sal_Bool bRet;
if( Intersection( rLine, fX, fY ) )
{
rIntersection.X() = FRound( fX );
rIntersection.Y() = FRound( fY );
- bRet = TRUE;
+ bRet = sal_True;
}
else
- bRet = FALSE;
+ bRet = sal_False;
return bRet;
}
// ------------------------------------------------------------------------
-BOOL Line::Intersection( const Line& rLine, double& rIntersectionX, double& rIntersectionY ) const
+sal_Bool Line::Intersection( const Line& rLine, double& rIntersectionX, double& rIntersectionY ) const
{
const double fAx = maEnd.X() - maStart.X();
const double fAy = maEnd.Y() - maStart.Y();
const double fBx = rLine.maStart.X() - rLine.maEnd.X();
const double fBy = rLine.maStart.Y() - rLine.maEnd.Y();
const double fDen = fAy * fBx - fAx * fBy;
- BOOL bOk = FALSE;
+ sal_Bool bOk = sal_False;
if( fDen != 0. )
{
const double fCx = maStart.X() - rLine.maStart.X();
const double fCy = maStart.Y() - rLine.maStart.Y();
const double fA = fBy * fCx - fBx * fCy;
- const BOOL bGreater = ( fDen > 0. );
+ const sal_Bool bGreater = ( fDen > 0. );
- bOk = TRUE;
+ bOk = sal_True;
if ( bGreater )
{
if ( ( fA < 0. ) || ( fA > fDen ) )
- bOk = FALSE;
+ bOk = sal_False;
}
else if ( ( fA > 0. ) || ( fA < fDen ) )
- bOk = FALSE;
+ bOk = sal_False;
if ( bOk )
{
@@ -100,10 +100,10 @@ BOOL Line::Intersection( const Line& rLine, double& rIntersectionX, double& rInt
if ( bGreater )
{
if ( ( fB < 0. ) || ( fB > fDen ) )
- bOk = FALSE;
+ bOk = sal_False;
}
else if ( ( fB > 0. ) || ( fB < fDen ) )
- bOk = FALSE;
+ bOk = sal_False;
if( bOk )
{
@@ -120,11 +120,11 @@ BOOL Line::Intersection( const Line& rLine, double& rIntersectionX, double& rInt
// ------------------------------------------------------------------------
-BOOL Line::Intersection( const Rectangle& rRect, Line& rIntersection ) const
+sal_Bool Line::Intersection( const Rectangle& rRect, Line& rIntersection ) const
{
- const BOOL bStartInside = rRect.IsInside( maStart );
- const BOOL bEndInside = rRect.IsInside( maEnd );
- BOOL bRet = TRUE;
+ const sal_Bool bStartInside = rRect.IsInside( maStart );
+ const sal_Bool bEndInside = rRect.IsInside( maEnd );
+ sal_Bool bRet = sal_True;
if( bStartInside && bEndInside )
{
@@ -171,7 +171,7 @@ BOOL Line::Intersection( const Rectangle& rRect, Line& rIntersection ) const
rIntersection.maEnd = rIntersection.maStart;
}
else
- bRet = FALSE;
+ bRet = sal_False;
}
return bRet;
diff --git a/tools/source/generic/link.cxx b/tools/source/generic/link.cxx
index 60231889556e..8b5615e964bd 100644
--- a/tools/source/generic/link.cxx
+++ b/tools/source/generic/link.cxx
@@ -36,22 +36,22 @@
|*
*************************************************************************/
-BOOL Link::operator==( const Link& rLink ) const
+sal_Bool Link::operator==( const Link& rLink ) const
{
if ( pFunc == rLink.pFunc )
{
if ( pFunc )
{
if ( pInst == rLink.pInst )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
else
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/generic/makefile.mk b/tools/source/generic/makefile.mk
deleted file mode 100644
index 07bab82f32b0..000000000000
--- a/tools/source/generic/makefile.mk
+++ /dev/null
@@ -1,71 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=gen
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-EXCEPTIONSFILES = $(SLO)$/poly.obj $(OBJ)$/poly.obj $(SLO)$/svlibrary.obj
-
-SLOFILES= $(SLO)$/toolsin.obj \
- $(SLO)$/svlibrary.obj \
- $(SLO)$/b3dtrans.obj \
- $(SLO)$/link.obj \
- $(SLO)$/bigint.obj \
- $(SLO)$/fract.obj \
- $(SLO)$/color.obj \
- $(SLO)$/gen.obj \
- $(SLO)$/config.obj \
- $(SLO)$/poly.obj \
- $(SLO)$/poly2.obj \
- $(SLO)$/svborder.obj \
- $(SLO)$/line.obj
-
-OBJFILES= $(OBJ)$/toolsin.obj \
- $(OBJ)$/b3dtrans.obj \
- $(OBJ)$/link.obj \
- $(OBJ)$/bigint.obj \
- $(OBJ)$/fract.obj \
- $(OBJ)$/color.obj \
- $(OBJ)$/gen.obj \
- $(OBJ)$/config.obj \
- $(OBJ)$/poly.obj \
- $(OBJ)$/poly2.obj \
- $(OBJ)$/svborder.obj \
- $(OBJ)$/line.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index ccf35d259bc5..ea1fbb3b8e14 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -77,19 +77,19 @@ static ImplPolygonData aStaticImplPolygon =
// =======================================================================
-ImplPolygon::ImplPolygon( USHORT nInitSize, BOOL bFlags )
+ImplPolygon::ImplPolygon( sal_uInt16 nInitSize, sal_Bool bFlags )
{
if ( nInitSize )
{
- mpPointAry = (Point*)new char[(ULONG)nInitSize*sizeof(Point)];
- memset( mpPointAry, 0, (ULONG)nInitSize*sizeof(Point) );
+ mpPointAry = (Point*)new char[(sal_uIntPtr)nInitSize*sizeof(Point)];
+ memset( mpPointAry, 0, (sal_uIntPtr)nInitSize*sizeof(Point) );
}
else
mpPointAry = NULL;
if( bFlags )
{
- mpFlagAry = new BYTE[ nInitSize ];
+ mpFlagAry = new sal_uInt8[ nInitSize ];
memset( mpPointAry, 0, nInitSize );
}
else
@@ -105,12 +105,12 @@ ImplPolygon::ImplPolygon( const ImplPolygon& rImpPoly )
{
if ( rImpPoly.mnPoints )
{
- mpPointAry = (Point*)new char[(ULONG)rImpPoly.mnPoints*sizeof(Point)];
- memcpy( mpPointAry, rImpPoly.mpPointAry, (ULONG)rImpPoly.mnPoints*sizeof(Point) );
+ mpPointAry = (Point*)new char[(sal_uIntPtr)rImpPoly.mnPoints*sizeof(Point)];
+ memcpy( mpPointAry, rImpPoly.mpPointAry, (sal_uIntPtr)rImpPoly.mnPoints*sizeof(Point) );
if( rImpPoly.mpFlagAry )
{
- mpFlagAry = new BYTE[ rImpPoly.mnPoints ];
+ mpFlagAry = new sal_uInt8[ rImpPoly.mnPoints ];
memcpy( mpFlagAry, rImpPoly.mpFlagAry, rImpPoly.mnPoints );
}
else
@@ -128,16 +128,16 @@ ImplPolygon::ImplPolygon( const ImplPolygon& rImpPoly )
// -----------------------------------------------------------------------
-ImplPolygon::ImplPolygon( USHORT nInitSize, const Point* pInitAry, const BYTE* pInitFlags )
+ImplPolygon::ImplPolygon( sal_uInt16 nInitSize, const Point* pInitAry, const sal_uInt8* pInitFlags )
{
if ( nInitSize )
{
- mpPointAry = (Point*)new char[(ULONG)nInitSize*sizeof(Point)];
- memcpy( mpPointAry, pInitAry, (ULONG)nInitSize*sizeof( Point ) );
+ mpPointAry = (Point*)new char[(sal_uIntPtr)nInitSize*sizeof(Point)];
+ memcpy( mpPointAry, pInitAry, (sal_uIntPtr)nInitSize*sizeof( Point ) );
if( pInitFlags )
{
- mpFlagAry = new BYTE[ nInitSize ];
+ mpFlagAry = new sal_uInt8[ nInitSize ];
memcpy( mpFlagAry, pInitFlags, nInitSize );
}
else
@@ -168,7 +168,7 @@ ImplPolygon::~ImplPolygon()
// -----------------------------------------------------------------------
-void ImplPolygon::ImplSetSize( USHORT nNewSize, BOOL bResize )
+void ImplPolygon::ImplSetSize( sal_uInt16 nNewSize, sal_Bool bResize )
{
if( mnPoints == nNewSize )
return;
@@ -177,7 +177,7 @@ void ImplPolygon::ImplSetSize( USHORT nNewSize, BOOL bResize )
if ( nNewSize )
{
- pNewAry = (Point*)new char[(ULONG)nNewSize*sizeof(Point)];
+ pNewAry = (Point*)new char[(sal_uIntPtr)nNewSize*sizeof(Point)];
if ( bResize )
{
@@ -185,14 +185,14 @@ void ImplPolygon::ImplSetSize( USHORT nNewSize, BOOL bResize )
if ( mnPoints < nNewSize )
{
// Neue Punkte mit 0 initialisieren
- memset( pNewAry+mnPoints, 0, (ULONG)(nNewSize-mnPoints)*sizeof(Point) );
+ memset( pNewAry+mnPoints, 0, (sal_uIntPtr)(nNewSize-mnPoints)*sizeof(Point) );
if ( mpPointAry )
memcpy( pNewAry, mpPointAry, mnPoints*sizeof(Point) );
}
else
{
if ( mpPointAry )
- memcpy( pNewAry, mpPointAry, (ULONG)nNewSize*sizeof(Point) );
+ memcpy( pNewAry, mpPointAry, (sal_uIntPtr)nNewSize*sizeof(Point) );
}
}
}
@@ -205,11 +205,11 @@ void ImplPolygon::ImplSetSize( USHORT nNewSize, BOOL bResize )
// ggf. FlagArray beruecksichtigen
if( mpFlagAry )
{
- BYTE* pNewFlagAry;
+ sal_uInt8* pNewFlagAry;
if( nNewSize )
{
- pNewFlagAry = new BYTE[ nNewSize ];
+ pNewFlagAry = new sal_uInt8[ nNewSize ];
if( bResize )
{
@@ -237,21 +237,21 @@ void ImplPolygon::ImplSetSize( USHORT nNewSize, BOOL bResize )
// -----------------------------------------------------------------------
-void ImplPolygon::ImplSplit( USHORT nPos, USHORT nSpace, ImplPolygon* pInitPoly )
+void ImplPolygon::ImplSplit( sal_uInt16 nPos, sal_uInt16 nSpace, ImplPolygon* pInitPoly )
{
- const ULONG nSpaceSize = nSpace * sizeof( Point );
+ const sal_uIntPtr nSpaceSize = nSpace * sizeof( Point );
//Can't fit this in :-(, throw ?
if (mnPoints + nSpace > USHRT_MAX)
return;
- const USHORT nNewSize = mnPoints + nSpace;
+ const sal_uInt16 nNewSize = mnPoints + nSpace;
if( nPos >= mnPoints )
{
// Hinten anhaengen
nPos = mnPoints;
- ImplSetSize( nNewSize, TRUE );
+ ImplSetSize( nNewSize, sal_True );
if( pInitPoly )
{
@@ -264,10 +264,10 @@ void ImplPolygon::ImplSplit( USHORT nPos, USHORT nSpace, ImplPolygon* pInitPoly
else
{
// PointArray ist in diesem Zweig immer vorhanden
- const USHORT nSecPos = nPos + nSpace;
- const USHORT nRest = mnPoints - nPos;
+ const sal_uInt16 nSecPos = nPos + nSpace;
+ const sal_uInt16 nRest = mnPoints - nPos;
- Point* pNewAry = (Point*) new char[ (ULONG) nNewSize * sizeof( Point ) ];
+ Point* pNewAry = (Point*) new char[ (sal_uIntPtr) nNewSize * sizeof( Point ) ];
memcpy( pNewAry, mpPointAry, nPos * sizeof( Point ) );
@@ -282,7 +282,7 @@ void ImplPolygon::ImplSplit( USHORT nPos, USHORT nSpace, ImplPolygon* pInitPoly
// ggf. FlagArray beruecksichtigen
if( mpFlagAry )
{
- BYTE* pNewFlagAry = new BYTE[ nNewSize ];
+ sal_uInt8* pNewFlagAry = new sal_uInt8[ nNewSize ];
memcpy( pNewFlagAry, mpFlagAry, nPos );
@@ -303,17 +303,17 @@ void ImplPolygon::ImplSplit( USHORT nPos, USHORT nSpace, ImplPolygon* pInitPoly
// -----------------------------------------------------------------------
-void ImplPolygon::ImplRemove( USHORT nPos, USHORT nCount )
+void ImplPolygon::ImplRemove( sal_uInt16 nPos, sal_uInt16 nCount )
{
- const USHORT nRemoveCount = Min( (USHORT) ( mnPoints - nPos ), (USHORT) nCount );
+ const sal_uInt16 nRemoveCount = Min( (sal_uInt16) ( mnPoints - nPos ), (sal_uInt16) nCount );
if( nRemoveCount )
{
- const USHORT nNewSize = mnPoints - nRemoveCount;
- const USHORT nSecPos = nPos + nRemoveCount;
- const USHORT nRest = mnPoints - nSecPos;
+ const sal_uInt16 nNewSize = mnPoints - nRemoveCount;
+ const sal_uInt16 nSecPos = nPos + nRemoveCount;
+ const sal_uInt16 nRest = mnPoints - nSecPos;
- Point* pNewAry = (Point*) new char[ (ULONG) nNewSize * sizeof( Point ) ];
+ Point* pNewAry = (Point*) new char[ (sal_uIntPtr) nNewSize * sizeof( Point ) ];
memcpy( pNewAry, mpPointAry, nPos * sizeof( Point ) );
memcpy( pNewAry + nPos, mpPointAry + nSecPos, nRest * sizeof( Point ) );
@@ -323,7 +323,7 @@ void ImplPolygon::ImplRemove( USHORT nPos, USHORT nCount )
// ggf. FlagArray beruecksichtigen
if( mpFlagAry )
{
- BYTE* pNewFlagAry = new BYTE[ nNewSize ];
+ sal_uInt8* pNewFlagAry = new sal_uInt8[ nNewSize ];
memcpy( pNewFlagAry, mpFlagAry, nPos );
memcpy( pNewFlagAry + nPos, mpFlagAry + nSecPos, nRest );
@@ -342,7 +342,7 @@ void ImplPolygon::ImplCreateFlagArray()
{
if( !mpFlagAry )
{
- mpFlagAry = new BYTE[ mnPoints ];
+ mpFlagAry = new sal_uInt8[ mnPoints ];
memset( mpFlagAry, 0, mnPoints );
}
}
@@ -378,7 +378,7 @@ Polygon::Polygon()
// -----------------------------------------------------------------------
-Polygon::Polygon( USHORT nSize )
+Polygon::Polygon( sal_uInt16 nSize )
{
DBG_CTOR( Polygon, NULL );
@@ -390,7 +390,7 @@ Polygon::Polygon( USHORT nSize )
// -----------------------------------------------------------------------
-Polygon::Polygon( USHORT nPoints, const Point* pPtAry, const BYTE* pFlagAry )
+Polygon::Polygon( sal_uInt16 nPoints, const Point* pPtAry, const sal_uInt8* pFlagAry )
{
DBG_CTOR( Polygon, NULL );
@@ -434,7 +434,7 @@ Polygon::Polygon( const Rectangle& rRect )
// -----------------------------------------------------------------------
-Polygon::Polygon( const Rectangle& rRect, ULONG nHorzRound, ULONG nVertRound )
+Polygon::Polygon( const Rectangle& rRect, sal_uIntPtr nHorzRound, sal_uIntPtr nVertRound )
{
DBG_CTOR( Polygon, NULL );
@@ -445,8 +445,8 @@ Polygon::Polygon( const Rectangle& rRect, ULONG nHorzRound, ULONG nVertRound )
Rectangle aRect( rRect );
aRect.Justify(); // SJ: i9140
- nHorzRound = Min( nHorzRound, (ULONG) labs( aRect.GetWidth() >> 1 ) );
- nVertRound = Min( nVertRound, (ULONG) labs( aRect.GetHeight() >> 1 ) );
+ nHorzRound = Min( nHorzRound, (sal_uIntPtr) labs( aRect.GetWidth() >> 1 ) );
+ nVertRound = Min( nVertRound, (sal_uIntPtr) labs( aRect.GetHeight() >> 1 ) );
if( !nHorzRound && !nVertRound )
{
@@ -464,7 +464,7 @@ Polygon::Polygon( const Rectangle& rRect, ULONG nHorzRound, ULONG nVertRound )
const Point aBR( aRect.Right() - nHorzRound, aRect.Bottom() - nVertRound );
const Point aBL( aRect.Left() + nHorzRound, aRect.Bottom() - nVertRound );
Polygon* pEllipsePoly = new Polygon( Point(), nHorzRound, nVertRound );
- USHORT i, nEnd, nSize4 = pEllipsePoly->GetSize() >> 2;
+ sal_uInt16 i, nEnd, nSize4 = pEllipsePoly->GetSize() >> 2;
mpImplPolygon = new ImplPolygon( pEllipsePoly->GetSize() + 1 );
@@ -491,7 +491,7 @@ Polygon::Polygon( const Rectangle& rRect, ULONG nHorzRound, ULONG nVertRound )
// -----------------------------------------------------------------------
-Polygon::Polygon( const Point& rCenter, long nRadX, long nRadY, USHORT nPoints )
+Polygon::Polygon( const Point& rCenter, long nRadX, long nRadY, sal_uInt16 nPoints )
{
DBG_CTOR( Polygon, NULL );
@@ -500,10 +500,10 @@ Polygon::Polygon( const Point& rCenter, long nRadX, long nRadY, USHORT nPoints )
// Default berechnen (abhaengig von Groesse)
if( !nPoints )
{
- nPoints = (USHORT) ( F_PI * ( 1.5 * ( nRadX + nRadY ) -
+ nPoints = (sal_uInt16) ( F_PI * ( 1.5 * ( nRadX + nRadY ) -
sqrt( (double) labs( nRadX * nRadY ) ) ) );
- nPoints = (USHORT) MinMax( nPoints, 32, 256 );
+ nPoints = (sal_uInt16) MinMax( nPoints, 32, 256 );
if( ( nRadX > 32 ) && ( nRadY > 32 ) && ( nRadX + nRadY ) < 8192 )
nPoints >>= 1;
@@ -513,9 +513,9 @@ Polygon::Polygon( const Point& rCenter, long nRadX, long nRadY, USHORT nPoints )
mpImplPolygon = new ImplPolygon( nPoints = (nPoints + 3) & ~3 );
Point* pPt;
- USHORT i;
- USHORT nPoints2 = nPoints >> 1;
- USHORT nPoints4 = nPoints >> 2;
+ sal_uInt16 i;
+ sal_uInt16 nPoints2 = nPoints >> 1;
+ sal_uInt16 nPoints4 = nPoints >> 2;
double nAngle;
double nAngleStep = F_PI2 / ( nPoints4 - 1 );
@@ -557,12 +557,12 @@ Polygon::Polygon( const Rectangle& rBound,
const Point aCenter( rBound.Center() );
const long nRadX = aCenter.X() - rBound.Left();
const long nRadY = aCenter.Y() - rBound.Top();
- USHORT nPoints;
+ sal_uInt16 nPoints;
- nPoints = (USHORT) ( F_PI * ( 1.5 * ( nRadX + nRadY ) -
+ nPoints = (sal_uInt16) ( F_PI * ( 1.5 * ( nRadX + nRadY ) -
sqrt( (double) labs( nRadX * nRadY ) ) ) );
- nPoints = (USHORT) MinMax( nPoints, 32, 256 );
+ nPoints = (sal_uInt16) MinMax( nPoints, 32, 256 );
if( ( nRadX > 32 ) && ( nRadY > 32 ) && ( nRadX + nRadY ) < 8192 )
nPoints >>= 1;
@@ -576,8 +576,8 @@ Polygon::Polygon( const Rectangle& rBound,
double fEnd = ImplGetAngle( aCenter, rEnd );
double fDiff = fEnd - fStart;
double fStep;
- USHORT nStart;
- USHORT nEnd;
+ sal_uInt16 nStart;
+ sal_uInt16 nEnd;
if( fDiff < 0. )
fDiff += F_2PI;
@@ -585,7 +585,7 @@ Polygon::Polygon( const Rectangle& rBound,
// Punktanzahl proportional verkleinern ( fDiff / (2PI) );
// ist eingentlich nur fuer einen Kreis richtig; wir
// machen es hier aber trotzdem
- nPoints = Max( (USHORT) ( ( fDiff * 0.1591549 ) * nPoints ), (USHORT) 16 );
+ nPoints = Max( (sal_uInt16) ( ( fDiff * 0.1591549 ) * nPoints ), (sal_uInt16) 16 );
fStep = fDiff / ( nPoints - 1 );
if( POLY_PIE == eStyle )
@@ -624,7 +624,7 @@ Polygon::Polygon( const Rectangle& rBound,
Polygon::Polygon( const Point& rBezPt1, const Point& rCtrlPt1,
const Point& rBezPt2, const Point& rCtrlPt2,
- USHORT nPoints )
+ sal_uInt16 nPoints )
{
DBG_CTOR( Polygon, NULL );
@@ -644,7 +644,7 @@ Polygon::Polygon( const Point& rBezPt1, const Point& rCtrlPt1,
mpImplPolygon = new ImplPolygon( nPoints );
- for( USHORT i = 0; i < nPoints; i++, fK_1 += fInc, fK1_1 -= fInc )
+ for( sal_uInt16 i = 0; i < nPoints; i++, fK_1 += fInc, fK1_1 -= fInc )
{
Point& rPt = mpImplPolygon->mpPointAry[ i ];
@@ -686,7 +686,7 @@ Point* Polygon::ImplGetPointAry()
// -----------------------------------------------------------------------
-BYTE* Polygon::ImplGetFlagAry()
+sal_uInt8* Polygon::ImplGetFlagAry()
{
DBG_CHKTHIS( Polygon, NULL );
@@ -705,7 +705,7 @@ const Point* Polygon::GetConstPointAry() const
// -----------------------------------------------------------------------
-const BYTE* Polygon::GetConstFlagAry() const
+const sal_uInt8* Polygon::GetConstFlagAry() const
{
DBG_CHKTHIS( Polygon, NULL );
return mpImplPolygon->mpFlagAry;
@@ -713,7 +713,7 @@ const BYTE* Polygon::GetConstFlagAry() const
// -----------------------------------------------------------------------
-void Polygon::SetPoint( const Point& rPt, USHORT nPos )
+void Polygon::SetPoint( const Point& rPt, sal_uInt16 nPos )
{
DBG_CHKTHIS( Polygon, NULL );
DBG_ASSERT( nPos < mpImplPolygon->mnPoints,
@@ -725,7 +725,7 @@ void Polygon::SetPoint( const Point& rPt, USHORT nPos )
// -----------------------------------------------------------------------
-void Polygon::SetFlags( USHORT nPos, PolyFlags eFlags )
+void Polygon::SetFlags( sal_uInt16 nPos, PolyFlags eFlags )
{
DBG_CHKTHIS( Polygon, NULL );
DBG_ASSERT( nPos < mpImplPolygon->mnPoints,
@@ -737,13 +737,13 @@ void Polygon::SetFlags( USHORT nPos, PolyFlags eFlags )
{
ImplMakeUnique();
mpImplPolygon->ImplCreateFlagArray();
- mpImplPolygon->mpFlagAry[ nPos ] = (BYTE) eFlags;
+ mpImplPolygon->mpFlagAry[ nPos ] = (sal_uInt8) eFlags;
}
}
// -----------------------------------------------------------------------
-const Point& Polygon::GetPoint( USHORT nPos ) const
+const Point& Polygon::GetPoint( sal_uInt16 nPos ) const
{
DBG_CHKTHIS( Polygon, NULL );
DBG_ASSERT( nPos < mpImplPolygon->mnPoints,
@@ -754,7 +754,7 @@ const Point& Polygon::GetPoint( USHORT nPos ) const
// -----------------------------------------------------------------------
-PolyFlags Polygon::GetFlags( USHORT nPos ) const
+PolyFlags Polygon::GetFlags( sal_uInt16 nPos ) const
{
DBG_CHKTHIS( Polygon, NULL );
DBG_ASSERT( nPos < mpImplPolygon->mnPoints,
@@ -773,7 +773,7 @@ sal_Bool Polygon::HasFlags() const
// -----------------------------------------------------------------------
-BOOL Polygon::IsControl(USHORT nPos) const
+sal_Bool Polygon::IsControl(sal_uInt16 nPos) const
{
DBG_CHKTHIS( Polygon, NULL );
DBG_ASSERT( nPos < mpImplPolygon->mnPoints,
@@ -786,7 +786,7 @@ BOOL Polygon::IsControl(USHORT nPos) const
// -----------------------------------------------------------------------
-BOOL Polygon::IsSmooth(USHORT nPos) const
+sal_Bool Polygon::IsSmooth(sal_uInt16 nPos) const
{
DBG_CHKTHIS( Polygon, NULL );
DBG_ASSERT( nPos < mpImplPolygon->mnPoints,
@@ -799,9 +799,9 @@ BOOL Polygon::IsSmooth(USHORT nPos) const
// -----------------------------------------------------------------------
-BOOL Polygon::IsRect() const
+sal_Bool Polygon::IsRect() const
{
- BOOL bIsRect = FALSE;
+ sal_Bool bIsRect = sal_False;
if ( mpImplPolygon->mpFlagAry == NULL )
{
if ( ( ( mpImplPolygon->mnPoints == 5 ) && ( mpImplPolygon->mpPointAry[ 0 ] == mpImplPolygon->mpPointAry[ 4 ] ) ) ||
@@ -811,7 +811,7 @@ BOOL Polygon::IsRect() const
( mpImplPolygon->mpPointAry[ 0 ].Y() == mpImplPolygon->mpPointAry[ 1 ].Y() ) &&
( mpImplPolygon->mpPointAry[ 1 ].X() == mpImplPolygon->mpPointAry[ 2 ].X() ) &&
( mpImplPolygon->mpPointAry[ 2 ].Y() == mpImplPolygon->mpPointAry[ 3 ].Y() ) )
- bIsRect = TRUE;
+ bIsRect = sal_True;
}
}
return bIsRect;
@@ -819,7 +819,7 @@ BOOL Polygon::IsRect() const
// -----------------------------------------------------------------------
-void Polygon::SetSize( USHORT nNewSize )
+void Polygon::SetSize( sal_uInt16 nNewSize )
{
DBG_CHKTHIS( Polygon, NULL );
@@ -832,7 +832,7 @@ void Polygon::SetSize( USHORT nNewSize )
// -----------------------------------------------------------------------
-USHORT Polygon::GetSize() const
+sal_uInt16 Polygon::GetSize() const
{
DBG_CHKTHIS( Polygon, NULL );
@@ -858,7 +858,7 @@ void Polygon::Clear()
// -----------------------------------------------------------------------
-double Polygon::CalcDistance( USHORT nP1, USHORT nP2 )
+double Polygon::CalcDistance( sal_uInt16 nP1, sal_uInt16 nP2 )
{
DBG_ASSERT( nP1 < mpImplPolygon->mnPoints,
"Polygon::CalcDistance(): nPos1 >= nPoints" );
@@ -875,12 +875,12 @@ double Polygon::CalcDistance( USHORT nP1, USHORT nP2 )
// -----------------------------------------------------------------------
-void Polygon::Optimize( ULONG nOptimizeFlags, const PolyOptimizeData* pData )
+void Polygon::Optimize( sal_uIntPtr nOptimizeFlags, const PolyOptimizeData* pData )
{
DBG_CHKTHIS( Polygon, NULL );
DBG_ASSERT( !mpImplPolygon->mpFlagAry, "Optimizing could fail with beziers!" );
- USHORT nSize = mpImplPolygon->mnPoints;
+ sal_uInt16 nSize = mpImplPolygon->mnPoints;
if( nOptimizeFlags && nSize )
{
@@ -888,7 +888,7 @@ void Polygon::Optimize( ULONG nOptimizeFlags, const PolyOptimizeData* pData )
{
const Rectangle aBound( GetBoundRect() );
const double fArea = ( aBound.GetWidth() + aBound.GetHeight() ) * 0.5;
- const USHORT nPercent = pData ? pData->GetPercentValue() : 50;
+ const sal_uInt16 nPercent = pData ? pData->GetPercentValue() : 50;
Optimize( POLY_OPTIMIZE_NO_SAME );
ImplReduceEdges( *this, fArea, nPercent );
@@ -897,7 +897,7 @@ void Polygon::Optimize( ULONG nOptimizeFlags, const PolyOptimizeData* pData )
{
Polygon aNewPoly;
const Point& rFirst = mpImplPolygon->mpPointAry[ 0 ];
- ULONG nReduce;
+ sal_uIntPtr nReduce;
if( nOptimizeFlags & ( POLY_OPTIMIZE_REDUCE ) )
nReduce = pData ? pData->GetAbsValue() : 4UL;
@@ -909,15 +909,15 @@ void Polygon::Optimize( ULONG nOptimizeFlags, const PolyOptimizeData* pData )
if( nSize > 1 )
{
- USHORT nLast = 0, nNewCount = 1;
+ sal_uInt16 nLast = 0, nNewCount = 1;
aNewPoly.SetSize( nSize );
aNewPoly[ 0 ] = rFirst;
- for( USHORT i = 1; i < nSize; i++ )
+ for( sal_uInt16 i = 1; i < nSize; i++ )
{
if( ( mpImplPolygon->mpPointAry[ i ] != mpImplPolygon->mpPointAry[ nLast ] ) &&
- ( !nReduce || ( nReduce < (ULONG) FRound( CalcDistance( nLast, i ) ) ) ) )
+ ( !nReduce || ( nReduce < (sal_uIntPtr) FRound( CalcDistance( nLast, i ) ) ) ) )
{
aNewPoly[ nNewCount++ ] = mpImplPolygon->mpPointAry[ nLast = i ];
}
@@ -1048,8 +1048,8 @@ void Polygon::AdaptiveSubdivide( Polygon& rResult, const double d ) const
}
else
{
- USHORT i;
- USHORT nPts( GetSize() );
+ sal_uInt16 i;
+ sal_uInt16 nPts( GetSize() );
::std::vector< Point > aPoints;
aPoints.reserve( nPts );
::std::back_insert_iterator< ::std::vector< Point > > aPointIter( aPoints );
@@ -1058,8 +1058,8 @@ void Polygon::AdaptiveSubdivide( Polygon& rResult, const double d ) const
{
if( ( i + 3 ) < nPts )
{
- BYTE P1( mpImplPolygon->mpFlagAry[ i ] );
- BYTE P4( mpImplPolygon->mpFlagAry[ i + 3 ] );
+ sal_uInt8 P1( mpImplPolygon->mpFlagAry[ i ] );
+ sal_uInt8 P4( mpImplPolygon->mpFlagAry[ i + 3 ] );
if( ( POLY_NORMAL == P1 || POLY_SMOOTH == P1 || POLY_SYMMTR == P1 ) &&
( POLY_CONTROL == mpImplPolygon->mpFlagAry[ i + 1 ] ) &&
@@ -1080,7 +1080,7 @@ void Polygon::AdaptiveSubdivide( Polygon& rResult, const double d ) const
}
// fill result polygon
- rResult = Polygon( (USHORT)aPoints.size() ); // ensure sufficient size for copy
+ rResult = Polygon( (sal_uInt16)aPoints.size() ); // ensure sufficient size for copy
::std::copy(aPoints.begin(), aPoints.end(), rResult.mpImplPolygon->mpPointAry);
}
}
@@ -1119,27 +1119,27 @@ void Polygon::GetXOR( const PolyPolygon& rPolyPoly, PolyPolygon& rResult ) const
// -----------------------------------------------------------------------
-void Polygon::ImplReduceEdges( Polygon& rPoly, const double& rArea, USHORT nPercent )
+void Polygon::ImplReduceEdges( Polygon& rPoly, const double& rArea, sal_uInt16 nPercent )
{
const double fBound = 2000.0 * ( 100 - nPercent ) * 0.01;
- USHORT nNumNoChange = 0, nNumRuns = 0;
+ sal_uInt16 nNumNoChange = 0, nNumRuns = 0;
while( nNumNoChange < 2 )
{
- USHORT nPntCnt = rPoly.GetSize(), nNewPos = 0;
+ sal_uInt16 nPntCnt = rPoly.GetSize(), nNewPos = 0;
Polygon aNewPoly( nPntCnt );
- BOOL bChangeInThisRun = FALSE;
+ sal_Bool bChangeInThisRun = sal_False;
- for( USHORT n = 0; n < nPntCnt; n++ )
+ for( sal_uInt16 n = 0; n < nPntCnt; n++ )
{
- BOOL bDeletePoint = FALSE;
+ sal_Bool bDeletePoint = sal_False;
if( ( n + nNumRuns ) % 2 )
{
- USHORT nIndPrev = !n ? nPntCnt - 1 : n - 1;
- USHORT nIndPrevPrev = !nIndPrev ? nPntCnt - 1 : nIndPrev - 1;
- USHORT nIndNext = ( n == nPntCnt-1 ) ? 0 : n + 1;
- USHORT nIndNextNext = ( nIndNext == nPntCnt - 1 ) ? 0 : nIndNext + 1;
+ sal_uInt16 nIndPrev = !n ? nPntCnt - 1 : n - 1;
+ sal_uInt16 nIndPrevPrev = !nIndPrev ? nPntCnt - 1 : nIndPrev - 1;
+ sal_uInt16 nIndNext = ( n == nPntCnt-1 ) ? 0 : n + 1;
+ sal_uInt16 nIndNextNext = ( nIndNext == nPntCnt - 1 ) ? 0 : nIndNext + 1;
Vector2D aVec1( rPoly[ nIndPrev ] ); aVec1 -= rPoly[ nIndPrevPrev ];
Vector2D aVec2( rPoly[ n ] ); aVec2 -= rPoly[ nIndPrev ];
Vector2D aVec3( rPoly[ nIndNext ] ); aVec3 -= rPoly[ n ];
@@ -1149,7 +1149,7 @@ void Polygon::ImplReduceEdges( Polygon& rPoly, const double& rArea, USHORT nPerc
double fTurnB = aVec2.Normalize().Scalar( aVec3.Normalize() );
if( fabs( fTurnB ) < ( 1.0 + SMALL_DVALUE ) && fabs( fTurnB ) > ( 1.0 - SMALL_DVALUE ) )
- bDeletePoint = TRUE;
+ bDeletePoint = sal_True;
else
{
Vector2D aVecB( rPoly[ nIndNext ] );
@@ -1178,7 +1178,7 @@ void Polygon::ImplReduceEdges( Polygon& rPoly, const double& rArea, USHORT nPerc
if( ( fLenFact < ( FSQRT2 + SMALL_DVALUE ) ) &&
( ( ( fDist1 + fDist4 ) / ( fDist2 + fDist3 ) ) * 2000.0 ) > fBound )
{
- bDeletePoint = TRUE;
+ bDeletePoint = sal_True;
}
}
else
@@ -1190,10 +1190,10 @@ void Polygon::ImplReduceEdges( Polygon& rPoly, const double& rArea, USHORT nPerc
else if( fRelLen > 1.0 )
fRelLen = 1.0;
- if( ( (UINT32) ( ( ( fLenFact - 1.0 ) * 1000000.0 ) + 0.5 ) < fBound ) &&
+ if( ( (sal_uInt32) ( ( ( fLenFact - 1.0 ) * 1000000.0 ) + 0.5 ) < fBound ) &&
( fabs( fGradB ) <= ( fRelLen * fBound * 0.01 ) ) )
{
- bDeletePoint = TRUE;
+ bDeletePoint = sal_True;
}
}
}
@@ -1202,7 +1202,7 @@ void Polygon::ImplReduceEdges( Polygon& rPoly, const double& rArea, USHORT nPerc
if( !bDeletePoint )
aNewPoly[ nNewPos++ ] = rPoly[ n ];
else
- bChangeInThisRun = TRUE;
+ bChangeInThisRun = sal_True;
}
if( bChangeInThisRun && nNewPos )
@@ -1231,8 +1231,8 @@ void Polygon::Move( long nHorzMove, long nVertMove )
ImplMakeUnique();
// Punkte verschieben
- USHORT nCount = mpImplPolygon->mnPoints;
- for ( USHORT i = 0; i < nCount; i++ )
+ sal_uInt16 nCount = mpImplPolygon->mnPoints;
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
Point* pPt = &(mpImplPolygon->mpPointAry[i]);
pPt->X() += nHorzMove;
@@ -1247,7 +1247,7 @@ void Polygon::Translate(const Point& rTrans)
DBG_CHKTHIS( Polygon, NULL );
ImplMakeUnique();
- for ( USHORT i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
+ for ( sal_uInt16 i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
mpImplPolygon->mpPointAry[ i ] += rTrans;
}
@@ -1258,7 +1258,7 @@ void Polygon::Scale( double fScaleX, double fScaleY )
DBG_CHKTHIS( Polygon, NULL );
ImplMakeUnique();
- for ( USHORT i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
+ for ( sal_uInt16 i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
{
Point& rPnt = mpImplPolygon->mpPointAry[i];
rPnt.X() = (long) ( fScaleX * rPnt.X() );
@@ -1268,7 +1268,7 @@ void Polygon::Scale( double fScaleX, double fScaleY )
// -----------------------------------------------------------------------
-void Polygon::Rotate( const Point& rCenter, USHORT nAngle10 )
+void Polygon::Rotate( const Point& rCenter, sal_uInt16 nAngle10 )
{
DBG_CHKTHIS( Polygon, NULL );
nAngle10 %= 3600;
@@ -1291,7 +1291,7 @@ void Polygon::Rotate( const Point& rCenter, double fSin, double fCos )
long nCenterX = rCenter.X();
long nCenterY = rCenter.Y();
- for( USHORT i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
{
Point& rPt = mpImplPolygon->mpPointAry[ i ];
@@ -1309,7 +1309,7 @@ void Polygon::SlantX( long nYRef, double fSin, double fCos )
DBG_CHKTHIS( Polygon, NULL );
ImplMakeUnique();
- for( USHORT i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
{
Point& rPnt = mpImplPolygon->mpPointAry[ i ];
const long nDy = rPnt.Y() - nYRef;
@@ -1326,7 +1326,7 @@ void Polygon::SlantY( long nXRef, double fSin, double fCos )
DBG_CHKTHIS( Polygon, NULL );
ImplMakeUnique();
- for( USHORT i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
{
Point& rPnt = mpImplPolygon->mpPointAry[ i ];
const long nDx = rPnt.X() - nXRef;
@@ -1365,7 +1365,7 @@ void Polygon::Distort( const Rectangle& rRefRect, const Polygon& rDistortedRect
X4 = rDistortedRect[2].X();
Y4 = rDistortedRect[2].Y();
- for( USHORT i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = mpImplPolygon->mnPoints; i < nCount; i++ )
{
Point& rPnt = mpImplPolygon->mpPointAry[ i ];
@@ -1393,9 +1393,9 @@ class ImplPolygonPointFilter : public ImplPointFilter
{
public:
ImplPolygon* mpPoly; // Nicht loeschen, wird dem Polygon zugewiesen
- USHORT mnSize;
+ sal_uInt16 mnSize;
- ImplPolygonPointFilter( USHORT nDestSize ) :
+ ImplPolygonPointFilter( sal_uInt16 nDestSize ) :
mnSize( 0 )
{
mpPoly = new ImplPolygon( nDestSize );
@@ -1431,7 +1431,7 @@ class ImplEdgePointFilter : public ImplPointFilter
const long mnHigh;
const int mnEdge;
int mnLastOutside;
- BOOL mbFirst;
+ sal_Bool mbFirst;
public:
ImplEdgePointFilter( int nEdge, long nLow, long nHigh,
@@ -1440,7 +1440,7 @@ public:
mnLow( nLow ),
mnHigh( nHigh ),
mnEdge( nEdge ),
- mbFirst( TRUE )
+ mbFirst( sal_True )
{
}
@@ -1539,7 +1539,7 @@ void ImplEdgePointFilter::Input( const Point& rPoint )
if ( mbFirst )
{
maFirstPoint = rPoint;
- mbFirst = FALSE;
+ mbFirst = sal_False;
if ( !nOutside )
mrNextFilter.Input( rPoint );
}
@@ -1577,20 +1577,20 @@ void ImplEdgePointFilter::LastPoint()
// -----------------------------------------------------------------------
-void Polygon::Clip( const Rectangle& rRect, BOOL bPolygon )
+void Polygon::Clip( const Rectangle& rRect, sal_Bool bPolygon )
{
// #105251# Justify rect befor edge filtering
Rectangle aJustifiedRect( rRect );
aJustifiedRect.Justify();
- USHORT nSourceSize = mpImplPolygon->mnPoints;
+ sal_uInt16 nSourceSize = mpImplPolygon->mnPoints;
ImplPolygonPointFilter aPolygon( nSourceSize );
ImplEdgePointFilter aHorzFilter( EDGE_HORZ, aJustifiedRect.Left(), aJustifiedRect.Right(),
aPolygon );
ImplEdgePointFilter aVertFilter( EDGE_VERT, aJustifiedRect.Top(), aJustifiedRect.Bottom(),
aHorzFilter );
- for ( USHORT i = 0; i < nSourceSize; i++ )
+ for ( sal_uInt16 i = 0; i < nSourceSize; i++ )
aVertFilter.Input( mpImplPolygon->mpPointAry[i] );
if ( bPolygon || aVertFilter.IsPolygon() )
aVertFilter.LastPoint();
@@ -1625,7 +1625,7 @@ Rectangle Polygon::GetBoundRect() const
//
// DBG_ASSERT( !mpImplPolygon->mpFlagAry, "GetBoundRect could fail with beziers!" );
- USHORT nCount = mpImplPolygon->mnPoints;
+ sal_uInt16 nCount = mpImplPolygon->mnPoints;
if( ! nCount )
return Rectangle();
@@ -1635,7 +1635,7 @@ Rectangle Polygon::GetBoundRect() const
nXMin = nXMax = pPt->X();
nYMin = nYMax = pPt->Y();
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
pPt = &(mpImplPolygon->mpPointAry[i]);
@@ -1671,9 +1671,9 @@ double Polygon::GetSignedArea() const
if( mpImplPolygon->mnPoints > 2 )
{
- const USHORT nCount1 = mpImplPolygon->mnPoints - 1;
+ const sal_uInt16 nCount1 = mpImplPolygon->mnPoints - 1;
- for( USHORT i = 0; i < nCount1; )
+ for( sal_uInt16 i = 0; i < nCount1; )
{
const Point& rPt = mpImplPolygon->mpPointAry[ i ];
const Point& rPt1 = mpImplPolygon->mpPointAry[ ++i ];
@@ -1690,15 +1690,15 @@ double Polygon::GetSignedArea() const
// -----------------------------------------------------------------------
-BOOL Polygon::IsInside( const Point& rPoint ) const
+sal_Bool Polygon::IsInside( const Point& rPoint ) const
{
DBG_CHKTHIS( Polygon, NULL );
DBG_ASSERT( !mpImplPolygon->mpFlagAry, "IsInside could fail with beziers!" );
const Rectangle aBound( GetBoundRect() );
const Line aLine( rPoint, Point( aBound.Right() + 100L, rPoint.Y() ) );
- USHORT nCount = mpImplPolygon->mnPoints;
- USHORT nPCounter = 0;
+ sal_uInt16 nCount = mpImplPolygon->mnPoints;
+ sal_uInt16 nPCounter = 0;
if ( ( nCount > 2 ) && aBound.IsInside( rPoint ) )
{
@@ -1709,7 +1709,7 @@ BOOL Polygon::IsInside( const Point& rPoint ) const
while ( ( aPt1 == mpImplPolygon->mpPointAry[ nCount - 1 ] ) && ( nCount > 3 ) )
nCount--;
- for ( USHORT i = 1; i <= nCount; i++ )
+ for ( sal_uInt16 i = 1; i <= nCount; i++ )
{
const Point& rPt2 = mpImplPolygon->mpPointAry[ ( i < nCount ) ? i : 0 ];
@@ -1742,7 +1742,7 @@ BOOL Polygon::IsInside( const Point& rPoint ) const
// -----------------------------------------------------------------------
-BOOL Polygon::IsRightOrientated() const
+sal_Bool Polygon::IsRightOrientated() const
{
DBG_CHKTHIS( Polygon, NULL );
return GetSignedArea() >= 0.0;
@@ -1750,7 +1750,7 @@ BOOL Polygon::IsRightOrientated() const
// -----------------------------------------------------------------------
-void Polygon::Insert( USHORT nPos, const Point& rPt, PolyFlags eFlags )
+void Polygon::Insert( sal_uInt16 nPos, const Point& rPt, PolyFlags eFlags )
{
DBG_CHKTHIS( Polygon, NULL );
ImplMakeUnique();
@@ -1764,16 +1764,16 @@ void Polygon::Insert( USHORT nPos, const Point& rPt, PolyFlags eFlags )
if( POLY_NORMAL != eFlags )
{
mpImplPolygon->ImplCreateFlagArray();
- mpImplPolygon->mpFlagAry[ nPos ] = (BYTE) eFlags;
+ mpImplPolygon->mpFlagAry[ nPos ] = (sal_uInt8) eFlags;
}
}
// -----------------------------------------------------------------------
-void Polygon::Insert( USHORT nPos, const Polygon& rPoly )
+void Polygon::Insert( sal_uInt16 nPos, const Polygon& rPoly )
{
DBG_CHKTHIS( Polygon, NULL );
- const USHORT nInsertCount = rPoly.mpImplPolygon->mnPoints;
+ const sal_uInt16 nInsertCount = rPoly.mpImplPolygon->mnPoints;
if( nInsertCount )
{
@@ -1791,7 +1791,7 @@ void Polygon::Insert( USHORT nPos, const Polygon& rPoly )
// -----------------------------------------------------------------------
-void Polygon::Remove( USHORT nPos, USHORT nCount )
+void Polygon::Remove( sal_uInt16 nPos, sal_uInt16 nCount )
{
DBG_CHKTHIS( Polygon, NULL );
if( nCount && ( nPos < mpImplPolygon->mnPoints ) )
@@ -1803,7 +1803,7 @@ void Polygon::Remove( USHORT nPos, USHORT nCount )
// -----------------------------------------------------------------------
-Point& Polygon::operator[]( USHORT nPos )
+Point& Polygon::operator[]( sal_uInt16 nPos )
{
DBG_CHKTHIS( Polygon, NULL );
DBG_ASSERT( nPos < mpImplPolygon->mnPoints, "Polygon::[]: nPos >= nPoints" );
@@ -1841,15 +1841,15 @@ Polygon& Polygon::operator=( const Polygon& rPoly )
// -----------------------------------------------------------------------
-BOOL Polygon::operator==( const Polygon& rPoly ) const
+sal_Bool Polygon::operator==( const Polygon& rPoly ) const
{
DBG_CHKTHIS( Polygon, NULL );
DBG_CHKOBJ( &rPoly, Polygon, NULL );
if ( (rPoly.mpImplPolygon == mpImplPolygon) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -1882,10 +1882,10 @@ SvStream& operator>>( SvStream& rIStream, Polygon& rPoly )
DBG_CHKOBJ( &rPoly, Polygon, NULL );
DBG_ASSERTWARNING( rIStream.GetVersion(), "Polygon::>> - Solar-Version not set on rIStream" );
- USHORT i;
- USHORT nStart;
- USHORT nCurPoints;
- USHORT nPoints;
+ sal_uInt16 i;
+ sal_uInt16 nStart;
+ sal_uInt16 nCurPoints;
+ sal_uInt16 nPoints;
unsigned char bShort;
short nShortX;
short nShortY;
@@ -1901,7 +1901,7 @@ SvStream& operator>>( SvStream& rIStream, Polygon& rPoly )
rPoly.mpImplPolygon = new ImplPolygon( nPoints );
}
else
- rPoly.mpImplPolygon->ImplSetSize( nPoints, FALSE );
+ rPoly.mpImplPolygon->ImplSetSize( nPoints, sal_False );
// Je nach CompressMode das Polygon einlesen
if ( rIStream.GetCompressMode() == COMPRESSMODE_FULL )
@@ -1966,9 +1966,9 @@ SvStream& operator<<( SvStream& rOStream, const Polygon& rPoly )
unsigned char bShort;
unsigned char bCurShort;
- USHORT nStart;
- USHORT i;
- USHORT nPoints = rPoly.GetSize();
+ sal_uInt16 nStart;
+ sal_uInt16 i;
+ sal_uInt16 nPoints = rPoly.GetSize();
// Anzahl der Punkte rausschreiben
rOStream << nPoints;
@@ -1986,9 +1986,9 @@ SvStream& operator<<( SvStream& rOStream, const Polygon& rPoly )
(rPoly.mpImplPolygon->mpPointAry[nStart].X() <= SHRT_MAX)) &&
((rPoly.mpImplPolygon->mpPointAry[nStart].Y() >= SHRT_MIN) &&
(rPoly.mpImplPolygon->mpPointAry[nStart].Y() <= SHRT_MAX)) )
- bShort = TRUE;
+ bShort = sal_True;
else
- bShort = FALSE;
+ bShort = sal_False;
while ( i < nPoints )
{
// Feststellen, welcher Typ geschrieben werden soll
@@ -1996,9 +1996,9 @@ SvStream& operator<<( SvStream& rOStream, const Polygon& rPoly )
(rPoly.mpImplPolygon->mpPointAry[nStart].X() <= SHRT_MAX)) &&
((rPoly.mpImplPolygon->mpPointAry[nStart].Y() >= SHRT_MIN) &&
(rPoly.mpImplPolygon->mpPointAry[nStart].Y() <= SHRT_MAX)) )
- bCurShort = TRUE;
+ bCurShort = sal_True;
else
- bCurShort = FALSE;
+ bCurShort = sal_False;
// Wenn sich die Werte in einen anderen Bereich begeben,
// muessen wir neu rausschreiben
@@ -2011,7 +2011,7 @@ SvStream& operator<<( SvStream& rOStream, const Polygon& rPoly )
i++;
}
- rOStream << bShort << (USHORT)(i-nStart);
+ rOStream << bShort << (sal_uInt16)(i-nStart);
if ( bShort )
{
@@ -2108,7 +2108,7 @@ void Polygon::Write( SvStream& rOStream ) const
// -----------------------------------------------------------------------
// #i74631# numerical correction method for B2DPolygon
-void impCorrectContinuity(basegfx::B2DPolygon& roPolygon, sal_uInt32 nIndex, BYTE nCFlag)
+void impCorrectContinuity(basegfx::B2DPolygon& roPolygon, sal_uInt32 nIndex, sal_uInt8 nCFlag)
{
const sal_uInt32 nPointCount(roPolygon.count());
OSL_ENSURE(nIndex < nPointCount, "impCorrectContinuity: index access out of range (!)");
@@ -2150,7 +2150,7 @@ basegfx::B2DPolygon Polygon::getB2DPolygon() const
{
// handling for curves. Add start point
const Point aStartPoint(mpImplPolygon->mpPointAry[0]);
- BYTE nPointFlag(mpImplPolygon->mpFlagAry[0]);
+ sal_uInt8 nPointFlag(mpImplPolygon->mpFlagAry[0]);
aRetval.append(basegfx::B2DPoint(aStartPoint.X(), aStartPoint.Y()));
Point aControlA, aControlB;
@@ -2272,7 +2272,7 @@ Polygon::Polygon(const basegfx::B2DPolygon& rPolygon)
const Point aStartPoint(FRound(aBezier.getStartPoint().getX()), FRound(aBezier.getStartPoint().getY()));
const sal_uInt32 nStartPointIndex(nArrayInsert);
mpImplPolygon->mpPointAry[nStartPointIndex] = aStartPoint;
- mpImplPolygon->mpFlagAry[nStartPointIndex] = (BYTE)POLY_NORMAL;
+ mpImplPolygon->mpFlagAry[nStartPointIndex] = (sal_uInt8)POLY_NORMAL;
nArrayInsert++;
// prepare next segment
@@ -2285,11 +2285,11 @@ Polygon::Polygon(const basegfx::B2DPolygon& rPolygon)
{
// if one is used, add always two control points due to the old schema
mpImplPolygon->mpPointAry[nArrayInsert] = Point(FRound(aBezier.getControlPointA().getX()), FRound(aBezier.getControlPointA().getY()));
- mpImplPolygon->mpFlagAry[nArrayInsert] = (BYTE)POLY_CONTROL;
+ mpImplPolygon->mpFlagAry[nArrayInsert] = (sal_uInt8)POLY_CONTROL;
nArrayInsert++;
mpImplPolygon->mpPointAry[nArrayInsert] = Point(FRound(aBezier.getControlPointB().getX()), FRound(aBezier.getControlPointB().getY()));
- mpImplPolygon->mpFlagAry[nArrayInsert] = (BYTE)POLY_CONTROL;
+ mpImplPolygon->mpFlagAry[nArrayInsert] = (sal_uInt8)POLY_CONTROL;
nArrayInsert++;
}
@@ -2300,11 +2300,11 @@ Polygon::Polygon(const basegfx::B2DPolygon& rPolygon)
if(basegfx::CONTINUITY_C1 == eCont)
{
- mpImplPolygon->mpFlagAry[nStartPointIndex] = (BYTE)POLY_SMOOTH;
+ mpImplPolygon->mpFlagAry[nStartPointIndex] = (sal_uInt8)POLY_SMOOTH;
}
else if(basegfx::CONTINUITY_C2 == eCont)
{
- mpImplPolygon->mpFlagAry[nStartPointIndex] = (BYTE)POLY_SYMMTR;
+ mpImplPolygon->mpFlagAry[nStartPointIndex] = (sal_uInt8)POLY_SYMMTR;
}
}
@@ -2316,7 +2316,7 @@ Polygon::Polygon(const basegfx::B2DPolygon& rPolygon)
{
// add first point again as closing point due to old definition
mpImplPolygon->mpPointAry[nArrayInsert] = mpImplPolygon->mpPointAry[0];
- mpImplPolygon->mpFlagAry[nArrayInsert] = (BYTE)POLY_NORMAL;
+ mpImplPolygon->mpFlagAry[nArrayInsert] = (sal_uInt8)POLY_NORMAL;
nArrayInsert++;
}
else
@@ -2325,7 +2325,7 @@ Polygon::Polygon(const basegfx::B2DPolygon& rPolygon)
const basegfx::B2DPoint aClosingPoint(rPolygon.getB2DPoint(nB2DLocalCount - 1L));
const Point aEnd(FRound(aClosingPoint.getX()), FRound(aClosingPoint.getY()));
mpImplPolygon->mpPointAry[nArrayInsert] = aEnd;
- mpImplPolygon->mpFlagAry[nArrayInsert] = (BYTE)POLY_NORMAL;
+ mpImplPolygon->mpFlagAry[nArrayInsert] = (sal_uInt8)POLY_NORMAL;
nArrayInsert++;
}
diff --git a/tools/source/generic/poly2.cxx b/tools/source/generic/poly2.cxx
index 9fc7be7c0dcf..fac5cf8c2d20 100644
--- a/tools/source/generic/poly2.cxx
+++ b/tools/source/generic/poly2.cxx
@@ -54,7 +54,7 @@ DBG_NAME( PolyPolygon )
// -----------------------------------------------------------------------
-ImplPolyPolygon::ImplPolyPolygon( USHORT nInitSize )
+ImplPolyPolygon::ImplPolyPolygon( sal_uInt16 nInitSize )
{
mnRefCount = 1;
mnCount = nInitSize;
@@ -75,7 +75,7 @@ ImplPolyPolygon::ImplPolyPolygon( const ImplPolyPolygon& rImplPolyPoly )
if ( rImplPolyPoly.mpPolyAry )
{
mpPolyAry = new SVPPOLYGON[mnSize];
- for ( USHORT i = 0; i < mnCount; i++ )
+ for ( sal_uInt16 i = 0; i < mnCount; i++ )
mpPolyAry[i] = new Polygon( *rImplPolyPoly.mpPolyAry[i] );
}
else
@@ -88,7 +88,7 @@ ImplPolyPolygon::~ImplPolyPolygon()
{
if ( mpPolyAry )
{
- for ( USHORT i = 0; i < mnCount; i++ )
+ for ( sal_uInt16 i = 0; i < mnCount; i++ )
delete mpPolyAry[i];
delete[] mpPolyAry;
}
@@ -96,7 +96,7 @@ ImplPolyPolygon::~ImplPolyPolygon()
// =======================================================================
-PolyPolygon::PolyPolygon( USHORT nInitSize, USHORT nResize )
+PolyPolygon::PolyPolygon( sal_uInt16 nInitSize, sal_uInt16 nResize )
{
DBG_CTOR( PolyPolygon, NULL );
@@ -128,7 +128,7 @@ PolyPolygon::PolyPolygon( const Polygon& rPoly )
// -----------------------------------------------------------------------
-PolyPolygon::PolyPolygon( USHORT nPoly, const USHORT* pPointCountAry,
+PolyPolygon::PolyPolygon( sal_uInt16 nPoly, const sal_uInt16* pPointCountAry,
const Point* pPtAry )
{
DBG_CTOR( PolyPolygon, NULL );
@@ -137,7 +137,7 @@ PolyPolygon::PolyPolygon( USHORT nPoly, const USHORT* pPointCountAry,
nPoly = MAX_POLYGONS;
mpImplPolyPolygon = new ImplPolyPolygon( nPoly );
- for ( USHORT i = 0; i < nPoly; i++ )
+ for ( sal_uInt16 i = 0; i < nPoly; i++ )
{
mpImplPolyPolygon->mpPolyAry[i] = new Polygon( *pPointCountAry, pPtAry );
pPtAry += *pPointCountAry;
@@ -171,7 +171,7 @@ PolyPolygon::~PolyPolygon()
// -----------------------------------------------------------------------
-void PolyPolygon::Insert( const Polygon& rPoly, USHORT nPos )
+void PolyPolygon::Insert( const Polygon& rPoly, sal_uInt16 nPos )
{
DBG_CHKTHIS( PolyPolygon, NULL );
@@ -191,8 +191,8 @@ void PolyPolygon::Insert( const Polygon& rPoly, USHORT nPos )
mpImplPolyPolygon->mpPolyAry = new SVPPOLYGON[mpImplPolyPolygon->mnSize];
else if ( mpImplPolyPolygon->mnCount == mpImplPolyPolygon->mnSize )
{
- USHORT nOldSize = mpImplPolyPolygon->mnSize;
- USHORT nNewSize = nOldSize + mpImplPolyPolygon->mnResize;
+ sal_uInt16 nOldSize = mpImplPolyPolygon->mnSize;
+ sal_uInt16 nNewSize = nOldSize + mpImplPolyPolygon->mnResize;
SVPPOLYGON* pNewAry;
if ( nNewSize >= MAX_POLYGONS )
@@ -218,7 +218,7 @@ void PolyPolygon::Insert( const Polygon& rPoly, USHORT nPos )
// -----------------------------------------------------------------------
-void PolyPolygon::Remove( USHORT nPos )
+void PolyPolygon::Remove( sal_uInt16 nPos )
{
DBG_CHKTHIS( PolyPolygon, NULL );
DBG_ASSERT( nPos < Count(), "PolyPolygon::Remove(): nPos >= nSize" );
@@ -238,7 +238,7 @@ void PolyPolygon::Remove( USHORT nPos )
// -----------------------------------------------------------------------
-void PolyPolygon::Replace( const Polygon& rPoly, USHORT nPos )
+void PolyPolygon::Replace( const Polygon& rPoly, sal_uInt16 nPos )
{
DBG_CHKTHIS( PolyPolygon, NULL );
DBG_ASSERT( nPos < Count(), "PolyPolygon::Replace(): nPos >= nSize" );
@@ -255,7 +255,7 @@ void PolyPolygon::Replace( const Polygon& rPoly, USHORT nPos )
// -----------------------------------------------------------------------
-const Polygon& PolyPolygon::GetObject( USHORT nPos ) const
+const Polygon& PolyPolygon::GetObject( sal_uInt16 nPos ) const
{
DBG_CHKTHIS( PolyPolygon, NULL );
DBG_ASSERT( nPos < Count(), "PolyPolygon::GetObject(): nPos >= nSize" );
@@ -265,9 +265,9 @@ const Polygon& PolyPolygon::GetObject( USHORT nPos ) const
// -----------------------------------------------------------------------
-BOOL PolyPolygon::IsRect() const
+sal_Bool PolyPolygon::IsRect() const
{
- BOOL bIsRect = FALSE;
+ sal_Bool bIsRect = sal_False;
if ( Count() == 1 )
bIsRect = mpImplPolyPolygon->mpPolyAry[ 0 ]->IsRect();
return bIsRect;
@@ -289,7 +289,7 @@ void PolyPolygon::Clear()
{
if ( mpImplPolyPolygon->mpPolyAry )
{
- for ( USHORT i = 0; i < mpImplPolyPolygon->mnCount; i++ )
+ for ( sal_uInt16 i = 0; i < mpImplPolyPolygon->mnCount; i++ )
delete mpImplPolyPolygon->mpPolyAry[i];
delete[] mpImplPolyPolygon->mpPolyAry;
mpImplPolyPolygon->mpPolyAry = NULL;
@@ -301,15 +301,15 @@ void PolyPolygon::Clear()
// -----------------------------------------------------------------------
-void PolyPolygon::Optimize( ULONG nOptimizeFlags, const PolyOptimizeData* pData )
+void PolyPolygon::Optimize( sal_uIntPtr nOptimizeFlags, const PolyOptimizeData* pData )
{
DBG_CHKTHIS( PolyPolygon, NULL );
if( nOptimizeFlags )
{
double fArea;
- const BOOL bEdges = ( nOptimizeFlags & POLY_OPTIMIZE_EDGES ) == POLY_OPTIMIZE_EDGES;
- USHORT nPercent = 0;
+ const sal_Bool bEdges = ( nOptimizeFlags & POLY_OPTIMIZE_EDGES ) == POLY_OPTIMIZE_EDGES;
+ sal_uInt16 nPercent = 0;
if( bEdges )
{
@@ -328,7 +328,7 @@ void PolyPolygon::Optimize( ULONG nOptimizeFlags, const PolyOptimizeData* pData
}
// Optimize polygons
- for( USHORT i = 0, nPolyCount = mpImplPolyPolygon->mnCount; i < nPolyCount; i++ )
+ for( sal_uInt16 i = 0, nPolyCount = mpImplPolyPolygon->mnCount; i < nPolyCount; i++ )
{
if( bEdges )
{
@@ -352,7 +352,7 @@ void PolyPolygon::AdaptiveSubdivide( PolyPolygon& rResult, const double d ) cons
Polygon aPolygon;
- for( USHORT i = 0; i < mpImplPolyPolygon->mnCount; i++ )
+ for( sal_uInt16 i = 0; i < mpImplPolyPolygon->mnCount; i++ )
{
mpImplPolyPolygon->mpPolyAry[ i ]->AdaptiveSubdivide( aPolygon, d );
rResult.Insert( aPolygon );
@@ -389,7 +389,7 @@ void PolyPolygon::GetXOR( const PolyPolygon& rPolyPoly, PolyPolygon& rResult ) c
// -----------------------------------------------------------------------
-void PolyPolygon::ImplDoOperation( const PolyPolygon& rPolyPoly, PolyPolygon& rResult, ULONG nOperation ) const
+void PolyPolygon::ImplDoOperation( const PolyPolygon& rPolyPoly, PolyPolygon& rResult, sal_uIntPtr nOperation ) const
{
// Convert to B2DPolyPolygon, temporarily. It might be
// advantageous in the future, to have a PolyPolygon adaptor that
@@ -442,7 +442,7 @@ void PolyPolygon::ImplDoOperation( const PolyPolygon& rPolyPoly, PolyPolygon& rR
// -----------------------------------------------------------------------
-USHORT PolyPolygon::Count() const
+sal_uInt16 PolyPolygon::Count() const
{
DBG_CHKTHIS( PolyPolygon, NULL );
return mpImplPolyPolygon->mnCount;
@@ -465,8 +465,8 @@ void PolyPolygon::Move( long nHorzMove, long nVertMove )
}
// Punkte verschieben
- USHORT nPolyCount = mpImplPolyPolygon->mnCount;
- for ( USHORT i = 0; i < nPolyCount; i++ )
+ sal_uInt16 nPolyCount = mpImplPolyPolygon->mnCount;
+ for ( sal_uInt16 i = 0; i < nPolyCount; i++ )
mpImplPolyPolygon->mpPolyAry[i]->Move( nHorzMove, nVertMove );
}
}
@@ -485,7 +485,7 @@ void PolyPolygon::Translate( const Point& rTrans )
}
// Punkte verschieben
- for ( USHORT i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
+ for ( sal_uInt16 i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
mpImplPolyPolygon->mpPolyAry[ i ]->Translate( rTrans );
}
@@ -503,13 +503,13 @@ void PolyPolygon::Scale( double fScaleX, double fScaleY )
}
// Punkte verschieben
- for ( USHORT i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
+ for ( sal_uInt16 i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
mpImplPolyPolygon->mpPolyAry[ i ]->Scale( fScaleX, fScaleY );
}
// -----------------------------------------------------------------------
-void PolyPolygon::Rotate( const Point& rCenter, USHORT nAngle10 )
+void PolyPolygon::Rotate( const Point& rCenter, sal_uInt16 nAngle10 )
{
DBG_CHKTHIS( PolyPolygon, NULL );
nAngle10 %= 3600;
@@ -535,7 +535,7 @@ void PolyPolygon::Rotate( const Point& rCenter, double fSin, double fCos )
}
// Punkte verschieben
- for ( USHORT i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
+ for ( sal_uInt16 i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
mpImplPolyPolygon->mpPolyAry[ i ]->Rotate( rCenter, fSin, fCos );
}
@@ -553,7 +553,7 @@ void PolyPolygon::SlantX( long nYRef, double fSin, double fCos )
}
// Punkte verschieben
- for ( USHORT i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
+ for ( sal_uInt16 i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
mpImplPolyPolygon->mpPolyAry[ i ]->SlantX( nYRef, fSin, fCos );
}
@@ -571,7 +571,7 @@ void PolyPolygon::SlantY( long nXRef, double fSin, double fCos )
}
// Punkte verschieben
- for ( USHORT i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
+ for ( sal_uInt16 i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
mpImplPolyPolygon->mpPolyAry[ i ]->SlantY( nXRef, fSin, fCos );
}
@@ -589,7 +589,7 @@ void PolyPolygon::Distort( const Rectangle& rRefRect, const Polygon& rDistortedR
}
// Punkte verschieben
- for ( USHORT i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
+ for ( sal_uInt16 i = 0, nCount = mpImplPolyPolygon->mnCount; i < nCount; i++ )
mpImplPolyPolygon->mpPolyAry[ i ]->Distort( rRefRect, rDistortedRect );
}
@@ -599,8 +599,8 @@ void PolyPolygon::Distort( const Rectangle& rRefRect, const Polygon& rDistortedR
void PolyPolygon::Clip( const Rectangle& rRect )
{
// Polygon-Clippen
- USHORT nPolyCount = mpImplPolyPolygon->mnCount;
- USHORT i;
+ sal_uInt16 nPolyCount = mpImplPolyPolygon->mnCount;
+ sal_uInt16 i;
if ( !nPolyCount )
return;
@@ -630,16 +630,16 @@ Rectangle PolyPolygon::GetBoundRect() const
DBG_CHKTHIS( PolyPolygon, NULL );
long nXMin=0, nXMax=0, nYMin=0, nYMax=0;
- BOOL bFirst = TRUE;
- USHORT nPolyCount = mpImplPolyPolygon->mnCount;
+ sal_Bool bFirst = sal_True;
+ sal_uInt16 nPolyCount = mpImplPolyPolygon->mnCount;
- for ( USHORT n = 0; n < nPolyCount; n++ )
+ for ( sal_uInt16 n = 0; n < nPolyCount; n++ )
{
const Polygon* pPoly = mpImplPolyPolygon->mpPolyAry[n];
const Point* pAry = pPoly->GetConstPointAry();
- USHORT nPointCount = pPoly->GetSize();
+ sal_uInt16 nPointCount = pPoly->GetSize();
- for ( USHORT i = 0; i < nPointCount; i++ )
+ for ( sal_uInt16 i = 0; i < nPointCount; i++ )
{
const Point* pPt = &pAry[ i ];
@@ -647,7 +647,7 @@ Rectangle PolyPolygon::GetBoundRect() const
{
nXMin = nXMax = pPt->X();
nYMin = nYMax = pPt->Y();
- bFirst = FALSE;
+ bFirst = sal_False;
}
else
{
@@ -671,7 +671,7 @@ Rectangle PolyPolygon::GetBoundRect() const
// -----------------------------------------------------------------------
-Polygon& PolyPolygon::operator[]( USHORT nPos )
+Polygon& PolyPolygon::operator[]( sal_uInt16 nPos )
{
DBG_CHKTHIS( PolyPolygon, NULL );
DBG_ASSERT( nPos < Count(), "PolyPolygon::[](): nPos >= nSize" );
@@ -706,15 +706,15 @@ PolyPolygon& PolyPolygon::operator=( const PolyPolygon& rPolyPoly )
// -----------------------------------------------------------------------
-BOOL PolyPolygon::operator==( const PolyPolygon& rPolyPoly ) const
+sal_Bool PolyPolygon::operator==( const PolyPolygon& rPolyPoly ) const
{
DBG_CHKTHIS( PolyPolygon, NULL );
DBG_CHKOBJ( &rPolyPoly, PolyPolygon, NULL );
if ( rPolyPoly.mpImplPolyPolygon == mpImplPolyPolygon )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -747,7 +747,7 @@ SvStream& operator>>( SvStream& rIStream, PolyPolygon& rPolyPoly )
DBG_ASSERTWARNING( rIStream.GetVersion(), "PolyPolygon::>> - Solar-Version not set on rIStream" );
Polygon* pPoly;
- USHORT nPolyCount;
+ sal_uInt16 nPolyCount;
// Anzahl der Polygone einlesen
rIStream >> nPolyCount;
@@ -763,7 +763,7 @@ SvStream& operator>>( SvStream& rIStream, PolyPolygon& rPolyPoly )
rPolyPoly.mpImplPolyPolygon = new ImplPolyPolygon( nPolyCount );
- for ( USHORT i = 0; i < nPolyCount; i++ )
+ for ( sal_uInt16 i = 0; i < nPolyCount; i++ )
{
pPoly = new Polygon;
rIStream >> *pPoly;
@@ -784,11 +784,11 @@ SvStream& operator<<( SvStream& rOStream, const PolyPolygon& rPolyPoly )
DBG_ASSERTWARNING( rOStream.GetVersion(), "PolyPolygon::<< - Solar-Version not set on rOStream" );
// Anzahl der Polygone rausschreiben
- USHORT nPolyCount = rPolyPoly.mpImplPolyPolygon->mnCount;
+ sal_uInt16 nPolyCount = rPolyPoly.mpImplPolyPolygon->mnCount;
rOStream << nPolyCount;
// Die einzelnen Polygone ausgeben
- for ( USHORT i = 0; i < nPolyCount; i++ )
+ for ( sal_uInt16 i = 0; i < nPolyCount; i++ )
rOStream << *(rPolyPoly.mpImplPolyPolygon->mpPolyAry[i]);
return rOStream;
@@ -804,7 +804,7 @@ void PolyPolygon::Read( SvStream& rIStream )
DBG_ASSERTWARNING( rIStream.GetVersion(), "PolyPolygon::>> - Solar-Version not set on rIStream" );
Polygon* pPoly;
- USHORT nPolyCount;
+ sal_uInt16 nPolyCount;
// Anzahl der Polygone einlesen
rIStream >> nPolyCount;
@@ -820,7 +820,7 @@ void PolyPolygon::Read( SvStream& rIStream )
mpImplPolyPolygon = new ImplPolyPolygon( nPolyCount );
- for ( USHORT i = 0; i < nPolyCount; i++ )
+ for ( sal_uInt16 i = 0; i < nPolyCount; i++ )
{
pPoly = new Polygon;
pPoly->ImplRead( rIStream );
@@ -841,11 +841,11 @@ void PolyPolygon::Write( SvStream& rOStream ) const
DBG_ASSERTWARNING( rOStream.GetVersion(), "PolyPolygon::<< - Solar-Version not set on rOStream" );
// Anzahl der Polygone rausschreiben
- USHORT nPolyCount = mpImplPolyPolygon->mnCount;
+ sal_uInt16 nPolyCount = mpImplPolyPolygon->mnCount;
rOStream << nPolyCount;
// Die einzelnen Polygone ausgeben
- for ( USHORT i = 0; i < nPolyCount; i++ )
+ for ( sal_uInt16 i = 0; i < nPolyCount; i++ )
mpImplPolyPolygon->mpPolyAry[i]->ImplWrite( rOStream );;
}
diff --git a/tools/source/generic/svborder.cxx b/tools/source/generic/svborder.cxx
index b9912a97d853..86df3dcffd82 100644
--- a/tools/source/generic/svborder.cxx
+++ b/tools/source/generic/svborder.cxx
@@ -43,7 +43,7 @@ SvBorder::SvBorder( const Rectangle & rOuter, const Rectangle & rInner )
aInner.Justify();
OSL_ENSURE( aOuter.IsInside( aInner ),
- "SvBorder::SvBorder: FALSE == aOuter.IsInside( aInner )" );
+ "SvBorder::SvBorder: sal_False == aOuter.IsInside( aInner )" );
nTop = aInner.Top() - aOuter.Top();
nRight = aOuter.Right() - aInner.Right();
nBottom = aOuter.Bottom() - aInner.Bottom();
diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx
index cc3f587e3e90..749efd8d0964 100644
--- a/tools/source/inet/inetmsg.cxx
+++ b/tools/source/inet/inetmsg.cxx
@@ -79,7 +79,7 @@ INetMessage::~INetMessage (void)
void INetMessage::ListCleanup_Impl (void)
{
// Cleanup.
- ULONG i, n = m_aHeaderList.Count();
+ sal_uIntPtr i, n = m_aHeaderList.Count();
for (i = 0; i < n; i++)
delete ((HEADERFIELD*)(m_aHeaderList.GetObject(i)));
m_aHeaderList.Clear();
@@ -96,7 +96,7 @@ void INetMessage::ListCopy (const INetMessage &rMsg)
ListCleanup_Impl();
// Copy.
- ULONG i, n = rMsg.GetHeaderCount();
+ sal_uIntPtr i, n = rMsg.GetHeaderCount();
for (i = 0; i < n; i++)
{
HEADERFIELD *p = (HEADERFIELD*)(rMsg.m_aHeaderList.GetObject(i));
@@ -112,7 +112,7 @@ void INetMessage::SetHeaderField_Impl (
INetMIME::HeaderFieldType eType,
const ByteString &rName,
const UniString &rValue,
- ULONG &rnIndex)
+ sal_uIntPtr &rnIndex)
{
INetMIMEStringOutputSink aSink (0, STRING_MAXLEN);
INetMIME::writeHeaderFieldBody (
@@ -124,10 +124,10 @@ void INetMessage::SetHeaderField_Impl (
/*
* SetHeaderField.
*/
-ULONG INetMessage::SetHeaderField (
- const UniString& rName, const UniString& rValue, ULONG nIndex)
+sal_uIntPtr INetMessage::SetHeaderField (
+ const UniString& rName, const UniString& rValue, sal_uIntPtr nIndex)
{
- ULONG nResult = nIndex;
+ sal_uIntPtr nResult = nIndex;
SetHeaderField_Impl (
INetMIME::HEADER_FIELD_TEXT,
ByteString (rName, RTL_TEXTENCODING_ASCII_US), rValue,
@@ -138,10 +138,10 @@ ULONG INetMessage::SetHeaderField (
/*
* SetHeaderField.
*/
-ULONG INetMessage::SetHeaderField (
- const INetMessageHeader &rHeader, ULONG nIndex)
+sal_uIntPtr INetMessage::SetHeaderField (
+ const INetMessageHeader &rHeader, sal_uIntPtr nIndex)
{
- ULONG nResult = nIndex;
+ sal_uIntPtr nResult = nIndex;
SetHeaderField_Impl (rHeader, nResult);
return nResult;
}
@@ -155,7 +155,7 @@ SvStream& INetMessage::operator<< (SvStream& rStrm) const
rStrm << static_cast<sal_uInt32>(m_nDocSize);
rStrm.WriteByteString (m_aDocName, RTL_TEXTENCODING_UTF8);
- ULONG i, n = m_aHeaderList.Count();
+ sal_uIntPtr i, n = m_aHeaderList.Count();
rStrm << static_cast<sal_uInt32>(n);
for (i = 0; i < n; i++)
@@ -181,7 +181,7 @@ SvStream& INetMessage::operator>> (SvStream& rStrm)
m_nDocSize = nTemp;
rStrm.ReadByteString (m_aDocName, RTL_TEXTENCODING_UTF8);
- ULONG i, n = 0;
+ sal_uIntPtr i, n = 0;
rStrm >> nTemp;
n = nTemp;
@@ -204,7 +204,7 @@ SvStream& INetMessage::operator>> (SvStream& rStrm)
INetMessageHeaderIterator::INetMessageHeaderIterator (
const INetMessage& rMsg, const UniString& rHdrName)
{
- ULONG i, n = rMsg.GetHeaderCount();
+ sal_uIntPtr i, n = rMsg.GetHeaderCount();
for (i = 0; i < n; i++)
{
if (rHdrName.CompareIgnoreCaseToAscii (rMsg.GetHeaderName(i)) == 0)
@@ -218,7 +218,7 @@ INetMessageHeaderIterator::INetMessageHeaderIterator (
INetMessageHeaderIterator::~INetMessageHeaderIterator (void)
{
- ULONG i, n = aValueList.Count();
+ sal_uIntPtr i, n = aValueList.Count();
for (i = 0; i < n; i++)
delete ((UniString*)(aValueList.GetObject(i)));
aValueList.Clear();
@@ -290,14 +290,14 @@ enum _ImplINetRFC822MessageHeaderState
INetRFC822Message::INetRFC822Message (void)
: INetMessage()
{
- for (USHORT i = 0; i < INETMSG_RFC822_NUMHDR; i++)
+ for (sal_uInt16 i = 0; i < INETMSG_RFC822_NUMHDR; i++)
m_nIndex[i] = LIST_ENTRY_NOTFOUND;
}
INetRFC822Message::INetRFC822Message (const INetRFC822Message& rMsg)
: INetMessage (rMsg)
{
- for (USHORT i = 0; i < INETMSG_RFC822_NUMHDR; i++)
+ for (sal_uInt16 i = 0; i < INETMSG_RFC822_NUMHDR; i++)
m_nIndex[i] = rMsg.m_nIndex[i];
}
@@ -310,7 +310,7 @@ INetRFC822Message& INetRFC822Message::operator= (const INetRFC822Message& rMsg)
{
INetMessage::operator= (rMsg);
- for (USHORT i = 0; i < INETMSG_RFC822_NUMHDR; i++)
+ for (sal_uInt16 i = 0; i < INETMSG_RFC822_NUMHDR; i++)
m_nIndex[i] = rMsg.m_nIndex[i];
}
return *this;
@@ -357,28 +357,28 @@ static const sal_Char *wkdays[7] =
/*
* GenerateDateField.
*/
-BOOL INetRFC822Message::GenerateDateField (
+sal_Bool INetRFC822Message::GenerateDateField (
const DateTime& rDateTime, UniString& rDateFieldW)
{
// Check arguments.
if (!rDateTime.IsValid() ||
(rDateTime.GetSec() > 59) ||
(rDateTime.GetMin() > 59) ||
- (rDateTime.GetHour() > 23) ) return FALSE;
+ (rDateTime.GetHour() > 23) ) return sal_False;
// Prepare output string.
ByteString rDateField;
// Insert Date.
- rDateField += wkdays[(USHORT)(rDateTime.GetDayOfWeek())];
+ rDateField += wkdays[(sal_uInt16)(rDateTime.GetDayOfWeek())];
rDateField += ", ";
- USHORT nNum = rDateTime.GetDay();
+ sal_uInt16 nNum = rDateTime.GetDay();
if (nNum < 10) rDateField += '0';
rDateField += ByteString::CreateFromInt32(nNum);
rDateField += ' ';
- rDateField += months[(USHORT)(rDateTime.GetMonth() - 1)];
+ rDateField += months[(sal_uInt16)(rDateTime.GetMonth() - 1)];
rDateField += ' ';
rDateField += ByteString::CreateFromInt32(rDateTime.GetYear());
@@ -402,47 +402,47 @@ BOOL INetRFC822Message::GenerateDateField (
// Done.
rDateFieldW = UniString (rDateField, RTL_TEXTENCODING_ASCII_US);
- return TRUE;
+ return sal_True;
}
/*
* ParseDateField and local helper functions.
*/
-static USHORT ParseNumber (const ByteString& rStr, USHORT& nIndex)
+static sal_uInt16 ParseNumber (const ByteString& rStr, sal_uInt16& nIndex)
{
- USHORT n = nIndex;
+ sal_uInt16 n = nIndex;
while ((n < rStr.Len()) && ascii_isDigit(rStr.GetChar(n))) n++;
ByteString aNum (rStr.Copy (nIndex, (n - nIndex)));
nIndex = n;
- return (USHORT)(aNum.ToInt32());
+ return (sal_uInt16)(aNum.ToInt32());
}
-static USHORT ParseMonth (const ByteString& rStr, USHORT& nIndex)
+static sal_uInt16 ParseMonth (const ByteString& rStr, sal_uInt16& nIndex)
{
- USHORT n = nIndex;
+ sal_uInt16 n = nIndex;
while ((n < rStr.Len()) && ascii_isLetter(rStr.GetChar(n))) n++;
ByteString aMonth (rStr.Copy (nIndex, 3));
nIndex = n;
- USHORT i;
+ sal_uInt16 i;
for (i = 0; i < 12; i++)
if (aMonth.CompareIgnoreCaseToAscii (months[i]) == 0) break;
return (i + 1);
}
-BOOL INetRFC822Message::ParseDateField (
+sal_Bool INetRFC822Message::ParseDateField (
const UniString& rDateFieldW, DateTime& rDateTime)
{
ByteString rDateField (rDateFieldW, RTL_TEXTENCODING_ASCII_US);
- if (rDateField.Len() == 0) return FALSE;
+ if (rDateField.Len() == 0) return sal_False;
if (rDateField.Search (':') != STRING_NOTFOUND)
{
// Some DateTime format.
- USHORT nIndex = 0;
+ sal_uInt16 nIndex = 0;
// Skip over <Wkd> or <Weekday>, leading and trailing space.
while ((nIndex < rDateField.Len()) &&
@@ -462,7 +462,7 @@ BOOL INetRFC822Message::ParseDateField (
if (ascii_isLetter (rDateField.GetChar(nIndex)))
{
// Format: ctime().
- if ((rDateField.Len() - nIndex) < 20) return FALSE;
+ if ((rDateField.Len() - nIndex) < 20) return sal_False;
rDateTime.SetMonth (ParseMonth (rDateField, nIndex)); nIndex++;
rDateTime.SetDay (ParseNumber (rDateField, nIndex)); nIndex++;
@@ -472,19 +472,19 @@ BOOL INetRFC822Message::ParseDateField (
rDateTime.SetSec (ParseNumber (rDateField, nIndex)); nIndex++;
rDateTime.Set100Sec (0);
- USHORT nYear = ParseNumber (rDateField, nIndex);
+ sal_uInt16 nYear = ParseNumber (rDateField, nIndex);
if (nYear < 100) nYear += 1900;
rDateTime.SetYear (nYear);
}
else
{
// Format: RFC1036 or RFC1123.
- if ((rDateField.Len() - nIndex) < 17) return FALSE;
+ if ((rDateField.Len() - nIndex) < 17) return sal_False;
rDateTime.SetDay (ParseNumber (rDateField, nIndex)); nIndex++;
rDateTime.SetMonth (ParseMonth (rDateField, nIndex)); nIndex++;
- USHORT nYear = ParseNumber (rDateField, nIndex); nIndex++;
+ sal_uInt16 nYear = ParseNumber (rDateField, nIndex); nIndex++;
if (nYear < 100) nYear += 1900;
rDateTime.SetYear (nYear);
@@ -497,8 +497,8 @@ BOOL INetRFC822Message::ParseDateField (
(rDateField.GetChar(nIndex) == '-') )
{
// Offset from GMT: "(+|-)HHMM".
- BOOL bEast = (rDateField.GetChar(nIndex++) == '+');
- USHORT nOffset = ParseNumber (rDateField, nIndex);
+ sal_Bool bEast = (rDateField.GetChar(nIndex++) == '+');
+ sal_uInt16 nOffset = ParseNumber (rDateField, nIndex);
if (nOffset > 0)
{
Time aDiff;
@@ -531,7 +531,7 @@ BOOL INetRFC822Message::ParseDateField (
else
{
// Junk.
- return FALSE;
+ return sal_False;
}
return (rDateTime.IsValid() &&
@@ -544,15 +544,15 @@ BOOL INetRFC822Message::ParseDateField (
* SetHeaderField.
* (Header Field Parser).
*/
-ULONG INetRFC822Message::SetHeaderField (
- const INetMessageHeader &rHeader, ULONG nNewIndex)
+sal_uIntPtr INetRFC822Message::SetHeaderField (
+ const INetMessageHeader &rHeader, sal_uIntPtr nNewIndex)
{
ByteString aName (rHeader.GetName());
const sal_Char *pData = aName.GetBuffer();
const sal_Char *pStop = pData + aName.Len() + 1;
const sal_Char *check = "";
- ULONG nIdx = LIST_APPEND;
+ sal_uIntPtr nIdx = LIST_APPEND;
int eState = INETMSG_RFC822_BEGIN;
int eOkState = INETMSG_RFC822_OK;
@@ -913,7 +913,7 @@ SvStream& INetRFC822Message::operator<< (SvStream& rStrm) const
{
INetMessage::operator<< (rStrm);
- for (USHORT i = 0; i < INETMSG_RFC822_NUMHDR; i++)
+ for (sal_uInt16 i = 0; i < INETMSG_RFC822_NUMHDR; i++)
rStrm << static_cast<sal_uInt32>(m_nIndex[i]);
return rStrm;
@@ -927,7 +927,7 @@ SvStream& INetRFC822Message::operator>> (SvStream& rStrm)
INetMessage::operator>> (rStrm);
sal_uInt32 nTemp;
- for (USHORT i = 0; i < INETMSG_RFC822_NUMHDR; i++)
+ for (sal_uInt16 i = 0; i < INETMSG_RFC822_NUMHDR; i++)
{
rStrm >> nTemp;
m_nIndex[i] = nTemp;
@@ -991,9 +991,9 @@ INetMIMEMessage::INetMIMEMessage (void)
: INetRFC822Message (),
pParent (NULL),
nNumChildren (0),
- bHeaderParsed (FALSE)
+ bHeaderParsed (sal_False)
{
- for (USHORT i = 0; i < INETMSG_MIME_NUMHDR; i++)
+ for (sal_uInt16 i = 0; i < INETMSG_MIME_NUMHDR; i++)
m_nIndex[i] = LIST_ENTRY_NOTFOUND;
}
@@ -1050,7 +1050,7 @@ void INetMIMEMessage::CopyImp (const INetMIMEMessage& rMsg)
{
bHeaderParsed = rMsg.bHeaderParsed;
- USHORT i;
+ sal_uInt16 i;
for (i = 0; i < INETMSG_MIME_NUMHDR; i++)
m_nIndex[i] = rMsg.m_nIndex[i];
@@ -1084,15 +1084,15 @@ INetMIMEMessage *INetMIMEMessage::CreateMessage (
* SetHeaderField.
* (Header Field Parser).
*/
-ULONG INetMIMEMessage::SetHeaderField (
- const INetMessageHeader &rHeader, ULONG nNewIndex)
+sal_uIntPtr INetMIMEMessage::SetHeaderField (
+ const INetMessageHeader &rHeader, sal_uIntPtr nNewIndex)
{
ByteString aName (rHeader.GetName());
const sal_Char *pData = aName.GetBuffer();
const sal_Char *pStop = pData + aName.Len() + 1;
const sal_Char *check = "";
- ULONG nIdx = LIST_APPEND;
+ sal_uIntPtr nIdx = LIST_APPEND;
int eState = INETMSG_MIME_BEGIN;
int eOkState = INETMSG_MIME_OK;
@@ -1320,11 +1320,11 @@ void INetMIMEMessage::GetDefaultContentType (String& rContentType)
/*
* EnableAttachChild.
*/
-BOOL INetMIMEMessage::EnableAttachChild (INetMessageContainerType eType)
+sal_Bool INetMIMEMessage::EnableAttachChild (INetMessageContainerType eType)
{
// Check context.
if (IsContainer())
- return FALSE;
+ return sal_False;
// Setup Content-Type header field.
ByteString aContentType;
@@ -1384,14 +1384,14 @@ BOOL INetMIMEMessage::EnableAttachChild (INetMessageContainerType eType)
SetContentTransferEncoding (String (CONSTASCII_STRINGPARAM("7bit")));
// Done.
- return TRUE;
+ return sal_True;
}
/*
* AttachChild.
*/
-BOOL INetMIMEMessage::AttachChild (
- INetMIMEMessage& rChildMsg, BOOL bOwner)
+sal_Bool INetMIMEMessage::AttachChild (
+ INetMIMEMessage& rChildMsg, sal_Bool bOwner)
{
if (IsContainer() /*&& rChildMsg.GetContentType().Len() */)
{
@@ -1399,21 +1399,21 @@ BOOL INetMIMEMessage::AttachChild (
aChildren.Insert (&rChildMsg, LIST_APPEND);
nNumChildren = aChildren.Count();
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*
* DetachChild.
*/
-BOOL INetMIMEMessage::DetachChild (
- ULONG nIndex, INetMIMEMessage& rChildMsg) const
+sal_Bool INetMIMEMessage::DetachChild (
+ sal_uIntPtr nIndex, INetMIMEMessage& rChildMsg) const
{
if (IsContainer())
{
// Check document stream.
- if (GetDocumentLB() == NULL) return FALSE;
+ if (GetDocumentLB() == NULL) return sal_False;
SvStream *pDocStrm = new SvStream (GetDocumentLB());
// Initialize message buffer.
@@ -1488,7 +1488,7 @@ BOOL INetMIMEMessage::DetachChild (
* Compare buffered line with part/close delimiter.
* Increment current part index upon match.
*/
- USHORT nLen = (USHORT)(aLineBuf.Tell() & 0xffff);
+ sal_uInt16 nLen = (sal_uInt16)(aLineBuf.Tell() & 0xffff);
if (nLen == aDelim.Len())
{
if (aDelim.CompareTo ((const sal_Char *) aLineBuf.GetData(), nLen)
@@ -1514,7 +1514,7 @@ BOOL INetMIMEMessage::DetachChild (
pMsgRead = pMsgWrite = pMsgBuffer;
// Read document stream.
- ULONG nRead = pDocStrm->Read (
+ sal_uIntPtr nRead = pDocStrm->Read (
pMsgBuffer, sizeof (pMsgBuffer));
if (nRead > 0)
{
@@ -1533,7 +1533,7 @@ BOOL INetMIMEMessage::DetachChild (
{
// Requested part not found.
delete pDocStrm;
- return FALSE;
+ return sal_False;
}
}
}
@@ -1573,7 +1573,7 @@ BOOL INetMIMEMessage::DetachChild (
pMsgRead = pMsgWrite = pMsgBuffer;
// Read document stream.
- ULONG nRead = pDocStrm->Read (
+ sal_uIntPtr nRead = pDocStrm->Read (
pMsgBuffer, sizeof (pMsgBuffer));
if (nRead > 0)
{
@@ -1592,9 +1592,9 @@ BOOL INetMIMEMessage::DetachChild (
// Done.
if (pDocStrm) delete pDocStrm;
if (pMsgStrm) delete pMsgStrm;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*
@@ -1604,7 +1604,7 @@ SvStream& INetMIMEMessage::operator<< (SvStream& rStrm) const
{
INetRFC822Message::operator<< (rStrm);
- for (USHORT i = 0; i < INETMSG_MIME_NUMHDR; i++)
+ for (sal_uInt16 i = 0; i < INETMSG_MIME_NUMHDR; i++)
rStrm << static_cast<sal_uInt32>(m_nIndex[i]);
#ifdef ENABLE_BYTESTRING_STREAM_OPERATORS
@@ -1625,7 +1625,7 @@ SvStream& INetMIMEMessage::operator>> (SvStream& rStrm)
INetRFC822Message::operator>> (rStrm);
sal_uInt32 nTemp;
- for (USHORT i = 0; i < INETMSG_MIME_NUMHDR; i++)
+ for (sal_uInt16 i = 0; i < INETMSG_MIME_NUMHDR; i++)
{
rStrm >> nTemp;
m_nIndex[i] = nTemp;
diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx
index 19434d323d10..9390cdd12a9e 100644
--- a/tools/source/inet/inetstrm.cxx
+++ b/tools/source/inet/inetstrm.cxx
@@ -54,23 +54,23 @@ class INetMessageEncodeQPStream_Impl : public INetMessageIStream
{
SvStream *pMsgStrm;
- ULONG nMsgBufSiz;
+ sal_uIntPtr nMsgBufSiz;
sal_Char *pMsgBuffer;
sal_Char *pMsgRead;
sal_Char *pMsgWrite;
- ULONG nTokBufSiz;
+ sal_uIntPtr nTokBufSiz;
sal_Char *pTokBuffer;
sal_Char *pTokRead;
sal_Char *pTokWrite;
INetMessageStreamState eState;
- BOOL bDone;
+ sal_Bool bDone;
- virtual int GetMsgLine (sal_Char *pData, ULONG nSize);
+ virtual int GetMsgLine (sal_Char *pData, sal_uIntPtr nSize);
public:
- INetMessageEncodeQPStream_Impl (ULONG nMsgBufferSize = 1024);
+ INetMessageEncodeQPStream_Impl (sal_uIntPtr nMsgBufferSize = 1024);
virtual ~INetMessageEncodeQPStream_Impl (void);
};
@@ -85,10 +85,10 @@ class INetMessageDecodeQPStream_Impl : public INetMessageOStream
INetMessageStreamState eState;
SvMemoryStream *pMsgBuffer;
- ULONG nTokBufLen;
+ sal_uIntPtr nTokBufLen;
sal_Char pTokBuffer[4];
- virtual int PutMsgLine (const sal_Char *pData, ULONG nSize);
+ virtual int PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize);
public:
INetMessageDecodeQPStream_Impl (void);
@@ -105,22 +105,22 @@ class INetMessageEncode64Stream_Impl : public INetMessageIStream
{
SvStream *pMsgStrm;
- ULONG nMsgBufSiz;
+ sal_uIntPtr nMsgBufSiz;
sal_uInt8 *pMsgBuffer;
sal_uInt8 *pMsgRead;
sal_uInt8 *pMsgWrite;
- ULONG nTokBufSiz;
+ sal_uIntPtr nTokBufSiz;
sal_Char *pTokBuffer;
sal_Char *pTokRead;
sal_Char *pTokWrite;
- BOOL bDone;
+ sal_Bool bDone;
- virtual int GetMsgLine (sal_Char *pData, ULONG nSize);
+ virtual int GetMsgLine (sal_Char *pData, sal_uIntPtr nSize);
public:
- INetMessageEncode64Stream_Impl (ULONG nMsgBufferSize = 2048);
+ INetMessageEncode64Stream_Impl (sal_uIntPtr nMsgBufferSize = 2048);
virtual ~INetMessageEncode64Stream_Impl (void);
};
@@ -134,15 +134,15 @@ class INetMessageDecode64Stream_Impl : public INetMessageOStream
{
INetMessageStreamState eState;
- ULONG nMsgBufSiz;
+ sal_uIntPtr nMsgBufSiz;
sal_Char *pMsgBuffer;
sal_Char *pMsgRead;
sal_Char *pMsgWrite;
- virtual int PutMsgLine (const sal_Char *pData, ULONG nSize);
+ virtual int PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize);
public:
- INetMessageDecode64Stream_Impl (ULONG nMsgBufferSize = 128);
+ INetMessageDecode64Stream_Impl (sal_uIntPtr nMsgBufferSize = 128);
virtual ~INetMessageDecode64Stream_Impl (void);
};
@@ -168,7 +168,7 @@ INetIStream::~INetIStream (void)
/*
* Read.
*/
-int INetIStream::Read (sal_Char *pData, ULONG nSize)
+int INetIStream::Read (sal_Char *pData, sal_uIntPtr nSize)
{
return GetData (pData, nSize);
}
@@ -179,7 +179,7 @@ int INetIStream::Read (sal_Char *pData, ULONG nSize)
void INetIStream::Decode64 (SvStream& rIn, SvStream& rOut)
{
INetMessage aMsg;
- aMsg.SetDocumentLB(new SvAsyncLockBytes(&rOut, FALSE));
+ aMsg.SetDocumentLB(new SvAsyncLockBytes(&rOut, sal_False));
INetMessageDecode64Stream_Impl aStream (8192);
aStream.SetTargetMessage (&aMsg);
@@ -201,7 +201,7 @@ void INetIStream::Encode64 (SvStream& rIn, SvStream& rOut)
{
INetMessage aMsg;
aMsg.SetDocumentLB (
- new SvLockBytes (&rIn, FALSE));
+ new SvLockBytes (&rIn, sal_False));
INetMessageEncode64Stream_Impl aStream (8192);
aStream.SetSourceMessage (&aMsg);
@@ -237,7 +237,7 @@ INetOStream::~INetOStream (void)
/*
* Write.
*/
-int INetOStream::Write (const sal_Char *pData, ULONG nSize)
+int INetOStream::Write (const sal_Char *pData, sal_uIntPtr nSize)
{
return PutData (pData, nSize);
}
@@ -250,9 +250,9 @@ int INetOStream::Write (const sal_Char *pData, ULONG nSize)
/*
* INetMessageIStream.
*/
-INetMessageIStream::INetMessageIStream (ULONG nBufferSize)
+INetMessageIStream::INetMessageIStream (sal_uIntPtr nBufferSize)
: pSourceMsg (NULL),
- bHeaderGenerated (FALSE),
+ bHeaderGenerated (sal_False),
nBufSiz (nBufferSize),
pMsgStrm (NULL),
pMsgBuffer (new SvMemoryStream)
@@ -275,7 +275,7 @@ INetMessageIStream::~INetMessageIStream (void)
/*
* GetData.
*/
-int INetMessageIStream::GetData (sal_Char *pData, ULONG nSize)
+int INetMessageIStream::GetData (sal_Char *pData, sal_uIntPtr nSize)
{
if (pSourceMsg == NULL) return INETSTREAM_STATUS_ERROR;
@@ -285,13 +285,13 @@ int INetMessageIStream::GetData (sal_Char *pData, ULONG nSize)
while (pWBuf < pWEnd)
{
// Caller's buffer not yet filled.
- ULONG n = pRead - pWrite;
+ sal_uIntPtr n = pRead - pWrite;
if (n > 0)
{
// Bytes still in buffer.
- ULONG m = pWEnd - pWBuf;
+ sal_uIntPtr m = pWEnd - pWBuf;
if (m < n) n = m;
- for (ULONG i = 0; i < n; i++) *pWBuf++ = *pWrite++;
+ for (sal_uIntPtr i = 0; i < n; i++) *pWBuf++ = *pWrite++;
}
else
{
@@ -310,7 +310,7 @@ int INetMessageIStream::GetData (sal_Char *pData, ULONG nSize)
if (!bHeaderGenerated)
{
// Header generated. Insert empty line.
- bHeaderGenerated = TRUE;
+ bHeaderGenerated = sal_True;
*pRead++ = '\r';
*pRead++ = '\n';
}
@@ -328,7 +328,7 @@ int INetMessageIStream::GetData (sal_Char *pData, ULONG nSize)
/*
* GetMsgLine.
*/
-int INetMessageIStream::GetMsgLine (sal_Char *pData, ULONG nSize)
+int INetMessageIStream::GetMsgLine (sal_Char *pData, sal_uIntPtr nSize)
{
if (pSourceMsg == NULL) return INETSTREAM_STATUS_ERROR;
@@ -337,7 +337,7 @@ int INetMessageIStream::GetMsgLine (sal_Char *pData, ULONG nSize)
if (!bHeaderGenerated)
{
- ULONG i, n;
+ sal_uIntPtr i, n;
if (pMsgBuffer->Tell() == 0)
{
@@ -380,7 +380,7 @@ int INetMessageIStream::GetMsgLine (sal_Char *pData, ULONG nSize)
if (pMsgStrm == NULL)
pMsgStrm = new SvStream (pSourceMsg->GetDocumentLB());
- ULONG nRead = pMsgStrm->Read (pWBuf, (pWEnd - pWBuf));
+ sal_uIntPtr nRead = pMsgStrm->Read (pWBuf, (pWEnd - pWBuf));
pWBuf += nRead;
}
}
@@ -397,7 +397,7 @@ int INetMessageIStream::GetMsgLine (sal_Char *pData, ULONG nSize)
*/
INetMessageOStream::INetMessageOStream (void)
: pTargetMsg (NULL),
- bHeaderParsed (FALSE),
+ bHeaderParsed (sal_False),
eOState (INETMSG_EOL_BEGIN),
pMsgBuffer (new SvMemoryStream)
{
@@ -428,7 +428,7 @@ INetMessageOStream::~INetMessageOStream (void)
* PutData.
* (Simple Field Parsing (RFC822, Appendix B)).
*/
-int INetMessageOStream::PutData (const sal_Char *pData, ULONG nSize)
+int INetMessageOStream::PutData (const sal_Char *pData, sal_uIntPtr nSize)
{
if (pTargetMsg == NULL) return INETSTREAM_STATUS_ERROR;
@@ -463,7 +463,7 @@ int INetMessageOStream::PutData (const sal_Char *pData, ULONG nSize)
pMsgBuffer->Seek (STREAM_SEEK_TO_BEGIN);
// Mark header parsed.
- bHeaderParsed = TRUE;
+ bHeaderParsed = sal_True;
}
else if ((*pData == ' ') || (*pData == '\t'))
{
@@ -535,7 +535,7 @@ int INetMessageOStream::PutData (const sal_Char *pData, ULONG nSize)
/*
* PutMsgLine.
*/
-int INetMessageOStream::PutMsgLine (const sal_Char *pData, ULONG nSize)
+int INetMessageOStream::PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize)
{
// Check for message container.
if (pTargetMsg == NULL) return INETSTREAM_STATUS_ERROR;
@@ -544,7 +544,7 @@ int INetMessageOStream::PutMsgLine (const sal_Char *pData, ULONG nSize)
if (!IsHeaderParsed())
{
ByteString aField (pData);
- USHORT nPos = aField.Search (':');
+ sal_uInt16 nPos = aField.Search (':');
if (nPos != STRING_NOTFOUND)
{
ByteString aName (
@@ -583,7 +583,7 @@ int INetMessageOStream::PutMsgLine (const sal_Char *pData, ULONG nSize)
/*
* INetMessageIOStream.
*/
-INetMessageIOStream::INetMessageIOStream (ULONG nBufferSize)
+INetMessageIOStream::INetMessageIOStream (sal_uIntPtr nBufferSize)
: INetMessageIStream (nBufferSize),
INetMessageOStream ()
{
@@ -615,15 +615,15 @@ static const sal_Char ebcdic[] = {
* INetMessageEncodeQPStream_Impl.
*/
INetMessageEncodeQPStream_Impl::INetMessageEncodeQPStream_Impl (
- ULONG nMsgBufferSize)
+ sal_uIntPtr nMsgBufferSize)
: INetMessageIStream (),
pMsgStrm (NULL),
nMsgBufSiz (nMsgBufferSize),
nTokBufSiz (80),
eState (INETMSG_EOL_SCR),
- bDone (FALSE)
+ bDone (sal_False)
{
- GenerateHeader (FALSE);
+ GenerateHeader (sal_False);
pMsgBuffer = new sal_Char[nMsgBufSiz];
pMsgRead = pMsgWrite = pMsgBuffer;
@@ -645,7 +645,7 @@ INetMessageEncodeQPStream_Impl::~INetMessageEncodeQPStream_Impl (void)
/*
* GetMsgLine.
*/
-int INetMessageEncodeQPStream_Impl::GetMsgLine (sal_Char *pData, ULONG nSize)
+int INetMessageEncodeQPStream_Impl::GetMsgLine (sal_Char *pData, sal_uIntPtr nSize)
{
INetMessage *pMsg = GetSourceMessage ();
if (pMsg == NULL) return INETSTREAM_STATUS_ERROR;
@@ -774,7 +774,7 @@ int INetMessageEncodeQPStream_Impl::GetMsgLine (sal_Char *pData, ULONG nSize)
pMsgRead = pMsgWrite = pMsgBuffer;
// Read next message block.
- ULONG nRead = pMsgStrm->Read (pMsgBuffer, nMsgBufSiz);
+ sal_uIntPtr nRead = pMsgStrm->Read (pMsgBuffer, nMsgBufSiz);
if (nRead > 0)
{
// Set read pointer.
@@ -789,7 +789,7 @@ int INetMessageEncodeQPStream_Impl::GetMsgLine (sal_Char *pData, ULONG nSize)
*pTokRead++ = '\r';
*pTokRead++ = '\n';
- bDone = TRUE;
+ bDone = sal_True;
}
else
{
@@ -851,7 +851,7 @@ INetMessageDecodeQPStream_Impl::INetMessageDecodeQPStream_Impl (void)
pMsgBuffer (new SvMemoryStream),
nTokBufLen (0)
{
- ParseHeader (FALSE);
+ ParseHeader (sal_False);
}
/*
@@ -866,7 +866,7 @@ INetMessageDecodeQPStream_Impl::~INetMessageDecodeQPStream_Impl (void)
* PutMsgLine.
*/
int INetMessageDecodeQPStream_Impl::PutMsgLine (
- const sal_Char *pData, ULONG nSize)
+ const sal_Char *pData, sal_uIntPtr nSize)
{
INetMessage *pMsg = GetTargetMessage();
if (pMsg == NULL) return INETSTREAM_STATUS_ERROR;
@@ -965,14 +965,14 @@ static const sal_Char six2pr[64] = {
* INetMessageEncode64Stream_Impl.
*/
INetMessageEncode64Stream_Impl::INetMessageEncode64Stream_Impl (
- ULONG nMsgBufferSize)
+ sal_uIntPtr nMsgBufferSize)
: INetMessageIStream (),
pMsgStrm (NULL),
nMsgBufSiz (nMsgBufferSize),
nTokBufSiz (80),
- bDone (FALSE)
+ bDone (sal_False)
{
- GenerateHeader (FALSE);
+ GenerateHeader (sal_False);
pMsgBuffer = new sal_uInt8[nMsgBufSiz];
pMsgRead = pMsgWrite = pMsgBuffer;
@@ -994,7 +994,7 @@ INetMessageEncode64Stream_Impl::~INetMessageEncode64Stream_Impl (void)
/*
* GetMsgLine.
*/
-int INetMessageEncode64Stream_Impl::GetMsgLine (sal_Char *pData, ULONG nSize)
+int INetMessageEncode64Stream_Impl::GetMsgLine (sal_Char *pData, sal_uIntPtr nSize)
{
INetMessage *pMsg = GetSourceMessage ();
if (pMsg == NULL) return INETSTREAM_STATUS_ERROR;
@@ -1064,7 +1064,7 @@ int INetMessageEncode64Stream_Impl::GetMsgLine (sal_Char *pData, ULONG nSize)
pMsgRead = pMsgWrite = pMsgBuffer;
// Read next message block.
- ULONG nRead = pMsgStrm->Read (pMsgBuffer, nMsgBufSiz);
+ sal_uIntPtr nRead = pMsgStrm->Read (pMsgBuffer, nMsgBufSiz);
if (nRead > 0)
{
// Set read pointer.
@@ -1093,7 +1093,7 @@ int INetMessageEncode64Stream_Impl::GetMsgLine (sal_Char *pData, ULONG nSize)
*pTokRead++ = '\n';
// Mark we're done.
- bDone = TRUE;
+ bDone = sal_True;
}
else
{
@@ -1109,7 +1109,7 @@ int INetMessageEncode64Stream_Impl::GetMsgLine (sal_Char *pData, ULONG nSize)
pTokRead = pTokWrite = pTokBuffer;
// Reset done flag, if everything has been done.
- // if (pWBuf == pData) bDone = FALSE;
+ // if (pWBuf == pData) bDone = sal_False;
// Return.
return (pWBuf - pData);
@@ -1173,12 +1173,12 @@ static const sal_uInt8 pr2six[256] = {
* INetMessageDecode64Stream_Impl.
*/
INetMessageDecode64Stream_Impl::INetMessageDecode64Stream_Impl (
- ULONG nMsgBufferSize)
+ sal_uIntPtr nMsgBufferSize)
: INetMessageOStream (),
eState (INETMSG_EOL_SCR),
nMsgBufSiz (nMsgBufferSize)
{
- ParseHeader (FALSE);
+ ParseHeader (sal_False);
pMsgBuffer = new sal_Char[nMsgBufSiz];
pMsgRead = pMsgWrite = pMsgBuffer;
@@ -1196,7 +1196,7 @@ INetMessageDecode64Stream_Impl::~INetMessageDecode64Stream_Impl (void)
* PutMsgLine.
*/
int INetMessageDecode64Stream_Impl::PutMsgLine (
- const sal_Char *pData, ULONG nSize)
+ const sal_Char *pData, sal_uIntPtr nSize)
{
INetMessage *pMsg = GetTargetMessage ();
if (pMsg == NULL) return INETSTREAM_STATUS_ERROR;
@@ -1299,7 +1299,7 @@ int INetMessageDecode64Stream_Impl::PutMsgLine (
/*
* INetMIMEMessageStream.
*/
-INetMIMEMessageStream::INetMIMEMessageStream (ULONG nBufferSize)
+INetMIMEMessageStream::INetMIMEMessageStream (sal_uIntPtr nBufferSize)
: INetMessageIOStream (nBufferSize),
eState (INETMSG_EOL_BEGIN),
nChildIndex (0),
@@ -1361,7 +1361,7 @@ INetMIMEMessageStream::GetMsgEncoding (const String& rContentType)
* GetMsgLine.
* (Message Generator).
*/
-int INetMIMEMessageStream::GetMsgLine (sal_Char *pData, ULONG nSize)
+int INetMIMEMessageStream::GetMsgLine (sal_Char *pData, sal_uIntPtr nSize)
{
// Check for message container.
INetMIMEMessage *pMsg = GetSourceMessage();
@@ -1595,7 +1595,7 @@ int INetMIMEMessageStream::GetMsgLine (sal_Char *pData, ULONG nSize)
* PutMsgLine.
* (Message Parser).
*/
-int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, ULONG nSize)
+int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize)
{
// Check for message container.
INetMIMEMessage *pMsg = GetTargetMessage();
@@ -1624,8 +1624,8 @@ int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, ULONG nSize)
pMsg->SetChildCount( pMsg->GetChildCount() + 1);
INetMIMEMessage* pNewMessage = new INetMIMEMessage;
pNewMessage->SetDocumentLB (
- new SvAsyncLockBytes(new SvCacheStream, FALSE));
- pMsg->AttachChild( *pNewMessage, TRUE );
+ new SvAsyncLockBytes(new SvCacheStream, sal_False));
+ pMsg->AttachChild( *pNewMessage, sal_True );
// Encapsulated message body. Create message parser stream.
pChildStrm = new INetMIMEMessageStream;
@@ -1657,7 +1657,7 @@ int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, ULONG nSize)
ByteString aLowerType (aType);
aLowerType.ToLowerAscii();
- USHORT nPos = aLowerType.Search ("boundary=");
+ sal_uInt16 nPos = aLowerType.Search ("boundary=");
ByteString aBoundary (aType.Copy (nPos + 9));
aBoundary.EraseLeadingAndTrailingChars (' ');
@@ -1679,7 +1679,7 @@ int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, ULONG nSize)
if (pMsgBuffer == NULL) pMsgBuffer = new SvMemoryStream;
pMsgBuffer->Write (pData, nSize);
- ULONG nBufSize = pMsgBuffer->Tell();
+ sal_uIntPtr nBufSize = pMsgBuffer->Tell();
const sal_Char* pChar;
const sal_Char* pOldPos;
@@ -1736,9 +1736,9 @@ int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, ULONG nSize)
new INetMIMEMessage;
pNewMessage->SetDocumentLB (
new SvAsyncLockBytes (
- new SvCacheStream, FALSE));
+ new SvCacheStream, sal_False));
- pMsg->AttachChild( *pNewMessage, TRUE );
+ pMsg->AttachChild( *pNewMessage, sal_True );
// Encapsulated message body. Create message parser stream.
pChildStrm = new INetMIMEMessageStream;
diff --git a/tools/source/inet/makefile.mk b/tools/source/inet/makefile.mk
deleted file mode 100644
index 1e0bdfdd2391..000000000000
--- a/tools/source/inet/makefile.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ = ..$/..
-PRJNAME = tools
-TARGET = inet
-
-.INCLUDE: settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-SLOFILES=\
- $(SLO)$/inetmime.obj \
- $(SLO)$/inetmsg.obj \
- $(SLO)$/inetstrm.obj
-
-OBJFILES=\
- $(OBJ)$/inetmime.obj \
- $(OBJ)$/inetmsg.obj \
- $(OBJ)$/inetstrm.obj
-
-.INCLUDE: target.mk
diff --git a/tools/source/makefile.mk b/tools/source/makefile.mk
deleted file mode 100644
index 8c3f3167635e..000000000000
--- a/tools/source/makefile.mk
+++ /dev/null
@@ -1,58 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..
-
-TARGET=source
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-.IF "$(GUI)" == "UNX"
-SUBDIRS+= solar
-.ENDIF
-
-SUBDIRS+= \
- datetime \
- timestamp \
- debug \
- fsys \
- generic \
- intntl \
- memtools \
- misc \
- rc \
- ref \
- stream \
- zcodec
-
-
-.INCLUDE : target.mk
-
diff --git a/tools/source/memtools/contnr.cxx b/tools/source/memtools/contnr.cxx
index 3aff098aa3bc..9fe9babc5f05 100644..100755
--- a/tools/source/memtools/contnr.cxx
+++ b/tools/source/memtools/contnr.cxx
@@ -75,7 +75,7 @@ const char* CBlock::DbgCheckCBlock( const void* pBlock )
|*
*************************************************************************/
-CBlock::CBlock( USHORT nInitSize, CBlock* _pPrev, CBlock* _pNext )
+CBlock::CBlock( sal_uInt16 nInitSize, CBlock* _pPrev, CBlock* _pNext )
{
DBG_CTOR( CBlock, DbgCheckCBlock );
@@ -96,7 +96,7 @@ CBlock::CBlock( USHORT nInitSize, CBlock* _pPrev, CBlock* _pNext )
|*
*************************************************************************/
-CBlock::CBlock( USHORT _nSize, CBlock* _pPrev )
+CBlock::CBlock( sal_uInt16 _nSize, CBlock* _pPrev )
{
DBG_CTOR( CBlock, DbgCheckCBlock );
DBG_ASSERT( _nSize, "CBlock::CBlock(): nSize == 0" );
@@ -158,7 +158,7 @@ inline CBlock::~CBlock()
|*
*************************************************************************/
-void CBlock::Insert( void* p, USHORT nIndex, USHORT nReSize )
+void CBlock::Insert( void* p, sal_uInt16 nIndex, sal_uInt16 nReSize )
{
DBG_CHKTHIS( CBlock, DbgCheckCBlock );
DBG_ASSERT( nIndex <= nCount, "CBlock::Insert(): Index > nCount" );
@@ -212,12 +212,12 @@ void CBlock::Insert( void* p, USHORT nIndex, USHORT nReSize )
|*
*************************************************************************/
-CBlock* CBlock::Split( void* p, USHORT nIndex, USHORT nReSize )
+CBlock* CBlock::Split( void* p, sal_uInt16 nIndex, sal_uInt16 nReSize )
{
DBG_CHKTHIS( CBlock, DbgCheckCBlock );
- USHORT nNewSize;
- USHORT nMiddle;
+ sal_uInt16 nNewSize;
+ sal_uInt16 nMiddle;
CBlock* pNewBlock;
nMiddle = nCount/2;
@@ -347,7 +347,7 @@ CBlock* CBlock::Split( void* p, USHORT nIndex, USHORT nReSize )
|*
*************************************************************************/
-void* CBlock::Remove( USHORT nIndex, USHORT nReSize )
+void* CBlock::Remove( sal_uInt16 nIndex, sal_uInt16 nReSize )
{
DBG_CHKTHIS( CBlock, DbgCheckCBlock );
@@ -404,7 +404,7 @@ void* CBlock::Remove( USHORT nIndex, USHORT nReSize )
|*
*************************************************************************/
-inline void* CBlock::Replace( void* p, USHORT nIndex )
+inline void* CBlock::Replace( void* p, sal_uInt16 nIndex )
{
DBG_CHKTHIS( CBlock, DbgCheckCBlock );
@@ -423,7 +423,7 @@ inline void* CBlock::Replace( void* p, USHORT nIndex )
|*
*************************************************************************/
-inline void** CBlock::GetObjectPtr( USHORT nIndex )
+inline void** CBlock::GetObjectPtr( sal_uInt16 nIndex )
{
DBG_CHKTHIS( CBlock, DbgCheckCBlock );
@@ -438,7 +438,7 @@ inline void** CBlock::GetObjectPtr( USHORT nIndex )
|*
*************************************************************************/
-void CBlock::SetSize( USHORT nNewSize )
+void CBlock::SetSize( sal_uInt16 nNewSize )
{
DBG_CHKTHIS( CBlock, DbgCheckCBlock );
DBG_ASSERT( nNewSize, "CBlock::SetSize(): nNewSize == 0" );
@@ -554,7 +554,7 @@ void Container::ImpCopyContainer( const Container* pCont2 )
|*
*************************************************************************/
-Container::Container( USHORT _nBlockSize, USHORT _nInitSize, USHORT _nReSize )
+Container::Container( sal_uInt16 _nBlockSize, sal_uInt16 _nInitSize, sal_uInt16 _nReSize )
{
DBG_CTOR( Container, DbgCheckContainer );
@@ -615,7 +615,7 @@ Container::Container( USHORT _nBlockSize, USHORT _nInitSize, USHORT _nReSize )
|*
*************************************************************************/
-Container::Container( ULONG nSize )
+Container::Container( sal_uIntPtr nSize )
{
DBG_CTOR( Container, DbgCheckContainer );
@@ -636,7 +636,7 @@ Container::Container( ULONG nSize )
// Muss mehr als ein Block angelegt werden
if ( nSize <= nBlockSize )
{
- pFirstBlock = new CBlock( (USHORT)nSize, NULL );
+ pFirstBlock = new CBlock( (sal_uInt16)nSize, NULL );
pLastBlock = pFirstBlock;
}
else
@@ -657,7 +657,7 @@ Container::Container( ULONG nSize )
nSize -= nBlockSize;
}
- pLastBlock = new CBlock( (USHORT)nSize, pBlock1 );
+ pLastBlock = new CBlock( (sal_uInt16)nSize, pBlock1 );
pBlock1->SetNextBlock( pLastBlock );
}
@@ -707,7 +707,7 @@ Container::~Container()
|*
*************************************************************************/
-void Container::ImpInsert( void* p, CBlock* pBlock, USHORT nIndex )
+void Container::ImpInsert( void* p, CBlock* pBlock, sal_uInt16 nIndex )
{
DBG_CHKTHIS( Container, DbgCheckContainer );
@@ -799,7 +799,7 @@ void Container::Insert( void* p )
|*
*************************************************************************/
-void Container::Insert( void* p, ULONG nIndex )
+void Container::Insert( void* p, sal_uIntPtr nIndex )
{
if ( nCount <= nIndex )
{
@@ -818,7 +818,7 @@ void Container::Insert( void* p, ULONG nIndex )
pTemp = pTemp->GetNextBlock();
}
- ImpInsert( p, pTemp, (USHORT)nIndex );
+ ImpInsert( p, pTemp, (sal_uInt16)nIndex );
}
}
@@ -830,7 +830,7 @@ void Container::Insert( void* p, ULONG nIndex )
void Container::Insert( void* pNew, void* pOld )
{
- ULONG nIndex = GetPos( pOld );
+ sal_uIntPtr nIndex = GetPos( pOld );
if ( nIndex != CONTAINER_ENTRY_NOTFOUND )
Insert( pNew, nIndex );
}
@@ -843,7 +843,7 @@ void Container::Insert( void* pNew, void* pOld )
|*
*************************************************************************/
-void* Container::ImpRemove( CBlock* pBlock, USHORT nIndex )
+void* Container::ImpRemove( CBlock* pBlock, sal_uInt16 nIndex )
{
DBG_CHKTHIS( Container, DbgCheckContainer );
@@ -931,7 +931,7 @@ void* Container::Remove()
|*
*************************************************************************/
-void* Container::Remove( ULONG nIndex )
+void* Container::Remove( sal_uIntPtr nIndex )
{
// Ist Index nicht innerhalb des Containers, dann NULL zurueckgeben
if ( nCount <= nIndex )
@@ -946,7 +946,7 @@ void* Container::Remove( ULONG nIndex )
pTemp = pTemp->GetNextBlock();
}
- return ImpRemove( pTemp, (USHORT)nIndex );
+ return ImpRemove( pTemp, (sal_uInt16)nIndex );
}
}
@@ -972,7 +972,7 @@ void* Container::Replace( void* p )
|*
*************************************************************************/
-void* Container::Replace( void* p, ULONG nIndex )
+void* Container::Replace( void* p, sal_uIntPtr nIndex )
{
DBG_CHKTHIS( Container, DbgCheckContainer );
@@ -989,7 +989,7 @@ void* Container::Replace( void* p, ULONG nIndex )
pTemp = pTemp->GetNextBlock();
}
- return pTemp->Replace( p, (USHORT)nIndex );
+ return pTemp->Replace( p, (sal_uInt16)nIndex );
}
}
@@ -999,7 +999,7 @@ void* Container::Replace( void* p, ULONG nIndex )
|*
*************************************************************************/
-void Container::SetSize( ULONG nNewSize )
+void Container::SetSize( sal_uIntPtr nNewSize )
{
DBG_CHKTHIS( Container, DbgCheckContainer );
@@ -1009,7 +1009,7 @@ void Container::SetSize( ULONG nNewSize )
if ( nNewSize != nCount )
{
CBlock* pTemp;
- ULONG nTemp;
+ sal_uIntPtr nTemp;
// Wird verkleinert
if ( nNewSize < nCount )
@@ -1023,14 +1023,14 @@ void Container::SetSize( ULONG nNewSize )
}
// Alle folgenden Bloecke loeschen
- BOOL bLast = FALSE;
+ sal_Bool bLast = sal_False;
CBlock* pDelNext;
CBlock* pDelBlock = pTemp->GetNextBlock();
while ( pDelBlock )
{
// Muss CurrentBlock umgesetzt werden
if ( pDelBlock == pCurBlock )
- bLast = TRUE;
+ bLast = sal_True;
pDelNext = pDelBlock->GetNextBlock();
delete pDelBlock;
pDelBlock = pDelNext;
@@ -1041,7 +1041,7 @@ void Container::SetSize( ULONG nNewSize )
{
pLastBlock = pTemp;
pTemp->SetNextBlock( NULL );
- pTemp->SetSize( (USHORT)(nNewSize-nTemp) );
+ pTemp->SetSize( (sal_uInt16)(nNewSize-nTemp) );
}
else
{
@@ -1068,7 +1068,7 @@ void Container::SetSize( ULONG nNewSize )
// Muss mehr als ein Block angelegt werden
if ( nNewSize <= nBlockSize )
{
- pFirstBlock = new CBlock( (USHORT)nNewSize, NULL );
+ pFirstBlock = new CBlock( (sal_uInt16)nNewSize, NULL );
pLastBlock = pFirstBlock;
}
else
@@ -1089,7 +1089,7 @@ void Container::SetSize( ULONG nNewSize )
nNewSize -= nBlockSize;
}
- pLastBlock = new CBlock( (USHORT)nNewSize, pBlock1 );
+ pLastBlock = new CBlock( (sal_uInt16)nNewSize, pBlock1 );
pBlock1->SetNextBlock( pLastBlock );
}
@@ -1097,7 +1097,7 @@ void Container::SetSize( ULONG nNewSize )
}
// Reicht es, den letzen Puffer in der Groesse anzupassen
else if ( (nTemp+pTemp->Count()) <= nBlockSize )
- pTemp->SetSize( (USHORT)(nTemp+pTemp->Count()) );
+ pTemp->SetSize( (sal_uInt16)(nTemp+pTemp->Count()) );
else
{
// Puffer auf max. Blockgroesse setzen
@@ -1118,7 +1118,7 @@ void Container::SetSize( ULONG nNewSize )
// Den letzten Block anlegen
if ( nTemp )
{
- pLastBlock = new CBlock( (USHORT)nTemp, pTemp );
+ pLastBlock = new CBlock( (sal_uInt16)nTemp, pTemp );
pTemp->SetNextBlock( pLastBlock );
}
else
@@ -1183,7 +1183,7 @@ void* Container::GetCurObject() const
|*
*************************************************************************/
-ULONG Container::GetCurPos() const
+sal_uIntPtr Container::GetCurPos() const
{
DBG_CHKTHIS( Container, DbgCheckContainer );
@@ -1194,7 +1194,7 @@ ULONG Container::GetCurPos() const
{
// Block suchen
CBlock* pTemp = pFirstBlock;
- ULONG nTemp = 0;
+ sal_uIntPtr nTemp = 0;
while ( pTemp != pCurBlock )
{
nTemp += pTemp->Count();
@@ -1213,7 +1213,7 @@ ULONG Container::GetCurPos() const
|*
*************************************************************************/
-void** Container::GetObjectPtr( ULONG nIndex )
+void** Container::GetObjectPtr( sal_uIntPtr nIndex )
{
DBG_CHKTHIS( Container, DbgCheckContainer );
@@ -1231,7 +1231,7 @@ void** Container::GetObjectPtr( ULONG nIndex )
}
// Item innerhalb des gefundenen Blocks zurueckgeben
- return pTemp->GetObjectPtr( (USHORT)nIndex );
+ return pTemp->GetObjectPtr( (sal_uInt16)nIndex );
}
}
@@ -1241,7 +1241,7 @@ void** Container::GetObjectPtr( ULONG nIndex )
|*
*************************************************************************/
-void* Container::GetObject( ULONG nIndex ) const
+void* Container::GetObject( sal_uIntPtr nIndex ) const
{
DBG_CHKTHIS( Container, DbgCheckContainer );
@@ -1259,7 +1259,7 @@ void* Container::GetObject( ULONG nIndex ) const
}
// Item innerhalb des gefundenen Blocks zurueckgeben
- return pTemp->GetObject( (USHORT)nIndex );
+ return pTemp->GetObject( (sal_uInt16)nIndex );
}
}
@@ -1269,15 +1269,15 @@ void* Container::GetObject( ULONG nIndex ) const
|*
*************************************************************************/
-ULONG Container::GetPos( const void* p ) const
+sal_uIntPtr Container::GetPos( const void* p ) const
{
DBG_CHKTHIS( Container, DbgCheckContainer );
void** pNodes;
CBlock* pTemp;
- ULONG nTemp;
- USHORT nBlockCount;
- USHORT i;
+ sal_uIntPtr nTemp;
+ sal_uInt16 nBlockCount;
+ sal_uInt16 i;
// Block suchen
pTemp = pFirstBlock;
@@ -1307,8 +1307,8 @@ ULONG Container::GetPos( const void* p ) const
|*
*************************************************************************/
-ULONG Container::GetPos( const void* p, ULONG nStartIndex,
- BOOL bForward ) const
+sal_uIntPtr Container::GetPos( const void* p, sal_uIntPtr nStartIndex,
+ sal_Bool bForward ) const
{
DBG_CHKTHIS( Container, DbgCheckContainer );
@@ -1318,12 +1318,12 @@ ULONG Container::GetPos( const void* p, ULONG nStartIndex,
else
{
void** pNodes;
- USHORT nBlockCount;
- USHORT i;
+ sal_uInt16 nBlockCount;
+ sal_uInt16 i;
// Block suchen
CBlock* pTemp = pFirstBlock;
- ULONG nTemp = 0;
+ sal_uIntPtr nTemp = 0;
while ( nTemp+pTemp->Count() <= nStartIndex )
{
nTemp += pTemp->Count();
@@ -1334,7 +1334,7 @@ ULONG Container::GetPos( const void* p, ULONG nStartIndex,
if ( bForward )
{
// Alle Bloecke durchrsuchen
- i = (USHORT)(nStartIndex - nTemp);
+ i = (sal_uInt16)(nStartIndex - nTemp);
pNodes = pTemp->GetObjectPtr( i );
do
{
@@ -1356,12 +1356,12 @@ ULONG Container::GetPos( const void* p, ULONG nStartIndex,
else
break;
}
- while ( TRUE );
+ while ( sal_True );
}
else
{
// Alle Bloecke durchrsuchen
- i = (USHORT)(nStartIndex-nTemp)+1;
+ i = (sal_uInt16)(nStartIndex-nTemp)+1;
pNodes = pTemp->GetObjectPtr( i-1 );
do
{
@@ -1385,7 +1385,7 @@ ULONG Container::GetPos( const void* p, ULONG nStartIndex,
else
break;
}
- while ( TRUE );
+ while ( sal_True );
}
}
@@ -1398,7 +1398,7 @@ ULONG Container::GetPos( const void* p, ULONG nStartIndex,
|*
*************************************************************************/
-void* Container::Seek( ULONG nIndex )
+void* Container::Seek( sal_uIntPtr nIndex )
{
DBG_CHKTHIS( Container, DbgCheckContainer );
@@ -1417,7 +1417,7 @@ void* Container::Seek( ULONG nIndex )
// Item innerhalb des gefundenen Blocks zurueckgeben
pCurBlock = pTemp;
- nCurIndex = (USHORT)nIndex;
+ nCurIndex = (sal_uInt16)nIndex;
return pCurBlock->GetObject( nCurIndex );
}
}
@@ -1552,22 +1552,22 @@ Container& Container::operator =( const Container& r )
|*
*************************************************************************/
-BOOL Container::operator ==( const Container& r ) const
+sal_Bool Container::operator ==( const Container& r ) const
{
DBG_CHKTHIS( Container, DbgCheckContainer );
if ( nCount != r.nCount )
- return FALSE;
+ return sal_False;
- ULONG i = 0;
+ sal_uIntPtr i = 0;
while ( i < nCount )
{
if ( GetObject( i ) != r.GetObject( i ) )
- return FALSE;
+ return sal_False;
i++;
}
- return TRUE;
+ return sal_True;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/memtools/makefile.mk b/tools/source/memtools/makefile.mk
deleted file mode 100644
index de03a0d50cc3..000000000000
--- a/tools/source/memtools/makefile.mk
+++ /dev/null
@@ -1,56 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=mtools
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(SLO)$/contnr.obj \
- $(SLO)$/table.obj \
- $(SLO)$/unqidx.obj \
- $(SLO)$/mempool.obj \
- $(SLO)$/multisel.obj
-
-EXCEPTIONSFILES= $(SLO)$/multisel.obj $(OBJ)$/multisel.obj
-
-OBJFILES= $(OBJ)$/contnr.obj \
- $(OBJ)$/table.obj \
- $(OBJ)$/unqidx.obj \
- $(OBJ)$/mempool.obj \
- $(OBJ)$/multisel.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/source/memtools/mempool.cxx b/tools/source/memtools/mempool.cxx
index 4e4886bb8ea9..006c5de7b6e0 100644..100755
--- a/tools/source/memtools/mempool.cxx
+++ b/tools/source/memtools/mempool.cxx
@@ -41,7 +41,7 @@
*************************************************************************/
FixedMemPool::FixedMemPool (
- USHORT _nTypeSize, USHORT, USHORT)
+ sal_uInt16 _nTypeSize, sal_uInt16, sal_uInt16)
{
char name[RTL_CACHE_NAME_LENGTH + 1];
snprintf (name, sizeof(name), "FixedMemPool_%d", (int)_nTypeSize);
diff --git a/tools/source/memtools/multisel.cxx b/tools/source/memtools/multisel.cxx
index 6b4187de1ef3..295b8376d366 100644..100755
--- a/tools/source/memtools/multisel.cxx
+++ b/tools/source/memtools/multisel.cxx
@@ -64,7 +64,7 @@ static void Print( const MultiSelection* pSel )
}
DbgOutf( "SelCount: %4ld\n", pSel->nSelCount );
DbgOutf( "SubCount: %4ld\n", pSel->aSels.Count() );
- for ( ULONG nPos = 0; nPos < pSel->aSels.Count(); ++nPos )
+ for ( sal_uIntPtr nPos = 0; nPos < pSel->aSels.Count(); ++nPos )
{
DbgOutf( "SubSel #%2ld: %4ld-%4ld\n", nPos,
pSel->aSels.GetObject(nPos)->Min(),
@@ -103,11 +103,11 @@ size_t MultiSelection::ImplFindSubSelection( long nIndex ) const
// -----------------------------------------------------------------------
-BOOL MultiSelection::ImplMergeSubSelections( size_t nPos1, size_t nPos2 )
+sal_Bool MultiSelection::ImplMergeSubSelections( size_t nPos1, size_t nPos2 )
{
// didn't a sub selection at nPos2 exist?
if ( nPos2 >= aSels.size() )
- return FALSE;
+ return sal_False;
// did the sub selections touch each other?
if ( (aSels[ nPos1 ]->Max() + 1) == aSels[ nPos2 ]->Min() )
@@ -118,10 +118,10 @@ BOOL MultiSelection::ImplMergeSubSelections( size_t nPos1, size_t nPos2 )
::std::advance( it, nPos2 );
delete *it;
aSels.erase( it );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
// -----------------------------------------------------------------------
@@ -130,8 +130,8 @@ MultiSelection::MultiSelection():
aTotRange( 0, -1 ),
nCurSubSel(0),
nSelCount(0),
- bCurValid(FALSE),
- bSelectNew(FALSE)
+ bCurValid(sal_False),
+ bSelectNew(sal_False)
{
}
@@ -141,8 +141,8 @@ MultiSelection::MultiSelection( const UniString& rString, sal_Unicode cRange, sa
aTotRange(0,RANGE_MAX),
nCurSubSel(0),
nSelCount(0),
- bCurValid(FALSE),
- bSelectNew(FALSE)
+ bCurValid(sal_False),
+ bSelectNew(sal_False)
{
// Dies ist nur ein Schnellschuss und sollte bald optimiert,
// an die verschiedenen Systeme (UNIX etc.)
@@ -151,8 +151,8 @@ MultiSelection::MultiSelection( const UniString& rString, sal_Unicode cRange, sa
UniString aStr( rString );
sal_Unicode* pStr = aStr.GetBufferAccess();
sal_Unicode* pOld = pStr;
- BOOL bReady = FALSE;
- BOOL bUntil = FALSE;
+ sal_Bool bReady = sal_False;
+ sal_Bool bUntil = sal_False;
xub_StrLen nCut = 0;
// Hier normieren wir den String, sodass nur Ziffern,
@@ -178,11 +178,11 @@ MultiSelection::MultiSelection( const UniString& rString, sal_Unicode cRange, sa
{
*pStr++ = ';';
nCut++;
- bReady = FALSE;
+ bReady = sal_False;
}
*pStr++ = *pOld;
nCut++;
- bUntil = FALSE;
+ bUntil = sal_False;
break;
case '-':
@@ -194,12 +194,12 @@ MultiSelection::MultiSelection( const UniString& rString, sal_Unicode cRange, sa
{
*pStr++ = '-';
nCut++;
- bUntil = TRUE;
+ bUntil = sal_True;
}
- bReady = FALSE;
+ bReady = sal_False;
}
else
- bReady = TRUE;
+ bReady = sal_True;
break;
case ' ':
@@ -215,12 +215,12 @@ MultiSelection::MultiSelection( const UniString& rString, sal_Unicode cRange, sa
{
*pStr++ = '-';
nCut++;
- bUntil = TRUE;
+ bUntil = sal_True;
}
- bReady = FALSE;
+ bReady = sal_False;
}
else
- bReady = TRUE;
+ bReady = sal_True;
break;
}
@@ -234,7 +234,7 @@ MultiSelection::MultiSelection( const UniString& rString, sal_Unicode cRange, sa
const sal_Unicode* pCStr = aStr.GetBuffer();
long nPage = 1;
long nNum = 1;
- bUntil = FALSE;
+ bUntil = sal_False;
while ( *pCStr )
{
switch ( *pCStr )
@@ -266,13 +266,13 @@ MultiSelection::MultiSelection( const UniString& rString, sal_Unicode cRange, sa
Select( nNum );
nPage = 0;
aNumStr.Erase();
- bUntil = FALSE;
+ bUntil = sal_False;
break;
case '-':
nPage = aNumStr.ToInt32();
aNumStr.Erase();
- bUntil = TRUE;
+ bUntil = sal_True;
break;
}
@@ -299,7 +299,7 @@ MultiSelection::MultiSelection( const MultiSelection& rOrig ) :
aTotRange(rOrig.aTotRange),
nSelCount(rOrig.nSelCount),
bCurValid(rOrig.bCurValid),
- bSelectNew(FALSE)
+ bSelectNew(sal_False)
{
if ( bCurValid )
{
@@ -318,8 +318,8 @@ MultiSelection::MultiSelection( const Range& rRange ):
aTotRange(rRange),
nCurSubSel(0),
nSelCount(0),
- bCurValid(FALSE),
- bSelectNew(FALSE)
+ bCurValid(sal_False),
+ bSelectNew(sal_False)
{
}
@@ -355,24 +355,24 @@ MultiSelection& MultiSelection::operator= ( const MultiSelection& rOrig )
// -----------------------------------------------------------------------
-BOOL MultiSelection::operator== ( MultiSelection& rWith )
+sal_Bool MultiSelection::operator== ( MultiSelection& rWith )
{
if ( aTotRange != rWith.aTotRange || nSelCount != rWith.nSelCount ||
aSels.size() != rWith.aSels.size() )
- return FALSE;
+ return sal_False;
// compare the sub seletions
for ( size_t n = 0; n < aSels.size(); ++n )
if ( *aSels[ n ] != *rWith.aSels[ n ] )
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
// -----------------------------------------------------------------------
-void MultiSelection::SelectAll( BOOL bSelect )
+void MultiSelection::SelectAll( sal_Bool bSelect )
{
- DBG(DbgOutf( "::SelectAll(%s)\n", bSelect ? "TRUE" : "FALSE" ));
+ DBG(DbgOutf( "::SelectAll(%s)\n", bSelect ? "sal_True" : "sal_False" ));
ImplClear();
if ( bSelect )
@@ -386,13 +386,13 @@ void MultiSelection::SelectAll( BOOL bSelect )
// -----------------------------------------------------------------------
-BOOL MultiSelection::Select( long nIndex, BOOL bSelect )
+sal_Bool MultiSelection::Select( long nIndex, sal_Bool bSelect )
{
DBG_ASSERT( aTotRange.IsInside(nIndex), "selected index out of range" );
// out of range?
if ( !aTotRange.IsInside(nIndex) )
- return FALSE;
+ return sal_False;
// find the virtual target position
size_t nSubSelPos = ImplFindSubSelection( nIndex );
@@ -402,7 +402,7 @@ BOOL MultiSelection::Select( long nIndex, BOOL bSelect )
// is it included in the found sub selection?
if ( nSubSelPos < aSels.size() && aSels[ nSubSelPos ]->IsInside( nIndex ) )
// already selected, nothing to do
- return FALSE;
+ return sal_False;
// it will become selected
++nSelCount;
@@ -445,7 +445,7 @@ BOOL MultiSelection::Select( long nIndex, BOOL bSelect )
) {
// not selected, nothing to do
DBG(Print( this ));
- return FALSE;
+ return sal_False;
}
// it will become deselected
@@ -460,7 +460,7 @@ BOOL MultiSelection::Select( long nIndex, BOOL bSelect )
delete *it;
aSels.erase( it );
DBG(Print( this ));
- return TRUE;
+ return sal_True;
}
// is it at the beginning of the found sub selection?
@@ -486,20 +486,20 @@ BOOL MultiSelection::Select( long nIndex, BOOL bSelect )
DBG(Print( this ));
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-void MultiSelection::Select( const Range& rIndexRange, BOOL bSelect )
+void MultiSelection::Select( const Range& rIndexRange, sal_Bool bSelect )
{
Range* pRange;
long nOld;
- ULONG nTmpMin = rIndexRange.Min();
- ULONG nTmpMax = rIndexRange.Max();
- ULONG nCurMin = FirstSelected();
- ULONG nCurMax = LastSelected();
+ sal_uIntPtr nTmpMin = rIndexRange.Min();
+ sal_uIntPtr nTmpMax = rIndexRange.Max();
+ sal_uIntPtr nCurMin = FirstSelected();
+ sal_uIntPtr nCurMax = LastSelected();
DBG_ASSERT(aTotRange.IsInside(nTmpMax), "selected index out of range" );
DBG_ASSERT(aTotRange.IsInside(nTmpMin), "selected index out of range" );
@@ -533,7 +533,7 @@ void MultiSelection::Select( const Range& rIndexRange, BOOL bSelect )
pRange->Min() = (long)nTmpMin;
nSelCount += ( nOld - nTmpMin );
}
- bCurValid = FALSE;
+ bCurValid = sal_False;
}
return;
}
@@ -556,7 +556,7 @@ void MultiSelection::Select( const Range& rIndexRange, BOOL bSelect )
pRange->Max() = (long)nTmpMax;
nSelCount += ( nTmpMax - nOld );
}
- bCurValid = FALSE;
+ bCurValid = sal_False;
}
return;
}
@@ -571,7 +571,7 @@ void MultiSelection::Select( const Range& rIndexRange, BOOL bSelect )
// -----------------------------------------------------------------------
-BOOL MultiSelection::IsSelected( long nIndex ) const
+sal_Bool MultiSelection::IsSelected( long nIndex ) const
{
// find the virtual target position
size_t nSubSelPos = ImplFindSubSelection( nIndex );
@@ -629,7 +629,7 @@ void MultiSelection::Insert( long nIndex, long nCount )
}
}
- bCurValid = FALSE;
+ bCurValid = sal_False;
aTotRange.Max() += nCount;
if ( bSelectNew )
nSelCount += nCount;
@@ -673,7 +673,7 @@ void MultiSelection::Remove( long nIndex )
--( aSels[ nPos ]->Max() );
}
- bCurValid = FALSE;
+ bCurValid = sal_False;
aTotRange.Max() -= 1;
DBG(Print( this ));
@@ -731,14 +731,14 @@ long MultiSelection::ImplBwdUnselected()
// -----------------------------------------------------------------------
-long MultiSelection::FirstSelected( BOOL bInverse )
+long MultiSelection::FirstSelected( sal_Bool bInverse )
{
bInverseCur = bInverse;
nCurSubSel = 0;
if ( bInverseCur )
{
- bCurValid = nSelCount < ULONG(aTotRange.Len());
+ bCurValid = nSelCount < sal_uIntPtr(aTotRange.Len());
if ( bCurValid )
{
nCurIndex = 0;
@@ -878,7 +878,7 @@ void MultiSelection::SetTotalRange( const Range& rTotRange )
nSelCount += pRange->Len();
}
- bCurValid = FALSE;
+ bCurValid = sal_False;
nCurIndex = 0;
}
diff --git a/tools/source/memtools/table.cxx b/tools/source/memtools/table.cxx
index 5e38574464f3..75119ba6f142 100644..100755
--- a/tools/source/memtools/table.cxx
+++ b/tools/source/memtools/table.cxx
@@ -38,16 +38,16 @@
// =======================================================================
-ULONG Table::ImplGetIndex( ULONG nKey, ULONG* pIndex ) const
+sal_uIntPtr Table::ImplGetIndex( sal_uIntPtr nKey, sal_uIntPtr* pIndex ) const
{
// Abpruefen, ob der erste Key groesser als der Vergleichskey ist
- if ( !nCount || (nKey < (ULONG)Container::ImpGetObject(0)) )
+ if ( !nCount || (nKey < (sal_uIntPtr)Container::ImpGetObject(0)) )
return TABLE_ENTRY_NOTFOUND;
- ULONG nLow;
- ULONG nHigh;
- ULONG nMid;
- ULONG nCompareKey;
+ sal_uIntPtr nLow;
+ sal_uIntPtr nHigh;
+ sal_uIntPtr nMid;
+ sal_uIntPtr nCompareKey;
void** pNodes = Container::ImpGetOnlyNodes();
// Binaeres Suchen
@@ -58,7 +58,7 @@ ULONG Table::ImplGetIndex( ULONG nKey, ULONG* pIndex ) const
do
{
nMid = (nLow + nHigh) / 2;
- nCompareKey = (ULONG)pNodes[nMid*2];
+ nCompareKey = (sal_uIntPtr)pNodes[nMid*2];
if ( nKey < nCompareKey )
nHigh = nMid-1;
else
@@ -76,7 +76,7 @@ ULONG Table::ImplGetIndex( ULONG nKey, ULONG* pIndex ) const
do
{
nMid = (nLow + nHigh) / 2;
- nCompareKey = (ULONG)Container::ImpGetObject( nMid*2 );
+ nCompareKey = (sal_uIntPtr)Container::ImpGetObject( nMid*2 );
if ( nKey < nCompareKey )
nHigh = nMid-1;
else
@@ -103,7 +103,7 @@ ULONG Table::ImplGetIndex( ULONG nKey, ULONG* pIndex ) const
// =======================================================================
-Table::Table( USHORT _nInitSize, USHORT _nReSize ) :
+Table::Table( sal_uInt16 _nInitSize, sal_uInt16 _nReSize ) :
Container( CONTAINER_MAXBLOCKSIZE, _nInitSize*2, _nReSize*2 )
{
DBG_ASSERT( _nInitSize <= 32767, "Table::Table(): InitSize > 32767" );
@@ -113,26 +113,26 @@ Table::Table( USHORT _nInitSize, USHORT _nReSize ) :
// -----------------------------------------------------------------------
-BOOL Table::Insert( ULONG nKey, void* p )
+sal_Bool Table::Insert( sal_uIntPtr nKey, void* p )
{
// Tabellenelement einsortieren
- ULONG i;
+ sal_uIntPtr i;
if ( nCount )
{
if ( nCount <= 24 )
{
- USHORT n = 0;
- USHORT nTempCount = (USHORT)nCount * 2;
+ sal_uInt16 n = 0;
+ sal_uInt16 nTempCount = (sal_uInt16)nCount * 2;
if( void** pNodes = Container::ImpGetOnlyNodes() )
{
- ULONG nCompareKey = (ULONG)(*pNodes);
+ sal_uIntPtr nCompareKey = (sal_uIntPtr)(*pNodes);
while ( nKey > nCompareKey )
{
n += 2;
pNodes += 2;
if ( n < nTempCount )
- nCompareKey = (ULONG)(*pNodes);
+ nCompareKey = (sal_uIntPtr)(*pNodes);
else
{
nCompareKey = 0;
@@ -142,7 +142,7 @@ BOOL Table::Insert( ULONG nKey, void* p )
// Testen, ob sich der Key schon in der Tabelle befindet
if ( nKey == nCompareKey )
- return FALSE;
+ return sal_False;
i = n;
}
@@ -150,14 +150,14 @@ BOOL Table::Insert( ULONG nKey, void* p )
{
i = 0;
if ( ImplGetIndex( nKey, &i ) != TABLE_ENTRY_NOTFOUND )
- return FALSE;
+ return sal_False;
}
}
else
{
i = 0;
if ( ImplGetIndex( nKey, &i ) != TABLE_ENTRY_NOTFOUND )
- return FALSE;
+ return sal_False;
}
}
else
@@ -170,15 +170,15 @@ BOOL Table::Insert( ULONG nKey, void* p )
// Ein neuer Eintrag
nCount++;
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-void* Table::Remove( ULONG nKey )
+void* Table::Remove( sal_uIntPtr nKey )
{
// Index besorgen
- ULONG nIndex = ImplGetIndex( nKey );
+ sal_uIntPtr nIndex = ImplGetIndex( nKey );
// Testen, ob sich der Key in der Tabelle befindet
if ( nIndex == TABLE_ENTRY_NOTFOUND )
@@ -196,10 +196,10 @@ void* Table::Remove( ULONG nKey )
// -----------------------------------------------------------------------
-void* Table::Replace( ULONG nKey, void* p )
+void* Table::Replace( sal_uIntPtr nKey, void* p )
{
// Index abfragen
- ULONG nIndex = ImplGetIndex( nKey );
+ sal_uIntPtr nIndex = ImplGetIndex( nKey );
// Existiert kein Eintrag mit dem Schluessel
if ( nIndex == TABLE_ENTRY_NOTFOUND )
@@ -210,10 +210,10 @@ void* Table::Replace( ULONG nKey, void* p )
// -----------------------------------------------------------------------
-void* Table::Get( ULONG nKey ) const
+void* Table::Get( sal_uIntPtr nKey ) const
{
// Index besorgen
- ULONG nIndex = ImplGetIndex( nKey );
+ sal_uIntPtr nIndex = ImplGetIndex( nKey );
// Testen, ob sich der Key in der Tabelle befindet
if ( nIndex == TABLE_ENTRY_NOTFOUND )
@@ -231,16 +231,16 @@ void* Table::GetCurObject() const
// -----------------------------------------------------------------------
-ULONG Table::GetKey( const void* p ) const
+sal_uIntPtr Table::GetKey( const void* p ) const
{
- ULONG nIndex = 0;
+ sal_uIntPtr nIndex = 0;
// Solange noch Eintraege Vorhanden sind
while ( nIndex < nCount )
{
// Stimmt der Pointer ueberein, wird der Key zurueckgegeben
if ( p == Container::ImpGetObject( (nIndex*2)+1 ) )
- return (ULONG)Container::ImpGetObject( nIndex*2 );
+ return (sal_uIntPtr)Container::ImpGetObject( nIndex*2 );
nIndex++;
}
@@ -250,14 +250,14 @@ ULONG Table::GetKey( const void* p ) const
// -----------------------------------------------------------------------
-BOOL Table::IsKeyValid( ULONG nKey ) const
+sal_Bool Table::IsKeyValid( sal_uIntPtr nKey ) const
{
- return (ImplGetIndex( nKey ) != TABLE_ENTRY_NOTFOUND) ? TRUE : FALSE;
+ return (ImplGetIndex( nKey ) != TABLE_ENTRY_NOTFOUND) ? sal_True : sal_False;
}
// -----------------------------------------------------------------------
-ULONG Table::GetUniqueKey( ULONG nStartKey ) const
+sal_uIntPtr Table::GetUniqueKey( sal_uIntPtr nStartKey ) const
{
DBG_ASSERT( (nStartKey > 1) && (nStartKey < 0xFFFFFFFF),
"Table::GetUniqueKey() - nStartKey == 0 or nStartKey >= 0xFFFFFFFF" );
@@ -265,7 +265,7 @@ ULONG Table::GetUniqueKey( ULONG nStartKey ) const
if ( !nCount )
return nStartKey;
- ULONG nLastKey = (ULONG)Container::GetObject( (nCount*2)-2 );
+ sal_uIntPtr nLastKey = (sal_uIntPtr)Container::GetObject( (nCount*2)-2 );
if ( nLastKey < nStartKey )
return nStartKey;
else
@@ -274,18 +274,18 @@ ULONG Table::GetUniqueKey( ULONG nStartKey ) const
return nLastKey+1;
else
{
- ULONG nPos;
- ULONG nTempPos = ImplGetIndex( nStartKey, &nPos );
+ sal_uIntPtr nPos;
+ sal_uIntPtr nTempPos = ImplGetIndex( nStartKey, &nPos );
if ( nTempPos != TABLE_ENTRY_NOTFOUND )
nPos = nTempPos;
- nLastKey = (ULONG)Container::GetObject( nPos );
+ nLastKey = (sal_uIntPtr)Container::GetObject( nPos );
if ( nStartKey < nLastKey )
return nStartKey;
while ( nLastKey < 0xFFFFFFFE )
{
nPos += 2;
nLastKey++;
- if ( nLastKey != (ULONG)Container::GetObject( nPos ) )
+ if ( nLastKey != (sal_uIntPtr)Container::GetObject( nPos ) )
return nLastKey;
}
}
@@ -296,10 +296,10 @@ ULONG Table::GetUniqueKey( ULONG nStartKey ) const
// -----------------------------------------------------------------------
-ULONG Table::SearchKey( ULONG nKey, ULONG* pPos ) const
+sal_uIntPtr Table::SearchKey( sal_uIntPtr nKey, sal_uIntPtr* pPos ) const
{
*pPos = 0;
- ULONG nPos = ImplGetIndex( nKey, pPos );
+ sal_uIntPtr nPos = ImplGetIndex( nKey, pPos );
if ( nPos != TABLE_ENTRY_NOTFOUND )
{
nPos /= 2;
@@ -312,12 +312,12 @@ ULONG Table::SearchKey( ULONG nKey, ULONG* pPos ) const
// -----------------------------------------------------------------------
-void* Table::Seek( ULONG nKey )
+void* Table::Seek( sal_uIntPtr nKey )
{
// Testen, ob ein Eintrag vorhanden ist
if ( nCount )
{
- ULONG nIndex = ImplGetIndex( nKey );
+ sal_uIntPtr nIndex = ImplGetIndex( nKey );
// Ist Key nicht enthalten
if ( nIndex == TABLE_ENTRY_NOTFOUND )
@@ -339,7 +339,7 @@ void* Table::Seek( ULONG nKey )
void* Table::Seek( void* p )
{
- ULONG nKey = GetKey( p );
+ sal_uIntPtr nKey = GetKey( p );
// Ist Key vorhanden, dann als aktuellen Eintrag setzen
if ( nKey != TABLE_ENTRY_NOTFOUND )
diff --git a/tools/source/memtools/unqidx.cxx b/tools/source/memtools/unqidx.cxx
index b4b733f9452b..278199333e37 100644..100755
--- a/tools/source/memtools/unqidx.cxx
+++ b/tools/source/memtools/unqidx.cxx
@@ -38,8 +38,8 @@
|*
*************************************************************************/
-UniqueIndex::UniqueIndex( ULONG _nStartIndex,
- ULONG _nInitSize, ULONG _nReSize ) :
+UniqueIndex::UniqueIndex( sal_uIntPtr _nStartIndex,
+ sal_uIntPtr _nInitSize, sal_uIntPtr _nReSize ) :
Container( _nInitSize )
{
nReSize = _nReSize;
@@ -69,7 +69,7 @@ UniqueIndex::UniqueIndex( const UniqueIndex& rIdx ) :
|*
*************************************************************************/
-ULONG UniqueIndex::Insert( void* p )
+sal_uIntPtr UniqueIndex::Insert( void* p )
{
// NULL-Pointer ist nicht erlaubt
if ( !p )
@@ -101,13 +101,13 @@ ULONG UniqueIndex::Insert( void* p )
|*
*************************************************************************/
-ULONG UniqueIndex::Insert( ULONG nIndex, void* p )
+sal_uIntPtr UniqueIndex::Insert( sal_uIntPtr nIndex, void* p )
{
// NULL-Pointer ist nicht erlaubt
if ( !p )
return UNIQUEINDEX_ENTRY_NOTFOUND;
- ULONG nContIndex = nIndex - nStartIndex;
+ sal_uIntPtr nContIndex = nIndex - nStartIndex;
// Ist Array voll, dann expandieren
if ( nContIndex >= Container::GetSize() )
SetSize( nContIndex + nReSize );
@@ -126,7 +126,7 @@ ULONG UniqueIndex::Insert( ULONG nIndex, void* p )
|*
*************************************************************************/
-void* UniqueIndex::Remove( ULONG nIndex )
+void* UniqueIndex::Remove( sal_uIntPtr nIndex )
{
// Ist Index zulaessig
if ( (nIndex >= nStartIndex) &&
@@ -149,7 +149,7 @@ void* UniqueIndex::Remove( ULONG nIndex )
|*
*************************************************************************/
-void* UniqueIndex::Replace( ULONG nIndex, void* p )
+void* UniqueIndex::Replace( sal_uIntPtr nIndex, void* p )
{
// NULL-Pointer ist nicht erlaubt
if ( !p )
@@ -171,7 +171,7 @@ void* UniqueIndex::Replace( ULONG nIndex, void* p )
|*
*************************************************************************/
-void* UniqueIndex::Get( ULONG nIndex ) const
+void* UniqueIndex::Get( sal_uIntPtr nIndex ) const
{
// Ist Index zulaessig
if ( (nIndex >= nStartIndex) &&
@@ -187,9 +187,9 @@ void* UniqueIndex::Get( ULONG nIndex ) const
|*
*************************************************************************/
-ULONG UniqueIndex::GetCurIndex() const
+sal_uIntPtr UniqueIndex::GetCurIndex() const
{
- ULONG nPos = Container::GetCurPos();
+ sal_uIntPtr nPos = Container::GetCurPos();
// Ist der Current-Index nicht belegt, dann gibt es keinen Current-Index
if ( !Container::ImpGetObject( nPos ) )
@@ -204,13 +204,13 @@ ULONG UniqueIndex::GetCurIndex() const
|*
*************************************************************************/
-ULONG UniqueIndex::GetIndex( const void* p ) const
+sal_uIntPtr UniqueIndex::GetIndex( const void* p ) const
{
// Wird ein NULL-Pointer uebergeben, dann wurde Pointer nicht gefunden
if ( !p )
return UNIQUEINDEX_ENTRY_NOTFOUND;
- ULONG nIndex = Container::GetPos( p );
+ sal_uIntPtr nIndex = Container::GetPos( p );
if ( nIndex != CONTAINER_ENTRY_NOTFOUND )
return nIndex+nStartIndex;
@@ -224,7 +224,7 @@ ULONG UniqueIndex::GetIndex( const void* p ) const
|*
*************************************************************************/
-BOOL UniqueIndex::IsIndexValid( ULONG nIndex ) const
+sal_Bool UniqueIndex::IsIndexValid( sal_uIntPtr nIndex ) const
{
// Ist Index zulaessig
if ( (nIndex >= nStartIndex) &&
@@ -232,12 +232,12 @@ BOOL UniqueIndex::IsIndexValid( ULONG nIndex ) const
{
// Index ist nur zulaessig, wenn Eintrag auch belegt ist
if ( Container::ImpGetObject( nIndex-nStartIndex ) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -246,7 +246,7 @@ BOOL UniqueIndex::IsIndexValid( ULONG nIndex ) const
|*
*************************************************************************/
-void* UniqueIndex::Seek( ULONG nIndex )
+void* UniqueIndex::Seek( sal_uIntPtr nIndex )
{
// Index-Eintrag als aktuellen setzten, wenn er gueltig ist
if ( IsIndexValid( nIndex ) )
@@ -267,7 +267,7 @@ void* UniqueIndex::Seek( void* p )
if ( !p )
return NULL;
- ULONG nIndex = GetIndex( p );
+ sal_uIntPtr nIndex = GetIndex( p );
// Ist Index vorhanden, dann als aktuellen Eintrag setzen
if ( nIndex != UNIQUEINDEX_ENTRY_NOTFOUND )
@@ -363,15 +363,15 @@ UniqueIndex& UniqueIndex::operator =( const UniqueIndex& rIdx )
|*
*************************************************************************/
-BOOL UniqueIndex::operator ==( const UniqueIndex& rIdx ) const
+sal_Bool UniqueIndex::operator ==( const UniqueIndex& rIdx ) const
{
// Neue Werte zuweisen
if ( (nStartIndex == rIdx.nStartIndex) &&
(nCount == rIdx.nCount) &&
(Container::operator ==( rIdx )) )
- return TRUE;
+ return sal_True;
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
|*
@@ -383,7 +383,7 @@ UniqueIdContainer::UniqueIdContainer( const UniqueIdContainer& rObj )
: UniqueIndex( rObj )
, nCollectCount( rObj.nCollectCount )
{
- ULONG nCur = GetCurIndex();
+ sal_uIntPtr nCur = GetCurIndex();
ImpUniqueId * pEle = (ImpUniqueId *)First();
while( pEle )
@@ -405,7 +405,7 @@ UniqueIdContainer& UniqueIdContainer::operator = ( const UniqueIdContainer & rOb
UniqueIndex::operator = ( rObj );
nCollectCount = rObj.nCollectCount;
- ULONG nCur = GetCurIndex();
+ sal_uIntPtr nCur = GetCurIndex();
ImpUniqueId * pEle = (ImpUniqueId *)First();
while( pEle )
@@ -423,12 +423,12 @@ UniqueIdContainer& UniqueIdContainer::operator = ( const UniqueIdContainer & rOb
|*
*************************************************************************/
-void UniqueIdContainer::Clear( BOOL bAll )
+void UniqueIdContainer::Clear( sal_Bool bAll )
{
- USHORT nFree = bAll ? 0xFFFF : 1;
+ sal_uInt16 nFree = bAll ? 0xFFFF : 1;
ImpUniqueId* pId = (ImpUniqueId*)Last();
- BOOL bLast = TRUE;
+ sal_Bool bLast = sal_True;
while ( pId )
{
if ( pId->nRefCount <= nFree )
@@ -442,7 +442,7 @@ void UniqueIdContainer::Clear( BOOL bAll )
else
{
pId = (ImpUniqueId *)Prev();
- bLast = FALSE;
+ bLast = sal_False;
}
}
}
@@ -457,7 +457,7 @@ UniqueItemId UniqueIdContainer::CreateId()
{
if( nCollectCount > 50 )
{ // aufraeumen
- Clear( FALSE );
+ Clear( sal_False );
nCollectCount = 0;
}
nCollectCount++;
@@ -474,7 +474,7 @@ UniqueItemId UniqueIdContainer::CreateId()
|*
*************************************************************************/
-UniqueItemId UniqueIdContainer::CreateFreeId( ULONG nId )
+UniqueItemId UniqueIdContainer::CreateFreeId( sal_uIntPtr nId )
{
// Einfach erzeugen, fuer abgeleitete Klasse
ImpUniqueId * pId = new ImpUniqueId;
@@ -489,7 +489,7 @@ UniqueItemId UniqueIdContainer::CreateFreeId( ULONG nId )
|*
*************************************************************************/
-UniqueItemId UniqueIdContainer::CreateIdProt( ULONG nId )
+UniqueItemId UniqueIdContainer::CreateIdProt( sal_uIntPtr nId )
{
if ( IsIndexValid( nId ) )
return UniqueItemId( (ImpUniqueId *)Get( nId ) );
diff --git a/tools/source/misc/makefile.mk b/tools/source/misc/makefile.mk
deleted file mode 100644
index a426bb4053c3..000000000000
--- a/tools/source/misc/makefile.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ = ..$/..
-PRJNAME = tools
-TARGET = misc
-LIBTARGET = NO
-ENABLE_EXCEPTIONS = TRUE
-
-.INCLUDE: settings.mk
-.INCLUDE: $(PRJ)$/util$/makefile.pmk
-
-LIB1TARGET = $(SLB)$/$(TARGET).lib
-LIB1OBJFILES = \
- $(SLO)$/appendunixshellword.obj \
- $(SLO)$/extendapplicationenvironment.obj \
- $(SLO)$/solarmutex.obj \
- $(SLO)$/getprocessworkingdir.obj
-
-OBJFILES = $(OBJ)$/pathutils.obj
-SLOFILES = $(SLO)$/pathutils.obj $(LIB1OBJFILES) $(SLO)$/solarmutex.obj
-
-.INCLUDE: target.mk
diff --git a/tools/source/misc/pathutils.cxx b/tools/source/misc/pathutils.cxx
index 387abd397efb..0f0d0b767356 100644
--- a/tools/source/misc/pathutils.cxx
+++ b/tools/source/misc/pathutils.cxx
@@ -26,7 +26,6 @@
*
************************************************************************/
-#include "precompiled_tools.hxx"
#include "sal/config.h"
#if defined WNT
diff --git a/tools/source/rc/makefile.mk b/tools/source/rc/makefile.mk
deleted file mode 100644
index f8b46f38a0f7..000000000000
--- a/tools/source/rc/makefile.mk
+++ /dev/null
@@ -1,53 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=rc
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(SLO)$/rc.obj \
- $(SLO)$/isofallback.obj \
- $(SLO)$/resmgr.obj \
- $(SLO)$/resary.obj
-
-OBJFILES= $(OBJ)$/rc.obj \
- $(OBJ)$/isofallback.obj \
- $(OBJ)$/resmgr.obj \
- $(OBJ)$/resary.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/source/rc/rc.cxx b/tools/source/rc/rc.cxx
index face720c701a..e2ada0d111ac 100644
--- a/tools/source/rc/rc.cxx
+++ b/tools/source/rc/rc.cxx
@@ -66,16 +66,16 @@ Time::Time( const ResId& rResId )
ResMgr::GetResourceSkipHeader( rResId, &pResMgr );
- ULONG nObjMask = (USHORT)pResMgr->ReadLong();
+ sal_uIntPtr nObjMask = (sal_uInt16)pResMgr->ReadLong();
if ( 0x01 & nObjMask )
- SetHour( (USHORT)pResMgr->ReadShort() );
+ SetHour( (sal_uInt16)pResMgr->ReadShort() );
if ( 0x02 & nObjMask )
- SetMin( (USHORT)pResMgr->ReadShort() );
+ SetMin( (sal_uInt16)pResMgr->ReadShort() );
if ( 0x04 & nObjMask )
- SetSec( (USHORT)pResMgr->ReadShort() );
+ SetSec( (sal_uInt16)pResMgr->ReadShort() );
if ( 0x08 & nObjMask )
- Set100Sec( (USHORT)pResMgr->ReadShort() );
+ Set100Sec( (sal_uInt16)pResMgr->ReadShort() );
}
// =======================================================================
@@ -87,14 +87,14 @@ Date::Date( const ResId& rResId ) : nDate(0)
ResMgr::GetResourceSkipHeader( rResId, &pResMgr );
- ULONG nObjMask = (USHORT)pResMgr->ReadLong();
+ sal_uIntPtr nObjMask = (sal_uInt16)pResMgr->ReadLong();
if ( 0x01 & nObjMask )
- SetYear( (USHORT)pResMgr->ReadShort() );
+ SetYear( (sal_uInt16)pResMgr->ReadShort() );
if ( 0x02 & nObjMask )
- SetMonth( (USHORT)pResMgr->ReadShort() );
+ SetMonth( (sal_uInt16)pResMgr->ReadShort() );
if ( 0x04 & nObjMask )
- SetDay( (USHORT)pResMgr->ReadShort() );
+ SetDay( (sal_uInt16)pResMgr->ReadShort() );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index d0b63c9ab027..d68b71f255ae 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -45,6 +45,7 @@
#include <osl/mutex.hxx>
#include <osl/signal.h>
#include <rtl/ustrbuf.hxx>
+#include <rtl/strbuf.hxx>
#include <tools/urlobj.hxx>
#include <rtl/instance.hxx>
#include <rtl/bootstrap.hxx>
@@ -97,11 +98,11 @@ class InternalResMgr
friend class ResMgrContainer;
ImpContent * pContent;
- UINT32 nOffCorrection;
- BYTE * pStringBlock;
+ sal_uInt32 nOffCorrection;
+ sal_uInt8 * pStringBlock;
SvStream * pStm;
- BOOL bEqual2Content;
- UINT32 nEntries;
+ sal_Bool bEqual2Content;
+ sal_uInt32 nEntries;
OUString aFileName;
OUString aPrefix;
OUString aResName;
@@ -114,9 +115,9 @@ class InternalResMgr
const OUString& aResName,
const com::sun::star::lang::Locale& rLocale );
~InternalResMgr();
- BOOL Create();
+ sal_Bool Create();
- BOOL IsGlobalAvailable( RESOURCE_TYPE nRT, sal_uInt32 nId ) const;
+ sal_Bool IsGlobalAvailable( RESOURCE_TYPE nRT, sal_uInt32 nId ) const;
void * LoadGlobalRes( RESOURCE_TYPE nRT, sal_uInt32 nId,
void **pResHandle );
public:
@@ -551,7 +552,7 @@ InternalResMgr::InternalResMgr( const OUString& rFileURL,
: pContent( NULL )
, pStringBlock( NULL )
, pStm( NULL )
- , bEqual2Content( TRUE )
+ , bEqual2Content( sal_True )
, nEntries( 0 )
, aFileName( rFileURL )
, aPrefix( rPrefix )
@@ -602,15 +603,15 @@ InternalResMgr::~InternalResMgr()
// -----------------------------------------------------------------------
-BOOL InternalResMgr::Create()
+sal_Bool InternalResMgr::Create()
{
ResMgrContainer::get();
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
pStm = new SvFileStream( aFileName, (STREAM_READ | STREAM_SHARE_DENYWRITE | STREAM_NOCREATE) );
if( pStm->GetError() == 0 )
{
- INT32 lContLen = 0;
+ sal_Int32 lContLen = 0;
pStm->Seek( STREAM_SEEK_TO_END );
/*
@@ -624,15 +625,15 @@ BOOL InternalResMgr::Create()
lContLen = ResMgr::GetLong( &lContLen );
pStm->SeekRel( -lContLen );
// allocate stored ImpContent data (12 bytes per unit)
- BYTE* pContentBuf = (BYTE*)rtl_allocateMemory( lContLen );
+ sal_uInt8* pContentBuf = (sal_uInt8*)rtl_allocateMemory( lContLen );
pStm->Read( pContentBuf, lContLen );
// allocate ImpContent space (sizeof(ImpContent) per unit, not necessarily 12)
pContent = (ImpContent *)rtl_allocateMemory( sizeof(ImpContent)*lContLen/12 );
// Auf die Anzahl der ImpContent k�rzen
- nEntries = (UINT32)lContLen / 12;
- bEqual2Content = TRUE; // Die Daten der Resourcen liegen
+ nEntries = (sal_uInt32)lContLen / 12;
+ bEqual2Content = sal_True; // Die Daten der Resourcen liegen
// genauso wie das Inhaltsverzeichnis
- BOOL bSorted = TRUE;
+ sal_Bool bSorted = sal_True;
if( nEntries )
{
#ifdef DBG_UTIL
@@ -654,10 +655,10 @@ BOOL InternalResMgr::Create()
pContent[j].nTypeAndId = ResMgr::GetUInt64( pContentBuf + (12*j) );
pContent[j].nOffset = ResMgr::GetLong( pContentBuf + (12*j+8) );
if( pContent[i].nTypeAndId >= pContent[j].nTypeAndId )
- bSorted = FALSE;
+ bSorted = sal_False;
if( (pContent[i].nTypeAndId & 0xFFFFFFFF00000000LL) == (pContent[j].nTypeAndId & 0xFFFFFFFF00000000LL)
&& pContent[i].nOffset >= pContent[j].nOffset )
- bEqual2Content = FALSE;
+ bEqual2Content = sal_False;
}
}
rtl_freeMemory( pContentBuf );
@@ -669,7 +670,7 @@ BOOL InternalResMgr::Create()
::std::sort(pContent,pContent+nEntries,ImpContentLessCompare());
// qsort( pContent, nEntries, sizeof( ImpContent ), Compare );
- bDone = TRUE;
+ bDone = sal_True;
}
return bDone;
@@ -677,7 +678,7 @@ BOOL InternalResMgr::Create()
// -----------------------------------------------------------------------
-BOOL InternalResMgr::IsGlobalAvailable( RESOURCE_TYPE nRT, sal_uInt32 nId ) const
+sal_Bool InternalResMgr::IsGlobalAvailable( RESOURCE_TYPE nRT, sal_uInt32 nId ) const
{
// Anfang der Strings suchen
sal_uInt64 nValue = ((sal_uInt64(nRT) << 32) | nId);
@@ -719,18 +720,18 @@ void* InternalResMgr::LoadGlobalRes( RESOURCE_TYPE nRT, sal_uInt32 nId,
while( pLast < pEnd && (pLast->nTypeAndId >> 32) == RSC_STRING )
++pLast;
nOffCorrection = pFirst->nOffset;
- UINT32 nSize;
+ sal_uInt32 nSize;
--pLast;
pStm->Seek( pLast->nOffset );
RSHEADER_TYPE aHdr;
pStm->Read( &aHdr, sizeof( aHdr ) );
nSize = pLast->nOffset + aHdr.GetGlobOff() - nOffCorrection;
- pStringBlock = (BYTE*)rtl_allocateMemory( nSize );
+ pStringBlock = (sal_uInt8*)rtl_allocateMemory( nSize );
pStm->Seek( pFirst->nOffset );
pStm->Read( pStringBlock, nSize );
}
*pResHandle = pStringBlock;
- return (BYTE*)pStringBlock + pFind->nOffset - nOffCorrection;
+ return (sal_uInt8*)pStringBlock + pFind->nOffset - nOffCorrection;
} // if( nRT == RSC_STRING && bEqual2Content )
else
{
@@ -740,7 +741,7 @@ void* InternalResMgr::LoadGlobalRes( RESOURCE_TYPE nRT, sal_uInt32 nId,
pStm->Read( &aHeader, sizeof( RSHEADER_TYPE ) );
void * pRes = rtl_allocateMemory( aHeader.GetGlobOff() );
memcpy( pRes, &aHeader, sizeof( RSHEADER_TYPE ) );
- pStm->Read( (BYTE*)pRes + sizeof( RSHEADER_TYPE ),
+ pStm->Read( (sal_uInt8*)pRes + sizeof( RSHEADER_TYPE ),
aHeader.GetGlobOff() - sizeof( RSHEADER_TYPE ) );
return pRes;
}
@@ -766,12 +767,12 @@ void InternalResMgr::FreeGlobalRes( void * pResHandle, void * pResource )
UniString GetTypeRes_Impl( const ResId& rTypeId )
{
// Funktion verlassen, falls Resourcefehler in dieser Funktion
- static int bInUse = FALSE;
+ static int bInUse = sal_False;
UniString aTypStr( UniString::CreateFromInt32( rTypeId.GetId() ) );
if ( !bInUse )
{
- bInUse = TRUE;
+ bInUse = sal_True;
ResId aResId( sal_uInt32(RSCVERSION_ID), *rTypeId.GetResMgr() );
aResId.SetRT( RSC_VERSIONCONTROL );
@@ -786,7 +787,7 @@ UniString GetTypeRes_Impl( const ResId& rTypeId )
rTypeId.GetResMgr()->Increment( sizeof( RSHEADER_TYPE ) );
}
}
- bInUse = FALSE;
+ bInUse = sal_False;
}
return aTypStr;
@@ -899,14 +900,14 @@ static RSHEADER_TYPE* LocalResource( const ImpRCStack* pStack,
if ( pStack->pResource && pStack->pClassRes )
{
pTmp = (RSHEADER_TYPE*)
- ((BYTE*)pStack->pResource + pStack->pResource->GetLocalOff());
+ ((sal_uInt8*)pStack->pResource + pStack->pResource->GetLocalOff());
pEnd = (RSHEADER_TYPE*)
- ((BYTE*)pStack->pResource + pStack->pResource->GetGlobOff());
+ ((sal_uInt8*)pStack->pResource + pStack->pResource->GetGlobOff());
while ( pTmp != pEnd )
{
if ( pTmp->GetRT() == nRTType && pTmp->GetId() == nId )
return pTmp;
- pTmp = (RSHEADER_TYPE*)((BYTE*)pTmp + pTmp->GetGlobOff());
+ pTmp = (RSHEADER_TYPE*)((sal_uInt8*)pTmp + pTmp->GetGlobOff());
}
}
@@ -1073,11 +1074,11 @@ void ResMgr::TestStack( const Resource* )
#endif
// -----------------------------------------------------------------------
-BOOL ResMgr::IsAvailable( const ResId& rId, const Resource* pResObj ) const
+sal_Bool ResMgr::IsAvailable( const ResId& rId, const Resource* pResObj ) const
{
osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
- BOOL bAvailable = FALSE;
+ sal_Bool bAvailable = sal_False;
RSHEADER_TYPE* pClassRes = rId.GetpResource();
RESOURCE_TYPE nRT = rId.GetRT2();
sal_uInt32 nId = rId.GetId();
@@ -1100,7 +1101,7 @@ BOOL ResMgr::IsAvailable( const ResId& rId, const Resource* pResObj ) const
if ( pClassRes )
{
if ( pClassRes->GetRT() == nRT )
- bAvailable = TRUE;
+ bAvailable = sal_True;
}
}
@@ -1125,7 +1126,7 @@ void* ResMgr::GetClass()
// -----------------------------------------------------------------------
-BOOL ResMgr::GetResource( const ResId& rId, const Resource* pResObj )
+sal_Bool ResMgr::GetResource( const ResId& rId, const Resource* pResObj )
{
osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
@@ -1170,7 +1171,7 @@ BOOL ResMgr::GetResource( const ResId& rId, const Resource* pResObj )
pTop->Flags |= RC_NOTFOUND;
pTop->pClassRes = getEmptyBuffer();
pTop->pResource = (RSHEADER_TYPE*)pTop->pClassRes;
- return FALSE;
+ return sal_False;
}
}
else
@@ -1216,12 +1217,12 @@ BOOL ResMgr::GetResource( const ResId& rId, const Resource* pResObj )
pTop->Flags |= RC_NOTFOUND;
pTop->pClassRes = getEmptyBuffer();
pTop->pResource = (RSHEADER_TYPE*)pTop->pClassRes;
- return FALSE;
+ return sal_False;
}
}
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
@@ -1270,7 +1271,7 @@ void ResMgr::PopContext( const Resource* pResObj )
#ifdef DBG_UTIL
if ( DbgIsResource() && !(pTop->Flags & RC_NOTFOUND) )
{
- void* pRes = (BYTE*)pTop->pResource +
+ void* pRes = (sal_uInt8*)pTop->pResource +
pTop->pResource->GetLocalOff();
if ( pTop->pClassRes != pRes )
@@ -1322,7 +1323,7 @@ RSHEADER_TYPE* ResMgr::CreateBlock( const ResId& rId )
// ------------------------------------------------------------------
-INT16 ResMgr::GetShort( void * pShort )
+sal_Int16 ResMgr::GetShort( void * pShort )
{
return ((*((sal_uInt8*)pShort + 0) << 8) |
(*((sal_uInt8*)pShort + 1) << 0) );
@@ -1330,7 +1331,7 @@ INT16 ResMgr::GetShort( void * pShort )
// ------------------------------------------------------------------
-INT32 ResMgr::GetLong( void * pLong )
+sal_Int32 ResMgr::GetLong( void * pLong )
{
return ((*((sal_uInt8*)pLong + 0) << 24) |
(*((sal_uInt8*)pLong + 1) << 16) |
@@ -1353,9 +1354,10 @@ sal_uInt64 ResMgr::GetUInt64( void* pDatum )
}
// -----------------------------------------------------------------------
-sal_uInt32 ResMgr::GetStringWithoutHook( UniString& rStr, const BYTE* pStr )
+sal_uInt32 ResMgr::GetStringWithoutHook( UniString& rStr, const sal_uInt8* pStr )
{
- sal_uInt32 nRet = GetStringSize( pStr );
+ sal_uInt32 nLen=0;
+ sal_uInt32 nRet = GetStringSize( pStr, nLen );
UniString aString( (sal_Char*)pStr, RTL_TEXTENCODING_UTF8,
RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MAPTOPRIVATE |
RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT |
@@ -1364,7 +1366,7 @@ sal_uInt32 ResMgr::GetStringWithoutHook( UniString& rStr, const BYTE* pStr )
return nRet;
}
-sal_uInt32 ResMgr::GetString( UniString& rStr, const BYTE* pStr )
+sal_uInt32 ResMgr::GetString( UniString& rStr, const sal_uInt8* pStr )
{
UniString aString;
sal_uInt32 nRet = GetStringWithoutHook( aString, pStr );
@@ -1374,11 +1376,20 @@ sal_uInt32 ResMgr::GetString( UniString& rStr, const BYTE* pStr )
return nRet;
}
+sal_uInt32 ResMgr::GetByteString( rtl::OString& rStr, const sal_uInt8* pStr )
+{
+ sal_uInt32 nLen=0;
+ sal_uInt32 nRet = GetStringSize( pStr, nLen );
+ rStr = rtl::OString( (const sal_Char*)pStr, nLen );
+ return nRet;
+}
+
// ------------------------------------------------------------------
-sal_uInt32 ResMgr::GetStringSize( const BYTE* pStr )
+sal_uInt32 ResMgr::GetStringSize( const sal_uInt8* pStr, sal_uInt32& nLen )
{
- return GetStringSize( strlen( (const char*)pStr ) );
+ nLen = static_cast< sal_uInt32 >( strlen( (const char*)pStr ) );
+ return GetStringSize( nLen );
}
// -----------------------------------------------------------------------
@@ -1391,9 +1402,9 @@ sal_uInt32 ResMgr::GetRemainSize()
return pFallbackResMgr->GetRemainSize();
const ImpRCStack& rTop = aStack[nCurStack];
- return (sal_uInt32)((long)(BYTE *)rTop.pResource +
+ return (sal_uInt32)((long)(sal_uInt8 *)rTop.pResource +
rTop.pResource->GetLocalOff() -
- (long)(BYTE *)rTop.pClassRes);
+ (long)(sal_uInt8 *)rTop.pClassRes);
}
// -----------------------------------------------------------------------
@@ -1409,7 +1420,7 @@ void* ResMgr::Increment( sal_uInt32 nSize )
if( (rStack.Flags & RC_NOTFOUND) )
return rStack.pClassRes;
- BYTE* pClassRes = (BYTE*)rStack.pClassRes + nSize;
+ sal_uInt8* pClassRes = (sal_uInt8*)rStack.pClassRes + nSize;
rStack.pClassRes = pClassRes;
@@ -1500,7 +1511,7 @@ ResMgr* ResMgr::CreateFallbackResMgr( const ResId& rId, const Resource* pResourc
//
//---------------------------------------------------------------------------
-const char* ResMgr::GetLang( LanguageType& nType, USHORT nPrio )
+const char* ResMgr::GetLang( LanguageType& nType, sal_uInt16 nPrio )
{
if ( nType == LANGUAGE_SYSTEM || nType == LANGUAGE_DONTKNOW )
nType = MsLangId::getSystemUILanguage();
@@ -1711,29 +1722,29 @@ ResMgr* ResMgr::SearchCreateResMgr(
// -----------------------------------------------------------------------
-INT16 ResMgr::ReadShort()
+sal_Int16 ResMgr::ReadShort()
{
osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
if( pFallbackResMgr )
return pFallbackResMgr->ReadShort();
- INT16 n = GetShort( GetClass() );
- Increment( sizeof( INT16 ) );
+ sal_Int16 n = GetShort( GetClass() );
+ Increment( sizeof( sal_Int16 ) );
return n;
}
// -----------------------------------------------------------------------
-INT32 ResMgr::ReadLong()
+sal_Int32 ResMgr::ReadLong()
{
osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
if( pFallbackResMgr )
return pFallbackResMgr->ReadLong();
- INT32 n = GetLong( GetClass() );
- Increment( sizeof( INT32 ) );
+ sal_Int32 n = GetLong( GetClass() );
+ Increment( sizeof( sal_Int32 ) );
return n;
}
@@ -1756,7 +1767,7 @@ UniString ResMgr::ReadStringWithoutHook()
#endif
}
else
- Increment( GetStringWithoutHook( aRet, (const BYTE*)GetClass() ) );
+ Increment( GetStringWithoutHook( aRet, (const sal_uInt8*)GetClass() ) );
return aRet;
}
@@ -1769,90 +1780,125 @@ UniString ResMgr::ReadString()
return aRet;
}
+rtl::OString ResMgr::ReadByteString()
+{
+ osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
+
+ if( pFallbackResMgr )
+ return pFallbackResMgr->ReadByteString();
+
+ rtl::OString aRet;
+
+ const ImpRCStack& rTop = aStack[nCurStack];
+ if( (rTop.Flags & RC_NOTFOUND) )
+ {
+ #if OSL_DEBUG_LEVEL > 0
+ aRet = OString( "<resource not found>" );
+ #endif
+ }
+ else
+ Increment( GetByteString( aRet, (const sal_uInt8*)GetClass() ) );
+
+ return aRet;
+}
+
// -----------------------------------------------------------------------
-ULONG ResMgr::GetAutoHelpId()
+rtl::OString ResMgr::GetAutoHelpId()
{
osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
if( pFallbackResMgr )
return pFallbackResMgr->GetAutoHelpId();
- DBG_ASSERT( nCurStack, "resource stack empty in Auto help id generation" );
+ OSL_ENSURE( nCurStack, "resource stack empty in Auto help id generation" );
if( nCurStack < 1 || nCurStack > 2 )
- return 0;
-
- const ImpRCStack *pRC = StackTop( nCurStack==1 ? 0 : 1 );
-
- DBG_ASSERT( pRC->pResource, "MM hat gesagt, dass der immer einen hat" );
- ULONG nGID = pRC->pResource->GetId();
-
- if( !nGID || nGID > 32767 )
- return 0;
-
- ULONG nHID = 0;
-
- // GGGg gggg::gggg gggg::ggLL LLLl::llll llll
- switch( pRC->pResource->GetRT() ) { // maximal 7
- case RSC_DOCKINGWINDOW:
- nHID += 0x20000000L;
- case RSC_WORKWIN:
- nHID += 0x20000000L;
- case RSC_MODELESSDIALOG:
- nHID += 0x20000000L;
- case RSC_FLOATINGWINDOW:
- nHID += 0x20000000L;
- case RSC_MODALDIALOG:
- nHID += 0x20000000L;
- case RSC_TABPAGE:
- nHID += 0x20000000L;
-
- if( nCurStack == 2 ) {
- pRC = StackTop();
- ULONG nLID = pRC->pResource->GetId();
-
- if( !nLID || nLID > 511 )
- return 0;
-
- switch( pRC->pResource->GetRT() ) { // maximal 32
- case RSC_TABCONTROL: nHID |= 0x0000; break;
- case RSC_RADIOBUTTON: nHID |= 0x0200; break;
- case RSC_CHECKBOX: nHID |= 0x0400; break;
- case RSC_TRISTATEBOX: nHID |= 0x0600; break;
- case RSC_EDIT: nHID |= 0x0800; break;
- case RSC_MULTILINEEDIT: nHID |= 0x0A00; break;
- case RSC_MULTILISTBOX: nHID |= 0x0C00; break;
- case RSC_LISTBOX: nHID |= 0x0E00; break;
- case RSC_COMBOBOX: nHID |= 0x1000; break;
- case RSC_PUSHBUTTON: nHID |= 0x1200; break;
- case RSC_SPINFIELD: nHID |= 0x1400; break;
- case RSC_PATTERNFIELD: nHID |= 0x1600; break;
- case RSC_NUMERICFIELD: nHID |= 0x1800; break;
- case RSC_METRICFIELD: nHID |= 0x1A00; break;
- case RSC_CURRENCYFIELD: nHID |= 0x1C00; break;
- case RSC_DATEFIELD: nHID |= 0x1E00; break;
- case RSC_TIMEFIELD: nHID |= 0x2000; break;
- case RSC_IMAGERADIOBUTTON: nHID |= 0x2200; break;
- case RSC_NUMERICBOX: nHID |= 0x2400; break;
- case RSC_METRICBOX: nHID |= 0x2600; break;
- case RSC_CURRENCYBOX: nHID |= 0x2800; break;
- case RSC_DATEBOX: nHID |= 0x2A00; break;
- case RSC_TIMEBOX: nHID |= 0x2C00; break;
- case RSC_IMAGEBUTTON: nHID |= 0x2E00; break;
- case RSC_MENUBUTTON: nHID |= 0x3000; break;
- case RSC_MOREBUTTON: nHID |= 0x3200; break;
+ return rtl::OString();
+
+ // prepare HID, start with resource prefix
+ rtl::OStringBuffer aHID( 32 );
+ aHID.append( rtl::OUStringToOString( pImpRes->aPrefix, RTL_TEXTENCODING_UTF8 ) );
+ aHID.append( '.' );
+
+ // append type
+ const ImpRCStack *pRC = StackTop();
+ OSL_ENSURE( pRC, "missing resource stack level" );
+
+ if ( nCurStack == 1 )
+ {
+ // auto help ids for top level windows
+ switch( pRC->pResource->GetRT() ) {
+ case RSC_DOCKINGWINDOW: aHID.append( "DockingWindow" ); break;
+ case RSC_WORKWIN: aHID.append( "WorkWindow" ); break;
+ case RSC_MODELESSDIALOG: aHID.append( "ModelessDialog" ); break;
+ case RSC_FLOATINGWINDOW: aHID.append( "FloatingWindow" ); break;
+ case RSC_MODALDIALOG: aHID.append( "ModalDialog" ); break;
+ case RSC_TABPAGE: aHID.append( "TabPage" ); break;
+ default: return rtl::OString();
+ }
+ }
+ else
+ {
+ // only controls with the following parents get auto help ids
+ const ImpRCStack *pRC1 = StackTop(1);
+ switch( pRC1->pResource->GetRT() ) {
+ case RSC_DOCKINGWINDOW:
+ case RSC_WORKWIN:
+ case RSC_MODELESSDIALOG:
+ case RSC_FLOATINGWINDOW:
+ case RSC_MODALDIALOG:
+ case RSC_TABPAGE:
+ // intentionally no breaks!
+ // auto help ids for controls
+ switch( pRC->pResource->GetRT() ) {
+ case RSC_TABCONTROL: aHID.append( "TabControl" ); break;
+ case RSC_RADIOBUTTON: aHID.append( "RadioButton" ); break;
+ case RSC_CHECKBOX: aHID.append( "CheckBox" ); break;
+ case RSC_TRISTATEBOX: aHID.append( "TriStateBox" ); break;
+ case RSC_EDIT: aHID.append( "Edit" ); break;
+ case RSC_MULTILINEEDIT: aHID.append( "MultiLineEdit" ); break;
+ case RSC_MULTILISTBOX: aHID.append( "MultiListBox" ); break;
+ case RSC_LISTBOX: aHID.append( "ListBox" ); break;
+ case RSC_COMBOBOX: aHID.append( "ComboBox" ); break;
+ case RSC_PUSHBUTTON: aHID.append( "PushButton" ); break;
+ case RSC_SPINFIELD: aHID.append( "SpinField" ); break;
+ case RSC_PATTERNFIELD: aHID.append( "PatternField" ); break;
+ case RSC_NUMERICFIELD: aHID.append( "NumericField" ); break;
+ case RSC_METRICFIELD: aHID.append( "MetricField" ); break;
+ case RSC_CURRENCYFIELD: aHID.append( "CurrencyField" ); break;
+ case RSC_DATEFIELD: aHID.append( "DateField" ); break;
+ case RSC_TIMEFIELD: aHID.append( "TimeField" ); break;
+ case RSC_IMAGERADIOBUTTON: aHID.append( "ImageRadioButton" ); break;
+ case RSC_NUMERICBOX: aHID.append( "NumericBox" ); break;
+ case RSC_METRICBOX: aHID.append( "MetricBox" ); break;
+ case RSC_CURRENCYBOX: aHID.append( "CurrencyBox" ); break;
+ case RSC_DATEBOX: aHID.append( "DateBox" ); break;
+ case RSC_TIMEBOX: aHID.append( "TimeBox" ); break;
+ case RSC_IMAGEBUTTON: aHID.append( "ImageButton" ); break;
+ case RSC_MENUBUTTON: aHID.append( "MenuButton" ); break;
+ case RSC_MOREBUTTON: aHID.append( "MoreButton" ); break;
default:
- return 0;
- } // of switch
- nHID |= nLID;
- } // of if
- break;
- default:
- return 0;
- } // of switch
- nHID |= nGID << 14;
+ // no type, no auto HID
+ return rtl::OString();
+ }
+ break;
+ default:
+ return rtl::OString();
+ }
+ }
+
+ // append resource id hierarchy
+ for( int nOff = nCurStack-1; nOff >= 0; nOff-- )
+ {
+ aHID.append( '.' );
+ pRC = StackTop( nOff );
+
+ OSL_ENSURE( pRC->pResource, "missing resource in resource stack level !" );
+ if( pRC->pResource )
+ aHID.append( sal_Int32( pRC->pResource->GetId() ) );
+ }
- return nHID;
+ return aHID.makeStringAndClear();
}
// -----------------------------------------------------------------------
@@ -1979,8 +2025,8 @@ UniString SimpleResMgr::ReadString( sal_uInt32 nId )
return sReturn;
}
- // ULONG nLen = pResHeader->GetLocalOff() - sizeof(RSHEADER_TYPE);
- ResMgr::GetString( sReturn, (const BYTE*)(pResHeader+1) );
+ // sal_uIntPtr nLen = pResHeader->GetLocalOff() - sizeof(RSHEADER_TYPE);
+ ResMgr::GetString( sReturn, (const sal_uInt8*)(pResHeader+1) );
// not neccessary with te current implementation which holds the string table permanently, but to be sure ....
// note: pFallback cannot be NULL here and is either the fallback or m_pResImpl
@@ -2056,7 +2102,7 @@ sal_uInt32 SimpleResMgr::ReadBlob( sal_uInt32 nId, void** pBuffer )
// FreeBlob doesn't know that so it would probably crash ....
sal_uInt32 nRemaining = pResHeader->GetLocalOff() - sizeof(RSHEADER_TYPE);
- *pBuffer = (void*)(((BYTE*)pResHeader) + sizeof(RSHEADER_TYPE));
+ *pBuffer = (void*)(((sal_uInt8*)pResHeader) + sizeof(RSHEADER_TYPE));
// free an eventual fallback InternalResMgr
if( m_pResImpl != pFallback )
@@ -2073,7 +2119,7 @@ sal_uInt32 SimpleResMgr::ReadBlob( sal_uInt32 nId, void** pBuffer )
void SimpleResMgr::FreeBlob( void* pBuffer )
{
- void* pCompleteBuffer = (void*)(((BYTE*)pBuffer) - sizeof(RSHEADER_TYPE));
+ void* pCompleteBuffer = (void*)(((sal_uInt8*)pBuffer) - sizeof(RSHEADER_TYPE));
rtl_freeMemory(pCompleteBuffer);
}
diff --git a/tools/source/ref/errinf.cxx b/tools/source/ref/errinf.cxx
index 35cf67d3b905..9ad9b71dcba3 100644
--- a/tools/source/ref/errinf.cxx
+++ b/tools/source/ref/errinf.cxx
@@ -50,11 +50,11 @@ struct EDcrData
ErrorHandler *pFirstHdl;
ErrorContext *pFirstCtx;
DisplayFnPtr pDsp;
- BOOL bIsWindowDsp;
+ sal_Bool bIsWindowDsp;
DynamicErrorInfo *ppDcr[ERRCODE_DYNAMIC_COUNT];
- USHORT nNextDcr;
+ sal_uInt16 nNextDcr;
EDcrData();
static EDcrData *GetData();
@@ -63,12 +63,12 @@ static EDcrData *GetData();
class EDcr_Impl
{
- ULONG lErrId;
- USHORT nMask;
+ sal_uIntPtr lErrId;
+ sal_uInt16 nMask;
void RegisterEDcr(DynamicErrorInfo *);
void UnRegisterEDcr(DynamicErrorInfo *);
- static ErrorInfo *GetDynamicErrorInfo(ULONG lId);
+ static ErrorInfo *GetDynamicErrorInfo(sal_uIntPtr lId);
friend class DynamicErrorInfo;
friend class ErrorInfo;
@@ -77,7 +77,7 @@ friend class ErrorInfo;
EDcrData::EDcrData()
{
- for(USHORT n=0;n<ERRCODE_DYNAMIC_COUNT;n++)
+ for(sal_uInt16 n=0;n<ERRCODE_DYNAMIC_COUNT;n++)
ppDcr[n]=0;
nNextDcr=0;
pFirstHdl=0;
@@ -106,10 +106,10 @@ void EDcr_Impl::RegisterEDcr(DynamicErrorInfo *pDcr)
//Vergibt eine dynamische Id
EDcrData* pData=EDcrData::GetData();
- lErrId= (((ULONG)pData->nNextDcr + 1) << ERRCODE_DYNAMIC_SHIFT) +
+ lErrId= (((sal_uIntPtr)pData->nNextDcr + 1) << ERRCODE_DYNAMIC_SHIFT) +
pDcr->GetErrorCode();
DynamicErrorInfo **ppDcr=pData->ppDcr;
- USHORT nNext=pData->nNextDcr;
+ sal_uInt16 nNext=pData->nNextDcr;
// bei einem Ringbuffer koennen wir uns das ASSERT wohl sparen!
// DBG_ASSERT(ppDcr[nNext]==0,"ErrHdl: Alle Errors belegt");
@@ -128,8 +128,8 @@ void EDcr_Impl::UnRegisterEDcr(DynamicErrorInfo *pDcr)
EDcrData* pData=EDcrData::GetData();
DynamicErrorInfo **ppDcr=pData->ppDcr;
- ULONG lIdx=(
- ((ULONG)(*pDcr) & ERRCODE_DYNAMIC_MASK)>>ERRCODE_DYNAMIC_SHIFT)-1;
+ sal_uIntPtr lIdx=(
+ ((sal_uIntPtr)(*pDcr) & ERRCODE_DYNAMIC_MASK)>>ERRCODE_DYNAMIC_SHIFT)-1;
DBG_ASSERT(ppDcr[lIdx]==pDcr,"ErrHdl: Error nicht gefunden");
if(ppDcr[lIdx]==pDcr)
ppDcr[lIdx]=0;
@@ -143,7 +143,7 @@ TYPEINIT1(TwoStringErrorInfo, DynamicErrorInfo);
TYPEINIT1(MessageInfo, DynamicErrorInfo);
-ErrorInfo *ErrorInfo::GetErrorInfo(ULONG lId)
+ErrorInfo *ErrorInfo::GetErrorInfo(sal_uIntPtr lId)
{
if(lId & ERRCODE_DYNAMIC_MASK)
return EDcr_Impl::GetDynamicErrorInfo(lId);
@@ -151,12 +151,12 @@ ErrorInfo *ErrorInfo::GetErrorInfo(ULONG lId)
return new ErrorInfo(lId);
}
-DynamicErrorInfo::operator ULONG() const
+DynamicErrorInfo::operator sal_uIntPtr() const
{
return pImpl->lErrId;
}
-DynamicErrorInfo::DynamicErrorInfo(ULONG lArgUserId, USHORT nMask)
+DynamicErrorInfo::DynamicErrorInfo(sal_uIntPtr lArgUserId, sal_uInt16 nMask)
: ErrorInfo(lArgUserId)
{
pImpl=new EDcr_Impl;
@@ -170,32 +170,32 @@ DynamicErrorInfo::~DynamicErrorInfo()
delete pImpl;
}
-ErrorInfo* EDcr_Impl::GetDynamicErrorInfo(ULONG lId)
+ErrorInfo* EDcr_Impl::GetDynamicErrorInfo(sal_uIntPtr lId)
{
- ULONG lIdx=((lId & ERRCODE_DYNAMIC_MASK)>>ERRCODE_DYNAMIC_SHIFT)-1;
+ sal_uIntPtr lIdx=((lId & ERRCODE_DYNAMIC_MASK)>>ERRCODE_DYNAMIC_SHIFT)-1;
DynamicErrorInfo* pDcr=EDcrData::GetData()->ppDcr[lIdx];
- if(pDcr && (ULONG)(*pDcr)==lId)
+ if(pDcr && (sal_uIntPtr)(*pDcr)==lId)
return pDcr;
else
return new ErrorInfo(lId & ~ERRCODE_DYNAMIC_MASK);
}
-USHORT DynamicErrorInfo::GetDialogMask() const
+sal_uInt16 DynamicErrorInfo::GetDialogMask() const
{
return pImpl->nMask;
}
StandardErrorInfo::StandardErrorInfo(
- ULONG UserId, ULONG lArgExtId, USHORT nFlags)
+ sal_uIntPtr UserId, sal_uIntPtr lArgExtId, sal_uInt16 nFlags)
: DynamicErrorInfo(UserId, nFlags), lExtId(lArgExtId)
{
}
StringErrorInfo::StringErrorInfo(
- ULONG UserId, const String& aStringP, USHORT nFlags)
+ sal_uIntPtr UserId, const String& aStringP, sal_uInt16 nFlags)
: DynamicErrorInfo(UserId, nFlags), aString(aStringP)
{
}
@@ -206,8 +206,8 @@ class ErrHdl_Impl
public:
ErrorHandler *pNext;
- static BOOL CreateString(const ErrorHandler *pStart,
- const ErrorInfo*, String&, USHORT&);
+ static sal_Bool CreateString(const ErrorHandler *pStart,
+ const ErrorInfo*, String&, sal_uInt16&);
};
@@ -268,19 +268,19 @@ ErrorHandler::~ErrorHandler()
void ErrorHandler::RegisterDisplay(WindowDisplayErrorFunc *aDsp)
{
EDcrData *pData=EDcrData::GetData();
- pData->bIsWindowDsp=TRUE;
+ pData->bIsWindowDsp=sal_True;
pData->pDsp = reinterpret_cast< DisplayFnPtr >(aDsp);
}
void ErrorHandler::RegisterDisplay(BasicDisplayErrorFunc *aDsp)
{
EDcrData *pData=EDcrData::GetData();
- pData->bIsWindowDsp=FALSE;
+ pData->bIsWindowDsp=sal_False;
pData->pDsp = reinterpret_cast< DisplayFnPtr >(aDsp);
}
-USHORT ErrorHandler::HandleError_Impl(
- ULONG lId, USHORT nFlags, BOOL bJustCreateString, String & rError)
+sal_uInt16 ErrorHandler::HandleError_Impl(
+ sal_uIntPtr lId, sal_uInt16 nFlags, sal_Bool bJustCreateString, String & rError)
{
/* [Beschreibung]
@@ -317,8 +317,8 @@ USHORT ErrorHandler::HandleError_Impl(
break;
}
- BOOL bWarning = ((lId & ERRCODE_WARNING_MASK) == ERRCODE_WARNING_MASK);
- USHORT nErrFlags = ERRCODE_BUTTON_DEF_OK | ERRCODE_BUTTON_OK;
+ sal_Bool bWarning = ((lId & ERRCODE_WARNING_MASK) == ERRCODE_WARNING_MASK);
+ sal_uInt16 nErrFlags = ERRCODE_BUTTON_DEF_OK | ERRCODE_BUTTON_OK;
if (bWarning)
nErrFlags |= ERRCODE_MSG_WARNING;
else
@@ -327,7 +327,7 @@ USHORT ErrorHandler::HandleError_Impl(
DynamicErrorInfo* pDynPtr=PTR_CAST(DynamicErrorInfo,pInfo);
if(pDynPtr)
{
- USHORT nDynFlags = pDynPtr->GetDialogMask();
+ sal_uInt16 nDynFlags = pDynPtr->GetDialogMask();
if( nDynFlags )
nErrFlags = nDynFlags;
}
@@ -380,12 +380,12 @@ USHORT ErrorHandler::HandleError_Impl(
}
// static
-BOOL ErrorHandler::GetErrorString(ULONG lId, String& rStr)
+sal_Bool ErrorHandler::GetErrorString(sal_uIntPtr lId, String& rStr)
{
- return (BOOL)HandleError_Impl( lId, USHRT_MAX, TRUE, rStr );
+ return (sal_Bool)HandleError_Impl( lId, USHRT_MAX, sal_True, rStr );
}
-USHORT ErrorHandler::HandleError(ULONG lId, USHORT nFlags)
+sal_uInt16 ErrorHandler::HandleError(sal_uIntPtr lId, sal_uInt16 nFlags)
{
/* [Beschreibung]
@@ -405,30 +405,30 @@ USHORT ErrorHandler::HandleError(ULONG lId, USHORT nFlags)
*/
String aDummy;
- return HandleError_Impl( lId, nFlags, FALSE, aDummy );
+ return HandleError_Impl( lId, nFlags, sal_False, aDummy );
}
-BOOL ErrorHandler::ForwCreateString(const ErrorInfo* pInfo, String& rStr, USHORT &rFlags) const
+sal_Bool ErrorHandler::ForwCreateString(const ErrorInfo* pInfo, String& rStr, sal_uInt16 &rFlags) const
{
return ErrHdl_Impl::CreateString(this->pImpl->pNext, pInfo, rStr, rFlags);
}
-BOOL ErrHdl_Impl::CreateString( const ErrorHandler *pStart,
+sal_Bool ErrHdl_Impl::CreateString( const ErrorHandler *pStart,
const ErrorInfo* pInfo, String& pStr,
- USHORT &rFlags)
+ sal_uInt16 &rFlags)
{
for(const ErrorHandler *pHdl=pStart;pHdl;pHdl=pHdl->pImpl->pNext)
{
if(pHdl->CreateString( pInfo, pStr, rFlags))
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL SimpleErrorHandler::CreateString(
- const ErrorInfo *pInfo, String &rStr, USHORT &) const
+sal_Bool SimpleErrorHandler::CreateString(
+ const ErrorInfo *pInfo, String &rStr, sal_uInt16 &) const
{
- ULONG nId = pInfo->GetErrorCode();
+ sal_uIntPtr nId = pInfo->GetErrorCode();
ByteString aStr;
aStr="Id ";
aStr+=ByteString::CreateFromInt32(nId);
@@ -444,7 +444,7 @@ BOOL SimpleErrorHandler::CreateString(
if(pDyn)
{
aStr+="\nDId ";
- aStr+=ByteString::CreateFromInt32((ULONG)*pDyn);
+ aStr+=ByteString::CreateFromInt32((sal_uIntPtr)*pDyn);
}
StandardErrorInfo *pStd=PTR_CAST(StandardErrorInfo,pInfo);
if(pStd)
@@ -453,7 +453,7 @@ BOOL SimpleErrorHandler::CreateString(
aStr+=ByteString::CreateFromInt32(pStd->GetExtendedErrorCode());
}
rStr = String( aStr, RTL_TEXTENCODING_ASCII_US );
- return TRUE;
+ return sal_True;
}
SimpleErrorHandler::SimpleErrorHandler()
diff --git a/tools/source/ref/globname.cxx b/tools/source/ref/globname.cxx
index c220fbe1af92..05c7709931e6 100644..100755
--- a/tools/source/ref/globname.cxx
+++ b/tools/source/ref/globname.cxx
@@ -53,7 +53,7 @@ ImpSvGlobalName::ImpSvGlobalName( int )
/*************************************************************************
|* ImpSvGlobalName::operator ==()
*************************************************************************/
-BOOL ImpSvGlobalName::operator == ( const ImpSvGlobalName & rObj ) const
+sal_Bool ImpSvGlobalName::operator == ( const ImpSvGlobalName & rObj ) const
{
return !memcmp( szData, rObj.szData, sizeof( szData ) );
}
@@ -76,10 +76,10 @@ struct _GUID
struct GUID
#endif
{
- UINT32 Data1;
- UINT16 Data2;
- UINT16 Data3;
- BYTE Data4[8];
+ sal_uInt32 Data1;
+ sal_uInt16 Data2;
+ sal_uInt16 Data3;
+ sal_uInt8 Data4[8];
};
SvGlobalName::SvGlobalName( const CLSID & rId )
{
@@ -88,9 +88,9 @@ SvGlobalName::SvGlobalName( const CLSID & rId )
memcpy( pImp->szData, &rId, sizeof( pImp->szData ) );
}
-SvGlobalName::SvGlobalName( UINT32 n1, USHORT n2, USHORT n3,
- BYTE b8, BYTE b9, BYTE b10, BYTE b11,
- BYTE b12, BYTE b13, BYTE b14, BYTE b15 )
+SvGlobalName::SvGlobalName( sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3,
+ sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11,
+ sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14, sal_uInt8 b15 )
{
pImp = new ImpSvGlobalName();
pImp->nRefCount++;
@@ -188,14 +188,14 @@ SvStream& operator >> ( SvStream& rStr, SvGlobalName & rObj )
/*************************************************************************
|* SvGlobalName::operator < ()
*************************************************************************/
-BOOL SvGlobalName::operator < ( const SvGlobalName & rObj ) const
+sal_Bool SvGlobalName::operator < ( const SvGlobalName & rObj ) const
{
int n = memcmp( pImp->szData +6, rObj.pImp->szData +6,
sizeof( pImp->szData ) -6);
if( n < 0 )
- return TRUE;
+ return sal_True;
else if( n > 0 )
- return FALSE;
+ return sal_False;
sal_uInt16 Data2_a;
memcpy(&Data2_a, pImp->szData+4, sizeof(sal_uInt16));
@@ -204,7 +204,7 @@ BOOL SvGlobalName::operator < ( const SvGlobalName & rObj ) const
memcpy(&Data2_b, rObj.pImp->szData+4, sizeof(sal_uInt16));
if( Data2_a < Data2_b )
- return TRUE;
+ return sal_True;
else if( Data2_a == Data2_b )
{
sal_uInt32 Data1_a;
@@ -216,14 +216,14 @@ BOOL SvGlobalName::operator < ( const SvGlobalName & rObj ) const
return Data1_a < Data1_b;
}
else
- return FALSE;
+ return sal_False;
}
/*************************************************************************
|* SvGlobalName::operator +=()
*************************************************************************/
-SvGlobalName & SvGlobalName::operator += ( UINT32 n )
+SvGlobalName & SvGlobalName::operator += ( sal_uInt32 n )
{
NewImp();
@@ -246,7 +246,7 @@ SvGlobalName & SvGlobalName::operator += ( UINT32 n )
/*************************************************************************
|* SvGlobalName::operator ==()
*************************************************************************/
-BOOL SvGlobalName::operator == ( const SvGlobalName & rObj ) const
+sal_Bool SvGlobalName::operator == ( const SvGlobalName & rObj ) const
{
return *pImp == *rObj.pImp;
}
@@ -260,7 +260,7 @@ void SvGlobalName::MakeFromMemory( void * pData )
/*************************************************************************
|* SvGlobalName::MakeId()
*************************************************************************/
-BOOL SvGlobalName::MakeId( const String & rIdStr )
+sal_Bool SvGlobalName::MakeId( const String & rIdStr )
{
ByteString aStr( rIdStr, RTL_TEXTENCODING_ASCII_US );
sal_Char * pStr = (sal_Char *)aStr.GetBuffer();
@@ -268,7 +268,7 @@ BOOL SvGlobalName::MakeId( const String & rIdStr )
&& '-' == pStr[ 8 ] && '-' == pStr[ 13 ]
&& '-' == pStr[ 18 ] && '-' == pStr[ 23 ] )
{
- UINT32 nFirst = 0;
+ sal_uInt32 nFirst = 0;
int i = 0;
for( i = 0; i < 8; i++ )
{
@@ -278,11 +278,11 @@ BOOL SvGlobalName::MakeId( const String & rIdStr )
else
nFirst = nFirst * 16 + (toupper( *pStr ) - 'A' + 10 );
else
- return FALSE;
+ return sal_False;
pStr++;
}
- UINT16 nSec = 0;
+ sal_uInt16 nSec = 0;
pStr++;
for( i = 0; i < 4; i++ )
{
@@ -290,13 +290,13 @@ BOOL SvGlobalName::MakeId( const String & rIdStr )
if( isdigit( *pStr ) )
nSec = nSec * 16 + (*pStr - '0');
else
- nSec = nSec * 16 + (UINT16)(toupper( *pStr ) - 'A' + 10 );
+ nSec = nSec * 16 + (sal_uInt16)(toupper( *pStr ) - 'A' + 10 );
else
- return FALSE;
+ return sal_False;
pStr++;
}
- UINT16 nThird = 0;
+ sal_uInt16 nThird = 0;
pStr++;
for( i = 0; i < 4; i++ )
{
@@ -304,13 +304,13 @@ BOOL SvGlobalName::MakeId( const String & rIdStr )
if( isdigit( *pStr ) )
nThird = nThird * 16 + (*pStr - '0');
else
- nThird = nThird * 16 + (UINT16)(toupper( *pStr ) - 'A' + 10 );
+ nThird = nThird * 16 + (sal_uInt16)(toupper( *pStr ) - 'A' + 10 );
else
- return FALSE;
+ return sal_False;
pStr++;
}
- BYTE szRemain[ 8 ];
+ sal_Int8 szRemain[ 8 ];
memset( szRemain, 0, sizeof( szRemain ) );
pStr++;
for( i = 0; i < 16; i++ )
@@ -319,9 +319,9 @@ BOOL SvGlobalName::MakeId( const String & rIdStr )
if( isdigit( *pStr ) )
szRemain[i/2] = szRemain[i/2] * 16 + (*pStr - '0');
else
- szRemain[i/2] = szRemain[i/2] * 16 + (BYTE)(toupper( *pStr ) - 'A' + 10 );
+ szRemain[i/2] = szRemain[i/2] * 16 + (sal_Int8)(toupper( *pStr ) - 'A' + 10 );
else
- return FALSE;
+ return sal_False;
pStr++;
if( i == 3 )
pStr++;
@@ -332,9 +332,9 @@ BOOL SvGlobalName::MakeId( const String & rIdStr )
memcpy(&pImp->szData[4], &nSec, sizeof(nSec));
memcpy(&pImp->szData[6], &nThird, sizeof(nThird));
memcpy(&pImp->szData[ 8 ], szRemain, 8);
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
/*************************************************************************
@@ -349,7 +349,7 @@ String SvGlobalName::GetctorName() const
memcpy(&Data1, pImp->szData, sizeof(sal_uInt32));
sprintf( buf, "0x%8.8" SAL_PRIXUINT32, Data1 );
aRet += buf;
- USHORT i;
+ sal_uInt16 i;
for( i = 4; i < 8; i += 2 )
{
aRet += ',';
@@ -380,7 +380,7 @@ String SvGlobalName::GetHexName() const
sprintf( buf, "%8.8" SAL_PRIXUINT32, Data1 );
aRet += buf;
aRet += '-';
- USHORT i ;
+ sal_uInt16 i ;
for( i = 4; i < 8; i += 2 )
{
sal_uInt16 Data2;
@@ -442,7 +442,7 @@ void SvGlobalNameList::Append( const SvGlobalName & rName )
/*************************************************************************
|* SvGlobalNameList::GetObject()
*************************************************************************/
-SvGlobalName SvGlobalNameList::GetObject( ULONG nPos )
+SvGlobalName SvGlobalNameList::GetObject( sal_uLong nPos )
{
return SvGlobalName(nPos < aList.size() ? aList[nPos] : NULL);
}
@@ -450,16 +450,16 @@ SvGlobalName SvGlobalNameList::GetObject( ULONG nPos )
/*************************************************************************
|* SvGlobalNameList::IsEntry()
*************************************************************************/
-BOOL SvGlobalNameList::IsEntry( const SvGlobalName & rName )
+sal_Bool SvGlobalNameList::IsEntry( const SvGlobalName & rName )
{
std::vector<ImpSvGlobalName*>::iterator piter;
for (piter = aList.begin(); piter != aList.end(); ++piter)
{
if (*rName.pImp == *(*piter))
- return true;
+ return sal_True;
}
- return false;
+ return sal_False;
}
com::sun::star::uno::Sequence < sal_Int8 > SvGlobalName::GetByteSequence() const
diff --git a/tools/source/ref/makefile.mk b/tools/source/ref/makefile.mk
deleted file mode 100644
index c87f8a740a4f..000000000000
--- a/tools/source/ref/makefile.mk
+++ /dev/null
@@ -1,53 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=ref
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(SLO)$/ref.obj \
- $(SLO)$/pstm.obj \
- $(SLO)$/globname.obj \
- $(SLO)$/errinf.obj
-
-OBJFILES= $(OBJ)$/ref.obj \
- $(OBJ)$/pstm.obj \
- $(OBJ)$/globname.obj \
- $(OBJ)$/errinf.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/source/ref/pstm.cxx b/tools/source/ref/pstm.cxx
index 84b21433d3da..75781b427c89 100644
--- a/tools/source/ref/pstm.cxx
+++ b/tools/source/ref/pstm.cxx
@@ -38,7 +38,7 @@
/************************************************************************
|* SvClassManager::Register()
*************************************************************************/
-void SvClassManager::Register( USHORT nClassId, SvCreateInstancePersist pFunc )
+void SvClassManager::Register( sal_uInt16 nClassId, SvCreateInstancePersist pFunc )
{
#ifdef DBG_UTIL
SvCreateInstancePersist p;
@@ -51,7 +51,7 @@ void SvClassManager::Register( USHORT nClassId, SvCreateInstancePersist pFunc )
/************************************************************************
|* SvClassManager::Get()
*************************************************************************/
-SvCreateInstancePersist SvClassManager::Get( USHORT nClassId )
+SvCreateInstancePersist SvClassManager::Get( sal_uInt16 nClassId )
{
Map::const_iterator i(aAssocTable.find(nClassId));
return i == aAssocTable.end() ? 0 : i->second;
@@ -64,32 +64,32 @@ TYPEINIT0( SvRttiBase );
SvPersistBaseMemberList::SvPersistBaseMemberList(){}
SvPersistBaseMemberList::SvPersistBaseMemberList(
- USHORT nInitSz, USHORT nResize )
+ sal_uInt16 nInitSz, sal_uInt16 nResize )
: SuperSvPersistBaseMemberList( nInitSz, nResize ){}
-#define PERSIST_LIST_VER (BYTE)0
-#define PERSIST_LIST_DBGUTIL (BYTE)0x80
+#define PERSIST_LIST_VER (sal_uInt8)0
+#define PERSIST_LIST_DBGUTIL (sal_uInt8)0x80
/************************************************************************
|* SvPersistBaseMemberList::WriteOnlyStreamedObjects()
*************************************************************************/
void SvPersistBaseMemberList::WriteObjects( SvPersistStream & rStm,
- BOOL bOnlyStreamed ) const
+ sal_Bool bOnlyStreamed ) const
{
#ifdef STOR_NO_OPTIMIZE
- rStm << (BYTE)(PERSIST_LIST_VER | PERSIST_LIST_DBGUTIL);
- UINT32 nObjPos = rStm.WriteDummyLen();
+ rStm << (sal_uInt8)(PERSIST_LIST_VER | PERSIST_LIST_DBGUTIL);
+ sal_uInt32 nObjPos = rStm.WriteDummyLen();
#else
- BYTE bTmp = PERSIST_LIST_VER;
+ sal_uInt8 bTmp = PERSIST_LIST_VER;
rStm << bTmp;
#endif
- UINT32 nCountMember = Count();
- ULONG nCountPos = rStm.Tell();
- UINT32 nWriteCount = 0;
+ sal_uInt32 nCountMember = Count();
+ sal_uIntPtr nCountPos = rStm.Tell();
+ sal_uInt32 nWriteCount = 0;
rStm << nCountMember;
//bloss die Liste nicht veraendern,
//wegen Seiteneffekten beim Save
- for( ULONG n = 0; n < nCountMember; n++ )
+ for( sal_uIntPtr n = 0; n < nCountMember; n++ )
{
SvPersistBase * pObj = GetObject( n );
if( !bOnlyStreamed || rStm.IsStreamed( pObj ) )
@@ -101,7 +101,7 @@ void SvPersistBaseMemberList::WriteObjects( SvPersistStream & rStm,
if( nWriteCount != nCountMember )
{
// nicht alle Objekte geschrieben, Count anpassen
- ULONG nPos = rStm.Tell();
+ sal_uIntPtr nPos = rStm.Tell();
rStm.Seek( nCountPos );
rStm << nWriteCount;
rStm.Seek( nPos );
@@ -127,7 +127,7 @@ SvPersistStream& operator << ( SvPersistStream & rStm,
SvPersistStream& operator >> ( SvPersistStream & rStm,
SvPersistBaseMemberList & rLst )
{
- BYTE nVer;
+ sal_uInt8 nVer;
rStm >> nVer;
if( (nVer & ~PERSIST_LIST_DBGUTIL) != PERSIST_LIST_VER )
@@ -136,13 +136,13 @@ SvPersistStream& operator >> ( SvPersistStream & rStm,
OSL_FAIL( "persist list, false version" );
}
- UINT32 nObjLen(0), nObjPos(0);
+ sal_uInt32 nObjLen(0), nObjPos(0);
if( nVer & PERSIST_LIST_DBGUTIL )
nObjLen = rStm.ReadLen( &nObjPos );
sal_uInt32 nCount;
rStm >> nCount;
- for( ULONG n = 0; n < nCount && rStm.GetError() == SVSTREAM_OK; n++ )
+ for( sal_uIntPtr n = 0; n < nCount && rStm.GetError() == SVSTREAM_OK; n++ )
{
SvPersistBase * pObj;
rStm >> pObj;
@@ -171,7 +171,7 @@ SvPersistStream::SvPersistStream
gespeichert werdn k"onnen */
SvStream * pStream, /* Dieser Stream wird als Medium genommen, auf
dem der PersistStream arbeitet */
- UINT32 nStartIdxP /* Ab diesem Index werden die Id's f"ur
+ sal_uInt32 nStartIdxP /* Ab diesem Index werden die Id's f"ur
die Objekte vergeben, er muss gr"osser
als Null sein. */
)
@@ -190,7 +190,7 @@ SvPersistStream::SvPersistStream
*/
{
DBG_ASSERT( nStartIdx != 0, "zero index not allowed" );
- bIsWritable = TRUE;
+ bIsWritable = sal_True;
if( pStm )
{
SetVersion( pStm->GetVersion() );
@@ -228,7 +228,7 @@ SvPersistStream::SvPersistStream
wenn das erste aus dieser Hierarchie benutzt werden soll.
*/
{
- bIsWritable = TRUE;
+ bIsWritable = sal_True;
if( pStm )
{
SetVersion( pStm->GetVersion() );
@@ -282,14 +282,14 @@ void SvPersistStream::SetStream
}
//=========================================================================
-USHORT SvPersistStream::IsA() const
+sal_uInt16 SvPersistStream::IsA() const
/* [Beschreibung]
Gibt den Identifier dieses Streamklasse zur"uck.
[R"uckgabewert]
- USHORT ID_PERSISTSTREAM wird zur"uckgegeben.
+ sal_uInt16 ID_PERSISTSTREAM wird zur"uckgegeben.
[Querverweise]
@@ -314,10 +314,10 @@ void SvPersistStream::ResetError()
/*************************************************************************
|* SvPersistStream::GetData()
*************************************************************************/
-ULONG SvPersistStream::GetData( void* pData, ULONG nSize )
+sal_uIntPtr SvPersistStream::GetData( void* pData, sal_uIntPtr nSize )
{
DBG_ASSERT( pStm, "stream not set" );
- ULONG nRet = pStm->Read( pData, nSize );
+ sal_uIntPtr nRet = pStm->Read( pData, nSize );
SetError( pStm->GetError() );
return nRet;
}
@@ -325,10 +325,10 @@ ULONG SvPersistStream::GetData( void* pData, ULONG nSize )
/*************************************************************************
|* SvPersistStream::PutData()
*************************************************************************/
-ULONG SvPersistStream::PutData( const void* pData, ULONG nSize )
+sal_uIntPtr SvPersistStream::PutData( const void* pData, sal_uIntPtr nSize )
{
DBG_ASSERT( pStm, "stream not set" );
- ULONG nRet = pStm->Write( pData, nSize );
+ sal_uIntPtr nRet = pStm->Write( pData, nSize );
SetError( pStm->GetError() );
return nRet;
}
@@ -336,10 +336,10 @@ ULONG SvPersistStream::PutData( const void* pData, ULONG nSize )
/*************************************************************************
|* SvPersistStream::Seek()
*************************************************************************/
-ULONG SvPersistStream::SeekPos( ULONG nPos )
+sal_uIntPtr SvPersistStream::SeekPos( sal_uIntPtr nPos )
{
DBG_ASSERT( pStm, "stream not set" );
- ULONG nRet = pStm->Seek( nPos );
+ sal_uIntPtr nRet = pStm->Seek( nPos );
SetError( pStm->GetError() );
return nRet;
}
@@ -354,15 +354,15 @@ void SvPersistStream::FlushData()
/*************************************************************************
|* SvPersistStream::GetCurMaxIndex()
*************************************************************************/
-ULONG SvPersistStream::GetCurMaxIndex( const SvPersistUIdx & rIdx ) const
+sal_uIntPtr SvPersistStream::GetCurMaxIndex( const SvPersistUIdx & rIdx ) const
{
// const bekomme ich nicht den hoechsten Index
SvPersistUIdx * p = (SvPersistUIdx *)&rIdx;
// alten merken
- ULONG nCurIdx = p->GetCurIndex();
+ sal_uIntPtr nCurIdx = p->GetCurIndex();
p->Last();
// Bereiche nicht ueberschneiden, deshalb nur groessere Indexe
- ULONG nMaxIdx = p->GetCurIndex();
+ sal_uIntPtr nMaxIdx = p->GetCurIndex();
// wieder herstellen
p->Seek( nCurIdx );
return nMaxIdx;
@@ -371,9 +371,9 @@ ULONG SvPersistStream::GetCurMaxIndex( const SvPersistUIdx & rIdx ) const
/*************************************************************************
|* SvPersistStream::GetIndex()
*************************************************************************/
-ULONG SvPersistStream::GetIndex( SvPersistBase * pObj ) const
+sal_uIntPtr SvPersistStream::GetIndex( SvPersistBase * pObj ) const
{
- ULONG nId = (ULONG)aPTable.Get( (ULONG)pObj );
+ sal_uIntPtr nId = (sal_uIntPtr)aPTable.Get( (sal_uIntPtr)pObj );
if( !nId && pRefStm )
return pRefStm->GetIndex( pObj );
return nId;
@@ -382,7 +382,7 @@ ULONG SvPersistStream::GetIndex( SvPersistBase * pObj ) const
/*************************************************************************
|* SvPersistStream::GetObject)
*************************************************************************/
-SvPersistBase * SvPersistStream::GetObject( ULONG nIdx ) const
+SvPersistBase * SvPersistStream::GetObject( sal_uIntPtr nIdx ) const
{
if( nIdx >= nStartIdx )
return aPUIdx.Get( nIdx );
@@ -396,7 +396,7 @@ SvPersistBase * SvPersistStream::GetObject( ULONG nIdx ) const
#define LEN_2 0x40
#define LEN_4 0x20
#define LEN_5 0x10
-UINT32 SvPersistStream::ReadCompressed
+sal_uInt32 SvPersistStream::ReadCompressed
(
SvStream & rStm /* Aus diesem Stream werden die komprimierten Daten
gelesen */
@@ -408,14 +408,14 @@ UINT32 SvPersistStream::ReadCompressed
[R"uckgabewert]
- UINT32 Das nicht komprimierte Wort wird zur"uckgegeben.
+ sal_uInt32 Das nicht komprimierte Wort wird zur"uckgegeben.
[Querverweise]
*/
{
- UINT32 nRet(0);
- BYTE nMask;
+ sal_uInt32 nRet(0);
+ sal_uInt8 nMask;
rStm >> nMask;
if( nMask & LEN_1 )
nRet = ~LEN_1 & nMask;
@@ -433,7 +433,7 @@ UINT32 SvPersistStream::ReadCompressed
rStm >> nMask;
nRet |= nMask;
nRet <<= 16;
- USHORT n;
+ sal_uInt16 n;
rStm >> n;
nRet |= n;
}
@@ -459,7 +459,7 @@ void SvPersistStream::WriteCompressed
(
SvStream & rStm,/* Aus diesem Stream werden die komprimierten Daten
gelesen */
- UINT32 nVal /* Dieser Wert wird komprimiert geschrieben */
+ sal_uInt32 nVal /* Dieser Wert wird komprimiert geschrieben */
)
/* [Beschreibung]
@@ -477,30 +477,30 @@ void SvPersistStream::WriteCompressed
{
#ifdef STOR_NO_OPTIMIZE
if( nVal < 0x80 )
- rStm << (BYTE)(LEN_1 | nVal);
+ rStm << (sal_uInt8)(LEN_1 | nVal);
else if( nVal < 0x4000 )
{
- rStm << (BYTE)(LEN_2 | (nVal >> 8));
- rStm << (BYTE)nVal;
+ rStm << (sal_uInt8)(LEN_2 | (nVal >> 8));
+ rStm << (sal_uInt8)nVal;
}
else if( nVal < 0x20000000 )
{
- // hoechstes BYTE
- rStm << (BYTE)(LEN_4 | (nVal >> 24));
- // 2. hoechstes BYTE
- rStm << (BYTE)(nVal >> 16);
- rStm << (USHORT)(nVal);
+ // hoechstes sal_uInt8
+ rStm << (sal_uInt8)(LEN_4 | (nVal >> 24));
+ // 2. hoechstes sal_uInt8
+ rStm << (sal_uInt8)(nVal >> 16);
+ rStm << (sal_uInt16)(nVal);
}
else
#endif
{
- rStm << (BYTE)LEN_5;
+ rStm << (sal_uInt8)LEN_5;
rStm << nVal;
}
}
//=========================================================================
-UINT32 SvPersistStream::WriteDummyLen()
+sal_uInt32 SvPersistStream::WriteDummyLen()
/* [Beschreibung]
Die Methode schreibt 4 Byte in den Stream und gibt die Streamposition
@@ -508,11 +508,11 @@ UINT32 SvPersistStream::WriteDummyLen()
[R"uckgabewert]
- UINT32 Die Position hinter der L"angenangabe wird zur"uckgegeben.
+ sal_uInt32 Die Position hinter der L"angenangabe wird zur"uckgegeben.
[Beispiel]
- UINT32 nObjPos = rStm.WriteDummyLen();
+ sal_uInt32 nObjPos = rStm.WriteDummyLen();
...
// Daten schreiben
...
@@ -525,13 +525,13 @@ UINT32 SvPersistStream::WriteDummyLen()
*/
{
#ifdef DBG_UTIL
- UINT32 nPos = Tell();
+ sal_uInt32 nPos = Tell();
#endif
- UINT32 n0 = 0;
+ sal_uInt32 n0 = 0;
*this << n0; // wegen Sun sp
// keine Assertion bei Streamfehler
DBG_ASSERT( GetError() != SVSTREAM_OK
- || (sizeof( UINT32 ) == Tell() -nPos),
+ || (sizeof( sal_uInt32 ) == Tell() -nPos),
"keine 4-Byte fuer Langenangabe" );
return Tell();
}
@@ -539,20 +539,20 @@ UINT32 SvPersistStream::WriteDummyLen()
//=========================================================================
void SvPersistStream::WriteLen
(
- UINT32 nObjPos /* die Position + 4, an der die L"ange geschrieben
+ sal_uInt32 nObjPos /* die Position + 4, an der die L"ange geschrieben
wird. */
)
/* [Beschreibung]
Die Methode schreibt die Differenz zwischen der aktuellen und
- nObjPos als UINT32 an die Position nObjPos -4 im Stream. Danach
+ nObjPos als sal_uInt32 an die Position nObjPos -4 im Stream. Danach
wird der Stream wieder auf die alte Position gestellt.
[Beispiel]
Die Differenz enth"alt nicht die L"angenangabe.
- UINT32 nObjPos = rStm.WriteDummyLen();
+ sal_uInt32 nObjPos = rStm.WriteDummyLen();
...
// Daten schreiben
...
@@ -564,19 +564,19 @@ void SvPersistStream::WriteLen
<SvPersistStream::ReadLen>, <SvPersistStream::WriteDummyLen>
*/
{
- UINT32 nPos = Tell();
- UINT32 nLen = nPos - nObjPos;
+ sal_uInt32 nPos = Tell();
+ sal_uInt32 nLen = nPos - nObjPos;
// die Laenge mu� im stream 4-Byte betragen
- Seek( nObjPos - sizeof( UINT32 ) );
+ Seek( nObjPos - sizeof( sal_uInt32 ) );
// Laenge schreiben
*this << nLen;
Seek( nPos );
}
//=========================================================================
-UINT32 SvPersistStream::ReadLen
+sal_uInt32 SvPersistStream::ReadLen
(
- UINT32 * pTestPos /* Die Position des Streams, nach dem Lesen der
+ sal_uInt32 * pTestPos /* Die Position des Streams, nach dem Lesen der
L"ange, wird zur"uckgegeben. Es darf auch NULL
"ubergeben werden. */
)
@@ -586,7 +586,7 @@ UINT32 SvPersistStream::ReadLen
und <SvPersistStream::WriteLen> geschrieben wurde.
*/
{
- UINT32 nLen;
+ sal_uInt32 nLen;
*this >> nLen;
if( pTestPos )
*pTestPos = Tell();
@@ -596,15 +596,15 @@ UINT32 SvPersistStream::ReadLen
//=========================================================================
// Dateirormat abw"arts kompatibel
#ifdef STOR_NO_OPTIMIZE
-#define P_VER (BYTE)0x00
+#define P_VER (sal_uInt8)0x00
#else
-#define P_VER (BYTE)0x01
+#define P_VER (sal_uInt8)0x01
#endif
-#define P_VER_MASK (BYTE)0x0F
-#define P_ID_0 (BYTE)0x80
-#define P_OBJ (BYTE)0x40
-#define P_DBGUTIL (BYTE)0x20
-#define P_ID (BYTE)0x10
+#define P_VER_MASK (sal_uInt8)0x0F
+#define P_ID_0 (sal_uInt8)0x80
+#define P_OBJ (sal_uInt8)0x40
+#define P_DBGUTIL (sal_uInt8)0x20
+#define P_ID (sal_uInt8)0x10
#ifdef STOR_NO_OPTIMIZE
#define P_STD P_DBGUTIL
#else
@@ -614,9 +614,9 @@ UINT32 SvPersistStream::ReadLen
static void WriteId
(
SvStream & rStm,
- BYTE nHdr,
- UINT32 nId,
- USHORT nClassId
+ sal_uInt8 nHdr,
+ sal_uInt32 nId,
+ sal_uInt16 nClassId
)
{
#ifdef STOR_NO_OPTIMIZE
@@ -627,12 +627,12 @@ static void WriteId
{
if( (nHdr & P_OBJ) || nId != 0 )
{ // Id nur bei Zeiger, oder DBGUTIL
- rStm << (BYTE)(nHdr);
+ rStm << (sal_uInt8)(nHdr);
SvPersistStream::WriteCompressed( rStm, nId );
}
else
{ // NULL Pointer
- rStm << (BYTE)(nHdr | P_ID_0);
+ rStm << (sal_uInt8)(nHdr | P_ID_0);
return;
}
}
@@ -649,9 +649,9 @@ static void WriteId
static void ReadId
(
SvStream & rStm,
- BYTE & nHdr,
- UINT32 & nId,
- USHORT & nClassId
+ sal_uInt8 & nHdr,
+ sal_uInt32 & nId,
+ sal_uInt16 & nClassId
)
{
nClassId = 0;
@@ -671,19 +671,19 @@ static void ReadId
nId = SvPersistStream::ReadCompressed( rStm );
if( (nHdr & P_DBGUTIL) || (nHdr & P_OBJ) )
- nClassId = (USHORT)SvPersistStream::ReadCompressed( rStm );
+ nClassId = (sal_uInt16)SvPersistStream::ReadCompressed( rStm );
}
}
//=========================================================================
void SvPersistStream::WriteObj
(
- BYTE nHdr,
+ sal_uInt8 nHdr,
SvPersistBase * pObj
)
{
#ifdef STOR_NO_OPTIMIZE
- UINT32 nObjPos = 0;
+ sal_uInt32 nObjPos = 0;
if( nHdr & P_DBGUTIL )
// Position fuer Laenge merken
nObjPos = WriteDummyLen();
@@ -701,17 +701,17 @@ SvPersistStream& SvPersistStream::WritePointer
SvPersistBase * pObj
)
{
- BYTE nP = P_STD;
+ sal_uInt8 nP = P_STD;
if( pObj )
{
- ULONG nId = GetIndex( pObj );
+ sal_uIntPtr nId = GetIndex( pObj );
if( nId )
nP |= P_ID;
else
{
nId = aPUIdx.Insert( pObj );
- aPTable.Insert( (ULONG)pObj, (void *)nId );
+ aPTable.Insert( (sal_uIntPtr)pObj, (void *)nId );
nP |= P_OBJ;
}
WriteId( *this, nP, nId, pObj->GetClassId() );
@@ -726,15 +726,15 @@ SvPersistStream& SvPersistStream::WritePointer
}
//=========================================================================
-UINT32 SvPersistStream::ReadObj
+sal_uInt32 SvPersistStream::ReadObj
(
SvPersistBase * & rpObj,
- BOOL bRegister
+ sal_Bool bRegister
)
{
- BYTE nHdr;
- UINT32 nId = 0;
- USHORT nClassId;
+ sal_uInt8 nHdr;
+ sal_uInt32 nId = 0;
+ sal_uInt16 nClassId;
rpObj = NULL; // Spezifikation: Im Fehlerfall 0.
ReadId( *this, nHdr, nId, nClassId );
@@ -754,7 +754,7 @@ UINT32 SvPersistStream::ReadObj
"object already exist" );
SvCreateInstancePersist pFunc = rClassMgr.Get( nClassId );
- UINT32 nObjLen(0), nObjPos(0);
+ sal_uInt32 nObjLen(0), nObjPos(0);
if( nHdr & P_DBGUTIL )
nObjLen = ReadLen( &nObjPos );
if( !pFunc )
@@ -777,9 +777,9 @@ UINT32 SvPersistStream::ReadObj
if( bRegister )
{
// unbedingt erst in Tabelle eintragen
- ULONG nNewId = aPUIdx.Insert( rpObj );
+ sal_uIntPtr nNewId = aPUIdx.Insert( rpObj );
// um den gleichen Zustand, wie nach dem Speichern herzustellen
- aPTable.Insert( (ULONG)rpObj, (void *)nNewId );
+ aPTable.Insert( (sal_uIntPtr)rpObj, (void *)nNewId );
DBG_ASSERT( !(nHdr & P_DBGUTIL) || nId == nNewId,
"read write id conflict: not the same" );
}
@@ -814,7 +814,7 @@ SvPersistStream& SvPersistStream::ReadPointer
SvPersistBase * & rpObj
)
{
- ReadObj( rpObj, TRUE );
+ ReadObj( rpObj, sal_True );
return *this;
}
@@ -848,14 +848,14 @@ SvStream& operator <<
SvStream * pOldStm = rThis.GetStream();
rThis.SetStream( &rStm );
- BYTE bTmp = 0;
+ sal_uInt8 bTmp = 0;
rThis << bTmp; // Version
- UINT32 nCount = (UINT32)rThis.aPUIdx.Count();
+ sal_uInt32 nCount = (sal_uInt32)rThis.aPUIdx.Count();
rThis << nCount;
SvPersistBase * pEle = rThis.aPUIdx.First();
- for( UINT32 i = 0; i < nCount; i++ )
+ for( sal_uInt32 i = 0; i < nCount; i++ )
{
- BYTE nP = P_OBJ | P_ID | P_STD;
+ sal_uInt8 nP = P_OBJ | P_ID | P_STD;
WriteId( rThis, nP, rThis.aPUIdx.GetCurIndex(),
pEle->GetClassId() );
rThis.WriteObj( nP, pEle );
@@ -875,23 +875,23 @@ SvStream& operator >>
SvStream * pOldStm = rThis.GetStream();
rThis.SetStream( &rStm );
- BYTE nVers;
+ sal_uInt8 nVers;
rThis >> nVers; // Version
if( 0 == nVers )
{
- UINT32 nCount = 0;
+ sal_uInt32 nCount = 0;
rThis >> nCount;
- for( UINT32 i = 0; i < nCount; i++ )
+ for( sal_uInt32 i = 0; i < nCount; i++ )
{
SvPersistBase * pEle;
// Lesen, ohne in die Tabellen einzutragen
- sal_uIntPtr nId = rThis.ReadObj( pEle, FALSE );
+ sal_uIntPtr nId = rThis.ReadObj( pEle, sal_False );
if( rThis.GetError() )
break;
// Die Id eines Objektes wird nie modifiziert
rThis.aPUIdx.Insert( nId, pEle );
- rThis.aPTable.Insert( (ULONG)pEle, (void *)nId );
+ rThis.aPTable.Insert( (sal_uIntPtr)pEle, (void *)nId );
}
}
else
@@ -902,19 +902,19 @@ SvStream& operator >>
}
//=========================================================================
-ULONG SvPersistStream::InsertObj( SvPersistBase * pObj )
+sal_uIntPtr SvPersistStream::InsertObj( SvPersistBase * pObj )
{
- ULONG nId = aPUIdx.Insert( pObj );
- aPTable.Insert( (ULONG)pObj, (void *)nId );
+ sal_uIntPtr nId = aPUIdx.Insert( pObj );
+ aPTable.Insert( (sal_uIntPtr)pObj, (void *)nId );
return nId;
}
//=========================================================================
-ULONG SvPersistStream::RemoveObj( SvPersistBase * pObj )
+sal_uIntPtr SvPersistStream::RemoveObj( SvPersistBase * pObj )
{
- ULONG nIdx = GetIndex( pObj );
+ sal_uIntPtr nIdx = GetIndex( pObj );
aPUIdx.Remove( nIdx );
- aPTable.Remove( (ULONG)pObj );
+ aPTable.Remove( (sal_uIntPtr)pObj );
return nIdx;
}
diff --git a/tools/source/reversemap/makefile.mk b/tools/source/reversemap/Makefile
index bfd3400d2d84..2bad931328fc 100644
--- a/tools/source/reversemap/makefile.mk
+++ b/tools/source/reversemap/Makefile
@@ -1,6 +1,3 @@
-#*************************************************************************
-#
-#
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
@@ -14,34 +11,22 @@
# License.
#
# The Initial Developer of the Original Code is
-# Caolán McNamara <caolanm@redhat.com> (Red Hat, Inc.)
-# Portions created by the Initial Developer are Copyright (C) 2010 the
+# Bjoern Michaelsen <bjoern.michaelsen@canonical.com> (Canonical Ltd.)
+# Portions created by the Initial Developer are Copyright (C) 2011 the
# Initial Developer. All Rights Reserved.
#
-# Contributor(s): Caolán McNamara <caolanm@redhat.com>
+# Contributor(s): Bjoern Michaelsen <bjoern.michaelsen@canonical.com> (Canonical Ltd.)
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
-#
-#*************************************************************************
-
-PRJ = ../..
-PRJNAME = tl
-TARGET = bestreversemap
-LIBTARGET = NO
-TARGETTYPE = CUI
-ENABLE_EXCEPTIONS=TRUE
-
-.INCLUDE: settings.mk
-OBJFILES = \
- $(OBJ)$/bestreversemap.obj
+all : reversemap.hxx
-APP1TARGET = bestreversemap
-APP1OBJS = $(OBJ)$/bestreversemap.obj
-APP1STDLIBS = $(SALLIB)
+reversemap.hxx : $(OUTDIR)/bin/bestreversemap
+ $(gb_Helper_execute)bestreversemap > $@
-.INCLUDE: target.mk
+.PHONY : all
+# vim: set noet sw=4 ts=4:
diff --git a/tools/source/reversemap/bestreversemap.cxx b/tools/source/reversemap/bestreversemap.cxx
index a4956c1e58b3..d937724b126d 100644
--- a/tools/source/reversemap/bestreversemap.cxx
+++ b/tools/source/reversemap/bestreversemap.cxx
@@ -28,7 +28,6 @@
#include "sal/config.h"
#include "rtl/textcvt.h"
-#include "sal/main.h"
#include <stdio.h>
@@ -77,7 +76,7 @@ struct Encoder
};
-SAL_IMPLEMENT_MAIN()
+int main(int, char**)
{
# define EXP(x) Encoder(x, #x)
diff --git a/tools/source/solar/makefile.mk b/tools/source/solar/makefile.mk
deleted file mode 100644
index 6f5dd85c608b..000000000000
--- a/tools/source/solar/makefile.mk
+++ /dev/null
@@ -1,63 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=mksvconf
-TARGETTYPE=CUI
-
-LIBSALCPPRT=$(0)
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-CFILES= solar.c
-
-OBJFILES= $(OBJ)$/solar.obj
-
-APP1TARGET= $(TARGET)
-APP1OBJS= $(OBJFILES)
-APP1STDLIBS=
-APP1DEPN=
-APP1DEF=
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-.IF "$(L10N-framework)"==""
-ALLTAR : $(INCCOM)$/svconf.h
-.ENDIF # "$(L10N-framework)"==""
-
-$(INCCOM)$/svconf.h : $(BIN)$/$(TARGET)
- $(BIN)$/$(TARGET) $@
-
diff --git a/tools/source/solar/solar.c b/tools/source/solar/solar.c
deleted file mode 100644
index 5d1549459bbf..000000000000
--- a/tools/source/solar/solar.c
+++ /dev/null
@@ -1,520 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/* POSIX defines that a program is undefined after a SIG_SEGV. The
- * code stopped working on Linux Kernel 2.6 so I have moved this back to
- * use FORK.
- * If at a later time the signals work correctly with the Linux Kernel 2.6
- * then this change may be reverted although not strictly posix safe. */
-#define USE_FORK_TO_CHECK 1
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-
-#include <unistd.h>
-#include <sys/types.h>
-
-#define I_STDARG
-#ifdef I_STDARG
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#define NO_USE_FORK_TO_CHECK
-#ifdef USE_FORK_TO_CHECK
-#include <sys/wait.h>
-#else
-#include <signal.h>
-#include <setjmp.h>
-#endif
-
-#define printTypeSize(Type,Name) printf( "sizeof(%s)\t= %d\n", Name, sizeof (Type) )
-
-#define isSignedType(Type) (((Type)-1) < 0)
-#define printTypeSign(Type,Name) printf( "%s\t= %s %s\n", Name, ( isSignedType(Type) ? "signed" : "unsigned" ), Name )
-
-
-/*************************************************************************
-|*
-|* IsBigEndian()
-|*
-|* Beschreibung True, wenn CPU BigEndian ist
-|*
-*************************************************************************/
-int IsBigEndian()
-{
- long l = 1;
- return ! *(char*)&l;
-}
-
-/*************************************************************************
-|*
-|* IsStackGrowingDown()
-|*
-|* Beschreibung True, wenn der Stack nach unten waechst
-|*
-*************************************************************************/
-int IsStackGrowingDown_2( int * pI )
-{
- int i = 1;
- return ((unsigned long)&i) < (unsigned long)pI;
-}
-
-int IsStackGrowingDown()
-{
- int i = 1;
- return IsStackGrowingDown_2(&i);
-}
-
-/*************************************************************************
-|*
-|* GetStackAlignment()
-|*
-|* Beschreibung Alignment von char Parametern, die (hoffentlich)
-|* ueber den Stack uebergeben werden
-|*
-*************************************************************************/
-int GetStackAlignment_3( char*p, long l, int i, short s, char b, char c, ... )
-{
- if ( IsStackGrowingDown() )
- return &c - &b;
- else
- return &b - &c;
-}
-
-int GetStackAlignment_2( char*p, long l, int i, short s, char b, char c )
-{
- if ( IsStackGrowingDown() )
- return &c - &b;
- else
- return &b - &c;
-}
-
-int GetStackAlignment()
-{
- int nStackAlignment = GetStackAlignment_3(0,1,2,3,4,5);
- if ( nStackAlignment != GetStackAlignment_2(0,1,2,3,4,5) )
- printf( "Pascal calling convention\n" );
- return nStackAlignment;
-}
-
-
-/*************************************************************************
-|*
-|* Typdeclarations for memory access test functions
-|*
-*************************************************************************/
-typedef enum { t_char, t_short, t_int, t_long, t_double } Type;
-typedef int (*TestFunc)( Type, void* );
-
-
-/*************************************************************************
-|*
-|* PrintArgs()
-|*
-|* Beschreibung Testfunktion fuer variable Parameter
-|*
-*************************************************************************/
-#ifdef I_STDARG
-void PrintArgs( int p, ... )
-#else
-void PrintArgs( p, va_alist )
-int p;
-va_dcl
-#endif
-{
- int value;
- va_list ap;
-
-#ifdef I_STDARG
- va_start( ap, p );
-#else
- va_start( ap );
-#endif
-
- printf( "value = %d", p );
-
- while ( ( value = va_arg(ap, int) ) != 0 )
- printf( " %d", value );
-
- printf( "\n" );
- va_end(ap);
-}
-
-#ifndef USE_FORK_TO_CHECK
-/*************************************************************************
-|*
-|* SignalHdl()
-|*
-|* Beschreibung faengt SIGBUS und SIGSEGV in check() ab
-|*
-*************************************************************************/
-static jmp_buf check_env;
-static int bSignal;
-void SignalHdl( int sig )
-{
- bSignal = 1;
-
- fprintf( stderr, "Signal %d caught\n", sig );
- signal( SIGSEGV, SIG_DFL );
- signal( SIGBUS, SIG_DFL );
- siglongjmp( check_env, sig );
-}
-#endif
-
-/*************************************************************************
-|*
-|* check()
-|*
-|* Beschreibung Testet MemoryZugriff (read/write)
-|*
-*************************************************************************/
-int check( TestFunc func, Type eT, void* p )
-{
-#ifdef USE_FORK_TO_CHECK
- pid_t nChild = fork();
- if ( nChild )
- {
- int exitVal;
- wait( &exitVal );
- if ( exitVal & 0xff )
- return -1;
- else
- return exitVal >> 8;
- }
- else
- {
- exit( func( eT, p ) );
- }
-#else
- int result;
-
- bSignal = 0;
-
- if ( !sigsetjmp( check_env, 1 ) )
- {
- signal( SIGSEGV, SignalHdl );
- signal( SIGBUS, SignalHdl );
- result = func( eT, p );
- signal( SIGSEGV, SIG_DFL );
- signal( SIGBUS, SIG_DFL );
- }
-
- if ( bSignal )
- return -1;
- else
- return 0;
-#endif
-}
-
-/*************************************************************************
-|*
-|* GetAtAddress()
-|*
-|* Beschreibung memory read access
-|*
-*************************************************************************/
-int GetAtAddress( Type eT, void* p )
-{
- switch ( eT )
- {
- case t_char: return *((char*)p);
- case t_short: return *((short*)p);
- case t_int: return *((int*)p);
- case t_long: return *((long*)p);
- case t_double: return *((double*)p);
- }
- abort();
-}
-
-/*************************************************************************
-|*
-|* SetAtAddress()
-|*
-|* Beschreibung memory write access
-|*
-*************************************************************************/
-int SetAtAddress( Type eT, void* p )
-{
- switch ( eT )
- {
- case t_char: return *((char*)p) = 0;
- case t_short: return *((short*)p) = 0;
- case t_int: return *((int*)p) = 0;
- case t_long: return *((long*)p) = 0;
- case t_double: return *((double*)p)= 0;
- }
- abort();
-}
-
-char* TypeName( Type eT )
-{
- switch ( eT )
- {
- case t_char: return "char";
- case t_short: return "short";
- case t_int: return "int";
- case t_long: return "long";
- case t_double: return "double";
- }
- abort();
-}
-
-/*************************************************************************
-|*
-|* Check(Get|Set)Access()
-|*
-|* Beschreibung Testet MemoryZugriff (read/write)
-|* Zugriffsverletzungen werden abgefangen
-|*
-*************************************************************************/
-int CheckGetAccess( Type eT, void* p )
-{
- int b;
- b = -1 != check( (TestFunc)GetAtAddress, eT, p );
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr,
- "%s read %s at %p\n",
- (b? "can" : "can not" ), TypeName(eT), p );
-#endif
- return b;
-}
-int CheckSetAccess( Type eT, void* p )
-{
- int b;
-
- b = -1 != check( (TestFunc)SetAtAddress, eT, p );
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr,
- "%s write %s at %p\n",
- (b? "can" : "can not" ), TypeName(eT), p );
-#endif
- return b;
-}
-
-/*************************************************************************
-|*
-|* GetAlignment()
-|*
-|* Beschreibung Bestimmt das Alignment verschiedener Typen
-|*
-*************************************************************************/
-int GetAlignment( Type eT )
-{
- char a[ 16*8 ];
- long p = (long)(void*)a;
- int i;
-
- /* clear a[...] to set legal value for double access */
- for ( i = 0; i < 16*8; i++ )
- a[i] = 0;
-
- p = ( p + 0xF ) & ~0xF;
- for ( i = 1; i < 16; i++ )
- if ( CheckGetAccess( eT, (void*)(p+i) ) )
- return i;
- return 0;
-}
-
-/*************************************************************************
-|*
-|* struct Description
-|*
-|* Beschreibung Beschreibt die Parameter der Architektur
-|*
-*************************************************************************/
-struct Description
-{
- int bBigEndian;
- int bStackGrowsDown;
- int nStackAlignment;
- int nAlignment[3]; /* 2,4,8 */
-};
-
-/*************************************************************************
-|*
-|* Description_Ctor()
-|*
-|* Beschreibung Bestimmt die Parameter der Architektur
-|*
-*************************************************************************/
-void Description_Ctor( struct Description* pThis )
-{
- pThis->bBigEndian = IsBigEndian();
- pThis->bStackGrowsDown = IsStackGrowingDown();
- pThis->nStackAlignment = GetStackAlignment();
-
- if ( sizeof(short) != 2 )
- abort();
- pThis->nAlignment[0] = GetAlignment( t_short );
- if ( sizeof(int) != 4 )
- abort();
- pThis->nAlignment[1] = GetAlignment( t_int );
-
- if ( sizeof(long) == 8 )
- pThis->nAlignment[2] = GetAlignment( t_long );
- else if ( sizeof(double) == 8 )
- pThis->nAlignment[2] = GetAlignment( t_double );
- else
- abort();
-}
-
-/*************************************************************************
-|*
-|* Description_Print()
-|*
-|* Beschreibung Schreibt die Parameter der Architektur als Header
-|*
-*************************************************************************/
-void Description_Print( struct Description* pThis, char* name )
-{
- int i;
- FILE* f = fopen( name, "w" );
- if( ! f ) {
- fprintf( stderr, "Unable to open file %s: %s\n", name, strerror( errno ) );
- exit( 99 );
- }
- fprintf( f, "#define __%s\n",
- pThis->bBigEndian ? "BIGENDIAN" : "LITTLEENDIAN" );
- for ( i = 0; i < 3; i++ )
- fprintf( f, "#define __ALIGNMENT%d\t%d\n",
- 1 << (i+1), pThis->nAlignment[i] );
- fprintf( f, "/* Stack alignment is not used... */\n" );
- fprintf( f, "#define __STACKALIGNMENT\t%d\n", pThis->nStackAlignment );
- fprintf( f, "#define __STACKDIRECTION\t%d\n",
- pThis->bStackGrowsDown ? -1 : 1 );
- fprintf( f, "#define __SIZEOFCHAR\t%d\n", sizeof( char ) );
- fprintf( f, "#define __SIZEOFSHORT\t%d\n", sizeof( short ) );
- fprintf( f, "#define __SIZEOFINT\t%d\n", sizeof( int ) );
- fprintf( f, "#define __SIZEOFLONG\t%d\n", sizeof( long ) );
- fprintf( f, "#define __SIZEOFPOINTER\t%d\n", sizeof( void* ) );
- fprintf( f, "#define __SIZEOFDOUBLE\t%d\n", sizeof( double ) );
- fprintf( f, "#define __IEEEDOUBLE\n" );
- fclose( f );
-}
-
-/*************************************************************************
-|*
-|* InfoMemoryAccess()
-|*
-|* Beschreibung Informeller Bytezugriffstest
-|*
-*************************************************************************/
-void InfoMemoryAccess( char* p )
-{
- if ( CheckGetAccess( t_char, p ) )
- printf( "can read address %p\n", p );
- else
- printf( "can not read address %p\n", p );
-
- if ( CheckSetAccess( t_char, p ) )
- printf( "can write address %p\n", p );
- else
- printf( "can not write address %p\n", p );
-}
-
-/*************************************************************************
-|*
-|* InfoMemoryTypeAccess()
-|*
-|* Beschreibung Informeller Zugriffstest verschiedener Typen
-|*
-*************************************************************************/
-void InfoMemoryTypeAccess( Type eT )
-{
- char a[64];
- int i;
-
- /* clear a[...] to set legal value for double access */
- for ( i = 0; i < 64; i++ )
- a[i] = 0;
-
- for ( i = 56; i >= 7; i >>= 1 )
- {
- printf( "Zugriff %s auf %i-Aligned Adresse : ", TypeName( eT ), i / 7 );
- printf( ( CheckGetAccess( eT, (long*)&a[i] ) ? "OK\n" : "ERROR\n" ) );
- }
-}
-/************************************************************************
- *
- * Use C code to determine the characteristics of the building platform.
- *
- ************************************************************************/
-int main( int argc, char* argv[] )
-{
- printTypeSign( char, "char" );
- printTypeSign( short, "short" );
- printTypeSign( int, "int" );
- printTypeSign( long, "long" );
-
- printTypeSize( char, "char" );
- printTypeSize( short, "short" );
- printTypeSize( int, "int" );
- printTypeSize( long, "long" );
- printTypeSize( float, "float" );
- printTypeSize( double, "double" );
- printTypeSize( void *, "void *" );
-
- if ( IsBigEndian() )
- printf( "BIGENDIAN (Sparc, MC680x0, RS6000, IP22, IP32, g3)\n" );
- else
- printf( "LITTLEENDIAN (Intel, VAX, PowerPC)\n" );
-
- if( IsStackGrowingDown() )
- printf( "Stack waechst nach unten\n" );
- else
- printf( "Stack waechst nach oben\n" );
-
- printf( "STACKALIGNMENT : %d\n", GetStackAlignment() );
-
- /* PrintArgs( 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 ); */
-
- if ( argc > 1 )
- {
- struct Description description;
- Description_Ctor( &description );
- Description_Print( &description, argv[1] );
- }
- {
- char* p = NULL;
- InfoMemoryAccess( p );
- p = (char*)&p;
- InfoMemoryAccess( p );
- InfoMemoryTypeAccess( t_short );
- InfoMemoryTypeAccess( t_int );
- InfoMemoryTypeAccess( t_long );
- InfoMemoryTypeAccess( t_double );
- }
-
- exit( 0 );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/stream/cachestr.cxx b/tools/source/stream/cachestr.cxx
index f68f563d427c..ab8a2e7c7806 100644
--- a/tools/source/stream/cachestr.cxx
+++ b/tools/source/stream/cachestr.cxx
@@ -40,13 +40,13 @@
|*
*************************************************************************/
-SvCacheStream::SvCacheStream( ULONG nMaxMemSize )
+SvCacheStream::SvCacheStream( sal_uIntPtr nMaxMemSize )
{
if( !nMaxMemSize )
nMaxMemSize = 20480;
- SvStream::bIsWritable = TRUE;
+ SvStream::bIsWritable = sal_True;
nMaxSize = nMaxMemSize;
- bPersistent = FALSE;
+ bPersistent = sal_False;
pSwapStream = 0;
pCurrentStream = new SvMemoryStream( nMaxMemSize );
pTempFile = 0;
@@ -59,8 +59,8 @@ SvCacheStream::SvCacheStream( ULONG nMaxMemSize )
*************************************************************************/
SvCacheStream::SvCacheStream( const String &rFileName,
- ULONG nExpectedSize,
- ULONG nMaxMemSize )
+ sal_uIntPtr nExpectedSize,
+ sal_uIntPtr nMaxMemSize )
{
if( !nMaxMemSize )
nMaxMemSize = 20480;
@@ -70,9 +70,9 @@ SvCacheStream::SvCacheStream( const String &rFileName,
else if( !nExpectedSize )
nExpectedSize = 4096;
- SvStream::bIsWritable = TRUE;
+ SvStream::bIsWritable = sal_True;
nMaxSize = nMaxMemSize;
- bPersistent = TRUE;
+ bPersistent = sal_True;
aFileName = rFileName;
pSwapStream = 0;
pCurrentStream = new SvMemoryStream( nExpectedSize );
@@ -94,7 +94,7 @@ SvCacheStream::~SvCacheStream()
if( pSwapStream && !bPersistent && pTempFile )
{
// temporaeres File loeschen
- pTempFile->EnableKillingFile( TRUE );
+ pTempFile->EnableKillingFile( sal_True );
}
delete pTempFile;
@@ -130,7 +130,7 @@ void SvCacheStream::SwapOut()
}
}
- ULONG nPos = pCurrentStream->Tell();
+ sal_uIntPtr nPos = pCurrentStream->Tell();
pCurrentStream->Seek( 0 );
if( !pSwapStream )
pSwapStream = new SvFileStream( aFileName, STREAM_READWRITE | STREAM_TRUNC );
@@ -148,7 +148,7 @@ void SvCacheStream::SwapOut()
|*
*************************************************************************/
-ULONG SvCacheStream::GetData( void* pData, ULONG nSize )
+sal_uIntPtr SvCacheStream::GetData( void* pData, sal_uIntPtr nSize )
{
return pCurrentStream->Read( pData, nSize );
}
@@ -159,7 +159,7 @@ ULONG SvCacheStream::GetData( void* pData, ULONG nSize )
|*
*************************************************************************/
-ULONG SvCacheStream::PutData( const void* pData, ULONG nSize )
+sal_uIntPtr SvCacheStream::PutData( const void* pData, sal_uIntPtr nSize )
{
// lieber unnoetig auslagern als unnoetig umkopieren
if( pCurrentStream != pSwapStream
@@ -174,7 +174,7 @@ ULONG SvCacheStream::PutData( const void* pData, ULONG nSize )
|*
*************************************************************************/
-ULONG SvCacheStream::SeekPos( ULONG nPos )
+sal_uIntPtr SvCacheStream::SeekPos( sal_uIntPtr nPos )
{
return pCurrentStream->Seek( nPos );
}
@@ -214,7 +214,7 @@ const void* SvCacheStream::GetBuffer()
|*
*************************************************************************/
-void SvCacheStream::SetSize( ULONG nSize )
+void SvCacheStream::SetSize( sal_uIntPtr nSize )
{
pCurrentStream->SetStreamSize( nSize );
}
@@ -225,13 +225,13 @@ void SvCacheStream::SetSize( ULONG nSize )
|*
*************************************************************************/
-ULONG SvCacheStream::GetSize()
+sal_uIntPtr SvCacheStream::GetSize()
{
// ACHTUNG: SvMemoryStream::GetSize() gibt Groesse
// des allozierten Buffers zurueck
Flush();
- ULONG nTemp = Tell();
- ULONG nLength = Seek( STREAM_SEEK_TO_END );
+ sal_uIntPtr nTemp = Tell();
+ sal_uIntPtr nLength = Seek( STREAM_SEEK_TO_END );
Seek( nTemp );
return nLength;
}
diff --git a/tools/source/stream/makefile.mk b/tools/source/stream/makefile.mk
deleted file mode 100644
index ee548934c6c6..000000000000
--- a/tools/source/stream/makefile.mk
+++ /dev/null
@@ -1,58 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=stream
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= $(SLO)$/stream.obj \
- $(SLO)$/strmsys.obj \
- $(SLO)$/cachestr.obj \
- $(SLO)$/vcompat.obj
-
-OBJFILES+= $(OBJ)$/stream.obj \
- $(OBJ)$/strmsys.obj \
- $(OBJ)$/cachestr.obj \
- $(OBJ)$/vcompat.obj
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
-$(SLO)$/strmsys.obj : \
- strmwnt.cxx \
- strmos2.cxx \
- strmunx.cxx
-
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 879ce44d6d83..bdaf4422f4bf 100644..100755
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -118,7 +118,7 @@ inline static void SwapDouble( double& r )
{
if( sizeof(double) != 8 )
{
- DBG_ASSERT( FALSE, "Can only swap 8-Byte-doubles\n" );
+ DBG_ASSERT( sal_False, "Can only swap 8-Byte-doubles\n" );
}
else
{
@@ -168,7 +168,7 @@ if( (tmp==STREAM_IO_WRITE) && sizeof(datatype) <= nBufFree)\
if( nBufActualPos > nBufActualLen )\
nBufActualLen = nBufActualPos;\
pBufPos += sizeof(datatype);\
- bIsDirty = TRUE;\
+ bIsDirty = sal_True;\
}\
else\
Write( (char*)&value, sizeof(datatype) );\
@@ -444,7 +444,7 @@ void SvStream::ImpInit()
eStreamCharSet = osl_getThreadTextEncoding();
// eTargetCharSet = osl_getThreadTextEncoding();
nCryptMask = 0;
- bIsEof = FALSE;
+ bIsEof = sal_False;
#if defined UNX
eLineDelimiter = LINEEND_LF; // UNIX-Format
#else
@@ -455,9 +455,9 @@ void SvStream::ImpInit()
nBufFilePos = 0;
nBufActualPos = 0;
- bIsDirty = FALSE;
- bIsConsistent = TRUE;
- bIsWritable = TRUE;
+ bIsDirty = sal_False;
+ bIsConsistent = sal_True;
+ bIsWritable = sal_True;
pRWBuf = 0;
pBufPos = 0;
@@ -544,7 +544,7 @@ sal_uInt16 SvStream::IsA() const
void SvStream::ClearError()
{
- bIsEof = FALSE;
+ bIsEof = sal_False;
nError = SVSTREAM_OK;
}
@@ -570,13 +570,13 @@ void SvStream::SetError( sal_uInt32 nErrorCode )
void SvStream::SetNumberFormatInt( sal_uInt16 nNewFormat )
{
nNumberFormatInt = nNewFormat;
- bSwap = FALSE;
+ bSwap = sal_False;
#ifdef OSL_BIGENDIAN
if( nNumberFormatInt == NUMBERFORMAT_INT_LITTLEENDIAN )
- bSwap = TRUE;
+ bSwap = sal_True;
#else
if( nNumberFormatInt == NUMBERFORMAT_INT_BIGENDIAN )
- bSwap = TRUE;
+ bSwap = sal_True;
#endif
}
@@ -605,8 +605,8 @@ void SvStream::SetBufferSize( sal_uInt16 nBufferSize )
nBufActualPos = 0;
nBufSize = nBufferSize;
if( nBufSize )
- pRWBuf = new BYTE[ nBufSize ];
- bIsConsistent = TRUE;
+ pRWBuf = new sal_uInt8[ nBufSize ];
+ bIsConsistent = sal_True;
pBufPos = pRWBuf;
eIOMode = STREAM_IO_DONTKNOW;
if( !bDontSeek )
@@ -625,11 +625,11 @@ void SvStream::ClearBuffer()
nBufActualPos = 0;
nBufFilePos = 0;
pBufPos = pRWBuf;
- bIsDirty = FALSE;
- bIsConsistent = TRUE;
+ bIsDirty = sal_False;
+ bIsConsistent = sal_True;
eIOMode = STREAM_IO_DONTKNOW;
- bIsEof = FALSE;
+ bIsEof = sal_False;
}
/*************************************************************************
@@ -662,7 +662,7 @@ sal_Bool SvStream::ReadByteStringLine( String& rStr, rtl_TextEncoding eSrcCharSe
sal_Bool SvStream::ReadLine( ByteString& rStr )
{
sal_Char buf[256+1];
- sal_Bool bEnd = FALSE;
+ sal_Bool bEnd = sal_False;
sal_Size nOldFilePos = Tell();
sal_Char c = 0;
sal_Size nTotalLen = 0;
@@ -678,8 +678,8 @@ sal_Bool SvStream::ReadLine( ByteString& rStr )
if ( rStr.Len() == 0 )
{
// der allererste Blockread hat fehlgeschlagen -> Abflug
- bIsEof = TRUE;
- return FALSE;
+ bIsEof = sal_True;
+ return sal_False;
}
else
break;
@@ -691,7 +691,7 @@ sal_Bool SvStream::ReadLine( ByteString& rStr )
c = buf[j];
if ( c == '\n' || c == '\r' )
{
- bEnd = TRUE;
+ bEnd = sal_True;
break;
}
// erAck 26.02.01: Old behavior was no special treatment of '\0'
@@ -711,7 +711,7 @@ sal_Bool SvStream::ReadLine( ByteString& rStr )
}
if ( !bEnd && !GetError() && rStr.Len() )
- bEnd = TRUE;
+ bEnd = sal_True;
nOldFilePos += nTotalLen;
if( Tell() > nOldFilePos )
@@ -729,14 +729,14 @@ sal_Bool SvStream::ReadLine( ByteString& rStr )
}
if ( bEnd )
- bIsEof = FALSE;
+ bIsEof = sal_False;
return bEnd;
}
sal_Bool SvStream::ReadUniStringLine( String& rStr )
{
sal_Unicode buf[256+1];
- sal_Bool bEnd = FALSE;
+ sal_Bool bEnd = sal_False;
sal_Size nOldFilePos = Tell();
sal_Unicode c = 0;
sal_Size nTotalLen = 0;
@@ -755,8 +755,8 @@ sal_Bool SvStream::ReadUniStringLine( String& rStr )
if ( rStr.Len() == 0 )
{
// der allererste Blockread hat fehlgeschlagen -> Abflug
- bIsEof = TRUE;
- return FALSE;
+ bIsEof = sal_True;
+ return sal_False;
}
else
break;
@@ -770,7 +770,7 @@ sal_Bool SvStream::ReadUniStringLine( String& rStr )
c = buf[j];
if ( c == '\n' || c == '\r' )
{
- bEnd = TRUE;
+ bEnd = sal_True;
break;
}
// erAck 26.02.01: Old behavior was no special treatment of '\0'
@@ -790,7 +790,7 @@ sal_Bool SvStream::ReadUniStringLine( String& rStr )
}
if ( !bEnd && !GetError() && rStr.Len() )
- bEnd = TRUE;
+ bEnd = sal_True;
nOldFilePos += nTotalLen * sizeof(sal_Unicode);
if( Tell() > nOldFilePos )
@@ -808,7 +808,7 @@ sal_Bool SvStream::ReadUniStringLine( String& rStr )
}
if ( bEnd )
- bIsEof = FALSE;
+ bIsEof = sal_False;
return bEnd;
}
@@ -832,7 +832,7 @@ sal_Bool SvStream::ReadCString( ByteString& rStr )
rStr.Erase();
sal_Char buf[ 256 + 1 ];
- sal_Bool bEnd = FALSE;
+ sal_Bool bEnd = sal_False;
sal_Size nFilePos = Tell();
while( !bEnd && !GetError() )
@@ -1008,7 +1008,7 @@ sal_Bool SvStream::WriteUniOrByteChar( sal_Unicode ch, rtl_TextEncoding eDestCha
sal_Bool SvStream::StartWritingUnicodeText()
{
- SetEndianSwap( FALSE ); // write native format
+ SetEndianSwap( sal_False ); // write native format
// BOM, Byte Order Mark, U+FEFF, see
// http://www.unicode.org/faq/utf_bom.html#BOM
// Upon read: 0xfeff(-257) => no swap; 0xfffe(-2) => swap
@@ -1022,21 +1022,59 @@ sal_Bool SvStream::StartWritingUnicodeText()
|*
*************************************************************************/
-sal_Bool SvStream::StartReadingUnicodeText()
+sal_Bool SvStream::StartReadingUnicodeText( rtl_TextEncoding eReadBomCharSet )
{
+ if (!( eReadBomCharSet == RTL_TEXTENCODING_DONTKNOW ||
+ eReadBomCharSet == RTL_TEXTENCODING_UNICODE ||
+ eReadBomCharSet == RTL_TEXTENCODING_UTF8))
+ return sal_True; // nothing to read
+
+ bool bTryUtf8 = false;
sal_uInt16 nFlag;
+ sal_sSize nBack = sizeof(nFlag);
*this >> nFlag;
switch ( nFlag )
{
case 0xfeff :
- // native
+ // native UTF-16
+ if ( eReadBomCharSet == RTL_TEXTENCODING_DONTKNOW ||
+ eReadBomCharSet == RTL_TEXTENCODING_UNICODE)
+ nBack = 0;
break;
case 0xfffe :
- SetEndianSwap( !bSwap );
+ // swapped UTF-16
+ if ( eReadBomCharSet == RTL_TEXTENCODING_DONTKNOW ||
+ eReadBomCharSet == RTL_TEXTENCODING_UNICODE)
+ {
+ SetEndianSwap( !bSwap );
+ nBack = 0;
+ }
+ break;
+ case 0xefbb :
+ if (nNumberFormatInt == NUMBERFORMAT_INT_BIGENDIAN &&
+ (eReadBomCharSet == RTL_TEXTENCODING_DONTKNOW ||
+ eReadBomCharSet == RTL_TEXTENCODING_UTF8))
+ bTryUtf8 = true;
+ break;
+ case 0xbbef :
+ if (nNumberFormatInt == NUMBERFORMAT_INT_LITTLEENDIAN &&
+ (eReadBomCharSet == RTL_TEXTENCODING_DONTKNOW ||
+ eReadBomCharSet == RTL_TEXTENCODING_UTF8))
+ bTryUtf8 = true;
break;
default:
- SeekRel( -((sal_sSize)sizeof(nFlag)) ); // no BOM, pure data
+ ; // nothing
+ }
+ if (bTryUtf8)
+ {
+ sal_uChar nChar;
+ nBack += sizeof(nChar);
+ *this >> nChar;
+ if (nChar == 0xbf)
+ nBack = 0; // it is UTF-8
}
+ if (nBack)
+ SeekRel( -nBack ); // no BOM, pure data
return nError == SVSTREAM_OK;
}
@@ -1370,7 +1408,7 @@ SvStream& SvStream::operator<< ( signed char v )
if( nBufActualPos > nBufActualLen ) // Append ?
nBufActualLen = nBufActualPos;
nBufFree--; // = sizeof(char);
- bIsDirty = TRUE;
+ bIsDirty = sal_True;
}
else
Write( (char*)&v, sizeof(signed char) );
@@ -1391,7 +1429,7 @@ SvStream& SvStream::operator<< ( char v )
if( nBufActualPos > nBufActualLen ) // Append ?
nBufActualLen = nBufActualPos;
nBufFree--; // = sizeof(char);
- bIsDirty = TRUE;
+ bIsDirty = sal_True;
}
else
Write( (char*)&v, sizeof(char) );
@@ -1410,7 +1448,7 @@ SvStream& SvStream::operator<< ( unsigned char v )
if( nBufActualPos > nBufActualLen ) // Append ?
nBufActualLen = nBufActualPos;
nBufFree--;
- bIsDirty = TRUE;
+ bIsDirty = sal_True;
}
else
Write( (char*)&v, sizeof(char) );
@@ -1607,7 +1645,7 @@ sal_Size SvStream::Read( void* pData, sal_Size nCount )
CryptAndWriteBuffer(pRWBuf, nBufActualLen);
else
PutData( pRWBuf, nBufActualLen );
- bIsDirty = FALSE;
+ bIsDirty = sal_False;
}
// passt der Datenblock in den Puffer ?
@@ -1652,10 +1690,10 @@ sal_Size SvStream::Read( void* pData, sal_Size nCount )
}
}
}
- bIsEof = FALSE;
+ bIsEof = sal_False;
nBufFree = nBufActualLen - nBufActualPos;
if( nCount != nSaveCount && nError != ERRCODE_IO_PENDING )
- bIsEof = TRUE;
+ bIsEof = sal_True;
if( nCount == nSaveCount && nError == ERRCODE_IO_PENDING )
nError = ERRCODE_NONE;
return nCount;
@@ -1699,7 +1737,7 @@ sal_Size SvStream::Write( const void* pData, sal_Size nCount )
nBufActualLen = nBufActualPos;
pBufPos += nCount;
- bIsDirty = TRUE;
+ bIsDirty = sal_True;
}
else
{
@@ -1711,7 +1749,7 @@ sal_Size SvStream::Write( const void* pData, sal_Size nCount )
CryptAndWriteBuffer( pRWBuf, (sal_Size)nBufActualLen );
else
PutData( pRWBuf, nBufActualLen );
- bIsDirty = FALSE;
+ bIsDirty = sal_False;
}
// passt der Block in den Puffer ?
@@ -1739,7 +1777,7 @@ sal_Size SvStream::Write( const void* pData, sal_Size nCount )
nBufActualPos = (sal_uInt16)nCount;
pBufPos = pRWBuf + nCount;
nBufActualLen = (sal_uInt16)nCount;
- bIsDirty = TRUE;
+ bIsDirty = sal_True;
}
}
nBufFree = nBufSize - nBufActualPos;
@@ -1757,7 +1795,7 @@ sal_Size SvStream::Seek( sal_Size nFilePos )
{
eIOMode = STREAM_IO_DONTKNOW;
- bIsEof = FALSE;
+ bIsEof = sal_False;
if( !pRWBuf )
{
nBufFilePos = SeekPos( nFilePos );
@@ -1783,7 +1821,7 @@ sal_Size SvStream::Seek( sal_Size nFilePos )
CryptAndWriteBuffer( pRWBuf, nBufActualLen );
else
PutData( pRWBuf, nBufActualLen );
- bIsDirty = FALSE;
+ bIsDirty = sal_False;
}
nBufActualLen = 0;
nBufActualPos = 0;
@@ -1815,7 +1853,7 @@ void SvStream::Flush()
else
if( PutData( pRWBuf, nBufActualLen ) != nBufActualLen )
SetError( SVSTREAM_WRITE_ERROR );
- bIsDirty = FALSE;
+ bIsDirty = sal_False;
}
if( bIsWritable )
FlushData();
@@ -1855,9 +1893,9 @@ SvStream& SvStream::PutBack( char aCh )
CryptAndWriteBuffer( pRWBuf, nBufActualLen );
else
PutData( pRWBuf, nBufActualLen );
- bIsDirty = FALSE;
+ bIsDirty = sal_False;
}
- bIsConsistent = FALSE; // Puffer enthaelt jetzt TRASH
+ bIsConsistent = sal_False; // Puffer enthaelt jetzt TRASH
if( nBufActualPos )
{
// 1. Fall
@@ -1886,7 +1924,7 @@ SvStream& SvStream::PutBack( char aCh )
*pRWBuf = aCh;
}
eIOMode = STREAM_IO_DONTKNOW;
- bIsEof = FALSE;
+ bIsEof = sal_False;
return *this;
}
@@ -1921,7 +1959,7 @@ void SvStream::RefreshBuffer()
CryptAndWriteBuffer( pRWBuf, (sal_Size)nBufActualLen );
else
PutData( pRWBuf, nBufActualLen );
- bIsDirty = FALSE;
+ bIsDirty = sal_False;
}
SeekPos( nBufFilePos );
nBufActualLen = (sal_uInt16)GetData( pRWBuf, nBufSize );
@@ -1929,7 +1967,7 @@ void SvStream::RefreshBuffer()
nError = ERRCODE_NONE;
if( nCryptMask )
EncryptBuffer(pRWBuf, (sal_Size)nBufActualLen);
- bIsConsistent = TRUE;
+ bIsConsistent = sal_True;
eIOMode = STREAM_IO_DONTKNOW;
}
@@ -1999,7 +2037,7 @@ SvStream& SvStream::ReadNumber( long& rLong )
rLong = strtol( buf, &pEndPtr, (int)nRadix );
nFPtr += ( (sal_Size)pEndPtr - (sal_Size)(&(buf[0])) );
Seek( nFPtr );
- bIsEof = FALSE;
+ bIsEof = sal_False;
return *this;
}
@@ -2024,7 +2062,7 @@ SvStream& SvStream::ReadNumber( sal_uInt32& rUInt32 )
rUInt32 = strtoul( buf, &pEndPtr, (int)nRadix );
nFPtr += ( (sal_uIntPtr)pEndPtr - (sal_uIntPtr)buf );
Seek( nFPtr );
- bIsEof = FALSE;
+ bIsEof = sal_False;
return *this;
}
@@ -2049,7 +2087,7 @@ SvStream& SvStream::ReadNumber( double& rDouble )
rDouble = strtod( buf, &pEndPtr );
nFPtr += ( (sal_Size)pEndPtr - (sal_Size)buf );
Seek( nFPtr );
- bIsEof = FALSE;
+ bIsEof = sal_False;
return *this;
}
@@ -2204,7 +2242,7 @@ sal_Bool SvStream::EncryptBuffer(void* pStart, sal_Size nLen)
aCh ^= nMask;
*pTemp = aCh;
}
- return TRUE;
+ return sal_True;
}
/*************************************************************************
@@ -2361,12 +2399,12 @@ SvMemoryStream::SvMemoryStream( void* pBuffer, sal_Size bufSize,
StreamMode eMode )
{
if( eMode & STREAM_WRITE )
- bIsWritable = TRUE;
+ bIsWritable = sal_True;
else
- bIsWritable = FALSE;
+ bIsWritable = sal_False;
nEndOfData = bufSize;
- bOwnsData = FALSE;
- pBuf = (BYTE *) pBuffer;
+ bOwnsData = sal_False;
+ pBuf = (sal_uInt8 *) pBuffer;
nResize = 0L;
nSize = bufSize;
nPos = 0L;
@@ -2381,8 +2419,8 @@ SvMemoryStream::SvMemoryStream( void* pBuffer, sal_Size bufSize,
SvMemoryStream::SvMemoryStream( sal_Size nInitSize, sal_Size nResizeOffset )
{
- bIsWritable = TRUE;
- bOwnsData = TRUE;
+ bIsWritable = sal_True;
+ bOwnsData = sal_True;
nEndOfData = 0L;
nResize = nResizeOffset;
nPos = 0;
@@ -2448,7 +2486,7 @@ void* SvMemoryStream::SetBuffer( void* pNewBuf, sal_Size nCount,
else
pResult = pBuf;
- pBuf = (BYTE *) pNewBuf;
+ pBuf = (sal_uInt8 *) pNewBuf;
nPos = 0;
nSize = nCount;
nResize = 0;
@@ -2612,7 +2650,7 @@ void SvMemoryStream::ResetError()
sal_Bool SvMemoryStream::AllocateMemory( sal_Size nNewSize )
{
- pBuf = new BYTE[nNewSize];
+ pBuf = new sal_uInt8[nNewSize];
return( pBuf != 0 );
}
@@ -2624,18 +2662,18 @@ sal_Bool SvMemoryStream::AllocateMemory( sal_Size nNewSize )
sal_Bool SvMemoryStream::ReAllocateMemory( long nDiff )
{
- sal_Bool bRetVal = FALSE;
+ sal_Bool bRetVal = sal_False;
long nTemp = (long)nSize;
nTemp += nDiff;
sal_Size nNewSize = (sal_Size)nTemp;
if( nNewSize )
{
- BYTE* pNewBuf = new BYTE[nNewSize];
+ sal_uInt8* pNewBuf = new sal_uInt8[nNewSize];
if( pNewBuf )
{
- bRetVal = TRUE; // Success!
+ bRetVal = sal_True; // Success!
if( nNewSize < nSize ) // Verkleinern ?
{
memcpy( pNewBuf, pBuf, (size_t)nNewSize );
@@ -2657,7 +2695,7 @@ sal_Bool SvMemoryStream::ReAllocateMemory( long nDiff )
}
else
{
- bRetVal = TRUE;
+ bRetVal = sal_True;
FreeMemory();
pBuf = 0;
nSize = 0;
diff --git a/tools/source/stream/strmos2.cxx b/tools/source/stream/strmos2.cxx
index 226c75f1d6f9..3957910cbfdb 100644
--- a/tools/source/stream/strmos2.cxx
+++ b/tools/source/stream/strmos2.cxx
@@ -58,20 +58,20 @@ class StreamData
{
public:
HFILE hFile;
- BOOL bIsEof;
+ sal_Bool bIsEof;
StreamData()
{
hFile = 0;
- bIsEof = TRUE;
+ bIsEof = sal_True;
}
};
// -----------------------------------------------------------------------
-ULONG GetSvError( APIRET nPMError )
+sal_uIntPtr GetSvError( APIRET nPMError )
{
- static struct { APIRET pm; ULONG sv; } errArr[] =
+ static struct { APIRET pm; sal_uIntPtr sv; } errArr[] =
{
{ ERROR_FILE_NOT_FOUND, SVSTREAM_FILE_NOT_FOUND },
{ ERROR_PATH_NOT_FOUND, SVSTREAM_PATH_NOT_FOUND },
@@ -92,7 +92,7 @@ ULONG GetSvError( APIRET nPMError )
{ 0xFFFF, SVSTREAM_GENERALERROR }
};
- ULONG nRetVal = SVSTREAM_GENERALERROR; // Standardfehler
+ sal_uIntPtr nRetVal = SVSTREAM_GENERALERROR; // Standardfehler
int i=0;
do
{
@@ -115,9 +115,9 @@ ULONG GetSvError( APIRET nPMError )
SvFileStream::SvFileStream( const String& rFileName, StreamMode nOpenMode )
{
- bIsOpen = FALSE;
+ bIsOpen = sal_False;
nLockCounter = 0;
- bIsWritable = FALSE;
+ bIsWritable = sal_False;
pInstanceData = new StreamData;
SetBufferSize( 8192 );
@@ -137,9 +137,9 @@ SvFileStream::SvFileStream( const String& rFileName, StreamMode nOpenMode )
SvFileStream::SvFileStream()
{
- bIsOpen = FALSE;
+ bIsOpen = sal_False;
nLockCounter = 0;
- bIsWritable = FALSE;
+ bIsWritable = sal_False;
pInstanceData = new StreamData;
SetBufferSize( 8192 );
}
@@ -163,9 +163,9 @@ SvFileStream::~SvFileStream()
|*
*************************************************************************/
-ULONG SvFileStream::GetFileHandle() const
+sal_uIntPtr SvFileStream::GetFileHandle() const
{
- return (ULONG)pInstanceData->hFile;
+ return (sal_uIntPtr)pInstanceData->hFile;
}
/*************************************************************************
@@ -174,7 +174,7 @@ ULONG SvFileStream::GetFileHandle() const
|*
*************************************************************************/
-USHORT SvFileStream::IsA() const
+sal_uInt16 SvFileStream::IsA() const
{
return ID_FILESTREAM;
}
@@ -187,7 +187,7 @@ USHORT SvFileStream::IsA() const
|*
*************************************************************************/
-ULONG SvFileStream::GetData( void* pData, ULONG nSize )
+sal_uIntPtr SvFileStream::GetData( void* pData, sal_uIntPtr nSize )
{
#ifdef DBG_UTIL
ByteString aTraceStr( "SvFileStream::GetData(): " );
@@ -197,7 +197,7 @@ ULONG SvFileStream::GetData( void* pData, ULONG nSize )
OSL_TRACE( "%s", aTraceStr.GetBuffer() );
#endif
- ULONG nCount = 0L;
+ sal_uIntPtr nCount = 0L;
if( IsOpen() )
{
APIRET nResult;
@@ -214,7 +214,7 @@ ULONG SvFileStream::GetData( void* pData, ULONG nSize )
|*
*************************************************************************/
-ULONG SvFileStream::PutData( const void* pData, ULONG nSize )
+sal_uIntPtr SvFileStream::PutData( const void* pData, sal_uIntPtr nSize )
{
#ifdef DBG_UTIL
ByteString aTraceStr( "SvFileStrean::PutData: " );
@@ -224,7 +224,7 @@ ULONG SvFileStream::PutData( const void* pData, ULONG nSize )
OSL_TRACE( "%s", aTraceStr.GetBuffer() );
#endif
- ULONG nCount = 0L;
+ sal_uIntPtr nCount = 0L;
if( IsOpen() )
{
APIRET nResult;
@@ -243,9 +243,9 @@ ULONG SvFileStream::PutData( const void* pData, ULONG nSize )
|*
*************************************************************************/
-ULONG SvFileStream::SeekPos( ULONG nPos )
+sal_uIntPtr SvFileStream::SeekPos( sal_uIntPtr nPos )
{
- ULONG nNewPos = 0L;
+ sal_uIntPtr nNewPos = 0L;
if( IsOpen() )
{
APIRET nResult;
@@ -271,9 +271,9 @@ ULONG SvFileStream::SeekPos( ULONG nPos )
|*
*************************************************************************/
/*
-ULONG SvFileStream::Tell()
+sal_uIntPtr SvFileStream::Tell()
{
- ULONG nPos = 0L;
+ sal_uIntPtr nPos = 0L;
if( IsOpen() )
{
@@ -309,9 +309,9 @@ void SvFileStream::FlushData()
|*
*************************************************************************/
-sal_Bool SvFileStream::LockRange( ULONG nByteOffset, ULONG nBytes )
+sal_Bool SvFileStream::LockRange( sal_uIntPtr nByteOffset, sal_uIntPtr nBytes )
{
- sal_Bool bRetVal = FALSE;
+ sal_Bool bRetVal = sal_False;
if( IsOpen() )
{
APIRET nResult;
@@ -330,7 +330,7 @@ sal_Bool SvFileStream::LockRange( ULONG nByteOffset, ULONG nBytes )
if( nResult )
SetError(::GetSvError(nResult) );
else
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
return bRetVal;
}
@@ -341,9 +341,9 @@ sal_Bool SvFileStream::LockRange( ULONG nByteOffset, ULONG nBytes )
|*
*************************************************************************/
-sal_Bool SvFileStream::UnlockRange( ULONG nByteOffset, ULONG nBytes )
+sal_Bool SvFileStream::UnlockRange( sal_uIntPtr nByteOffset, sal_uIntPtr nBytes )
{
- sal_Bool bRetVal = FALSE;
+ sal_Bool bRetVal = sal_False;
if( IsOpen() )
{
APIRET nResult;
@@ -362,7 +362,7 @@ sal_Bool SvFileStream::UnlockRange( ULONG nByteOffset, ULONG nBytes )
if( nResult )
SetError(::GetSvError(nResult) );
else
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
return bRetVal;
}
@@ -375,19 +375,19 @@ sal_Bool SvFileStream::UnlockRange( ULONG nByteOffset, ULONG nBytes )
sal_Bool SvFileStream::LockFile()
{
- sal_Bool bRetVal = FALSE;
+ sal_Bool bRetVal = sal_False;
if( !nLockCounter )
{
if( LockRange( 0L, LONG_MAX ) )
{
nLockCounter = 1;
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
}
else
{
nLockCounter++;
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
return bRetVal;
}
@@ -400,7 +400,7 @@ sal_Bool SvFileStream::LockFile()
sal_Bool SvFileStream::UnlockFile()
{
- sal_Bool bRetVal = FALSE;
+ sal_Bool bRetVal = sal_False;
if( nLockCounter > 0)
{
if( nLockCounter == 1)
@@ -408,13 +408,13 @@ sal_Bool SvFileStream::UnlockFile()
if( UnlockRange( 0L, LONG_MAX ) )
{
nLockCounter = 0;
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
}
else
{
nLockCounter--;
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
}
return bRetVal;
@@ -437,10 +437,10 @@ void SvFileStream::Open( const String& rFilename, StreamMode nOpenMode )
Close();
SvStream::ClearBuffer();
- ULONG nActionTaken;
- ULONG nOpenAction = 0L;
- ULONG nShareBits = 0L;
- ULONG nReadWriteBits = 0L;
+ sal_uIntPtr nActionTaken;
+ sal_uIntPtr nOpenAction = 0L;
+ sal_uIntPtr nShareBits = 0L;
+ sal_uIntPtr nReadWriteBits = 0L;
eStreamMode = nOpenMode;
eStreamMode &= ~STREAM_TRUNC; // beim ReOpen nicht cutten
@@ -508,7 +508,7 @@ void SvFileStream::Open( const String& rFilename, StreamMode nOpenMode )
if( nRet == ERROR_TOO_MANY_OPEN_FILES )
{
long nToAdd = 10;
- ULONG nCurMaxFH;
+ sal_uIntPtr nCurMaxFH;
nRet = DosSetRelMaxFH( &nToAdd, &nCurMaxFH );
nRet = DosOpen( aFileNameA.GetBuffer(), &pInstanceData->hFile,
&nActionTaken, 0L, FILE_NORMAL, nOpenAction,
@@ -526,15 +526,15 @@ void SvFileStream::Open( const String& rFilename, StreamMode nOpenMode )
if( nRet )
{
- bIsOpen = FALSE;
+ bIsOpen = sal_False;
SetError(::GetSvError(nRet) );
}
else
{
- bIsOpen = TRUE;
- pInstanceData->bIsEof = FALSE;
+ bIsOpen = sal_True;
+ pInstanceData->bIsEof = sal_False;
if( nReadWriteBits != OPEN_ACCESS_READONLY )
- bIsWritable = TRUE;
+ bIsWritable = sal_True;
}
}
@@ -575,10 +575,10 @@ void SvFileStream::Close()
DosClose( pInstanceData->hFile );
}
- bIsOpen = FALSE;
+ bIsOpen = sal_False;
nLockCounter= 0;
- bIsWritable = FALSE;
- pInstanceData->bIsEof = TRUE;
+ bIsWritable = sal_False;
+ pInstanceData->bIsEof = sal_True;
SvStream::ClearBuffer();
SvStream::ClearError();
}
@@ -602,7 +602,7 @@ void SvFileStream::ResetError()
|*
*************************************************************************/
-void SvFileStream::SetSize( ULONG nSize )
+void SvFileStream::SetSize( sal_uIntPtr nSize )
{
if( IsOpen() )
{
diff --git a/tools/source/stream/strmwnt.cxx b/tools/source/stream/strmwnt.cxx
index bcfbb0fd03e8..62ed9e2df6c8 100644
--- a/tools/source/stream/strmwnt.cxx
+++ b/tools/source/stream/strmwnt.cxx
@@ -64,9 +64,9 @@ public:
// -----------------------------------------------------------------------
-static ULONG GetSvError( DWORD nWntError )
+static sal_uIntPtr GetSvError( DWORD nWntError )
{
- static struct { DWORD wnt; ULONG sv; } errArr[] =
+ static struct { DWORD wnt; sal_uIntPtr sv; } errArr[] =
{
{ ERROR_SUCCESS, SVSTREAM_OK },
{ ERROR_ACCESS_DENIED, SVSTREAM_ACCESS_DENIED },
@@ -106,7 +106,7 @@ static ULONG GetSvError( DWORD nWntError )
{ (DWORD)0xFFFFFFFF, SVSTREAM_GENERALERROR }
};
- ULONG nRetVal = SVSTREAM_GENERALERROR; // Standardfehler
+ sal_uIntPtr nRetVal = SVSTREAM_GENERALERROR; // Standardfehler
int i=0;
do
{
@@ -128,9 +128,9 @@ static ULONG GetSvError( DWORD nWntError )
SvFileStream::SvFileStream( const String& rFileName, StreamMode nMode )
{
- bIsOpen = FALSE;
+ bIsOpen = sal_False;
nLockCounter = 0;
- bIsWritable = FALSE;
+ bIsWritable = sal_False;
pInstanceData = new StreamData;
SetBufferSize( 8192 );
@@ -150,9 +150,9 @@ SvFileStream::SvFileStream( const String& rFileName, StreamMode nMode )
SvFileStream::SvFileStream()
{
- bIsOpen = FALSE;
+ bIsOpen = sal_False;
nLockCounter = 0;
- bIsWritable = FALSE;
+ bIsWritable = sal_False;
pInstanceData = new StreamData;
SetBufferSize( 8192 );
@@ -177,17 +177,9 @@ SvFileStream::~SvFileStream()
|*
*************************************************************************/
-sal_uInt32 SvFileStream::GetFileHandle() const
+sal_uIntPtr SvFileStream::GetFileHandle() const
{
- // Note that this method is broken on 64-bit as it would return
- // only the lower 32 bits of a file handle. (As such, it might be
- // that on 64-bit Windows, even in a 64-bit process, the upper 32
- // bits of handles are always zero? But surely we should not rely
- // on that.) On the other hand, this method is private in
- // SvFileStream and isn't used anywhere for Windows. So make sure
- // it doesn't get used in the future either, just abort().
- abort( );
- return 0;
+ return (sal_uIntPtr)pInstanceData->hFile;
}
/*************************************************************************
@@ -196,7 +188,7 @@ sal_uInt32 SvFileStream::GetFileHandle() const
|*
*************************************************************************/
-USHORT SvFileStream::IsA() const
+sal_uInt16 SvFileStream::IsA() const
{
return ID_FILESTREAM;
}
@@ -209,7 +201,7 @@ USHORT SvFileStream::IsA() const
|*
*************************************************************************/
-ULONG SvFileStream::GetData( void* pData, ULONG nSize )
+sal_uIntPtr SvFileStream::GetData( void* pData, sal_uIntPtr nSize )
{
DWORD nCount = 0;
if( IsOpen() )
@@ -217,7 +209,7 @@ ULONG SvFileStream::GetData( void* pData, ULONG nSize )
bool bResult = ReadFile(pInstanceData->hFile,(LPVOID)pData,nSize,&nCount,NULL);
if( !bResult )
{
- ULONG nTestError = GetLastError();
+ sal_uIntPtr nTestError = GetLastError();
SetError(::GetSvError( nTestError ) );
}
}
@@ -230,7 +222,7 @@ ULONG SvFileStream::GetData( void* pData, ULONG nSize )
|*
*************************************************************************/
-ULONG SvFileStream::PutData( const void* pData, ULONG nSize )
+sal_uIntPtr SvFileStream::PutData( const void* pData, sal_uIntPtr nSize )
{
DWORD nCount = 0;
if( IsOpen() )
@@ -247,7 +239,7 @@ ULONG SvFileStream::PutData( const void* pData, ULONG nSize )
|*
*************************************************************************/
-ULONG SvFileStream::SeekPos( ULONG nPos )
+sal_uIntPtr SvFileStream::SeekPos( sal_uIntPtr nPos )
{
DWORD nNewPos = 0;
if( IsOpen() )
@@ -266,7 +258,7 @@ ULONG SvFileStream::SeekPos( ULONG nPos )
}
else
SetError( SVSTREAM_GENERALERROR );
- return (ULONG)nNewPos;
+ return (sal_uIntPtr)nNewPos;
}
/*************************************************************************
@@ -290,7 +282,7 @@ void SvFileStream::FlushData()
|*
*************************************************************************/
-BOOL SvFileStream::LockRange( ULONG nByteOffset, ULONG nBytes )
+sal_Bool SvFileStream::LockRange( sal_uIntPtr nByteOffset, sal_uIntPtr nBytes )
{
bool bRetVal = false;
if( IsOpen() )
@@ -308,7 +300,7 @@ BOOL SvFileStream::LockRange( ULONG nByteOffset, ULONG nBytes )
|*
*************************************************************************/
-BOOL SvFileStream::UnlockRange( ULONG nByteOffset, ULONG nBytes )
+sal_Bool SvFileStream::UnlockRange( sal_uIntPtr nByteOffset, sal_uIntPtr nBytes )
{
bool bRetVal = false;
if( IsOpen() )
@@ -326,21 +318,21 @@ BOOL SvFileStream::UnlockRange( ULONG nByteOffset, ULONG nBytes )
|*
*************************************************************************/
-BOOL SvFileStream::LockFile()
+sal_Bool SvFileStream::LockFile()
{
- BOOL bRetVal = FALSE;
+ sal_Bool bRetVal = sal_False;
if( !nLockCounter )
{
if( LockRange( 0L, LONG_MAX ) )
{
nLockCounter = 1;
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
}
else
{
nLockCounter++;
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
return bRetVal;
}
@@ -351,9 +343,9 @@ BOOL SvFileStream::LockFile()
|*
*************************************************************************/
-BOOL SvFileStream::UnlockFile()
+sal_Bool SvFileStream::UnlockFile()
{
- BOOL bRetVal = FALSE;
+ sal_Bool bRetVal = sal_False;
if( nLockCounter > 0)
{
if( nLockCounter == 1)
@@ -361,13 +353,13 @@ BOOL SvFileStream::UnlockFile()
if( UnlockRange( 0L, LONG_MAX ) )
{
nLockCounter = 0;
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
}
else
{
nLockCounter--;
- bRetVal = TRUE;
+ bRetVal = sal_True;
}
}
return bRetVal;
@@ -474,7 +466,7 @@ void SvFileStream::Open( const String& rFilename, StreamMode nMode )
if( (pInstanceData->hFile==INVALID_HANDLE_VALUE) &&
(nAccessMode & GENERIC_WRITE))
{
- ULONG nErr = ::GetSvError( GetLastError() );
+ sal_uIntPtr nErr = ::GetSvError( GetLastError() );
if(nErr==SVSTREAM_ACCESS_DENIED || nErr==SVSTREAM_SHARING_VIOLATION)
{
nMode &= (~STREAM_WRITE);
@@ -499,15 +491,15 @@ void SvFileStream::Open( const String& rFilename, StreamMode nMode )
if( GetLastError() != ERROR_SUCCESS )
{
- bIsOpen = FALSE;
+ bIsOpen = sal_False;
SetError(::GetSvError( GetLastError() ) );
}
else
{
- bIsOpen = TRUE;
- // pInstanceData->bIsEof = FALSE;
+ bIsOpen = sal_True;
+ // pInstanceData->bIsEof = sal_False;
if( nAccessMode & GENERIC_WRITE )
- bIsWritable = TRUE;
+ bIsWritable = sal_True;
}
SetErrorMode( nOldErrorMode );
}
@@ -542,9 +534,9 @@ void SvFileStream::Close()
Flush();
CloseHandle( pInstanceData->hFile );
}
- bIsOpen = FALSE;
+ bIsOpen = sal_False;
nLockCounter= 0;
- bIsWritable = FALSE;
+ bIsWritable = sal_False;
SvStream::ClearBuffer();
SvStream::ClearError();
}
@@ -568,24 +560,24 @@ void SvFileStream::ResetError()
|*
*************************************************************************/
-void SvFileStream::SetSize( ULONG nSize )
+void SvFileStream::SetSize( sal_uIntPtr nSize )
{
if( IsOpen() )
{
- int bError = FALSE;
+ int bError = sal_False;
HANDLE hFile = pInstanceData->hFile;
- ULONG nOld = SetFilePointer( hFile, 0L, NULL, FILE_CURRENT );
+ sal_uIntPtr nOld = SetFilePointer( hFile, 0L, NULL, FILE_CURRENT );
if( nOld != 0xffffffff )
{
if( SetFilePointer(hFile,nSize,NULL,FILE_BEGIN ) != 0xffffffff)
{
bool bSucc = SetEndOfFile( hFile );
if( !bSucc )
- bError = TRUE;
+ bError = sal_True;
}
if( SetFilePointer( hFile,nOld,NULL,FILE_BEGIN ) == 0xffffffff)
- bError = TRUE;
+ bError = sal_True;
}
if( bError )
SetError(::GetSvError( GetLastError() ) );
diff --git a/tools/source/stream/vcompat.cxx b/tools/source/stream/vcompat.cxx
index 77ab0ef5f840..227c3e05ddca 100644
--- a/tools/source/stream/vcompat.cxx
+++ b/tools/source/stream/vcompat.cxx
@@ -37,7 +37,7 @@
// - VersionCompat -
// -----------------
-VersionCompat::VersionCompat( SvStream& rStm, USHORT nStreamMode, USHORT nVersion ) :
+VersionCompat::VersionCompat( SvStream& rStm, sal_uInt16 nStreamMode, sal_uInt16 nVersion ) :
mpRWStm ( &rStm ),
mnStmMode ( nStreamMode ),
mnVersion ( nVersion )
@@ -65,7 +65,7 @@ VersionCompat::~VersionCompat()
{
if( STREAM_WRITE == mnStmMode )
{
- const UINT32 nEndPos = mpRWStm->Tell();
+ const sal_uInt32 nEndPos = mpRWStm->Tell();
mpRWStm->Seek( mnCompatPos );
*mpRWStm << ( nEndPos - mnTotalSize );
@@ -73,7 +73,7 @@ VersionCompat::~VersionCompat()
}
else
{
- const UINT32 nReadSize = mpRWStm->Tell() - mnCompatPos;
+ const sal_uInt32 nReadSize = mpRWStm->Tell() - mnCompatPos;
if( mnTotalSize > nReadSize )
mpRWStm->SeekRel( mnTotalSize - nReadSize );
diff --git a/tools/source/string/makefile.mk b/tools/source/string/makefile.mk
deleted file mode 100644
index d99ef7be8c4a..000000000000
--- a/tools/source/string/makefile.mk
+++ /dev/null
@@ -1,89 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=str
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-.IF "$(OS)"!="AIX"
-ALWAYSDBGFILES = $(SLO)$/debugprint.obj
-.ENDIF
-
-.IF "$(ALWAYSDBGFILES)" != ""
-ALWAYSDBGTARGET=do_it_alwaysdebug
-.ENDIF
-
-SLOFILES= $(SLO)$/tstring.obj \
- $(SLO)$/tustring.obj \
- $(SLO)$/tenccvt.obj \
- $(SLO)$/reversemap.obj \
- $(SLO)$/debugprint.obj
-
-OBJFILES= $(OBJ)$/tstring.obj \
- $(OBJ)$/tustring.obj \
- $(OBJ)$/tenccvt.obj \
- $(OBJ)$/reversemap.obj \
- $(OBJ)$/debugprint.obj
-
-# --- Targets ------------------------------------------------------
-
-.IF "$(ALWAYSDBG_FLAG)"==""
-TARGETDEPS+=$(ALWAYSDBGTARGET)
-.ENDIF
-
-.INCLUDE : target.mk
-
-$(INCCOM)$/reversemap.hxx: $(BIN)$/bestreversemap
- $(AUGMENT_LIBRARY_PATH) $(BIN)$/bestreversemap > $@
-
-$(SLO)$/reversemap.obj: $(INCCOM)$/reversemap.hxx
-$(OBJ)$/reversemap.obj: $(INCCOM)$/reversemap.hxx
-
-.IF "$(ALWAYSDBGTARGET)" != ""
-.IF "$(ALWAYSDBG_FLAG)" == ""
-# --------------------------------------------------
-# - ALWAYSDBG - files always compiled with debugging
-# --------------------------------------------------
-$(ALWAYSDBGTARGET):
- @echo --- ALWAYSDBGFILES ---
- @dmake $(MFLAGS) $(MAKEFILE) debug=true $(ALWAYSDBGFILES) ALWAYSDBG_FLAG=TRUE $(CALLMACROS)
- @echo --- ALWAYSDBGFILES OVER ---
-
-$(ALWAYSDBGFILES):
- @echo --- ALWAYSDBG ---
- @dmake $(MFLAGS) $(MAKEFILE) debug=true ALWAYSDBG_FLAG=TRUE $(CALLMACROS) $@
- @echo --- ALWAYSDBG OVER ---
-.ENDIF
-.ENDIF
diff --git a/tools/source/string/strascii.cxx b/tools/source/string/strascii.cxx
index 95fc092ad799..f7729c99b305 100644
--- a/tools/source/string/strascii.cxx
+++ b/tools/source/string/strascii.cxx
@@ -32,17 +32,17 @@
#ifdef DBG_UTIL
-static BOOL ImplDbgCheckAsciiStr( const sal_Char* pAsciiStr, sal_Int32 nLen )
+static sal_Bool ImplDbgCheckAsciiStr( const sal_Char* pAsciiStr, sal_Int32 nLen )
{
while ( nLen && *pAsciiStr )
{
if ( ((unsigned char)*pAsciiStr) > 127 )
- return FALSE;
+ return sal_False;
++pAsciiStr,
--nLen;
}
- return TRUE;
+ return sal_True;
}
#endif
@@ -505,7 +505,7 @@ StringCompare UniString::CompareIgnoreCaseToAscii( const sal_Char* pAsciiStr,
// -----------------------------------------------------------------------
-BOOL UniString::EqualsAscii( const sal_Char* pAsciiStr ) const
+sal_Bool UniString::EqualsAscii( const sal_Char* pAsciiStr ) const
{
DBG_CHKTHIS( UniString, DbgCheckUniString );
DBG_ASSERT( ImplDbgCheckAsciiStr( pAsciiStr, STRING_LEN ),
@@ -516,7 +516,7 @@ BOOL UniString::EqualsAscii( const sal_Char* pAsciiStr ) const
// -----------------------------------------------------------------------
-BOOL UniString::EqualsIgnoreCaseAscii( const sal_Char* pAsciiStr ) const
+sal_Bool UniString::EqualsIgnoreCaseAscii( const sal_Char* pAsciiStr ) const
{
DBG_CHKTHIS( UniString, DbgCheckUniString );
DBG_ASSERT( ImplDbgCheckAsciiStr( pAsciiStr, STRING_LEN ),
@@ -527,7 +527,7 @@ BOOL UniString::EqualsIgnoreCaseAscii( const sal_Char* pAsciiStr ) const
// -----------------------------------------------------------------------
-BOOL UniString::EqualsAscii( const sal_Char* pAsciiStr,
+sal_Bool UniString::EqualsAscii( const sal_Char* pAsciiStr,
xub_StrLen nIndex, xub_StrLen nLen ) const
{
DBG_CHKTHIS( UniString, DbgCheckUniString );
@@ -543,7 +543,7 @@ BOOL UniString::EqualsAscii( const sal_Char* pAsciiStr,
// -----------------------------------------------------------------------
-BOOL UniString::EqualsIgnoreCaseAscii( const sal_Char* pAsciiStr,
+sal_Bool UniString::EqualsIgnoreCaseAscii( const sal_Char* pAsciiStr,
xub_StrLen nIndex, xub_StrLen nLen ) const
{
DBG_CHKTHIS( UniString, DbgCheckUniString );
diff --git a/tools/source/string/strcvt.cxx b/tools/source/string/strcvt.cxx
index 81588c48e6cf..54169c3c0716 100644
--- a/tools/source/string/strcvt.cxx
+++ b/tools/source/string/strcvt.cxx
@@ -228,7 +228,7 @@ sal_Unicode* ImplGet1ByteUnicodeTab( rtl_TextEncoding eTextEncoding )
static sal_uChar* ImplGet1ByteConvertTab( rtl_TextEncoding eSrcTextEncoding,
rtl_TextEncoding eDestTextEncoding,
- BOOL bReplace )
+ sal_Bool bReplace )
{
#ifndef BOOTSTRAP
TOOLSINDATA* pToolsData = ImplGetToolsInData();
@@ -354,7 +354,7 @@ void ImplDeleteCharTabData()
// =======================================================================
void ByteString::ImplStringConvert(
- rtl_TextEncoding eSource, rtl_TextEncoding eTarget, BOOL bReplace )
+ rtl_TextEncoding eSource, rtl_TextEncoding eTarget, sal_Bool bReplace )
{
sal_uChar* pConvertTab = ImplGet1ByteConvertTab( eSource, eTarget, bReplace );
if ( pConvertTab )
@@ -410,7 +410,7 @@ void ByteString::ImplStringConvert(
// =======================================================================
-ByteString& ByteString::Convert( rtl_TextEncoding eSource, rtl_TextEncoding eTarget, BOOL bReplace )
+ByteString& ByteString::Convert( rtl_TextEncoding eSource, rtl_TextEncoding eTarget, sal_Bool bReplace )
{
DBG_CHKTHIS( ByteString, DbgCheckByteString );
@@ -443,7 +443,7 @@ ByteString& ByteString::Convert( rtl_TextEncoding eSource, rtl_TextEncoding eTar
char ByteString::Convert( char c,
rtl_TextEncoding eSource, rtl_TextEncoding eTarget,
- BOOL bReplace )
+ sal_Bool bReplace )
{
// TextEncoding Dontknow kann nicht konvertiert werden
if ( (eSource == RTL_TEXTENCODING_DONTKNOW) || (eTarget == RTL_TEXTENCODING_DONTKNOW) )
@@ -481,7 +481,7 @@ sal_Unicode ByteString::ConvertToUnicode( char c, rtl_TextEncoding eTextEncoding
// -----------------------------------------------------------------------
-char ByteString::ConvertFromUnicode( sal_Unicode c, rtl_TextEncoding eTextEncoding, BOOL bReplace )
+char ByteString::ConvertFromUnicode( sal_Unicode c, rtl_TextEncoding eTextEncoding, sal_Bool bReplace )
{
sal_Size nLen;
char aBuf[30];
@@ -531,7 +531,7 @@ sal_Unicode ByteString::ConvertToUnicode( const char* pChar, sal_Size* pLen, rtl
// -----------------------------------------------------------------------
sal_Size ByteString::ConvertFromUnicode( sal_Unicode c, char* pBuf, sal_Size nBufLen, rtl_TextEncoding eTextEncoding,
- BOOL bReplace )
+ sal_Bool bReplace )
{
// TextEncoding Dontknow wird nicht konvertiert
if ( eTextEncoding == RTL_TEXTENCODING_DONTKNOW )
diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx
index dd7ad23326c1..21065f999958 100644
--- a/tools/source/string/strimp.cxx
+++ b/tools/source/string/strimp.cxx
@@ -1142,7 +1142,7 @@ STRING& STRING::ConvertLineEnd( LineEnd eLineEnd )
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
// Zeilenumbrueche ermitteln und neue Laenge berechnen
- BOOL bConvert = FALSE; // Muss konvertiert werden
+ sal_Bool bConvert = sal_False; // Muss konvertiert werden
const STRCODE* pStr = mpData->maStr; // damit es schneller geht
xub_StrLen nLineEndLen = (eLineEnd == LINEEND_CRLF) ? 2 : 1;
xub_StrLen nLen = 0; // Ziel-Laenge
@@ -1165,7 +1165,7 @@ STRING& STRING::ConvertLineEnd( LineEnd eLineEnd )
((pStr[i] == _CR) || (pStr[i+1] == _CR))) ||
((eLineEnd == LINEEND_CR) &&
((pStr[i] == _LF) || (pStr[i+1] == _LF))) )
- bConvert = TRUE;
+ bConvert = sal_True;
}
// \r\n oder \n\r, dann Zeichen ueberspringen
@@ -1328,18 +1328,18 @@ StringCompare STRING::CompareIgnoreCaseToAscii( const STRCODE* pCharStr,
// -----------------------------------------------------------------------
-BOOL STRING::Equals( const STRING& rStr ) const
+sal_Bool STRING::Equals( const STRING& rStr ) const
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
// Sind die Daten gleich
if ( mpData == rStr.mpData )
- return TRUE;
+ return sal_True;
// Gleiche Laenge
if ( mpData->mnLen != rStr.mpData->mnLen )
- return FALSE;
+ return sal_False;
// String vergleichen
return (ImplStringCompareWithoutZero( mpData->maStr, rStr.mpData->maStr, mpData->mnLen ) == 0);
@@ -1347,7 +1347,7 @@ BOOL STRING::Equals( const STRING& rStr ) const
// -----------------------------------------------------------------------
-BOOL STRING::Equals( const STRCODE* pCharStr ) const
+sal_Bool STRING::Equals( const STRCODE* pCharStr ) const
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
@@ -1356,18 +1356,18 @@ BOOL STRING::Equals( const STRCODE* pCharStr ) const
// -----------------------------------------------------------------------
-BOOL STRING::EqualsIgnoreCaseAscii( const STRING& rStr ) const
+sal_Bool STRING::EqualsIgnoreCaseAscii( const STRING& rStr ) const
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
// Sind die Daten gleich
if ( mpData == rStr.mpData )
- return TRUE;
+ return sal_True;
// Gleiche Laenge
if ( mpData->mnLen != rStr.mpData->mnLen )
- return FALSE;
+ return sal_False;
// String vergleichen
return (ImplStringICompareWithoutZero( mpData->maStr, rStr.mpData->maStr, mpData->mnLen ) == 0);
@@ -1375,7 +1375,7 @@ BOOL STRING::EqualsIgnoreCaseAscii( const STRING& rStr ) const
// -----------------------------------------------------------------------
-BOOL STRING::EqualsIgnoreCaseAscii( const STRCODE* pCharStr ) const
+sal_Bool STRING::EqualsIgnoreCaseAscii( const STRCODE* pCharStr ) const
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
@@ -1384,7 +1384,7 @@ BOOL STRING::EqualsIgnoreCaseAscii( const STRCODE* pCharStr ) const
// -----------------------------------------------------------------------
-BOOL STRING::Equals( const STRING& rStr, xub_StrLen nIndex, xub_StrLen nLen ) const
+sal_Bool STRING::Equals( const STRING& rStr, xub_StrLen nIndex, xub_StrLen nLen ) const
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
@@ -1396,7 +1396,7 @@ BOOL STRING::Equals( const STRING& rStr, xub_StrLen nIndex, xub_StrLen nLen ) co
if ( nMaxLen < nLen )
{
if ( rStr.mpData->mnLen != nMaxLen )
- return FALSE;
+ return sal_False;
nLen = static_cast< xub_StrLen >(nMaxLen);
}
@@ -1406,7 +1406,7 @@ BOOL STRING::Equals( const STRING& rStr, xub_StrLen nIndex, xub_StrLen nLen ) co
// -----------------------------------------------------------------------
-BOOL STRING::Equals( const STRCODE* pCharStr, xub_StrLen nIndex, xub_StrLen nLen ) const
+sal_Bool STRING::Equals( const STRCODE* pCharStr, xub_StrLen nIndex, xub_StrLen nLen ) const
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
@@ -1419,7 +1419,7 @@ BOOL STRING::Equals( const STRCODE* pCharStr, xub_StrLen nIndex, xub_StrLen nLen
// -----------------------------------------------------------------------
-BOOL STRING::EqualsIgnoreCaseAscii( const STRING& rStr, xub_StrLen nIndex, xub_StrLen nLen ) const
+sal_Bool STRING::EqualsIgnoreCaseAscii( const STRING& rStr, xub_StrLen nIndex, xub_StrLen nLen ) const
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
@@ -1431,7 +1431,7 @@ BOOL STRING::EqualsIgnoreCaseAscii( const STRING& rStr, xub_StrLen nIndex, xub_S
if ( nMaxLen < nLen )
{
if ( rStr.mpData->mnLen != nMaxLen )
- return FALSE;
+ return sal_False;
nLen = static_cast< xub_StrLen >(nMaxLen);
}
@@ -1441,7 +1441,7 @@ BOOL STRING::EqualsIgnoreCaseAscii( const STRING& rStr, xub_StrLen nIndex, xub_S
// -----------------------------------------------------------------------
-BOOL STRING::EqualsIgnoreCaseAscii( const STRCODE* pCharStr, xub_StrLen nIndex, xub_StrLen nLen ) const
+sal_Bool STRING::EqualsIgnoreCaseAscii( const STRCODE* pCharStr, xub_StrLen nIndex, xub_StrLen nLen ) const
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
diff --git a/tools/source/string/tenccvt.cxx b/tools/source/string/tenccvt.cxx
index c259e63817c7..e4ffa7791180 100644
--- a/tools/source/string/tenccvt.cxx
+++ b/tools/source/string/tenccvt.cxx
@@ -85,14 +85,14 @@ rtl_TextEncoding GetOneByteTextEncoding( rtl_TextEncoding eEncoding )
// -----------------------------------------------------------------------
-rtl_TextEncoding GetSOLoadTextEncoding( rtl_TextEncoding eEncoding, USHORT /* nVersion = SOFFICE_FILEFORMAT_50 */ )
+rtl_TextEncoding GetSOLoadTextEncoding( rtl_TextEncoding eEncoding, sal_uInt16 /* nVersion = SOFFICE_FILEFORMAT_50 */ )
{
return GetExtendedCompatibilityTextEncoding( GetOneByteTextEncoding( eEncoding ) );
}
// -----------------------------------------------------------------------
-rtl_TextEncoding GetSOStoreTextEncoding( rtl_TextEncoding eEncoding, USHORT /* nVersion = SOFFICE_FILEFORMAT_50 */ )
+rtl_TextEncoding GetSOStoreTextEncoding( rtl_TextEncoding eEncoding, sal_uInt16 /* nVersion = SOFFICE_FILEFORMAT_50 */ )
{
return GetExtendedTextEncoding( GetOneByteTextEncoding( eEncoding ) );
}
diff --git a/tools/source/string/tstring.cxx b/tools/source/string/tstring.cxx
index 10b9cef09965..c7a5f380fb72 100644
--- a/tools/source/string/tstring.cxx
+++ b/tools/source/string/tstring.cxx
@@ -181,7 +181,7 @@ double ByteString::ToDouble() const
// -----------------------------------------------------------------------
-BOOL ByteString::IsLowerAscii() const
+sal_Bool ByteString::IsLowerAscii() const
{
DBG_CHKTHIS( ByteString, DbgCheckByteString );
@@ -191,18 +191,18 @@ BOOL ByteString::IsLowerAscii() const
while ( nIndex < nLen )
{
if ( (*pStr >= 65) && (*pStr <= 90) )
- return FALSE;
+ return sal_False;
++pStr,
++nIndex;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL ByteString::IsUpperAscii() const
+sal_Bool ByteString::IsUpperAscii() const
{
DBG_CHKTHIS( ByteString, DbgCheckByteString );
@@ -212,18 +212,18 @@ BOOL ByteString::IsUpperAscii() const
while ( nIndex < nLen )
{
if ( (*pStr >= 97) && (*pStr <= 122) )
- return FALSE;
+ return sal_False;
++pStr,
++nIndex;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL ByteString::IsAlphaAscii() const
+sal_Bool ByteString::IsAlphaAscii() const
{
DBG_CHKTHIS( ByteString, DbgCheckByteString );
@@ -234,18 +234,18 @@ BOOL ByteString::IsAlphaAscii() const
{
if ( !(((*pStr >= 97) && (*pStr <= 122)) ||
((*pStr >= 65) && (*pStr <= 90))) )
- return FALSE;
+ return sal_False;
++pStr,
++nIndex;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL ByteString::IsNumericAscii() const
+sal_Bool ByteString::IsNumericAscii() const
{
DBG_CHKTHIS( ByteString, DbgCheckByteString );
@@ -255,18 +255,18 @@ BOOL ByteString::IsNumericAscii() const
while ( nIndex < nLen )
{
if ( !((*pStr >= 48) && (*pStr <= 57)) )
- return FALSE;
+ return sal_False;
++pStr,
++nIndex;
}
- return TRUE;
+ return sal_True;
}
// -----------------------------------------------------------------------
-BOOL ByteString::IsAlphaNumericAscii() const
+sal_Bool ByteString::IsAlphaNumericAscii() const
{
DBG_CHKTHIS( ByteString, DbgCheckByteString );
@@ -278,13 +278,13 @@ BOOL ByteString::IsAlphaNumericAscii() const
if ( !(((*pStr >= 97) && (*pStr <= 122)) ||
((*pStr >= 65) && (*pStr <= 90)) ||
((*pStr >= 48) && (*pStr <= 57))) )
- return FALSE;
+ return sal_False;
++pStr,
++nIndex;
}
- return TRUE;
+ return sal_True;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/testtoolloader/makefile.mk b/tools/source/testtoolloader/makefile.mk
deleted file mode 100644
index 3d5cb8223e3f..000000000000
--- a/tools/source/testtoolloader/makefile.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=TOOLS
-TARGET=testtoolloader
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/testtoolloader.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/source/testtoolloader/testtoolloader.cxx b/tools/source/testtoolloader/testtoolloader.cxx
index ae685a81df2e..f479faa5aa07 100644
--- a/tools/source/testtoolloader/testtoolloader.cxx
+++ b/tools/source/testtoolloader/testtoolloader.cxx
@@ -135,7 +135,7 @@ void InitTestToolLib()
if ( pInitFunc )
{
(reinterpret_cast< pfunc_CreateEventLogger >(pInitFunc))();
- bLoggerStarted = TRUE;
+ bLoggerStarted = sal_True;
}
else
{
@@ -172,7 +172,7 @@ void DeInitTestToolLib()
if ( pDeInitFunc )
{
(reinterpret_cast< pfunc_DestroyEventLogger >(pDeInitFunc))();
- bLoggerStarted = FALSE;
+ bLoggerStarted = sal_False;
}
}
diff --git a/tools/source/zcodec/makefile.mk b/tools/source/zcodec/makefile.mk
deleted file mode 100644
index 9067b45c3b5d..000000000000
--- a/tools/source/zcodec/makefile.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=tools
-TARGET=zcodec
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-.IF "$(SYSTEM_ZLIB)" == "YES"
-CFLAGS+=-DSYSTEM_ZLIB
-.ENDIF
-SLOFILES= $(SLO)$/zcodec.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/tools/source/zcodec/zcodec.cxx b/tools/source/zcodec/zcodec.cxx
index c86983d41799..2386415a4266 100644
--- a/tools/source/zcodec/zcodec.cxx
+++ b/tools/source/zcodec/zcodec.cxx
@@ -61,7 +61,7 @@ static int gz_magic[2] = { 0x1f, 0x8b }; /* gzip magic header */
// - ZCodec -
// ----------
-ZCodec::ZCodec( ULONG nInBufSize, ULONG nOutBufSize, ULONG nMemUsage )
+ZCodec::ZCodec( sal_uIntPtr nInBufSize, sal_uIntPtr nOutBufSize, sal_uIntPtr nMemUsage )
: mnCRC(0)
{
mnMemUsage = nMemUsage;
@@ -88,11 +88,11 @@ ZCodec::~ZCodec()
// ------------------------------------------------------------------------
-void ZCodec::BeginCompression( ULONG nCompressMethod )
+void ZCodec::BeginCompression( sal_uIntPtr nCompressMethod )
{
mbInit = 0;
- mbStatus = TRUE;
- mbFinish = FALSE;
+ mbStatus = sal_True;
+ mbFinish = sal_False;
mpIStm = mpOStm = NULL;
mnInToRead = 0xffffffff;
mpInBuf = mpOutBuf = NULL;
@@ -147,8 +147,8 @@ long ZCodec::Compress( SvStream& rIStm, SvStream& rOStm )
{
mpIStm = &rIStm;
mpOStm = &rOStm;
- ImplInitBuf( FALSE );
- mpInBuf = new BYTE[ mnInBufSize ];
+ ImplInitBuf( sal_False );
+ mpInBuf = new sal_uInt8[ mnInBufSize ];
}
while (( PZSTREAM->avail_in = mpIStm->Read( PZSTREAM->next_in = mpInBuf, mnInBufSize )) != 0 )
{
@@ -156,7 +156,7 @@ long ZCodec::Compress( SvStream& rIStm, SvStream& rOStm )
ImplWriteBack();
if ( deflate( PZSTREAM, Z_NO_FLUSH ) < 0 )
{
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
};
@@ -168,7 +168,7 @@ long ZCodec::Compress( SvStream& rIStm, SvStream& rOStm )
long ZCodec::Decompress( SvStream& rIStm, SvStream& rOStm )
{
int err;
- ULONG nInToRead;
+ sal_uIntPtr nInToRead;
long nOldTotal_Out = PZSTREAM->total_out;
if ( mbFinish )
@@ -178,8 +178,8 @@ long ZCodec::Decompress( SvStream& rIStm, SvStream& rOStm )
{
mpIStm = &rIStm;
mpOStm = &rOStm;
- ImplInitBuf( TRUE );
- PZSTREAM->next_out = mpOutBuf = new BYTE[ PZSTREAM->avail_out = mnOutBufSize ];
+ ImplInitBuf( sal_True );
+ PZSTREAM->next_out = mpOutBuf = new sal_uInt8[ PZSTREAM->avail_out = mnOutBufSize ];
}
do
{
@@ -197,7 +197,7 @@ long ZCodec::Decompress( SvStream& rIStm, SvStream& rOStm )
err = inflate( PZSTREAM, Z_NO_FLUSH );
if ( err < 0 )
{
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
@@ -206,18 +206,18 @@ long ZCodec::Decompress( SvStream& rIStm, SvStream& rOStm )
ImplWriteBack();
if ( err == Z_STREAM_END )
- mbFinish = TRUE;
+ mbFinish = sal_True;
return ( mbStatus ) ? (long)(PZSTREAM->total_out - nOldTotal_Out) : -1;
}
// ------------------------------------------------------------------------
-long ZCodec::Write( SvStream& rOStm, const BYTE* pData, ULONG nSize )
+long ZCodec::Write( SvStream& rOStm, const sal_uInt8* pData, sal_uIntPtr nSize )
{
if ( mbInit == 0 )
{
mpOStm = &rOStm;
- ImplInitBuf( FALSE );
+ ImplInitBuf( sal_False );
}
PZSTREAM->avail_in = nSize;
@@ -230,7 +230,7 @@ long ZCodec::Write( SvStream& rOStm, const BYTE* pData, ULONG nSize )
if ( deflate( PZSTREAM, Z_NO_FLUSH ) < 0 )
{
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
}
@@ -239,10 +239,10 @@ long ZCodec::Write( SvStream& rOStm, const BYTE* pData, ULONG nSize )
// ------------------------------------------------------------------------
-long ZCodec::Read( SvStream& rIStm, BYTE* pData, ULONG nSize )
+long ZCodec::Read( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize )
{
int err;
- ULONG nInToRead;
+ sal_uIntPtr nInToRead;
if ( mbFinish )
return 0; // PZSTREAM->total_out;
@@ -250,7 +250,7 @@ long ZCodec::Read( SvStream& rIStm, BYTE* pData, ULONG nSize )
mpIStm = &rIStm;
if ( mbInit == 0 )
{
- ImplInitBuf( TRUE );
+ ImplInitBuf( sal_True );
}
PZSTREAM->avail_out = nSize;
PZSTREAM->next_out = pData;
@@ -279,17 +279,17 @@ long ZCodec::Read( SvStream& rIStm, BYTE* pData, ULONG nSize )
(PZSTREAM->avail_out != 0) &&
(PZSTREAM->avail_in || mnInToRead) );
if ( err == Z_STREAM_END )
- mbFinish = TRUE;
+ mbFinish = sal_True;
return (mbStatus ? (long)(nSize - PZSTREAM->avail_out) : -1);
}
// ------------------------------------------------------------------------
-long ZCodec::ReadAsynchron( SvStream& rIStm, BYTE* pData, ULONG nSize )
+long ZCodec::ReadAsynchron( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize )
{
int err = 0;
- ULONG nInToRead;
+ sal_uIntPtr nInToRead;
if ( mbFinish )
return 0; // PZSTREAM->total_out;
@@ -297,7 +297,7 @@ long ZCodec::ReadAsynchron( SvStream& rIStm, BYTE* pData, ULONG nSize )
if ( mbInit == 0 )
{
mpIStm = &rIStm;
- ImplInitBuf( TRUE );
+ ImplInitBuf( sal_True );
}
PZSTREAM->avail_out = nSize;
PZSTREAM->next_out = pData;
@@ -307,9 +307,9 @@ long ZCodec::ReadAsynchron( SvStream& rIStm, BYTE* pData, ULONG nSize )
{
nInToRead = (mnInBufSize > mnInToRead) ? mnInToRead : mnInBufSize;
- ULONG nStreamPos = rIStm.Tell();
+ sal_uIntPtr nStreamPos = rIStm.Tell();
rIStm.Seek( STREAM_SEEK_TO_END );
- ULONG nMaxPos = rIStm.Tell();
+ sal_uIntPtr nMaxPos = rIStm.Tell();
rIStm.Seek( nStreamPos );
if ( ( nMaxPos - nStreamPos ) < nInToRead )
{
@@ -338,7 +338,7 @@ long ZCodec::ReadAsynchron( SvStream& rIStm, BYTE* pData, ULONG nSize )
(PZSTREAM->avail_out != 0) &&
(PZSTREAM->avail_in || mnInToRead) );
if ( err == Z_STREAM_END )
- mbFinish = TRUE;
+ mbFinish = sal_True;
return (mbStatus ? (long)(nSize - PZSTREAM->avail_out) : -1);
}
@@ -347,7 +347,7 @@ long ZCodec::ReadAsynchron( SvStream& rIStm, BYTE* pData, ULONG nSize )
void ZCodec::ImplWriteBack()
{
- ULONG nAvail = mnOutBufSize - PZSTREAM->avail_out;
+ sal_uIntPtr nAvail = mnOutBufSize - PZSTREAM->avail_out;
if ( nAvail )
{
@@ -360,35 +360,35 @@ void ZCodec::ImplWriteBack()
// ------------------------------------------------------------------------
-void ZCodec::SetBreak( ULONG nInToRead )
+void ZCodec::SetBreak( sal_uIntPtr nInToRead )
{
mnInToRead = nInToRead;
}
// ------------------------------------------------------------------------
-ULONG ZCodec::GetBreak( void )
+sal_uIntPtr ZCodec::GetBreak( void )
{
return ( mnInToRead + PZSTREAM->avail_in );
}
// ------------------------------------------------------------------------
-void ZCodec::SetCRC( ULONG nCRC )
+void ZCodec::SetCRC( sal_uIntPtr nCRC )
{
mnCRC = nCRC;
}
// ------------------------------------------------------------------------
-ULONG ZCodec::GetCRC()
+sal_uIntPtr ZCodec::GetCRC()
{
return mnCRC;
}
// ------------------------------------------------------------------------
-void ZCodec::ImplInitBuf ( BOOL nIOFlag )
+void ZCodec::ImplInitBuf ( sal_Bool nIOFlag )
{
if ( mbInit == 0 )
{
@@ -397,19 +397,19 @@ void ZCodec::ImplInitBuf ( BOOL nIOFlag )
mbInit = 1;
if ( mbStatus && ( mnCompressMethod & ZCODEC_GZ_LIB ) )
{
- BYTE n1, n2, j, nMethod, nFlags;
+ sal_uInt8 n1, n2, j, nMethod, nFlags;
for ( int i = 0; i < 2; i++ ) // gz - magic number
{
*mpIStm >> j;
if ( j != gz_magic[ i ] )
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
*mpIStm >> nMethod;
*mpIStm >> nFlags;
if ( nMethod != Z_DEFLATED )
- mbStatus = FALSE;
+ mbStatus = sal_False;
if ( ( nFlags & GZ_RESERVED ) != 0 )
- mbStatus = FALSE;
+ mbStatus = sal_False;
/* Discard time, xflags and OS code: */
mpIStm->SeekRel( 6 );
/* skip the extra field */
@@ -440,13 +440,13 @@ void ZCodec::ImplInitBuf ( BOOL nIOFlag )
if ( nFlags & GZ_HEAD_CRC )
mpIStm->SeekRel( 2 );
if ( mbStatus )
- mbStatus = ( inflateInit2( PZSTREAM, -MAX_WBITS) != Z_OK ) ? FALSE : TRUE;
+ mbStatus = ( inflateInit2( PZSTREAM, -MAX_WBITS) != Z_OK ) ? sal_False : sal_True;
}
else
{
mbStatus = ( inflateInit( PZSTREAM ) >= 0 );
}
- mpInBuf = new BYTE[ mnInBufSize ];
+ mpInBuf = new sal_uInt8[ mnInBufSize ];
}
else
{
@@ -456,14 +456,14 @@ void ZCodec::ImplInitBuf ( BOOL nIOFlag )
MAX_WBITS, mnMemUsage, ( mnCompressMethod >> 8 ) & 0xff,
ZLIB_VERSION, sizeof( z_stream ) ) >= 0 );
- PZSTREAM->next_out = mpOutBuf = new BYTE[ PZSTREAM->avail_out = mnOutBufSize ];
+ PZSTREAM->next_out = mpOutBuf = new sal_uInt8[ PZSTREAM->avail_out = mnOutBufSize ];
}
}
}
// ------------------------------------------------------------------------
-ULONG ZCodec::UpdateCRC ( ULONG nLatestCRC, ULONG nNumber )
+sal_uIntPtr ZCodec::UpdateCRC ( sal_uIntPtr nLatestCRC, sal_uIntPtr nNumber )
{
#ifdef OSL_LITENDIAN
@@ -474,14 +474,14 @@ ULONG ZCodec::UpdateCRC ( ULONG nLatestCRC, ULONG nNumber )
// ------------------------------------------------------------------------
-ULONG ZCodec::UpdateCRC ( ULONG nLatestCRC, BYTE* pSource, long nDatSize)
+sal_uIntPtr ZCodec::UpdateCRC ( sal_uIntPtr nLatestCRC, sal_uInt8* pSource, long nDatSize)
{
return rtl_crc32( nLatestCRC, pSource, nDatSize );
}
// ------------------------------------------------------------------------
-void GZCodec::BeginCompression( ULONG nCompressMethod )
+void GZCodec::BeginCompression( sal_uIntPtr nCompressMethod )
{
ZCodec::BeginCompression( nCompressMethod | ZCODEC_GZ_LIB );
};