diff options
Diffstat (limited to 'svl/source/items/style.cxx')
-rw-r--r-- | svl/source/items/style.cxx | 238 |
1 files changed, 119 insertions, 119 deletions
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 60c622208d53..1d8c25c085d9 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -54,7 +54,7 @@ #include <algorithm> #define STYLESTREAM "SfxStyleSheets" -#define STYLESTREAM_VERSION USHORT(50) +#define STYLESTREAM_VERSION sal_uInt16(50) #ifdef DBG_UTIL class DbgStyleSheetReferences @@ -86,7 +86,7 @@ TYPEINIT1(SfxStyleSheetPoolHint, SfxHint); SfxStyleSheetHintExtended::SfxStyleSheetHintExtended ( - USHORT nAction, // SFX_STYLESHEET_... (s.o.) + sal_uInt16 nAction, // SFX_STYLESHEET_... (s.o.) const String& rOldName ) : SfxStyleSheetHint( nAction ), @@ -94,7 +94,7 @@ SfxStyleSheetHintExtended::SfxStyleSheetHintExtended {} SfxStyleSheetHintExtended::SfxStyleSheetHintExtended ( - USHORT nAction, // SFX_STYLESHEET_... (s.o.) + sal_uInt16 nAction, // SFX_STYLESHEET_... (s.o.) const String& rOldName, SfxStyleSheetBase& rStyleSheet // geh"ort weiterhin dem Aufrufer ) @@ -106,7 +106,7 @@ SfxStyleSheetHintExtended::SfxStyleSheetHintExtended SfxStyleSheetHint::SfxStyleSheetHint ( - USHORT nAction, // SFX_STYLESHEET_... (s.o.) + sal_uInt16 nAction, // SFX_STYLESHEET_... (s.o.) SfxStyleSheetBase& rStyleSheet // geh"ort weiterhin dem Aufrufer ) : pStyleSh( &rStyleSheet ), @@ -115,7 +115,7 @@ SfxStyleSheetHint::SfxStyleSheetHint SfxStyleSheetHint::SfxStyleSheetHint ( - USHORT nAction // SFX_STYLESHEET_... (s.o.) + sal_uInt16 nAction // SFX_STYLESHEET_... (s.o.) ) : pStyleSh( NULL ), nHint( nAction ) @@ -137,7 +137,7 @@ class SfxStyleSheetBasePool_Impl // Konstruktoren -SfxStyleSheetBase::SfxStyleSheetBase( const XubString& rName, SfxStyleSheetBasePool& r, SfxStyleFamily eFam, USHORT mask ) +SfxStyleSheetBase::SfxStyleSheetBase( const XubString& rName, SfxStyleSheetBasePool& r, SfxStyleFamily eFam, sal_uInt16 mask ) : rPool( r ) , nFamily( eFam ) , aName( rName ) @@ -146,7 +146,7 @@ SfxStyleSheetBase::SfxStyleSheetBase( const XubString& rName, SfxStyleSheetBaseP , pSet( NULL ) , nMask(mask) , nHelpId( 0 ) - , bMySet( FALSE ) + , bMySet( sal_False ) { #ifdef DBG_UTIL aDbgStyleSheetReferences.mnStyles++; @@ -206,7 +206,7 @@ SfxStyleSheetBase::~SfxStyleSheetBase() } } -USHORT SfxStyleSheetBase::GetVersion() const +sal_uInt16 SfxStyleSheetBase::GetVersion() const { return 0x0000; } @@ -218,24 +218,24 @@ const XubString& SfxStyleSheetBase::GetName() const return aName; } -BOOL SfxStyleSheetBase::SetName( const XubString& rName ) +sal_Bool SfxStyleSheetBase::SetName( const XubString& rName ) { if(rName.Len() == 0) - return FALSE; + return sal_False; if( aName != rName ) { String aOldName = aName; SfxStyleSheetBase *pOther = rPool.Find( rName, nFamily ) ; if ( pOther && pOther != this ) - return FALSE; + return sal_False; SfxStyleFamily eTmpFam=rPool.GetSearchFamily(); - USHORT nTmpMask=rPool.GetSearchMask(); + sal_uInt16 nTmpMask=rPool.GetSearchMask(); rPool.SetSearchMask(nFamily); if ( aName.Len() ) - rPool.ChangeParent( aName, rName, FALSE ); + rPool.ChangeParent( aName, rName, sal_False ); if ( aFollow.Equals( aName ) ) aFollow = rName; aName = rName; @@ -243,7 +243,7 @@ BOOL SfxStyleSheetBase::SetName( const XubString& rName ) rPool.Broadcast( SfxStyleSheetHintExtended( SFX_STYLESHEET_MODIFIED, aOldName, *this ) ); } - return TRUE; + return sal_True; } rtl::OUString SfxStyleSheetBase::GetDisplayName() const @@ -270,10 +270,10 @@ const XubString& SfxStyleSheetBase::GetParent() const return aParent; } -BOOL SfxStyleSheetBase::SetParent( const XubString& rName ) +sal_Bool SfxStyleSheetBase::SetParent( const XubString& rName ) { if ( rName == aName ) - return FALSE; + return sal_False; if( aParent != rName ) { @@ -281,20 +281,20 @@ BOOL SfxStyleSheetBase::SetParent( const XubString& rName ) if( rName.Len() && !pIter ) { DBG_ERROR( "StyleSheet-Parent nicht gefunden" ); - return FALSE; + return sal_False; } // rekursive Verknuepfungen verhindern if( aName.Len() ) while(pIter) { if(pIter->GetName() == aName && aName != rName) - return FALSE; + return sal_False; pIter = rPool.Find(pIter->GetParent(), nFamily); } aParent = rName; } rPool.Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_MODIFIED, *this ) ); - return TRUE; + return sal_True; } // Follow aendern @@ -304,19 +304,19 @@ const XubString& SfxStyleSheetBase::GetFollow() const return aFollow; } -BOOL SfxStyleSheetBase::SetFollow( const XubString& rName ) +sal_Bool SfxStyleSheetBase::SetFollow( const XubString& rName ) { if( aFollow != rName ) { if( !rPool.Find( rName, nFamily ) ) { DBG_ERROR( "StyleSheet-Follow nicht gefunden" ); - return FALSE; + return sal_False; } aFollow = rName; } rPool.Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_MODIFIED, *this ) ); - return TRUE; + return sal_True; } // Itemset setzen. Die Dflt-Implementation legt ein neues Set an. @@ -326,20 +326,20 @@ SfxItemSet& SfxStyleSheetBase::GetItemSet() if( !pSet ) { pSet = new SfxItemSet( rPool.GetPool() ); - bMySet = TRUE; + bMySet = sal_True; } return *pSet; } // Hilfe-Datei und -ID setzen und abfragen -ULONG SfxStyleSheetBase::GetHelpId( String& rFile ) +sal_uIntPtr SfxStyleSheetBase::GetHelpId( String& rFile ) { rFile = aHelpFile; return nHelpId; } -void SfxStyleSheetBase::SetHelpId( const String& rFile, ULONG nId ) +void SfxStyleSheetBase::SetHelpId( const String& rFile, sal_uIntPtr nId ) { aHelpFile = rFile; nHelpId = nId; @@ -347,30 +347,30 @@ void SfxStyleSheetBase::SetHelpId( const String& rFile, ULONG nId ) // Folgevorlage m"oglich? Default: Ja -BOOL SfxStyleSheetBase::HasFollowSupport() const +sal_Bool SfxStyleSheetBase::HasFollowSupport() const { - return TRUE; + return sal_True; } // Basisvorlage m"oglich? Default: Ja -BOOL SfxStyleSheetBase::HasParentSupport() const +sal_Bool SfxStyleSheetBase::HasParentSupport() const { - return TRUE; + return sal_True; } // Basisvorlage uf NULL setzen m"oglich? Default: Nein -BOOL SfxStyleSheetBase::HasClearParentSupport() const +sal_Bool SfxStyleSheetBase::HasClearParentSupport() const { - return FALSE; + return sal_False; } // Defaultmaessig sind alle StyleSheets Used -BOOL SfxStyleSheetBase::IsUsed() const +sal_Bool SfxStyleSheetBase::IsUsed() const { - return TRUE; + return sal_True; } // eingestellte Attribute ausgeben @@ -417,30 +417,30 @@ SfxStyleFamily SfxStyleSheetIterator::GetSearchFamily() const return nSearchFamily; } -inline BOOL SfxStyleSheetIterator::IsTrivialSearch() +inline sal_Bool SfxStyleSheetIterator::IsTrivialSearch() { return nMask == 0xFFFF && GetSearchFamily() == SFX_STYLE_FAMILY_ALL; } -BOOL SfxStyleSheetIterator::DoesStyleMatch(SfxStyleSheetBase *pStyle) +sal_Bool SfxStyleSheetIterator::DoesStyleMatch(SfxStyleSheetBase *pStyle) { return ((GetSearchFamily() == SFX_STYLE_FAMILY_ALL) || ( pStyle->GetFamily() == GetSearchFamily() )) && (( pStyle->GetMask() & ( GetSearchMask() & ~SFXSTYLEBIT_USED )) || - ( bSearchUsed ? pStyle->IsUsed() : FALSE ) || + ( bSearchUsed ? pStyle->IsUsed() : sal_False ) || GetSearchMask() == SFXSTYLEBIT_ALL ); } SfxStyleSheetIterator::SfxStyleSheetIterator(SfxStyleSheetBasePool *pBase, - SfxStyleFamily eFam, USHORT n) + SfxStyleFamily eFam, sal_uInt16 n) { pBasePool=pBase; nSearchFamily=eFam; - bSearchUsed=FALSE; + bSearchUsed=sal_False; if((n != SFXSTYLEBIT_ALL ) && ((n & SFXSTYLEBIT_USED) == SFXSTYLEBIT_USED)) { - bSearchUsed = TRUE; + bSearchUsed = sal_True; n &= ~SFXSTYLEBIT_USED; } nMask=n; @@ -451,13 +451,13 @@ SfxStyleSheetIterator::~SfxStyleSheetIterator() } -USHORT SfxStyleSheetIterator::Count() +sal_uInt16 SfxStyleSheetIterator::Count() { - USHORT n = 0; + sal_uInt16 n = 0; if( IsTrivialSearch()) - n = (USHORT) pBasePool->aStyles.size(); + n = (sal_uInt16) pBasePool->aStyles.size(); else - for(USHORT i=0; i<pBasePool->aStyles.size(); i++) + for(sal_uInt16 i=0; i<pBasePool->aStyles.size(); i++) { SfxStyleSheetBase* pStyle = pBasePool->aStyles[i].get(); if(DoesStyleMatch(pStyle)) @@ -466,13 +466,13 @@ USHORT SfxStyleSheetIterator::Count() return n; } -SfxStyleSheetBase* SfxStyleSheetIterator::operator[](USHORT nIdx) +SfxStyleSheetBase* SfxStyleSheetIterator::operator[](sal_uInt16 nIdx) { if( IsTrivialSearch()) return pBasePool->aStyles[nIdx].get(); - USHORT z = 0; - for(USHORT n=0; n<pBasePool->aStyles.size(); n++) + sal_uInt16 z = 0; + for(sal_uInt16 n=0; n<pBasePool->aStyles.size(); n++) { SfxStyleSheetBase* pStyle = pBasePool->aStyles[n].get(); if( DoesStyleMatch(pStyle)) @@ -491,12 +491,12 @@ SfxStyleSheetBase* SfxStyleSheetIterator::operator[](USHORT nIdx) SfxStyleSheetBase* SfxStyleSheetIterator::First() { - INT32 nIdx = -1; + sal_Int32 nIdx = -1; if ( IsTrivialSearch() && pBasePool->aStyles.size() ) nIdx = 0; else - for( USHORT n = 0; n < pBasePool->aStyles.size(); n++ ) + for( sal_uInt16 n = 0; n < pBasePool->aStyles.size(); n++ ) { SfxStyleSheetBase* pStyle = pBasePool->aStyles[n].get(); @@ -509,7 +509,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::First() if ( nIdx != -1 ) { - nAktPosition = (USHORT)nIdx; + nAktPosition = (sal_uInt16)nIdx; return pAktStyle = pBasePool->aStyles[nIdx].get(); } return 0; @@ -518,13 +518,13 @@ SfxStyleSheetBase* SfxStyleSheetIterator::First() SfxStyleSheetBase* SfxStyleSheetIterator::Next() { - INT32 nIdx = -1; + sal_Int32 nIdx = -1; if ( IsTrivialSearch() && - (USHORT)pBasePool->aStyles.size() > nAktPosition + 1 ) + (sal_uInt16)pBasePool->aStyles.size() > nAktPosition + 1 ) nIdx = nAktPosition + 1; else - for( USHORT n = nAktPosition + 1; n < pBasePool->aStyles.size(); n++ ) + for( sal_uInt16 n = nAktPosition + 1; n < pBasePool->aStyles.size(); n++ ) { SfxStyleSheetBase* pStyle = pBasePool->aStyles[n].get(); @@ -537,7 +537,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Next() if ( nIdx != -1 ) { - nAktPosition = (USHORT)nIdx; + nAktPosition = (sal_uInt16)nIdx; return pAktStyle = pBasePool->aStyles[nIdx].get(); } return 0; @@ -546,11 +546,11 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Next() SfxStyleSheetBase* SfxStyleSheetIterator::Find(const XubString& rStr) { - for ( USHORT n = 0; n < pBasePool->aStyles.size(); n++ ) + for ( sal_uInt16 n = 0; n < pBasePool->aStyles.size(); n++ ) { SfxStyleSheetBase* pStyle = pBasePool->aStyles[n].get(); - // #98454# performance: in case of bSearchUsed==TRUE it may be + // #98454# performance: in case of bSearchUsed==sal_True it may be // significant to first compare the name and only if it matches to call // the style sheet IsUsed() method in DoesStyleMatch(). if ( pStyle->GetName().Equals( rStr ) && DoesStyleMatch( pStyle ) ) @@ -563,9 +563,9 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Find(const XubString& rStr) } -USHORT SfxStyleSheetIterator::GetSearchMask() const +sal_uInt16 SfxStyleSheetIterator::GetSearchMask() const { - USHORT mask = nMask; + sal_uInt16 mask = nMask; if ( bSearchUsed ) mask |= SFXSTYLEBIT_USED; @@ -637,7 +637,7 @@ SfxStyleSheetBasePool::~SfxStyleSheetBasePool() delete pImp; } -BOOL SfxStyleSheetBasePool::SetParent(SfxStyleFamily eFam, const XubString& rStyle, const XubString& rParent) +sal_Bool SfxStyleSheetBasePool::SetParent(SfxStyleFamily eFam, const XubString& rStyle, const XubString& rParent) { SfxStyleSheetIterator aIter(this,eFam,SFXSTYLEBIT_ALL); SfxStyleSheetBase *pStyle = @@ -646,16 +646,16 @@ BOOL SfxStyleSheetBasePool::SetParent(SfxStyleFamily eFam, const XubString& rSty if(pStyle) return pStyle->SetParent(rParent); else - return FALSE; + return sal_False; } -void SfxStyleSheetBasePool::SetSearchMask(SfxStyleFamily eFam, USHORT n) +void SfxStyleSheetBasePool::SetSearchMask(SfxStyleFamily eFam, sal_uInt16 n) { nSearchFamily = eFam; nMask = n; } -USHORT SfxStyleSheetBasePool::GetSearchMask() const +sal_uInt16 SfxStyleSheetBasePool::GetSearchMask() const { return nMask; } @@ -675,7 +675,7 @@ String SfxStyleSheetBasePool::GetStreamName() SfxStyleSheetIterator* SfxStyleSheetBasePool::CreateIterator ( SfxStyleFamily eFam, - USHORT mask + sal_uInt16 mask ) { return new SfxStyleSheetIterator(this,eFam,mask); @@ -686,7 +686,7 @@ SfxStyleSheetBase* SfxStyleSheetBasePool::Create ( const XubString& rName, SfxStyleFamily eFam, - USHORT mask + sal_uInt16 mask ) { return new SfxStyleSheetBase( rName, *this, eFam, mask ); @@ -697,7 +697,7 @@ SfxStyleSheetBase* SfxStyleSheetBasePool::Create( const SfxStyleSheetBase& r ) return new SfxStyleSheetBase( r ); } -SfxStyleSheetBase& SfxStyleSheetBasePool::Make( const XubString& rName, SfxStyleFamily eFam, USHORT mask, USHORT nPos) +SfxStyleSheetBase& SfxStyleSheetBasePool::Make( const XubString& rName, SfxStyleFamily eFam, sal_uInt16 mask, sal_uInt16 nPos) { DBG_ASSERT( eFam != SFX_STYLE_FAMILY_ALL, "svl::SfxStyleSheetBasePool::Make(), FamilyAll is not a allowed Familie" ); @@ -765,19 +765,19 @@ SfxStyleSheetBasePool& SfxStyleSheetBasePool::operator+=( const SfxStyleSheetBas //////////////////////////////// Suchen //////////////////////////////////// -USHORT SfxStyleSheetBasePool::Count() +sal_uInt16 SfxStyleSheetBasePool::Count() { return GetIterator_Impl().Count(); } -SfxStyleSheetBase *SfxStyleSheetBasePool::operator[](USHORT nIdx) +SfxStyleSheetBase *SfxStyleSheetBasePool::operator[](sal_uInt16 nIdx) { return GetIterator_Impl()[nIdx]; } SfxStyleSheetBase* SfxStyleSheetBasePool::Find(const XubString& rName, SfxStyleFamily eFam, - USHORT mask) + sal_uInt16 mask) { SfxStyleSheetIterator aIter(this,eFam,mask); return aIter.Find(rName); @@ -866,9 +866,9 @@ void SfxStyleSheetBasePool::Clear() void SfxStyleSheetBasePool::ChangeParent(const XubString& rOld, const XubString& rNew, - BOOL bVirtual) + sal_Bool bVirtual) { - const USHORT nTmpMask = GetSearchMask(); + const sal_uInt16 nTmpMask = GetSearchMask(); SetSearchMask(GetSearchFamily(), 0xffff); for( SfxStyleSheetBase* p = First(); p; p = Next() ) { @@ -885,7 +885,7 @@ void SfxStyleSheetBasePool::ChangeParent(const XubString& rOld, /////////////////////////// Laden/Speichern ///////////////////////////////// -void SfxStyleSheetBase::Load( SvStream&, USHORT ) +void SfxStyleSheetBase::Load( SvStream&, sal_uInt16 ) { } @@ -894,7 +894,7 @@ void SfxStyleSheetBase::Store( SvStream& ) } -BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) +sal_Bool SfxStyleSheetBasePool::Load( SvStream& rStream ) { // alte Version? if ( !rPool.IsVer2_Impl() ) @@ -909,7 +909,7 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) { SfxSingleRecordReader aHeaderRec( &rStream, SFX_STYLES_REC_HEADER ); if ( !aHeaderRec.IsValid() ) - return FALSE; + return sal_False; aAppName = rPool.GetName(); rStream >> nCharSet; @@ -920,15 +920,15 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) { SfxMultiRecordReader aStylesRec( &rStream, SFX_STYLES_REC_STYLES ); if ( !aStylesRec.IsValid() ) - return FALSE; + return sal_False; rtl_TextEncoding eEnc = GetSOLoadTextEncoding( (rtl_TextEncoding)nCharSet, - sal::static_int_cast< USHORT >(rStream.GetVersion()) ); + sal::static_int_cast< sal_uInt16 >(rStream.GetVersion()) ); rtl_TextEncoding eOldEnc = rStream.GetStreamCharSet(); rStream.SetStreamCharSet( eEnc ); - USHORT nStyles; + sal_uInt16 nStyles; for ( nStyles = 0; aStylesRec.GetContent(); nStyles++ ) { // kann nicht mehr weiterlesen? @@ -938,7 +938,7 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) // Globale Teile XubString aName, aParent, aFollow; String aHelpFile; - USHORT nFamily, nStyleMask,nCount; + sal_uInt16 nFamily, nStyleMask,nCount; sal_uInt32 nHelpId; rStream.ReadByteString(aName, eEnc ); rStream.ReadByteString(aParent, eEnc ); @@ -952,7 +952,7 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) // Hier erst einmal Parent und Follow zwischenspeichern rSheet.aParent = aParent; rSheet.aFollow = aFollow; - UINT32 nPos = rStream.Tell(); + sal_uInt32 nPos = rStream.Tell(); rStream >> nCount; if(nCount) { @@ -966,8 +966,8 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) //! rSet.Put( aTmpSet ); } // Lokale Teile - UINT32 nSize; - USHORT nVer; + sal_uInt32 nSize; + sal_uInt16 nVer; rStream >> nVer >> nSize; nPos = rStream.Tell() + nSize; rSheet.Load( rStream, nVer ); @@ -975,13 +975,13 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) } // #72939# only loop through the styles that were really inserted - ULONG n = aStyles.size(); + sal_uIntPtr n = aStyles.size(); //! delete pTmpPool; // Jetzt Parent und Follow setzen. Alle Sheets sind geladen. // Mit Setxxx() noch einmal den String eintragen, da diese // virtuellen Methoden evtl. ueberlagert sind. - for ( ULONG i = 0; i < n; i++ ) + for ( sal_uIntPtr i = 0; i < n; i++ ) { SfxStyleSheetBase* p = aStyles[ i ].get(); XubString aText = p->aParent; @@ -996,13 +996,13 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) } // alles klar? - return BOOL( rStream.GetError() == SVSTREAM_OK ); + return sal_Bool( rStream.GetError() == SVSTREAM_OK ); } -BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream ) +sal_Bool SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream ) { aAppName = rPool.GetName(); - USHORT nVersion; + sal_uInt16 nVersion; short nCharSet; rStream >> nVersion; @@ -1013,13 +1013,13 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream ) rtl_TextEncoding eEnc = GetSOLoadTextEncoding( (rtl_TextEncoding)nCharSet, - sal::static_int_cast< USHORT >(rStream.GetVersion()) ); + sal::static_int_cast< sal_uInt16 >(rStream.GetVersion()) ); rtl_TextEncoding eOldEnc = rStream.GetStreamCharSet(); rStream.SetStreamCharSet( eEnc ); - USHORT nStyles; + sal_uInt16 nStyles; rStream >> nStyles; - USHORT i; + sal_uInt16 i; for ( i = 0; i < nStyles; i++ ) { // kann nicht mehr weiterlesen? @@ -1032,7 +1032,7 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream ) // Globale Teile XubString aName, aParent, aFollow; String aHelpFile; - USHORT nFamily, nStyleMask,nCount; + sal_uInt16 nFamily, nStyleMask,nCount; sal_uInt32 nHelpId; rStream.ReadByteString(aName, eEnc ); rStream.ReadByteString(aParent, eEnc ); @@ -1041,7 +1041,7 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream ) SfxPoolItem::readByteString(rStream, aHelpFile); if(nVersion!=STYLESTREAM_VERSION) { - USHORT nTmpHelpId; + sal_uInt16 nTmpHelpId; rStream >> nTmpHelpId; nHelpId=nTmpHelpId; } @@ -1053,7 +1053,7 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream ) // Hier erst einmal Parent und Follow zwischenspeichern rSheet.aParent = aParent; rSheet.aFollow = aFollow; - UINT32 nPos = rStream.Tell(); + sal_uInt32 nPos = rStream.Tell(); rStream >> nCount; if(nCount) { rStream.Seek( nPos ); @@ -1066,8 +1066,8 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream ) //! rSet.Put( aTmpSet ); } // Lokale Teile - UINT32 nSize; - USHORT nVer; + sal_uInt32 nSize; + sal_uInt16 nVer; rStream >> nVer >> nSize; nPos = rStream.Tell() + nSize; rSheet.Load( rStream, nVer ); @@ -1091,16 +1091,16 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream ) rStream.SetStreamCharSet( eOldEnc ); - return BOOL( rStream.GetError() == SVSTREAM_OK ); + return sal_Bool( rStream.GetError() == SVSTREAM_OK ); } -BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed ) +sal_Bool SfxStyleSheetBasePool::Store( SvStream& rStream, sal_Bool bUsed ) { // den ganzen StyleSheet-Pool in einen Mini-Record SfxMiniRecordWriter aPoolRec( &rStream, SFX_STYLES_REC ); // Erst einmal die Dummies rauszaehlen; die werden nicht gespeichert - USHORT nCount = 0; + sal_uInt16 nCount = 0; for( SfxStyleSheetBase* p = First(); p; p = Next() ) { if(!bUsed || p->IsUsed()) @@ -1111,7 +1111,7 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed ) rtl_TextEncoding eEnc = ::GetSOStoreTextEncoding( rStream.GetStreamCharSet(), - sal::static_int_cast< USHORT >(rStream.GetVersion()) ); + sal::static_int_cast< sal_uInt16 >(rStream.GetVersion()) ); rtl_TextEncoding eOldEnc = rStream.GetStreamCharSet(); rStream.SetStreamCharSet( eEnc ); @@ -1138,7 +1138,7 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed ) { if(!bUsed || p->IsUsed()) { - USHORT nFamily = (USHORT)p->GetFamily(); + sal_uInt16 nFamily = (sal_uInt16)p->GetFamily(); String* pName = new String( p->GetName() ); ByteString* pConvName = new ByteString( *pName, eEnc ); @@ -1150,7 +1150,7 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed ) pConvName->SetChar( 1, sal::static_int_cast< char >(0xff & nFamily) ); - USHORT nInsPos, nAdd = aSortConvNames.Count(); + sal_uInt16 nInsPos, nAdd = aSortConvNames.Count(); while( !aSortConvNames.Insert( pConvName, nInsPos ) ) (pConvName->Append( '_' )).Append( ByteString::CreateFromInt32( nAdd++ )); @@ -1161,9 +1161,9 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed ) // now we have the list of the names, sorted by convertede names // But now we need the sorted list of orignames. { - USHORT nInsPos, nEnd = aOrigNames.Count(); + sal_uInt16 nInsPos, nEnd = aOrigNames.Count(); const ByteStringPtr* ppB = aSortConvNames.GetData(); - for( USHORT n = 0; n < nEnd; ++n, ++ppB ) + for( sal_uInt16 n = 0; n < nEnd; ++n, ++ppB ) { String* p = aOrigNames.GetObject( n ); aSortOrigNames.Insert( p, nInsPos ); @@ -1175,7 +1175,7 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed ) ByteString sEmpty; - USHORT nFndPos; + sal_uInt16 nFndPos; String sNm; SfxMultiVarRecordWriter aStylesRec( &rStream, SFX_STYLES_REC_STYLES, 0 ); for( SfxStyleSheetBase* p = First(); p; p = Next() ) @@ -1187,7 +1187,7 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed ) // Globale Teile speichern String aHelpFile; sal_uInt32 nHelpId = p->GetHelpId( aHelpFile ); - USHORT nFamily = sal::static_int_cast< USHORT >(p->GetFamily()); + sal_uInt16 nFamily = sal::static_int_cast< sal_uInt16 >(p->GetFamily()); String sFamily( (sal_Unicode)nFamily ); (sNm = sFamily) += p->GetName(); @@ -1214,18 +1214,18 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed ) if(p->pSet) p->pSet->Store( rStream ); else - rStream << (USHORT)0; + rStream << (sal_uInt16)0; // Lokale Teile speichern // Vor dem lokalen Teil wird die Laenge der lokalen Daten - // als UINT32 sowie die Versionsnummer gespeichert. - rStream << (USHORT) p->GetVersion(); - ULONG nPos1 = rStream.Tell(); - rStream << (UINT32) 0; + // als sal_uInt32 sowie die Versionsnummer gespeichert. + rStream << (sal_uInt16) p->GetVersion(); + sal_uIntPtr nPos1 = rStream.Tell(); + rStream << (sal_uInt32) 0; p->Store( rStream ); - ULONG nPos2 = rStream.Tell(); + sal_uIntPtr nPos2 = rStream.Tell(); rStream.Seek( nPos1 ); - rStream << (UINT32) ( nPos2 - nPos1 - sizeof( UINT32 ) ); + rStream << (sal_uInt32) ( nPos2 - nPos1 - sizeof( sal_uInt32 ) ); rStream.Seek( nPos2 ); if( rStream.GetError() != SVSTREAM_OK ) break; @@ -1235,7 +1235,7 @@ BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed ) rStream.SetStreamCharSet( eOldEnc ); - return BOOL( rStream.GetError() == SVSTREAM_OK ); + return sal_Bool( rStream.GetError() == SVSTREAM_OK ); } SfxItemPool& SfxStyleSheetBasePool::GetPool() @@ -1253,7 +1253,7 @@ const SfxItemPool& SfxStyleSheetBasePool::GetPool() const SfxStyleSheet::SfxStyleSheet(const XubString &rName, const SfxStyleSheetBasePool& r_Pool, SfxStyleFamily eFam, - USHORT mask ): + sal_uInt16 mask ): SfxStyleSheetBase(rName, const_cast< SfxStyleSheetBasePool& >( r_Pool ), eFam, mask) {} @@ -1273,10 +1273,10 @@ SfxStyleSheet::~SfxStyleSheet() } -BOOL SfxStyleSheet::SetParent( const XubString& rName ) +sal_Bool SfxStyleSheet::SetParent( const XubString& rName ) { if(aParent == rName) - return TRUE; + return sal_True; const XubString aOldParent(aParent); if(SfxStyleSheetBase::SetParent(rName)) { // aus der Benachrichtigungskette des alten @@ -1293,9 +1293,9 @@ BOOL SfxStyleSheet::SetParent( const XubString& rName ) if(pParent) StartListening(*pParent); } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // alle Zuhoerer benachtichtigen @@ -1315,7 +1315,7 @@ SfxStyleSheetPool::SfxStyleSheetPool( SfxItemPool const& rSet) /////////////////////////////////// Factory //////////////////////////////// SfxStyleSheetBase* SfxStyleSheetPool::Create( const XubString& rName, - SfxStyleFamily eFam, USHORT mask ) + SfxStyleFamily eFam, sal_uInt16 mask ) { return new SfxStyleSheet( rName, *this, eFam, mask ); } @@ -1325,9 +1325,9 @@ SfxStyleSheetBase* SfxStyleSheetPool::Create( const SfxStyleSheet& r ) return new SfxStyleSheet( r ); } /* -BOOL SfxStyleSheetPool::CopyTo(SfxStyleSheetPool &, const String &) +sal_Bool SfxStyleSheetPool::CopyTo(SfxStyleSheetPool &, const String &) { - return FALSE; + return sal_False; } */ @@ -1335,7 +1335,7 @@ BOOL SfxStyleSheetPool::CopyTo(SfxStyleSheetPool &, const String &) // class SfxUnoStyleSheet // -------------------------------------------------------------------- -SfxUnoStyleSheet::SfxUnoStyleSheet( const UniString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, USHORT _nMaske ) +SfxUnoStyleSheet::SfxUnoStyleSheet( const UniString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, sal_uInt16 _nMaske ) : ::cppu::ImplInheritanceHelper2< SfxStyleSheet, ::com::sun::star::style::XStyle, ::com::sun::star::lang::XUnoTunnel >( _rName, _rPool, _eFamily, _nMaske ) { } |