diff options
Diffstat (limited to 'sw/source/core/fields/authfld.cxx')
-rw-r--r-- | sw/source/core/fields/authfld.cxx | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index 7e32e2f09b..d88ccdb14b 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -83,16 +83,16 @@ SV_IMPL_PTRARR( SortKeyArr, TOXSortKeyPtr ) SwAuthEntry::SwAuthEntry(const SwAuthEntry& rCopy) : nRefCount(0) { - for(USHORT i = 0; i < AUTH_FIELD_END; i++) + for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++) aAuthFields[i] = rCopy.aAuthFields[i]; } // -------------------------------------------------------- -BOOL SwAuthEntry::operator==(const SwAuthEntry& rComp) +sal_Bool SwAuthEntry::operator==(const SwAuthEntry& rComp) { - for(USHORT i = 0; i < AUTH_FIELD_END; i++) + for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++) if(aAuthFields[i] != rComp.aAuthFields[i]) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } // -------------------------------------------------------- @@ -107,8 +107,8 @@ SwAuthorityFieldType::SwAuthorityFieldType(SwDoc* pDoc) m_pSortKeyArr(new SortKeyArr(3, 3)), m_cPrefix('['), m_cSuffix(']'), - m_bIsSequence(FALSE), - m_bSortByDocument(TRUE), + m_bIsSequence(sal_False), + m_bSortByDocument(sal_True), m_eLanguage((LanguageType)::GetAppLanguage()) { } @@ -125,7 +125,7 @@ SwAuthorityFieldType::SwAuthorityFieldType( const SwAuthorityFieldType& rFType) m_eLanguage(rFType.m_eLanguage), m_sSortAlgorithm(rFType.m_sSortAlgorithm) { - for(USHORT i = 0; i < rFType.m_pSortKeyArr->Count(); i++) + for(sal_uInt16 i = 0; i < rFType.m_pSortKeyArr->Count(); i++) m_pSortKeyArr->Insert((*rFType.m_pSortKeyArr)[i], i); } @@ -153,16 +153,16 @@ SwFieldType* SwAuthorityFieldType::Copy() const void SwAuthorityFieldType::RemoveField(long nHandle) { #ifdef DBG_UTIL - BOOL bRemoved = FALSE; + sal_Bool bRemoved = sal_False; #endif - for(USHORT j = 0; j < m_pDataArr->Count(); j++) + for(sal_uInt16 j = 0; j < m_pDataArr->Count(); j++) { SwAuthEntry* pTemp = m_pDataArr->GetObject(j); long nRet = (long)(void*)pTemp; if(nRet == nHandle) { #ifdef DBG_UTIL - bRemoved = TRUE; + bRemoved = sal_True; #endif pTemp->RemoveRef(); if(!pTemp->GetRefCount()) @@ -185,11 +185,11 @@ long SwAuthorityFieldType::AddField(const String& rFieldContents) { long nRet = 0; SwAuthEntry* pEntry = new SwAuthEntry; - for( USHORT i = 0; i < AUTH_FIELD_END; ++i ) + for( sal_uInt16 i = 0; i < AUTH_FIELD_END; ++i ) pEntry->SetAuthorField( (ToxAuthorityField)i, rFieldContents.GetToken( i, TOX_STYLE_DELIMITER )); - for(USHORT j = 0; j < m_pDataArr->Count() && pEntry; j++) + for(sal_uInt16 j = 0; j < m_pDataArr->Count() && pEntry; j++) { SwAuthEntry* pTemp = m_pDataArr->GetObject(j); if(*pTemp == *pEntry) @@ -213,16 +213,16 @@ long SwAuthorityFieldType::AddField(const String& rFieldContents) /* -----------------17.09.99 14:18------------------- --------------------------------------------------*/ -BOOL SwAuthorityFieldType::AddField(long nHandle) +sal_Bool SwAuthorityFieldType::AddField(long nHandle) { - BOOL bRet = FALSE; - for( USHORT j = 0; j < m_pDataArr->Count(); j++ ) + sal_Bool bRet = sal_False; + for( sal_uInt16 j = 0; j < m_pDataArr->Count(); j++ ) { SwAuthEntry* pTemp = m_pDataArr->GetObject(j); long nTmp = (long)(void*)pTemp; if( nTmp == nHandle ) { - bRet = TRUE; + bRet = sal_True; pTemp->AddRef(); //re-generate positions of the fields DelSequenceArray(); @@ -238,7 +238,7 @@ BOOL SwAuthorityFieldType::AddField(long nHandle) const SwAuthEntry* SwAuthorityFieldType::GetEntryByHandle(long nHandle) const { const SwAuthEntry* pRet = 0; - for(USHORT j = 0; j < m_pDataArr->Count(); j++) + for(sal_uInt16 j = 0; j < m_pDataArr->Count(); j++) { const SwAuthEntry* pTemp = m_pDataArr->GetObject(j); long nTmp = (long)(void*)pTemp; @@ -257,7 +257,7 @@ const SwAuthEntry* SwAuthorityFieldType::GetEntryByHandle(long nHandle) const void SwAuthorityFieldType::GetAllEntryIdentifiers( SvStringsDtor& rToFill )const { - for(USHORT j = 0; j < m_pDataArr->Count(); j++) + for(sal_uInt16 j = 0; j < m_pDataArr->Count(); j++) { SwAuthEntry* pTemp = m_pDataArr->GetObject(j); rToFill.Insert( new String( pTemp->GetAuthorField( @@ -271,7 +271,7 @@ const SwAuthEntry* SwAuthorityFieldType::GetEntryByIdentifier( const String& rIdentifier)const { const SwAuthEntry* pRet = 0; - for( USHORT j = 0; j < m_pDataArr->Count(); ++j ) + for( sal_uInt16 j = 0; j < m_pDataArr->Count(); ++j ) { const SwAuthEntry* pTemp = m_pDataArr->GetObject(j); if( rIdentifier == pTemp->GetAuthorField( AUTH_FIELD_IDENTIFIER )) @@ -288,13 +288,13 @@ const SwAuthEntry* SwAuthorityFieldType::GetEntryByIdentifier( bool SwAuthorityFieldType::ChangeEntryContent(const SwAuthEntry* pNewEntry) { bool bChanged = false; - for( USHORT j = 0; j < m_pDataArr->Count(); ++j ) + for( sal_uInt16 j = 0; j < m_pDataArr->Count(); ++j ) { SwAuthEntry* pTemp = m_pDataArr->GetObject(j); if(pTemp->GetAuthorField(AUTH_FIELD_IDENTIFIER) == pNewEntry->GetAuthorField(AUTH_FIELD_IDENTIFIER)) { - for(USHORT i = 0; i < AUTH_FIELD_END; i++) + for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++) pTemp->SetAuthorField((ToxAuthorityField) i, pNewEntry->GetAuthorField((ToxAuthorityField)i)); bChanged = true; @@ -307,9 +307,9 @@ bool SwAuthorityFieldType::ChangeEntryContent(const SwAuthEntry* pNewEntry) Description: appends a new entry (if new) and returns the array position -----------------------------------------------------------------------*/ -USHORT SwAuthorityFieldType::AppendField( const SwAuthEntry& rInsert ) +sal_uInt16 SwAuthorityFieldType::AppendField( const SwAuthEntry& rInsert ) { - USHORT nRet = 0; + sal_uInt16 nRet = 0; for( nRet = 0; nRet < m_pDataArr->Count(); ++nRet ) { SwAuthEntry* pTemp = m_pDataArr->GetObject( nRet ); @@ -330,7 +330,7 @@ USHORT SwAuthorityFieldType::AppendField( const SwAuthEntry& rInsert ) /*-- 11.10.99 08:49:24--------------------------------------------------- -----------------------------------------------------------------------*/ -long SwAuthorityFieldType::GetHandle(USHORT nPos) +long SwAuthorityFieldType::GetHandle(sal_uInt16 nPos) { long nRet = 0; if( nPos < m_pDataArr->Count() ) @@ -343,7 +343,7 @@ long SwAuthorityFieldType::GetHandle(USHORT nPos) /* -----------------19.10.99 13:46------------------- --------------------------------------------------*/ -USHORT SwAuthorityFieldType::GetSequencePos(long nHandle) +sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle) { //find the field in a sorted array of handles, #ifdef DBG_UTIL @@ -417,7 +417,7 @@ USHORT SwAuthorityFieldType::GetSequencePos(long nHandle) } } - for(USHORT i = 0; i < aSortArr.Count(); i++) + for(sal_uInt16 i = 0; i < aSortArr.Count(); i++) { const SwTOXSortTabBase& rBase = *aSortArr[i]; SwFmtFld& rFmtFld = ((SwTOXAuthority&)rBase).GetFldFmt(); @@ -427,8 +427,8 @@ USHORT SwAuthorityFieldType::GetSequencePos(long nHandle) aSortArr.DeleteAndDestroy(0, aSortArr.Count()); } //find nHandle - USHORT nRet = 0; - for(USHORT i = 0; i < m_pSequArr->Count(); i++) + sal_uInt16 nRet = 0; + for(sal_uInt16 i = 0; i < m_pSequArr->Count(); i++) { if((*m_pSequArr)[i] == nHandle) { @@ -442,7 +442,7 @@ USHORT SwAuthorityFieldType::GetSequencePos(long nHandle) /* -----------------------------15.11.00 17:33-------------------------------- ---------------------------------------------------------------------------*/ -BOOL SwAuthorityFieldType::QueryValue( Any& rVal, USHORT nWhichId ) const +sal_Bool SwAuthorityFieldType::QueryValue( Any& rVal, sal_uInt16 nWhichId ) const { switch( nWhichId ) { @@ -494,14 +494,14 @@ BOOL SwAuthorityFieldType::QueryValue( Any& rVal, USHORT nWhichId ) const default: DBG_ERROR("illegal property"); } - return TRUE; + return sal_True; } /* -----------------------------15.11.00 17:33-------------------------------- ---------------------------------------------------------------------------*/ -BOOL SwAuthorityFieldType::PutValue( const Any& rAny, USHORT nWhichId ) +sal_Bool SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId ) { - sal_Bool bRet = TRUE; + sal_Bool bRet = sal_True; String sTmp; switch( nWhichId ) { @@ -554,7 +554,7 @@ BOOL SwAuthorityFieldType::PutValue( const Any& rAny, USHORT nWhichId ) if(nVal >= 0 && nVal < AUTH_FIELD_END) pSortKey->eField = (ToxAuthorityField) nVal; else - bRet = FALSE; + bRet = sal_False; } else if(pValue[j].Name.equalsAsciiL(SW_PROP_NAME(UNO_NAME_IS_SORT_ASCENDING))) { @@ -583,14 +583,14 @@ void SwAuthorityFieldType::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) /* -----------------20.10.99 13:38------------------- --------------------------------------------------*/ -USHORT SwAuthorityFieldType::GetSortKeyCount() const +sal_uInt16 SwAuthorityFieldType::GetSortKeyCount() const { return m_pSortKeyArr->Count(); } /* -----------------20.10.99 13:38------------------- --------------------------------------------------*/ -const SwTOXSortKey* SwAuthorityFieldType::GetSortKey(USHORT nIdx) const +const SwTOXSortKey* SwAuthorityFieldType::GetSortKey(sal_uInt16 nIdx) const { SwTOXSortKey* pRet = 0; if(m_pSortKeyArr->Count() > nIdx) @@ -601,11 +601,11 @@ const SwTOXSortKey* SwAuthorityFieldType::GetSortKey(USHORT nIdx) const /* -----------------20.10.99 13:38------------------- --------------------------------------------------*/ -void SwAuthorityFieldType::SetSortKeys(USHORT nKeyCount, SwTOXSortKey aKeys[]) +void SwAuthorityFieldType::SetSortKeys(sal_uInt16 nKeyCount, SwTOXSortKey aKeys[]) { m_pSortKeyArr->DeleteAndDestroy(0, m_pSortKeyArr->Count()); - USHORT nArrIdx = 0; - for(USHORT i = 0; i < nKeyCount; i++) + sal_uInt16 nArrIdx = 0; + for(sal_uInt16 i = 0; i < nKeyCount; i++) if(aKeys[i].eField < AUTH_FIELD_END) m_pSortKeyArr->Insert(new SwTOXSortKey(aKeys[i]), nArrIdx++); } @@ -742,13 +742,13 @@ const char* aFieldNames[] = /* -----------------------------16.11.00 12:27-------------------------------- ---------------------------------------------------------------------------*/ -BOOL SwAuthorityField::QueryValue( Any& rAny, USHORT /*nWhichId*/ ) const +sal_Bool SwAuthorityField::QueryValue( Any& rAny, sal_uInt16 /*nWhichId*/ ) const { if(!GetTyp()) - return FALSE; + return sal_False; const SwAuthEntry* pAuthEntry = ((SwAuthorityFieldType*)GetTyp())->GetEntryByHandle(m_nHandle); if(!pAuthEntry) - return FALSE; + return sal_False; Sequence <PropertyValue> aRet(AUTH_FIELD_END); PropertyValue* pValues = aRet.getArray(); for(sal_Int16 i = 0; i < AUTH_FIELD_END; i++) @@ -761,7 +761,7 @@ BOOL SwAuthorityField::QueryValue( Any& rAny, USHORT /*nWhichId*/ ) const pValues[i].Value <<= OUString(rField); } rAny <<= aRet; - return FALSE; + return sal_False; } /* -----------------------------15.11.00 17:33-------------------------------- @@ -774,14 +774,14 @@ sal_Int16 lcl_Find(const OUString& rFieldName) return -1; } //---------------------------------------------------------------------------- -BOOL SwAuthorityField::PutValue( const Any& rAny, USHORT /*nWhichId*/ ) +sal_Bool SwAuthorityField::PutValue( const Any& rAny, sal_uInt16 /*nWhichId*/ ) { if(!GetTyp() || !((SwAuthorityFieldType*)GetTyp())->GetEntryByHandle(m_nHandle)) - return FALSE; + return sal_False; Sequence <PropertyValue> aParam; if(!(rAny >>= aParam)) - return FALSE; + return sal_False; String sToSet; sToSet.Fill(AUTH_FIELD_ISBN, TOX_STYLE_DELIMITER); @@ -807,7 +807,7 @@ BOOL SwAuthorityField::PutValue( const Any& rAny, USHORT /*nWhichId*/ ) ((SwAuthorityFieldType*)GetTyp())->RemoveField(m_nHandle); m_nHandle = ((SwAuthorityFieldType*)GetTyp())->AddField(sToSet); - return FALSE; + return sal_False; } /* -----------------11.10.99 09:43------------------- @@ -820,7 +820,7 @@ SwFieldType* SwAuthorityField::ChgTyp( SwFieldType* pFldTyp ) { const SwAuthEntry* pEntry = pSrcTyp->GetEntryByHandle( m_nHandle ); - USHORT nHdlPos = pDstTyp->AppendField( *pEntry ); + sal_uInt16 nHdlPos = pDstTyp->AppendField( *pEntry ); pSrcTyp->RemoveField( m_nHandle ); m_nHandle = pDstTyp->GetHandle( nHdlPos ); pDstTyp->AddField( m_nHandle ); |