summaryrefslogtreecommitdiff
path: root/svl/source/items/poolio.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svl/source/items/poolio.cxx')
-rw-r--r--svl/source/items/poolio.cxx388
1 files changed, 194 insertions, 194 deletions
diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx
index 6aeb64d76d1a..19efb02c4cef 100644
--- a/svl/source/items/poolio.cxx
+++ b/svl/source/items/poolio.cxx
@@ -99,43 +99,43 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
;zun"achst ein Kompatiblit"ats-Header-Block
Start: 0x1111 SFX_ITEMPOOL_TAG_STARTPOOLS(_4/_5)
- BYTE MAJOR_VER ;SfxItemPool-Version
- BYTE MINOR_VER ;"
+ sal_uInt8 MAJOR_VER ;SfxItemPool-Version
+ sal_uInt8 MINOR_VER ;"
0xFFFF SFX_ITEMPOOL_TAG_TRICK4OLD ;ex. GetVersion()
- USHORT 0x0000 ;Pseudo-StyleSheetPool
- USHORT 0x0000 ;Pseudo-StyleSheetPool
+ sal_uInt16 0x0000 ;Pseudo-StyleSheetPool
+ sal_uInt16 0x0000 ;Pseudo-StyleSheetPool
;den ganzen Pool in einen Record
record SfxMiniRecod(SFX_ITEMPOOL_REC)
;je ein Header vorweg
Header: record SfxMiniRecord(SFX_ITEMPOOL_REC_HEADER)
- USHORT GetVersion() ;Which-Ranges etc.
+ sal_uInt16 GetVersion() ;Which-Ranges etc.
String GetName() ;Pool-Name
;die Versions-Map, um WhichIds neuer File-Versionen mappen zu k"onnen
Versions: record SfxMultiRecord(SFX_ITEMPOOL_REC_VERSIONS, 0)
- USHORT OldVersion
- USHORT OldStartWhich
- USHORT OldEndWhich
- USHORT[] NewWhich (OldEndWhich-OldStartWhich+1)
+ sal_uInt16 OldVersion
+ sal_uInt16 OldStartWhich
+ sal_uInt16 OldEndWhich
+ sal_uInt16[] NewWhich (OldEndWhich-OldStartWhich+1)
;jetzt die gepoolten Items (zuerst nicht-SfxSetItems)
Items: record SfxMultiRecord(SFX_ITEMPOOL_REC_WHICHIDS, 0)
content SlotId, 0
- USHORT WhichId
- USHORT pItem->GetVersion()
- USHORT Array-Size
+ sal_uInt16 WhichId
+ sal_uInt16 pItem->GetVersion()
+ sal_uInt16 Array-Size
record SfxMultiRecord(SFX_, 0)
content Surrogate
- USHORT RefCount
+ sal_uInt16 RefCount
unknown pItem->Store()
;jetzt die gesetzten Pool-Defaults
Defaults: record SfxMultiRecord(SFX_ITEMPOOL_REC_DEFAULTS, 0)
content SlotId, 0
- USHORT WhichId
- USHORT pPoolDef->GetVersion()
+ sal_uInt16 WhichId
+ sal_uInt16 pPoolDef->GetVersion()
unknown pPoolDef->Store();
;dahinter folgt ggf. der Secondary ohne Kompatiblit"ats-Header-Block
@@ -150,7 +150,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
pStoreMaster = pStoreMaster->pSecondary;
// Alter-Header (Version des Pools an sich und Inhalts-Version 0xffff)
- pImp->bStreaming = TRUE;
+ pImp->bStreaming = sal_True;
if ( !pStoreMaster )
{
rStream << ( rStream.GetVersion() >= SOFFICE_FILEFORMAT_50
@@ -160,8 +160,8 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
rStream << SFX_ITEMPOOL_TAG_TRICK4OLD;
// SfxStyleSheet-Bug umgehen
- rStream << UINT16(0); // Version
- rStream << UINT16(0); // Count (2. Schleife f"allt sonst auf die Fresse)
+ rStream << sal_uInt16(0); // Version
+ rStream << sal_uInt16(0); // Count (2. Schleife f"allt sonst auf die Fresse)
}
// jeder Pool ist als ganzes ein Record
@@ -178,14 +178,14 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
// Version-Maps
{
SfxMultiVarRecordWriter aVerRec( &rStream, SFX_ITEMPOOL_REC_VERSIONMAP, 0 );
- for ( USHORT nVerNo = 0; nVerNo < pImp->aVersions.Count(); ++nVerNo )
+ for ( sal_uInt16 nVerNo = 0; nVerNo < pImp->aVersions.Count(); ++nVerNo )
{
aVerRec.NewContent();
SfxPoolVersion_Impl *pVer = pImp->aVersions[nVerNo];
rStream << pVer->_nVer << pVer->_nStart << pVer->_nEnd;
- USHORT nCount = pVer->_nEnd - pVer->_nStart + 1;
- USHORT nNewWhich = 0;
- for ( USHORT n = 0; n < nCount; ++n )
+ sal_uInt16 nCount = pVer->_nEnd - pVer->_nStart + 1;
+ sal_uInt16 nNewWhich = 0;
+ for ( sal_uInt16 n = 0; n < nCount; ++n )
{
nNewWhich = pVer->_pMap[n];
rStream << nNewWhich;
@@ -193,7 +193,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
// Workaround gegen Bug in SetVersionMap der 312
if ( SOFFICE_FILEFORMAT_31 == _nFileFormatVersion )
- rStream << USHORT(nNewWhich+1);
+ rStream << sal_uInt16(nNewWhich+1);
}
}
@@ -202,15 +202,15 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
SfxMultiMixRecordWriter aWhichIdsRec( &rStream, SFX_ITEMPOOL_REC_WHICHIDS, 0 );
// erst Atomaren-Items und dann die Sets schreiben (wichtig beim Laden)
- for ( pImp->bInSetItem = FALSE; pImp->bInSetItem <= TRUE && !rStream.GetError(); ++pImp->bInSetItem )
+ for ( pImp->bInSetItem = sal_False; pImp->bInSetItem <= sal_True && !rStream.GetError(); ++pImp->bInSetItem )
{
SfxPoolItemArray_Impl **pArr = pImp->ppPoolItems;
SfxPoolItem **ppDefItem = ppStaticDefaults;
- const USHORT nSize = GetSize_Impl();
- for ( USHORT i = 0; i < nSize && !rStream.GetError(); ++i, ++pArr, ++ppDefItem )
+ const sal_uInt16 nSize = GetSize_Impl();
+ for ( sal_uInt16 i = 0; i < nSize && !rStream.GetError(); ++i, ++pArr, ++ppDefItem )
{
// Version des Items feststellen
- USHORT nItemVersion = (*ppDefItem)->GetVersion( _nFileFormatVersion );
+ sal_uInt16 nItemVersion = (*ppDefItem)->GetVersion( _nFileFormatVersion );
if ( USHRT_MAX == nItemVersion )
// => kam in zu exportierender Version gar nicht vor
continue;
@@ -225,17 +225,17 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
pImp->bInSetItem == (*ppDefItem)->ISA(SfxSetItem) )
{
// eigene Kennung, globale Which-Id und Item-Version
- USHORT nSlotId = GetSlotId( (*ppDefItem)->Which(), FALSE );
+ sal_uInt16 nSlotId = GetSlotId( (*ppDefItem)->Which(), sal_False );
aWhichIdsRec.NewContent(nSlotId, 0);
rStream << (*ppDefItem)->Which();
rStream << nItemVersion;
- const USHORT nCount = (*pArr)->Count();
+ const sal_uInt16 nCount = (*pArr)->Count();
DBG_ASSERT(nCount, "ItemArr ist leer");
rStream << nCount;
// Items an sich schreiben
SfxMultiMixRecordWriter aItemsRec( &rStream, SFX_ITEMPOOL_REC_ITEMS, 0 );
- for ( USHORT j = 0; j < nCount; ++j )
+ for ( sal_uInt16 j = 0; j < nCount; ++j )
{
// Item selbst besorgen
const SfxPoolItem *pItem = (*pArr)->GetObject(j);
@@ -244,10 +244,10 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
aItemsRec.NewContent(j, 'X' );
if ( pItem->GetRefCount() == SFX_ITEMS_SPECIAL )
- rStream << (USHORT) pItem->GetKind();
+ rStream << (sal_uInt16) pItem->GetKind();
else
{
- rStream << (USHORT) pItem->GetRefCount();
+ rStream << (sal_uInt16) pItem->GetRefCount();
if( pItem->GetRefCount() > SFX_ITEMS_OLD_MAXREF )
rStream.SetError( ERRCODE_IO_NOTSTORABLEINBINARYFORMAT );
}
@@ -259,10 +259,10 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
#ifdef DBG_UTIL_MI
if ( !pItem->ISA(SfxSetItem) )
{
- ULONG nMark = rStream.Tell();
- rStream.Seek( nItemStartPos + sizeof(USHORT) );
+ sal_uIntPtr nMark = rStream.Tell();
+ rStream.Seek( nItemStartPos + sizeof(sal_uInt16) );
SfxPoolItem *pClone = pItem->Create(rStream, nItemVersion );
- USHORT nWh = pItem->Which();
+ sal_uInt16 nWh = pItem->Which();
SFX_ASSERT( rStream.Tell() == nMark, nWh,"asymmetric store/create" );
SFX_ASSERT( *pClone == *pItem, nWh, "unequal after store/create" );
delete pClone;
@@ -274,27 +274,27 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
}
}
- pImp->bInSetItem = FALSE;
+ pImp->bInSetItem = sal_False;
}
// die gesetzten Defaults speichern (Pool-Defaults)
if ( !rStream.GetError() )
{
SfxMultiMixRecordWriter aDefsRec( &rStream, SFX_ITEMPOOL_REC_DEFAULTS, 0 );
- USHORT nCount = GetSize_Impl();
- for ( USHORT n = 0; n < nCount; ++n )
+ sal_uInt16 nCount = GetSize_Impl();
+ for ( sal_uInt16 n = 0; n < nCount; ++n )
{
const SfxPoolItem* pDefaultItem = ppPoolDefaults[n];
if ( pDefaultItem )
{
// Version ermitteln
- USHORT nItemVersion = pDefaultItem->GetVersion( _nFileFormatVersion );
+ sal_uInt16 nItemVersion = pDefaultItem->GetVersion( _nFileFormatVersion );
if ( USHRT_MAX == nItemVersion )
// => gab es in der Version noch nicht
continue;
// eigene Kennung, globale Kennung, Version
- USHORT nSlotId = GetSlotId( pDefaultItem->Which(), FALSE );
+ sal_uInt16 nSlotId = GetSlotId( pDefaultItem->Which(), sal_False );
aDefsRec.NewContent( nSlotId, 0 );
rStream << pDefaultItem->Which();
rStream << nItemVersion;
@@ -311,7 +311,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
if ( !rStream.GetError() && pSecondary )
pSecondary->Store( rStream );
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
}
@@ -321,7 +321,7 @@ void SfxItemPool::LoadCompleted()
/* [Beschreibung]
- Wurde der SfxItemPool mit 'bRefCounts' == FALSE geladen, mu\s das
+ Wurde der SfxItemPool mit 'bRefCounts' == sal_False geladen, mu\s das
Laden der Dokumentinhalte mit einem Aufruf dieser Methode beendet
werden. Ansonsten hat der Aufruf dieser Methode keine Funktion.
@@ -347,14 +347,14 @@ void SfxItemPool::LoadCompleted()
// "uber alle Which-Werte iterieren
SfxPoolItemArray_Impl** ppItemArr = pImp->ppPoolItems;
- for( USHORT nArrCnt = GetSize_Impl(); nArrCnt; --nArrCnt, ++ppItemArr )
+ for( sal_uInt16 nArrCnt = GetSize_Impl(); nArrCnt; --nArrCnt, ++ppItemArr )
{
// ist "uberhaupt ein Item mit dem Which-Wert da?
if ( *ppItemArr )
{
// "uber alle Items mit dieser Which-Id iterieren
SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData();
- for( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr )
+ for( sal_uInt16 n = (*ppItemArr)->Count(); n; --n, ++ppHtArr )
if (*ppHtArr)
{
#ifdef DBG_UTIL
@@ -382,7 +382,7 @@ void SfxItemPool::LoadCompleted()
//============================================================================
// This had to be moved to a method of its own to keep Solaris GCC happy:
void SfxItemPool::readTheItems (
- SvStream & rStream, USHORT nItemCount, USHORT nVersion,
+ SvStream & rStream, sal_uInt16 nItemCount, sal_uInt16 nVersion,
SfxPoolItem * pDefItem, SfxPoolItemArray_Impl ** ppArr)
{
SfxMultiRecordReader aItemsRec( &rStream, SFX_ITEMPOOL_REC_ITEMS );
@@ -390,11 +390,11 @@ void SfxItemPool::readTheItems (
SfxPoolItemArray_Impl *pNewArr = new SfxPoolItemArray_Impl( nItemCount );
SfxPoolItem *pItem = 0;
- USHORT n, nLastSurrogate = USHORT(-1);
+ sal_uInt16 n, nLastSurrogate = sal_uInt16(-1);
while (aItemsRec.GetContent())
{
// n"achstes Surrogat holen
- USHORT nSurrogate = aItemsRec.GetContentTag();
+ sal_uInt16 nSurrogate = aItemsRec.GetContentTag();
DBG_ASSERT( aItemsRec.GetContentVersion() == 'X',
"not an item content" );
@@ -404,7 +404,7 @@ void SfxItemPool::readTheItems (
nLastSurrogate = nSurrogate;
// Ref-Count und Item laden
- USHORT nRef;
+ sal_uInt16 nRef;
rStream >> nRef;
pItem = pDefItem->Create(rStream, nVersion);
@@ -430,7 +430,7 @@ void SfxItemPool::readTheItems (
*ppArr = pNewArr;
// die Items merken, die schon im Pool sind
- int bEmpty = TRUE;
+ int bEmpty = sal_True;
if ( 0 != pOldArr )
for ( n = 0; bEmpty && n < pOldArr->Count(); ++n )
bEmpty = pOldArr->GetObject(n) == 0;
@@ -438,15 +438,15 @@ void SfxItemPool::readTheItems (
if ( !bEmpty )
{
// f"ur alle alten suchen, ob ein gleiches neues existiert
- for ( USHORT nOld = 0; nOld < pOldArr->Count(); ++nOld )
+ for ( sal_uInt16 nOld = 0; nOld < pOldArr->Count(); ++nOld )
{
SfxPoolItem *pOldItem = (*pOldArr)[nOld];
if ( pOldItem )
{
- USHORT nFree = USHRT_MAX;
- int bFound = FALSE;
- USHORT nCount = (*ppArr)->Count();
- for ( USHORT nNew = nCount; !bFound && nNew--; )
+ sal_uInt16 nFree = USHRT_MAX;
+ int bFound = sal_False;
+ sal_uInt16 nCount = (*ppArr)->Count();
+ for ( sal_uInt16 nNew = nCount; !bFound && nNew--; )
{
// geladenes Item
SfxPoolItem *&rpNewItem =
@@ -464,7 +464,7 @@ void SfxItemPool::readTheItems (
SetRefCount( *rpNewItem, 0 );
delete rpNewItem;
rpNewItem = pOldItem;
- bFound = TRUE;
+ bFound = sal_True;
}
}
@@ -495,14 +495,14 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
// "uber alle Which-Werte iterieren
SfxPoolItemArray_Impl** ppItemArr = pImp->ppPoolItems;
- for( USHORT nArrCnt = GetSize_Impl(); nArrCnt; --nArrCnt, ++ppItemArr )
+ for( sal_uInt16 nArrCnt = GetSize_Impl(); nArrCnt; --nArrCnt, ++ppItemArr )
{
// ist "uberhaupt ein Item mit dem Which-Wert da?
if ( *ppItemArr )
{
// "uber alle Items mit dieser Which-Id iterieren
SfxPoolItem** ppHtArr = (SfxPoolItem**)(*ppItemArr)->GetData();
- for( USHORT n = (*ppItemArr)->Count(); n; --n, ++ppHtArr )
+ for( sal_uInt16 n = (*ppItemArr)->Count(); n; --n, ++ppHtArr )
if (*ppHtArr)
{
#ifdef DBG_UTIL
@@ -528,7 +528,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
pLoadMaster = pLoadMaster->pSecondary;
// Gesamt Header einlesen
- pImp->bStreaming = TRUE;
+ pImp->bStreaming = sal_True;
if ( !pLoadMaster )
{
// Format-Version laden
@@ -549,7 +549,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
if ( pImp->nMajorVer > SFX_ITEMPOOL_VER_MAJOR )
{
rStream.SetError(SVSTREAM_FILEFORMAT_ERROR);
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
}
@@ -562,19 +562,19 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
SfxMiniRecordReader aPoolRec( &rStream, SFX_ITEMPOOL_REC );
if ( rStream.GetError() )
{
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
}
// Einzel-Header
- int bOwnPool = TRUE;
+ int bOwnPool = sal_True;
UniString aExternName;
{
// Header-Record suchen
SfxMiniRecordReader aPoolHeaderRec( &rStream, SFX_ITEMPOOL_REC_HEADER );
if ( rStream.GetError() )
{
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
}
@@ -588,7 +588,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
{
rStream.SetError(SVSTREAM_FILEFORMAT_ERROR);
aPoolRec.Skip();
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
}
}
@@ -598,25 +598,25 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
SfxMultiRecordReader aVerRec( &rStream, SFX_ITEMPOOL_REC_VERSIONMAP );
if ( rStream.GetError() )
{
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
}
// Versions-Maps einlesen
- USHORT nOwnVersion = pImp->nVersion;
- for ( USHORT nVerNo = 0; aVerRec.GetContent(); ++nVerNo )
+ sal_uInt16 nOwnVersion = pImp->nVersion;
+ for ( sal_uInt16 nVerNo = 0; aVerRec.GetContent(); ++nVerNo )
{
// Header f"ur einzelne Version einlesen
- USHORT nVersion, nHStart, nHEnd;
+ sal_uInt16 nVersion, nHStart, nHEnd;
rStream >> nVersion >> nHStart >> nHEnd;
- USHORT nCount = nHEnd - nHStart + 1;
+ sal_uInt16 nCount = nHEnd - nHStart + 1;
// Version neuer als bekannt?
if ( nVerNo >= pImp->aVersions.Count() )
{
// neue Version hinzufuegen
- USHORT *pMap = new USHORT[nCount];
- for ( USHORT n = 0; n < nCount; ++n )
+ sal_uInt16 *pMap = new sal_uInt16[nCount];
+ for ( sal_uInt16 n = 0; n < nCount; ++n )
rStream >> pMap[n];
SetVersionMap( nVersion, nHStart, nHEnd, pMap );
}
@@ -625,15 +625,15 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
}
// Items laden
- FASTBOOL bSecondaryLoaded = FALSE;
+ int bSecondaryLoaded = sal_False;
long nSecondaryEnd = 0;
{
SfxMultiRecordReader aWhichIdsRec( &rStream, SFX_ITEMPOOL_REC_WHICHIDS);
while ( aWhichIdsRec.GetContent() )
{
// SlotId, Which-Id und Item-Version besorgen
- USHORT nCount, nVersion, nWhich;
- //!USHORT nSlotId = aWhichIdsRec.GetContentTag();
+ sal_uInt16 nCount, nVersion, nWhich;
+ //!sal_uInt16 nSlotId = aWhichIdsRec.GetContentTag();
rStream >> nWhich;
if ( pImp->nLoadingVersion != pImp->nVersion )
// Which-Id aus File-Version in Pool-Version verschieben
@@ -646,11 +646,11 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
rStream >> nVersion;
rStream >> nCount;
//!SFX_ASSERTWARNING( !nSlotId || !HasMap() ||
- //! ( nSlotId == GetSlotId( nWhich, FALSE ) ) ||
- //! !GetSlotId( nWhich, FALSE ),
+ //! ( nSlotId == GetSlotId( nWhich, sal_False ) ) ||
+ //! !GetSlotId( nWhich, sal_False ),
//! nWhich, "Slot/Which mismatch" );
- USHORT nIndex = GetIndex_Impl(nWhich);
+ sal_uInt16 nIndex = GetIndex_Impl(nWhich);
SfxPoolItemArray_Impl **ppArr = pImp->ppPoolItems + nIndex;
// SfxSetItems k"onnten Items aus Sekund"arpools beinhalten
@@ -659,12 +659,12 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
if ( !bSecondaryLoaded && pSecondary && pImp->bInSetItem )
{
// an das Ende des eigenen Pools seeken
- ULONG nLastPos = rStream.Tell();
+ sal_uIntPtr nLastPos = rStream.Tell();
aPoolRec.Skip();
// Sekund"arpool einlesen
pSecondary->Load( rStream );
- bSecondaryLoaded = TRUE;
+ bSecondaryLoaded = sal_True;
nSecondaryEnd = rStream.Tell();
// zur"uck zu unseren eigenen Items
@@ -674,7 +674,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
// Items an sich lesen
readTheItems(rStream, nCount, nVersion, pDefItem, ppArr);
- pImp->bInSetItem = FALSE;
+ pImp->bInSetItem = sal_False;
}
}
@@ -685,8 +685,8 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
while ( aDefsRec.GetContent() )
{
// SlotId, Which-Id und Item-Version besorgen
- USHORT nVersion, nWhich;
- //!USHORT nSlotId = aDefsRec.GetContentTag();
+ sal_uInt16 nVersion, nWhich;
+ //!sal_uInt16 nSlotId = aDefsRec.GetContentTag();
rStream >> nWhich;
if ( pImp->nLoadingVersion != pImp->nVersion )
// Which-Id aus File-Version in Pool-Version verschieben
@@ -697,7 +697,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
continue;
rStream >> nVersion;
- //!SFX_ASSERTWARNING( !HasMap() || ( nSlotId == GetSlotId( nWhich, FALSE ) ),
+ //!SFX_ASSERTWARNING( !HasMap() || ( nSlotId == GetSlotId( nWhich, sal_False ) ),
//! nWhich, "Slot/Which mismatch" );
// Pool-Default-Item selbst laden
@@ -723,7 +723,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
if ( aExternName != aName )
aName.Erase();
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
};
@@ -739,19 +739,19 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
rStream >> pImp->nMajorVer >> pImp->nMinorVer;
}
sal_uInt32 nAttribSize;
- int bOwnPool = TRUE;
+ int bOwnPool = sal_True;
UniString aExternName;
if ( pImp->nMajorVer > 1 || pImp->nMinorVer >= 2 )
rStream >> pImp->nLoadingVersion;
SfxPoolItem::readByteString(rStream, aExternName);
bOwnPool = aExternName == aName;
- pImp->bStreaming = TRUE;
+ pImp->bStreaming = sal_True;
//! solange wir keine fremden laden k"onnen
if ( !bOwnPool )
{
rStream.SetError(SVSTREAM_FILEFORMAT_ERROR);
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
}
@@ -760,7 +760,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
pImp->nVersion < pImp->nLoadingVersion )
{
rStream.SetError(ERRCODE_IO_WRONGVERSION);
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
}
@@ -768,20 +768,20 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
rStream >> nAttribSize;
// Size-Table einlesen
- ULONG nStartPos = rStream.Tell();
+ sal_uIntPtr nStartPos = rStream.Tell();
rStream.SeekRel( nAttribSize );
CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_SIZES );
sal_uInt32 nSizeTableLen;
rStream >> nSizeTableLen;
sal_Char *pBuf = new sal_Char[nSizeTableLen];
rStream.Read( pBuf, nSizeTableLen );
- ULONG nEndOfSizes = rStream.Tell();
+ sal_uIntPtr nEndOfSizes = rStream.Tell();
SvMemoryStream aSizeTable( pBuf, nSizeTableLen, STREAM_READ );
// ab Version 1.3 steht in der Size-Table eine Versions-Map
if ( pImp->nMajorVer > 1 || pImp->nMinorVer >= 3 )
{
- // Version-Map finden (letztes ULONG der Size-Table gibt Pos an)
+ // Version-Map finden (letztes sal_uIntPtr der Size-Table gibt Pos an)
rStream.Seek( nEndOfSizes - sizeof(sal_uInt32) );
sal_uInt32 nVersionMapPos;
rStream >> nVersionMapPos;
@@ -789,22 +789,22 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
// Versions-Maps einlesen
CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_VERSIONMAP );
- USHORT nVerCount;
+ sal_uInt16 nVerCount;
rStream >> nVerCount;
- for ( USHORT nVerNo = 0; nVerNo < nVerCount; ++nVerNo )
+ for ( sal_uInt16 nVerNo = 0; nVerNo < nVerCount; ++nVerNo )
{
// Header f"ur einzelne Version einlesen
- USHORT nVersion, nHStart, nHEnd;
+ sal_uInt16 nVersion, nHStart, nHEnd;
rStream >> nVersion >> nHStart >> nHEnd;
- USHORT nCount = nHEnd - nHStart + 1;
- USHORT nBytes = (nCount)*sizeof(USHORT);
+ sal_uInt16 nCount = nHEnd - nHStart + 1;
+ sal_uInt16 nBytes = (nCount)*sizeof(sal_uInt16);
// Version neuer als bekannt?
if ( nVerNo >= pImp->aVersions.Count() )
{
// neue Version hinzufuegen
- USHORT *pMap = new USHORT[nCount];
- for ( USHORT n = 0; n < nCount; ++n )
+ sal_uInt16 *pMap = new sal_uInt16[nCount];
+ for ( sal_uInt16 n = 0; n < nCount; ++n )
rStream >> pMap[n];
SetVersionMap( nVersion, nHStart, nHEnd, pMap );
}
@@ -817,9 +817,9 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
// Items laden
rStream.Seek( nStartPos );
CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_ITEMS );
- FASTBOOL bSecondaryLoaded = FALSE;
+ int bSecondaryLoaded = sal_False;
long nSecondaryEnd = 0;
- USHORT nWhich, nSlot;
+ sal_uInt16 nWhich, nSlot;
while ( rStream >> nWhich, nWhich )
{
// ggf. Which-Id aus alter Version verschieben?
@@ -827,10 +827,10 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
nWhich = GetNewWhich( nWhich );
rStream >> nSlot;
- USHORT nMappedWhich = GetWhich(nSlot, FALSE);
+ sal_uInt16 nMappedWhich = GetWhich(nSlot, sal_False);
int bKnownItem = bOwnPool || IsWhich(nMappedWhich);
- USHORT nRef, nCount, nVersion;
+ sal_uInt16 nRef, nCount, nVersion;
sal_uInt32 nAttrSize;
rStream >> nVersion >> nCount;
@@ -843,18 +843,18 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
nWhich = nMappedWhich;
//!SFX_ASSERTWARNING( !nSlot || !HasMap() ||
- //! ( nSlot == GetSlotId( nWhich, FALSE ) ) ||
- //! !GetSlotId( nWhich, FALSE ),
+ //! ( nSlot == GetSlotId( nWhich, sal_False ) ) ||
+ //! !GetSlotId( nWhich, sal_False ),
//! nWhich, "Slot/Which mismatch" );
- USHORT nIndex = GetIndex_Impl(nWhich);
+ sal_uInt16 nIndex = GetIndex_Impl(nWhich);
ppArr = pImp->ppPoolItems + nIndex;
pNewArr = new SfxPoolItemArray_Impl( nCount );
pDefItem = *(ppStaticDefaults + nIndex);
}
// Position vor ersten Item merken
- ULONG nLastPos = rStream.Tell();
+ sal_uIntPtr nLastPos = rStream.Tell();
// SfxSetItems k"onnten Items aus Sekund"arpools beinhalten
if ( !bSecondaryLoaded && pSecondary && pDefItem->ISA(SfxSetItem) )
@@ -866,7 +866,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
// Sekund"arpool einlesen
pSecondary->Load1_Impl( rStream );
- bSecondaryLoaded = TRUE;
+ bSecondaryLoaded = sal_True;
nSecondaryEnd = rStream.Tell();
// zur"uck zu unseren eigenen Items
@@ -874,9 +874,9 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
}
// Items an sich lesen
- for ( USHORT j = 0; j < nCount; ++j )
+ for ( sal_uInt16 j = 0; j < nCount; ++j )
{
- ULONG nPos = nLastPos;
+ sal_uIntPtr nPos = nLastPos;
rStream >> nRef;
if ( bKnownItem )
@@ -922,21 +922,21 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
*ppArr = pNewArr;
// die Items merken, die schon im Pool sind
- int bEmpty = TRUE;
+ int bEmpty = sal_True;
if ( 0 != pOldArr )
- for ( USHORT n = 0; bEmpty && n < pOldArr->Count(); ++n )
+ for ( sal_uInt16 n = 0; bEmpty && n < pOldArr->Count(); ++n )
bEmpty = pOldArr->GetObject(n) == 0;
DBG_ASSERTWARNING( bEmpty, "loading non-empty pool" );
if ( !bEmpty )
{
// f"ur alle alten suchen, ob ein gleiches neues existiert
- for ( USHORT nOld = 0; nOld < pOldArr->Count(); ++nOld )
+ for ( sal_uInt16 nOld = 0; nOld < pOldArr->Count(); ++nOld )
{
SfxPoolItem *pOldItem = (*pOldArr)[nOld];
if ( pOldItem )
{
- int bFound = FALSE;
- for ( USHORT nNew = 0;
+ int bFound = sal_False;
+ for ( sal_uInt16 nNew = 0;
!bFound && nNew < (*ppArr)->Count();
++nNew )
{
@@ -949,7 +949,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
SetRefCount( *rpNewItem, 0 );
delete rpNewItem;
rpNewItem = pOldItem;
- bFound = TRUE;
+ bFound = sal_True;
SFX_TRACE( "reusing item", pOldItem );
}
}
@@ -969,7 +969,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
if ( pImp->nMajorVer > 1 || pImp->nMinorVer > 0 )
CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_DEFAULTS );
- ULONG nLastPos = rStream.Tell();
+ sal_uIntPtr nLastPos = rStream.Tell();
while ( rStream >> nWhich, nWhich )
{
// ggf. Which-Id aus alter Version verschieben?
@@ -977,12 +977,12 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
nWhich = GetNewWhich( nWhich );
rStream >> nSlot;
- USHORT nMappedWhich = GetWhich(nSlot, FALSE);
+ sal_uInt16 nMappedWhich = GetWhich(nSlot, sal_False);
int bKnownItem = bOwnPool || IsWhich(nMappedWhich);
- ULONG nPos = nLastPos;
+ sal_uIntPtr nPos = nLastPos;
sal_uInt32 nSize;
- USHORT nVersion;
+ sal_uInt16 nVersion;
rStream >> nVersion;
if ( bKnownItem )
@@ -1020,7 +1020,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
if ( aExternName != aName )
aName.Erase();
- pImp->bStreaming = FALSE;
+ pImp->bStreaming = sal_False;
return rStream;
}
@@ -1029,8 +1029,8 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
const SfxPoolItem* SfxItemPool::LoadSurrogate
(
SvStream& rStream, // vor einem Surrogat positionierter Stream
- USHORT& rWhich, // Which-Id des zu ladenden <SfxPoolItem>s
- USHORT nSlotId, // Slot-Id des zu ladenden <SfxPoolItem>s
+ sal_uInt16& rWhich, // Which-Id des zu ladenden <SfxPoolItem>s
+ sal_uInt16 nSlotId, // Slot-Id des zu ladenden <SfxPoolItem>s
const SfxItemPool* pRefPool // <SfxItemPool> in dem das Surrogat gilt
)
@@ -1072,7 +1072,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate
{
// erstmal das Surrogat lesen
- USHORT nSurrogat;
+ sal_uInt16 nSurrogat;
rStream >> nSurrogat;
// direkt gespeichertes Item?
@@ -1090,17 +1090,17 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate
// auf jeden Fall aufgel"ost werden.
if ( !pRefPool )
pRefPool = this;
- FASTBOOL bResolvable = pRefPool->GetName().Len() > 0;
+ int bResolvable = pRefPool->GetName().Len() > 0;
if ( !bResolvable )
{
// Bei einem anders aufgebauten Pool im Stream, mu\s die SlotId
// aus dem Stream in eine Which-Id gemappt werden k"onnen.
- USHORT nMappedWhich = nSlotId ? GetWhich(nSlotId, TRUE) : 0;
+ sal_uInt16 nMappedWhich = nSlotId ? GetWhich(nSlotId, sal_True) : 0;
if ( IsWhich(nMappedWhich) )
{
// gemappte SlotId kann "ubernommen werden
rWhich = nMappedWhich;
- bResolvable = TRUE;
+ bResolvable = sal_True;
}
}
@@ -1144,7 +1144,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate
}
}
- SFX_ASSERT( FALSE, rWhich, "can't resolve Which-Id in LoadSurrogate" );
+ SFX_ASSERT( sal_False, rWhich, "can't resolve Which-Id in LoadSurrogate" );
}
return 0;
@@ -1153,7 +1153,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate
//-------------------------------------------------------------------------
-FASTBOOL SfxItemPool::StoreSurrogate
+int SfxItemPool::StoreSurrogate
(
SvStream& rStream,
const SfxPoolItem* pItem
@@ -1166,13 +1166,13 @@ FASTBOOL SfxItemPool::StoreSurrogate
[R"uckgabewert]
- FASTBOOL TRUE
+ int sal_True
es wurde ein echtes Surrogat gespeichert, auch
SFX_ITEMS_NULL bei 'pItem==0',
SFX_ITEMS_STATICDEFAULT und SFX_ITEMS_POOLDEFAULT
gelten als 'echte' Surrogate
- FALSE
+ sal_False
es wurde ein Dummy-Surrogat (SFX_ITEMS_DIRECT)
gespeichert, das eigentliche Item mu\s direkt
hinterher selbst gespeichert werden
@@ -1181,20 +1181,20 @@ FASTBOOL SfxItemPool::StoreSurrogate
{
if ( pItem )
{
- FASTBOOL bRealSurrogate = IsItemFlag(*pItem, SFX_ITEM_POOLABLE);
+ int bRealSurrogate = IsItemFlag(*pItem, SFX_ITEM_POOLABLE);
rStream << ( bRealSurrogate
? GetSurrogate( pItem )
- : (UINT16) SFX_ITEMS_DIRECT );
+ : (sal_uInt16) SFX_ITEMS_DIRECT );
return bRealSurrogate;
}
- rStream << (UINT16) SFX_ITEMS_NULL;
- return TRUE;
+ rStream << (sal_uInt16) SFX_ITEMS_NULL;
+ return sal_True;
}
// -----------------------------------------------------------------------
-USHORT SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const
+sal_uInt16 SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const
{
DBG_CHKTHIS(SfxItemPool, 0);
DBG_ASSERT( pItem, "no 0-Pointer Surrogate" );
@@ -1214,8 +1214,8 @@ USHORT SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const
SfxPoolItemArray_Impl* pItemArr = *(pImp->ppPoolItems + GetIndex_Impl(pItem->Which()));
DBG_ASSERT(pItemArr, "ItemArr nicht vorhanden");
- const USHORT nCount = pItemArr->Count();
- for ( USHORT i = 0; i < nCount; ++i )
+ const sal_uInt16 nCount = pItemArr->Count();
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
{
const SfxPoolItem *p = (*pItemArr)[i];
if ( p == pItem )
@@ -1227,7 +1227,7 @@ USHORT SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const
// -----------------------------------------------------------------------
-FASTBOOL SfxItemPool::IsInStoringRange( USHORT nWhich ) const
+int SfxItemPool::IsInStoringRange( sal_uInt16 nWhich ) const
{
return nWhich >= pImp->nStoringStart &&
nWhich <= pImp->nStoringEnd;
@@ -1235,7 +1235,7 @@ FASTBOOL SfxItemPool::IsInStoringRange( USHORT nWhich ) const
//------------------------------------------------------------------------
-void SfxItemPool::SetStoringRange( USHORT nFrom, USHORT nTo )
+void SfxItemPool::SetStoringRange( sal_uInt16 nFrom, sal_uInt16 nTo )
/* [Beschreibung]
@@ -1262,10 +1262,10 @@ void SfxItemPool::SetStoringRange( USHORT nFrom, USHORT nTo )
void SfxItemPool::SetVersionMap
(
- USHORT nVer, /* neue Versionsnummer */
- USHORT nOldStart, /* alte erste Which-Id */
- USHORT nOldEnd, /* alte letzte Which-Id */
- USHORT* pOldWhichIdTab /* Array mit genau dem Aufbau der Which-Ids
+ sal_uInt16 nVer, /* neue Versionsnummer */
+ sal_uInt16 nOldStart, /* alte erste Which-Id */
+ sal_uInt16 nOldEnd, /* alte letzte Which-Id */
+ sal_uInt16* pOldWhichIdTab /* Array mit genau dem Aufbau der Which-Ids
der vorhergehenden Version, in denen
die jeweils neue Which-Id steht. */
)
@@ -1313,14 +1313,14 @@ void SfxItemPool::SetVersionMap
Dabei haben sich also die Ids 3 und 4 ge"andert. F"ur die neue Version
m"u\ste am Pool folgendes gesetzt werden:
- static USHORT nVersion1Map = { 1, 2, 5, 6 };
+ static sal_uInt16 nVersion1Map = { 1, 2, 5, 6 };
pPool->SetVersionMap( 1, 1, 4, &nVersion1Map );
[Querverweise]
<SfxItemPool::IsLoadingVersionCurrent()const>
- <SfxItemPool::GetNewWhich(USHORT)>
+ <SfxItemPool::GetNewWhich(sal_uInt16)>
<SfxItemPool::GetVersion()const>
<SfxItemPool::GetLoadingVersion()const>
*/
@@ -1335,9 +1335,9 @@ void SfxItemPool::SetVersionMap
pImp->nVersion = nVer;
// Versions-Range anpassen
- for ( USHORT n = 0; n < nOldEnd-nOldStart+1; ++n )
+ for ( sal_uInt16 n = 0; n < nOldEnd-nOldStart+1; ++n )
{
- USHORT nWhich = pOldWhichIdTab[n];
+ sal_uInt16 nWhich = pOldWhichIdTab[n];
if ( nWhich < pImp->nVerStart )
{
if ( !nWhich )
@@ -1351,9 +1351,9 @@ void SfxItemPool::SetVersionMap
// -----------------------------------------------------------------------
-USHORT SfxItemPool::GetNewWhich
+sal_uInt16 SfxItemPool::GetNewWhich
(
- USHORT nFileWhich // die aus dem Stream geladene Which-Id
+ sal_uInt16 nFileWhich // die aus dem Stream geladene Which-Id
) const
/* [Beschreibung]
@@ -1377,7 +1377,7 @@ USHORT SfxItemPool::GetNewWhich
[Querverweise]
<SfxItemPool::IsLoadingVersionCurrent()const>
- <SfxItemPool::SetVersionMap(USHORT,USHORT,USHORT,USHORT*)>
+ <SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)>
<SfxItemPool::GetVersion()const>
<SfxItemPool::GetLoadingVersion()const>
*/
@@ -1398,12 +1398,12 @@ USHORT SfxItemPool::GetNewWhich
if ( nDiff > 0 )
{
// von der Top-Version bis runter zur File-Version stufenweise mappen
- for ( USHORT nMap = pImp->aVersions.Count(); nMap > 0; --nMap )
+ for ( sal_uInt16 nMap = pImp->aVersions.Count(); nMap > 0; --nMap )
{
SfxPoolVersion_Impl *pVerInfo = pImp->aVersions[nMap-1];
if ( pVerInfo->_nVer > pImp->nVersion )
- { USHORT nOfs;
- USHORT nCount = pVerInfo->_nEnd - pVerInfo->_nStart + 1;
+ { sal_uInt16 nOfs;
+ sal_uInt16 nCount = pVerInfo->_nEnd - pVerInfo->_nStart + 1;
for ( nOfs = 0;
nOfs <= nCount &&
pVerInfo->_pMap[nOfs] != nFileWhich;
@@ -1424,7 +1424,7 @@ USHORT SfxItemPool::GetNewWhich
else if ( nDiff < 0 )
{
// von der File-Version bis zur aktuellen Version stufenweise mappen
- for ( USHORT nMap = 0; nMap < pImp->aVersions.Count(); ++nMap )
+ for ( sal_uInt16 nMap = 0; nMap < pImp->aVersions.Count(); ++nMap )
{
SfxPoolVersion_Impl *pVerInfo = pImp->aVersions[nMap];
if ( pVerInfo->_nVer > pImp->nLoadingVersion )
@@ -1444,14 +1444,14 @@ USHORT SfxItemPool::GetNewWhich
// -----------------------------------------------------------------------
-FASTBOOL SfxItemPool::IsInVersionsRange( USHORT nWhich ) const
+int SfxItemPool::IsInVersionsRange( sal_uInt16 nWhich ) const
{
return nWhich >= pImp->nVerStart && nWhich <= pImp->nVerEnd;
}
// -----------------------------------------------------------------------
-FASTBOOL SfxItemPool::IsCurrentVersionLoading() const
+int SfxItemPool::IsCurrentVersionLoading() const
/* [Beschreibung]
@@ -1465,8 +1465,8 @@ FASTBOOL SfxItemPool::IsCurrentVersionLoading() const
[Querverweise]
- <SfxItemPool::SetVersionMap(USHORT,USHORT,USHORT,USHORT*)>
- <SfxItemPool::GetNewWhich(USHORT)const>
+ <SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)>
+ <SfxItemPool::GetNewWhich(sal_uInt16)const>
<SfxItemPool::GetVersion()const>
<SfxItemPool::GetLoadingVersion()const>
*/
@@ -1478,7 +1478,7 @@ FASTBOOL SfxItemPool::IsCurrentVersionLoading() const
// -----------------------------------------------------------------------
-USHORT SfxItemPool::GetVersion() const
+sal_uInt16 SfxItemPool::GetVersion() const
/* [Beschreibung]
@@ -1499,8 +1499,8 @@ USHORT SfxItemPool::GetVersion() const
[Querverweise]
<SfxItemPool::IsLoadingVersionCurrent()const>
- <SfxItemPool::SetVersionMap(USHORT,USHORT,USHORT,USHORT*)>
- <SfxItemPool::GetNewWhich(USHORT)const>
+ <SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)>
+ <SfxItemPool::GetNewWhich(sal_uInt16)const>
<SfxItemPool::GetLoadingVersion()const>
*/
@@ -1510,7 +1510,7 @@ USHORT SfxItemPool::GetVersion() const
// -----------------------------------------------------------------------
-USHORT SfxItemPool::GetLoadingVersion() const
+sal_uInt16 SfxItemPool::GetLoadingVersion() const
/* [Beschreibung]
@@ -1531,8 +1531,8 @@ USHORT SfxItemPool::GetLoadingVersion() const
[Querverweise]
<SfxItemPool::IsLoadingVersionCurrent()const>
- <SfxItemPool::SetVersionMap(USHORT,USHORT,USHORT,USHORT*)>
- <SfxItemPool::GetNewWhich(USHORT)const>
+ <SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)>
+ <SfxItemPool::GetNewWhich(sal_uInt16)const>
<SfxItemPool::GetVersion()const>
*/
@@ -1542,7 +1542,7 @@ USHORT SfxItemPool::GetLoadingVersion() const
//-------------------------------------------------------------------------
-FASTBOOL SfxItemPool::IsVer2_Impl() const
+int SfxItemPool::IsVer2_Impl() const
{
return pMaster->pImp->nMajorVer >= 2;
}
@@ -1550,82 +1550,82 @@ FASTBOOL SfxItemPool::IsVer2_Impl() const
//-------------------------------------------------------------------------
-FASTBOOL SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem,
- FASTBOOL bDirect ) const
+int SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem,
+ int bDirect ) const
/* [Beschreibung]
Speichert das <SfxPoolItem> 'rItem' in den <SvStream> 'rStream'
- entweder als Surrogat ('bDirect == FALSE') oder direkt mit 'rItem.Store()'.
+ entweder als Surrogat ('bDirect == sal_False') oder direkt mit 'rItem.Store()'.
Nicht poolable Items werden immer direkt gespeichert. Items ohne Which-Id,
also SID-Items, werden nicht gespeichert, ebenso wenn Items, die in der
- File-Format-Version noch nicht vorhanden waren (return FALSE).
+ File-Format-Version noch nicht vorhanden waren (return sal_False).
Das Item wird im Stream wie folgt abgelegt:
- USHORT rItem.Which()
- USHORT GetSlotId( rItem.Which() ) bzw. 0 falls nicht verf"urbar
- USHORT GetSurrogate( &rItem ) bzw. SFX_ITEM_DIRECT bei '!SFX_ITEM_POOLBLE'
+ sal_uInt16 rItem.Which()
+ sal_uInt16 GetSlotId( rItem.Which() ) bzw. 0 falls nicht verf"urbar
+ sal_uInt16 GetSurrogate( &rItem ) bzw. SFX_ITEM_DIRECT bei '!SFX_ITEM_POOLBLE'
- optional (falls 'bDirect == TRUE' oder '!rItem.IsPoolable()':
+ optional (falls 'bDirect == sal_True' oder '!rItem.IsPoolable()':
- USHORT rItem.GetVersion()
- ULONG Size
+ sal_uInt16 rItem.GetVersion()
+ sal_uIntPtr Size
Size rItem.Store()
[Querverweise]
- <SfxItemPool::LoadItem(SvStream&,FASTBOOL)const>
+ <SfxItemPool::LoadItem(SvStream&,int)const>
*/
{
DBG_ASSERT( !IsInvalidItem(&rItem), "cannot store invalid items" );
if ( IsSlot( rItem.Which() ) )
- return FALSE;
+ return sal_False;
const SfxItemPool *pPool = this;
while ( !pPool->IsInStoringRange(rItem.Which()) )
if ( 0 == ( pPool = pPool->pSecondary ) )
- return FALSE;
+ return sal_False;
DBG_ASSERT( !pImp->bInSetItem || !rItem.ISA(SfxSetItem),
"SetItem contains ItemSet with SetItem" );
- USHORT nSlotId = pPool->GetSlotId( rItem.Which(), TRUE );
- USHORT nItemVersion = rItem.GetVersion(_nFileFormatVersion);
+ sal_uInt16 nSlotId = pPool->GetSlotId( rItem.Which(), sal_True );
+ sal_uInt16 nItemVersion = rItem.GetVersion(_nFileFormatVersion);
if ( USHRT_MAX == nItemVersion )
- return FALSE;
+ return sal_False;
rStream << rItem.Which() << nSlotId;
if ( bDirect || !pPool->StoreSurrogate( rStream, &rItem ) )
{
rStream << nItemVersion;
- rStream << (UINT32) 0L; // Platz fuer Laenge in Bytes
- ULONG nIStart = rStream.Tell();
+ rStream << (sal_uInt32) 0L; // Platz fuer Laenge in Bytes
+ sal_uIntPtr nIStart = rStream.Tell();
rItem.Store(rStream, nItemVersion);
- ULONG nIEnd = rStream.Tell();
+ sal_uIntPtr nIEnd = rStream.Tell();
rStream.Seek( nIStart-4 );
- rStream << (INT32) ( nIEnd-nIStart );
+ rStream << (sal_Int32) ( nIEnd-nIStart );
rStream.Seek( nIEnd );
}
- return TRUE;
+ return sal_True;
}
//-------------------------------------------------------------------------
-const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect,
+const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, int bDirect,
const SfxItemPool *pRefPool )
// pRefPool==-1 => nicht putten!
{
- USHORT nWhich, nSlot; // nSurrogate;
+ sal_uInt16 nWhich, nSlot; // nSurrogate;
rStream >> nWhich >> nSlot;
- BOOL bDontPut = (SfxItemPool*)-1 == pRefPool;
+ sal_Bool bDontPut = (SfxItemPool*)-1 == pRefPool;
if ( bDontPut || !pRefPool )
pRefPool = this;
@@ -1637,7 +1637,7 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect,
else
{
// WID in der Version nicht vorhanden => ueberspringen
- USHORT nSurro, nVersion, nLen;
+ sal_uInt16 nSurro, nVersion, nLen;
rStream >> nSurro;
if ( SFX_ITEMS_DIRECT == nSurro )
{
@@ -1649,7 +1649,7 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect,
}
// wird eine andere Version geladen?
- FASTBOOL bCurVersion = pRefPool->IsCurrentVersionLoading();
+ int bCurVersion = pRefPool->IsCurrentVersionLoading();
if ( !bCurVersion )
// Which-Id auf neue Version mappen
nWhich = pRefPool->GetNewWhich( nWhich );
@@ -1668,17 +1668,17 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect,
pItem = LoadSurrogate( rStream, nWhich, nSlot, pRefPool );
else
// sonst "uberspringen
- rStream.SeekRel( sizeof(USHORT) );
+ rStream.SeekRel( sizeof(sal_uInt16) );
}
// wird direkt, also nicht "uber Surrogat geladen?
if ( bDirect || ( nWhich && !pItem ) )
{
// bDirekt bzw. nicht IsPoolable() => Item direkt laden
- USHORT nVersion;
+ sal_uInt16 nVersion;
sal_uInt32 nLen;
rStream >> nVersion >> nLen;
- ULONG nIStart = rStream.Tell();
+ sal_uIntPtr nIStart = rStream.Tell();
// Which-Id in dieser Version bekannt?
if ( nWhich )
@@ -1696,7 +1696,7 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect,
}
else
pItem = 0;
- ULONG nIEnd = rStream.Tell();
+ sal_uIntPtr nIEnd = rStream.Tell();
DBG_ASSERT( nIEnd <= (nIStart+nLen), "read past end of item" );
if ( (nIStart+nLen) != nIEnd )
rStream.Seek( nIStart+nLen );