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 243ab85019a0..adb7efa7b260 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -53,7 +53,7 @@ #include <algorithm> #define STYLESTREAM "SfxStyleSheets" -#define STYLESTREAM_VERSION USHORT(50) +#define STYLESTREAM_VERSION sal_uInt16(50) #ifdef DBG_UTIL class DbgStyleSheetReferences @@ -85,7 +85,7 @@ TYPEINIT1(SfxStyleSheetPoolHint, SfxHint); SfxStyleSheetHintExtended::SfxStyleSheetHintExtended ( - USHORT nAction, // SFX_STYLESHEET_... (s.o.) + sal_uInt16 nAction, // SFX_STYLESHEET_... (s.o.) const String& rOldName ) : SfxStyleSheetHint( nAction ), @@ -93,7 +93,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 ) @@ -105,7 +105,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 ), @@ -114,7 +114,7 @@ SfxStyleSheetHint::SfxStyleSheetHint SfxStyleSheetHint::SfxStyleSheetHint ( - USHORT nAction // SFX_STYLESHEET_... (s.o.) + sal_uInt16 nAction // SFX_STYLESHEET_... (s.o.) ) : pStyleSh( NULL ), nHint( nAction ) @@ -136,7 +136,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 ) @@ -145,7 +145,7 @@ SfxStyleSheetBase::SfxStyleSheetBase( const XubString& rName, SfxStyleSheetBaseP , pSet( NULL ) , nMask(mask) , nHelpId( 0 ) - , bMySet( FALSE ) + , bMySet( sal_False ) { #ifdef DBG_UTIL aDbgStyleSheetReferences.mnStyles++; @@ -205,7 +205,7 @@ SfxStyleSheetBase::~SfxStyleSheetBase() } } -USHORT SfxStyleSheetBase::GetVersion() const +sal_uInt16 SfxStyleSheetBase::GetVersion() const { return 0x0000; } @@ -217,24 +217,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; @@ -242,7 +242,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 @@ -269,10 +269,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 ) { @@ -280,20 +280,20 @@ BOOL SfxStyleSheetBase::SetParent( const XubString& rName ) if( rName.Len() && !pIter ) { OSL_FAIL( "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 @@ -303,19 +303,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 ) ) { OSL_FAIL( "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. @@ -325,20 +325,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_uLong SfxStyleSheetBase::GetHelpId( String& rFile ) { rFile = aHelpFile; return nHelpId; } -void SfxStyleSheetBase::SetHelpId( const String& rFile, ULONG nId ) +void SfxStyleSheetBase::SetHelpId( const String& rFile, sal_uLong nId ) { aHelpFile = rFile; nHelpId = nId; @@ -346,30 +346,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 @@ -416,30 +416,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; @@ -450,13 +450,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)) @@ -465,13 +465,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)) @@ -490,12 +490,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(); @@ -508,7 +508,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::First() if ( nIdx != -1 ) { - nAktPosition = (USHORT)nIdx; + nAktPosition = (sal_uInt16)nIdx; return pAktStyle = pBasePool->aStyles[nIdx].get(); } return 0; @@ -517,13 +517,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(); @@ -536,7 +536,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Next() if ( nIdx != -1 ) { - nAktPosition = (USHORT)nIdx; + nAktPosition = (sal_uInt16)nIdx; return pAktStyle = pBasePool->aStyles[nIdx].get(); } return 0; @@ -545,11 +545,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 ) ) @@ -562,9 +562,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; @@ -636,7 +636,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 = @@ -645,16 +645,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; } @@ -674,7 +674,7 @@ String SfxStyleSheetBasePool::GetStreamName() SfxStyleSheetIterator* SfxStyleSheetBasePool::CreateIterator ( SfxStyleFamily eFam, - USHORT mask + sal_uInt16 mask ) { return new SfxStyleSheetIterator(this,eFam,mask); @@ -685,7 +685,7 @@ SfxStyleSheetBase* SfxStyleSheetBasePool::Create ( const XubString& rName, SfxStyleFamily eFam, - USHORT mask + sal_uInt16 mask ) { return new SfxStyleSheetBase( rName, *this, eFam, mask ); @@ -696,7 +696,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) { OSL_ENSURE( eFam != SFX_STYLE_FAMILY_ALL, "svl::SfxStyleSheetBasePool::Make(), FamilyAll is not a allowed Familie" ); @@ -764,19 +764,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); @@ -867,9 +867,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() ) { @@ -886,7 +886,7 @@ void SfxStyleSheetBasePool::ChangeParent(const XubString& rOld, /////////////////////////// Laden/Speichern ///////////////////////////////// -void SfxStyleSheetBase::Load( SvStream&, USHORT ) +void SfxStyleSheetBase::Load( SvStream&, sal_uInt16 ) { } @@ -895,7 +895,7 @@ void SfxStyleSheetBase::Store( SvStream& ) } -BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) +sal_Bool SfxStyleSheetBasePool::Load( SvStream& rStream ) { // alte Version? if ( !rPool.IsVer2_Impl() ) @@ -910,7 +910,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; @@ -921,15 +921,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? @@ -939,7 +939,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 ); @@ -953,7 +953,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) { @@ -967,8 +967,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 ); @@ -976,13 +976,13 @@ BOOL SfxStyleSheetBasePool::Load( SvStream& rStream ) } // #72939# only loop through the styles that were really inserted - ULONG n = aStyles.size(); + sal_uLong 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_uLong i = 0; i < n; i++ ) { SfxStyleSheetBase* p = aStyles[ i ].get(); XubString aText = p->aParent; @@ -997,13 +997,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; @@ -1014,13 +1014,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? @@ -1033,7 +1033,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 ); @@ -1042,7 +1042,7 @@ BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream ) SfxPoolItem::readByteString(rStream, aHelpFile); if(nVersion!=STYLESTREAM_VERSION) { - USHORT nTmpHelpId; + sal_uInt16 nTmpHelpId; rStream >> nTmpHelpId; nHelpId=nTmpHelpId; } @@ -1054,7 +1054,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 ); @@ -1067,8 +1067,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 ); @@ -1092,16 +1092,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()) @@ -1112,7 +1112,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 ); @@ -1139,7 +1139,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 ); @@ -1151,7 +1151,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++ )); @@ -1162,9 +1162,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 ); @@ -1176,7 +1176,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() ) @@ -1188,7 +1188,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(); @@ -1215,18 +1215,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_uLong nPos1 = rStream.Tell(); + rStream << (sal_uInt32) 0; p->Store( rStream ); - ULONG nPos2 = rStream.Tell(); + sal_uLong 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; @@ -1236,7 +1236,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() @@ -1254,7 +1254,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) {} @@ -1274,10 +1274,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 @@ -1294,9 +1294,9 @@ BOOL SfxStyleSheet::SetParent( const XubString& rName ) if(pParent) StartListening(*pParent); } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // alle Zuhoerer benachtichtigen @@ -1316,7 +1316,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 ); } @@ -1326,9 +1326,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; } */ @@ -1336,7 +1336,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 ) { } |