diff options
Diffstat (limited to 'sw/source/core/tox/txmsrt.cxx')
-rw-r--r-- | sw/source/core/tox/txmsrt.cxx | 108 |
1 files changed, 56 insertions, 52 deletions
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index a5bf52ebc4b0..38b143db6825 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -54,7 +54,7 @@ #include <comcore.hrc> #include <numrule.hxx> -extern BOOL IsFrameBehind( const SwTxtNode& rMyNd, xub_StrLen nMySttPos, +extern sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, xub_StrLen nMySttPos, const SwTxtNode& rBehindNd, xub_StrLen nSttPos ); using namespace ::com::sun::star; @@ -64,12 +64,12 @@ using ::rtl::OUString; Beschreibung: Strings initialisieren --------------------------------------------------------------------*/ -USHORT SwTOXSortTabBase::nOpt = 0; +sal_uInt16 SwTOXSortTabBase::nOpt = 0; SV_IMPL_VARARR( SwTOXSources, SwTOXSource ) -SwTOXInternational::SwTOXInternational( LanguageType nLang, USHORT nOpt, +SwTOXInternational::SwTOXInternational( LanguageType nLang, sal_uInt16 nOpt, const String& rSortAlgorithm ) : eLang( nLang ), sSortAlgorithm(rSortAlgorithm), @@ -119,7 +119,7 @@ String SwTOXInternational::ToUpper( const String& rStr, xub_StrLen nPos ) const { return pCharClass->toUpper( rStr, nPos, 1 ); } -inline BOOL SwTOXInternational::IsNumeric( const String& rStr ) const +inline sal_Bool SwTOXInternational::IsNumeric( const String& rStr ) const { return pCharClass->isNumeric( rStr ); } @@ -139,7 +139,7 @@ String SwTOXInternational::GetIndexKey( const String& rTxt, const String& rTxtRe return pIndexWrapper->GetIndexKey( rTxt, rTxtReading, rLocale ); } -String SwTOXInternational::GetFollowingText( BOOL bMorePages ) const +String SwTOXInternational::GetFollowingText( sal_Bool bMorePages ) const { return pIndexWrapper->GetFollowingText( bMorePages ); } @@ -154,7 +154,7 @@ SwTOXSortTabBase::SwTOXSortTabBase( TOXSortType nTyp, const SwCntntNode* pNd, const SwTOXInternational* pInter, const lang::Locale* pLocale ) : pTOXNd( 0 ), pTxtMark( pMark ), pTOXIntl( pInter ), - nPos( 0 ), nCntPos( 0 ), nType( static_cast<USHORT>(nTyp) ), bValidTxt( FALSE ) + nPos( 0 ), nCntPos( 0 ), nType( static_cast<sal_uInt16>(nTyp) ), bValidTxt( sal_False ) { if ( pLocale ) aLocale = *pLocale; @@ -165,7 +165,7 @@ SwTOXSortTabBase::SwTOXSortTabBase( TOXSortType nTyp, const SwCntntNode* pNd, if( pTxtMark ) n = *pTxtMark->GetStart(); SwTOXSource aTmp( pNd, n, - pTxtMark ? pTxtMark->GetTOXMark().IsMainEntry() : FALSE ); + pTxtMark ? pTxtMark->GetTOXMark().IsMainEntry() : sal_False ); aTOXSources.Insert( aTmp, aTOXSources.Count() ); nPos = pNd->GetIndex(); @@ -181,7 +181,11 @@ SwTOXSortTabBase::SwTOXSortTabBase( TOXSortType nTyp, const SwCntntNode* pNd, { // dann die "Anker" (Body) Position holen. Point aPt; +<<<<<<< local const SwCntntFrm* pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE ); +======= + const SwCntntFrm* pFrm = pNd->GetFrm( &aPt, 0, sal_False ); +>>>>>>> other if( pFrm ) { SwPosition aPos( *pNd ); @@ -211,7 +215,7 @@ String SwTOXSortTabBase::GetURL() const } void SwTOXSortTabBase::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, - USHORT ) const + sal_uInt16 ) const { String sMyTxt; String sMyTxtReading; @@ -221,9 +225,9 @@ void SwTOXSortTabBase::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, rNd.InsertText( sMyTxt, rInsPos ); } -BOOL SwTOXSortTabBase::operator==( const SwTOXSortTabBase& rCmp ) +sal_Bool SwTOXSortTabBase::operator==( const SwTOXSortTabBase& rCmp ) { - BOOL bRet = nPos == rCmp.nPos && nCntPos == rCmp.nCntPos && + sal_Bool bRet = nPos == rCmp.nPos && nCntPos == rCmp.nCntPos && (!aTOXSources[0].pNd || !rCmp.aTOXSources[0].pNd || aTOXSources[0].pNd == rCmp.aTOXSources[0].pNd ); @@ -255,15 +259,15 @@ BOOL SwTOXSortTabBase::operator==( const SwTOXSortTabBase& rCmp ) return bRet; } -BOOL SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp ) +sal_Bool SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp ) { if( nPos < rCmp.nPos ) - return TRUE; + return sal_True; if( nPos == rCmp.nPos ) { if( nCntPos < rCmp.nCntPos ) - return TRUE; + return sal_True; if( nCntPos == rCmp.nCntPos ) { @@ -275,7 +279,7 @@ BOOL SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp ) if( TOX_SORT_CONTENT == nType && pTxtMark && rCmp.pTxtMark ) { if( *pTxtMark->GetStart() < *rCmp.pTxtMark->GetStart() ) - return TRUE; + return sal_True; if( *pTxtMark->GetStart() == *rCmp.pTxtMark->GetStart() ) { @@ -297,7 +301,7 @@ BOOL SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp ) sOtherTxt, sOtherTxtReading, rCmp.GetLocale() ); if( pEnd && !pEndCmp ) - return TRUE; + return sal_True; } } } @@ -307,7 +311,7 @@ BOOL SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp ) *(SwTxtNode*)pFirst, nCntPos ); } } - return FALSE; + return sal_False; } /*-------------------------------------------------------------------- @@ -316,8 +320,8 @@ BOOL SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp ) SwTOXIndex::SwTOXIndex( const SwTxtNode& rNd, - const SwTxtTOXMark* pMark, USHORT nOptions, - BYTE nKyLevel, + const SwTxtTOXMark* pMark, sal_uInt16 nOptions, + sal_uInt8 nKyLevel, const SwTOXInternational& rIntl, const lang::Locale& rLocale ) : SwTOXSortTabBase( TOX_SORT_INDEX, &rNd, pMark, &rIntl, &rLocale ), @@ -332,13 +336,13 @@ SwTOXIndex::SwTOXIndex( const SwTxtNode& rNd, // -BOOL SwTOXIndex::operator==( const SwTOXSortTabBase& rCmpBase ) +sal_Bool SwTOXIndex::operator==( const SwTOXSortTabBase& rCmpBase ) { SwTOXIndex& rCmp = (SwTOXIndex&)rCmpBase; // In Abhaengigkeit von den Optionen Grosskleinschreibung beachten if(GetLevel() != rCmp.GetLevel() || nKeyLevel != rCmp.nKeyLevel) - return FALSE; + return sal_False; ASSERT(pTxtMark, "pTxtMark == 0, Kein Stichwort"); @@ -350,7 +354,7 @@ BOOL SwTOXIndex::operator==( const SwTOXSortTabBase& rCmpBase ) String sOtherTxtReading; rCmp.GetTxt( sOtherTxt, sOtherTxtReading ); - BOOL bRet = pTOXIntl->IsEqual( sMyTxt, sMyTxtReading, GetLocale(), + sal_Bool bRet = pTOXIntl->IsEqual( sMyTxt, sMyTxtReading, GetLocale(), sOtherTxt, sOtherTxtReading, rCmp.GetLocale() ); // Wenn nicht zusammengefasst wird muss die Pos aus gewertet werden @@ -366,7 +370,7 @@ BOOL SwTOXIndex::operator==( const SwTOXSortTabBase& rCmpBase ) // -BOOL SwTOXIndex::operator<( const SwTOXSortTabBase& rCmpBase ) +sal_Bool SwTOXIndex::operator<( const SwTOXSortTabBase& rCmpBase ) { SwTOXIndex& rCmp = (SwTOXIndex&)rCmpBase; @@ -380,7 +384,7 @@ BOOL SwTOXIndex::operator<( const SwTOXSortTabBase& rCmpBase ) String sOtherTxtReading; rCmp.GetTxt( sOtherTxt, sOtherTxtReading ); - BOOL bRet = GetLevel() == rCmp.GetLevel() && + sal_Bool bRet = GetLevel() == rCmp.GetLevel() && pTOXIntl->IsLess( sMyTxt, sMyTxtReading, GetLocale(), sOtherTxt, sOtherTxtReading, rCmp.GetLocale() ); @@ -434,7 +438,7 @@ void SwTOXIndex::GetText_Impl( String& rTxt, String& rTxtReading ) const } } -void SwTOXIndex::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT ) const +void SwTOXIndex::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 ) const { const xub_StrLen* pEnd = pTxtMark->GetEnd(); String sTmp; @@ -459,11 +463,11 @@ void SwTOXIndex::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT ) cons -USHORT SwTOXIndex::GetLevel() const +sal_uInt16 SwTOXIndex::GetLevel() const { ASSERT(pTxtMark, "pTxtMark == 0, Kein Stichwort"); - USHORT nForm = FORM_PRIMARY_KEY; + sal_uInt16 nForm = FORM_PRIMARY_KEY; if( 0 == (GetOptions() & nsSwTOIOptions::TOI_KEY_AS_ENTRY)&& pTxtMark->GetTOXMark().GetPrimaryKey().Len() ) @@ -481,7 +485,7 @@ USHORT SwTOXIndex::GetLevel() const SwTOXCustom::SwTOXCustom(const String& rStr, const String& rReading, - USHORT nLevel, + sal_uInt16 nLevel, const SwTOXInternational& rIntl, const lang::Locale& rLocale ) : SwTOXSortTabBase( TOX_SORT_CUSTOM, 0, 0, &rIntl, &rLocale ), @@ -490,7 +494,7 @@ SwTOXCustom::SwTOXCustom(const String& rStr, const String& rReading, } -BOOL SwTOXCustom::operator==(const SwTOXSortTabBase& rCmpBase) +sal_Bool SwTOXCustom::operator==(const SwTOXSortTabBase& rCmpBase) { String sMyTxt; String sMyTxtReading; @@ -506,7 +510,7 @@ BOOL SwTOXCustom::operator==(const SwTOXSortTabBase& rCmpBase) } -BOOL SwTOXCustom::operator < (const SwTOXSortTabBase& rCmpBase) +sal_Bool SwTOXCustom::operator < (const SwTOXSortTabBase& rCmpBase) { String sMyTxt; String sMyTxtReading; @@ -522,7 +526,7 @@ BOOL SwTOXCustom::operator < (const SwTOXSortTabBase& rCmpBase) } -USHORT SwTOXCustom::GetLevel() const +sal_uInt16 SwTOXCustom::GetLevel() const { return nLev; } @@ -566,7 +570,7 @@ void SwTOXContent::GetText_Impl( String& rTxt, String& rTxtReading ) const rTxt = pTxtMark->GetTOXMark().GetAlternativeText(); } -void SwTOXContent::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT ) const +void SwTOXContent::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 ) const { const xub_StrLen* pEnd = pTxtMark->GetEnd(); if( pEnd && !pTxtMark->GetTOXMark().IsAlternativeText() ) @@ -586,7 +590,7 @@ void SwTOXContent::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT ) co // -USHORT SwTOXContent::GetLevel() const +sal_uInt16 SwTOXContent::GetLevel() const { return pTxtMark->GetTOXMark().GetLevel(); } @@ -600,7 +604,7 @@ USHORT SwTOXContent::GetLevel() const // sondern muss die vom "Henkel" sein !! -SwTOXPara::SwTOXPara( const SwCntntNode& rNd, SwTOXElement eT, USHORT nLevel ) +SwTOXPara::SwTOXPara( const SwCntntNode& rNd, SwTOXElement eT, sal_uInt16 nLevel ) : SwTOXSortTabBase( TOX_SORT_PARA, &rNd, 0, 0 ), eType( eT ), m_nLevel(nLevel), @@ -644,7 +648,7 @@ void SwTOXPara::GetText_Impl( String& rTxt, String& ) const else { ASSERT( !this, "Grafik/Object ohne Namen" ) - USHORT nId = nsSwTOXElement::TOX_OLE == eType + sal_uInt16 nId = nsSwTOXElement::TOX_OLE == eType ? STR_OBJECT_DEFNAME : nsSwTOXElement::TOX_GRAPHIC == eType ? STR_GRAPHIC_DEFNAME @@ -657,7 +661,7 @@ void SwTOXPara::GetText_Impl( String& rTxt, String& ) const } } -void SwTOXPara::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT ) const +void SwTOXPara::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 ) const { if( nsSwTOXElement::TOX_TEMPLATE == eType || nsSwTOXElement::TOX_SEQUENCE == eType || nsSwTOXElement::TOX_OUTLINELEVEL == eType) { @@ -672,7 +676,7 @@ void SwTOXPara::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT ) const */ pSrc->GetExpandTxt( rNd, &rInsPos, nStt, nEndIndex == STRING_LEN ? STRING_LEN : nEndIndex - nStt, - FALSE, FALSE, TRUE ); + sal_False, sal_False, sal_True ); } else { @@ -684,19 +688,19 @@ void SwTOXPara::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT ) const } -USHORT SwTOXPara::GetLevel() const +sal_uInt16 SwTOXPara::GetLevel() const { - USHORT nRet = m_nLevel; + sal_uInt16 nRet = m_nLevel; const SwCntntNode* pNd = aTOXSources[0].pNd; if( nsSwTOXElement::TOX_OUTLINELEVEL == eType && pNd->GetTxtNode() ) { - //USHORT nTmp = ((SwTxtNode*)pNd)->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei + //sal_uInt16 nTmp = ((SwTxtNode*)pNd)->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei //if(nTmp < NO_NUMBERING) // nRet = nTmp + 1; const int nTmp = ((SwTxtNode*)pNd)->GetAttrOutlineLevel();//#outline level,zhaojianwei???? if(nTmp != 0 ) - nRet = static_cast<USHORT>(nTmp); + nRet = static_cast<sal_uInt16>(nTmp); } return nRet; } @@ -722,7 +726,7 @@ String SwTOXPara::GetURL() const // if( pRule ) // { // // dann noch die rel. Nummer davor setzen -// const USHORT nCurrLevel = static_cast<USHORT>(pTxtNd->GetActualListLevel()); +// const sal_uInt16 nCurrLevel = static_cast<sal_uInt16>(pTxtNd->GetActualListLevel()); // if(nCurrLevel <= MAXLEVEL) // { // // --> OD 2005-11-02 #i51089 - TUNING# @@ -731,7 +735,7 @@ String SwTOXPara::GetURL() const // SwNumberTree::tNumberVector aNumVector = // pTxtNd->GetNumberVector(); -// for( USHORT n = 0; n <= nCurrLevel; ++n ) +// for( sal_uInt16 n = 0; n <= nCurrLevel; ++n ) // { // int nNum = aNumVector[ n ]; // nNum -= ( pRule->Get( n ).GetStart() - 1 ); @@ -813,7 +817,7 @@ void SwTOXTable::GetText_Impl( String& rTxt, String& ) const } } -USHORT SwTOXTable::GetLevel() const +sal_uInt16 SwTOXTable::GetLevel() const { return nLevel; } @@ -847,15 +851,15 @@ SwTOXAuthority::SwTOXAuthority( const SwCntntNode& rNd, nCntPos = *rField.GetTxtFld()->GetStart(); } -USHORT SwTOXAuthority::GetLevel() const +sal_uInt16 SwTOXAuthority::GetLevel() const { String sText(((SwAuthorityField*)m_rField.GetFld())-> GetFieldText(AUTH_FIELD_AUTHORITY_TYPE)); //#i18655# the level '0' is the heading level therefor the values are incremented here - USHORT nRet = 1; + sal_uInt16 nRet = 1; if( pTOXIntl->IsNumeric( sText ) ) { - nRet = (USHORT)sText.ToInt32(); + nRet = (sal_uInt16)sText.ToInt32(); nRet++; } //illegal values are also set to 'ARTICLE' as non-numeric values are @@ -880,7 +884,7 @@ void SwTOXAuthority::GetText_Impl( String& rTxt, String& ) const --------------------------------------------------*/ void SwTOXAuthority::FillText( SwTxtNode& rNd, - const SwIndex& rInsPos, USHORT nAuthField ) const + const SwIndex& rInsPos, sal_uInt16 nAuthField ) const { SwAuthorityField* pField = (SwAuthorityField*)m_rField.GetFld(); String sText; @@ -897,7 +901,7 @@ void SwTOXAuthority::FillText( SwTxtNode& rNd, } else if(AUTH_FIELD_AUTHORITY_TYPE == nAuthField) { - USHORT nLevel = GetLevel(); + sal_uInt16 nLevel = GetLevel(); if(nLevel) sText = SwAuthorityFieldType::GetAuthTypeName((ToxAuthorityType) --nLevel); } @@ -908,7 +912,7 @@ void SwTOXAuthority::FillText( SwTxtNode& rNd, /* -----------------14.10.99 09:35------------------- --------------------------------------------------*/ -BOOL SwTOXAuthority::operator==( const SwTOXSortTabBase& rCmp) +sal_Bool SwTOXAuthority::operator==( const SwTOXSortTabBase& rCmp) { return nType == rCmp.nType && ((SwAuthorityField*)m_rField.GetFld())->GetHandle() == @@ -917,9 +921,9 @@ BOOL SwTOXAuthority::operator==( const SwTOXSortTabBase& rCmp) /* -----------------21.10.99 09:52------------------- --------------------------------------------------*/ -BOOL SwTOXAuthority::operator<( const SwTOXSortTabBase& rBase) +sal_Bool SwTOXAuthority::operator<( const SwTOXSortTabBase& rBase) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; SwAuthorityField* pField = (SwAuthorityField*)m_rField.GetFld(); SwAuthorityFieldType* pType = (SwAuthorityFieldType*) pField->GetTyp(); @@ -931,7 +935,7 @@ BOOL SwTOXAuthority::operator<( const SwTOXSortTabBase& rBase) ((SwTOXAuthority&)rBase).m_rField.GetFld(); - for(USHORT i = 0; i < pType->GetSortKeyCount(); i++) + for(sal_uInt16 i = 0; i < pType->GetSortKeyCount(); i++) { const SwTOXSortKey* pKey = pType->GetSortKey(i); String sMyTxt = pField->GetFieldText(pKey->eField); |