summaryrefslogtreecommitdiff
path: root/sw/source/core/tox/tox.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/tox/tox.cxx')
-rw-r--r--sw/source/core/tox/tox.cxx130
1 files changed, 65 insertions, 65 deletions
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index bc3565216ae0..47c03a776797 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -66,16 +66,16 @@ const sal_Char* SwForm::aFormEntryTxt = "<ET>";
const sal_Char* SwForm::aFormChapterMark= "<C>";
const sal_Char* SwForm::aFormText = "<X>";
const sal_Char* SwForm::aFormAuth = "<A>";
-BYTE SwForm::nFormTabLen = 3;
-BYTE SwForm::nFormEntryLen = 3;
-BYTE SwForm::nFormPageNumsLen = 3;
-BYTE SwForm::nFormLinkSttLen = 4;
-BYTE SwForm::nFormLinkEndLen = 4;
-BYTE SwForm::nFormEntryNumLen = 4;
-BYTE SwForm::nFormEntryTxtLen = 4;
-BYTE SwForm::nFormChapterMarkLen = 3;
-BYTE SwForm::nFormTextLen = 3;
-BYTE SwForm::nFormAuthLen = 5;
+sal_uInt8 SwForm::nFormTabLen = 3;
+sal_uInt8 SwForm::nFormEntryLen = 3;
+sal_uInt8 SwForm::nFormPageNumsLen = 3;
+sal_uInt8 SwForm::nFormLinkSttLen = 4;
+sal_uInt8 SwForm::nFormLinkEndLen = 4;
+sal_uInt8 SwForm::nFormEntryNumLen = 4;
+sal_uInt8 SwForm::nFormEntryTxtLen = 4;
+sal_uInt8 SwForm::nFormChapterMarkLen = 3;
+sal_uInt8 SwForm::nFormTextLen = 3;
+sal_uInt8 SwForm::nFormAuthLen = 5;
SV_IMPL_PTRARR(SwTOXMarks, SwTOXMark*)
@@ -86,11 +86,11 @@ TYPEINIT2( SwTOXMark, SfxPoolItem, SwClient ); // fuers rtti
--------------------------------------------------*/
struct PatternIni
{
- USHORT n1;
- USHORT n2;
- USHORT n3;
- USHORT n4;
- USHORT n5;
+ sal_uInt16 n1;
+ sal_uInt16 n2;
+ sal_uInt16 n3;
+ sal_uInt16 n4;
+ sal_uInt16 n5;
};
const PatternIni aPatternIni[] =
{
@@ -130,13 +130,13 @@ const PatternIni aPatternIni[] =
--------------------------------------------------*/
// -> #i21237#
-SwFormTokens lcl_GetAuthPattern(USHORT nTypeId)
+SwFormTokens lcl_GetAuthPattern(sal_uInt16 nTypeId)
{
SwFormTokens aRet; // #i21237#
PatternIni aIni = aPatternIni[nTypeId];
- USHORT nVals[5];
+ sal_uInt16 nVals[5];
nVals[0] = aIni.n1;
nVals[1] = aIni.n2;
nVals[2] = aIni.n3;
@@ -152,7 +152,7 @@ SwFormTokens lcl_GetAuthPattern(USHORT nTypeId)
SwFormToken aTextToken( TOKEN_TEXT );
aTextToken.sText = String::CreateFromAscii( ", " );
- for(USHORT i = 0; i < 5 ; i++)
+ for(sal_uInt16 i = 0; i < 5 ; i++)
{
if(nVals[i] == USHRT_MAX)
break;
@@ -180,8 +180,8 @@ SwTOXMark::SwTOXMark()
, SwModify( 0 )
,
pTxtAttr( 0 ),
- bAutoGenerated(FALSE),
- bMainEntry(FALSE)
+ bAutoGenerated(sal_False),
+ bMainEntry(sal_False)
{
}
@@ -191,8 +191,8 @@ SwTOXMark::SwTOXMark( const SwTOXType* pTyp )
, SwModify( const_cast<SwTOXType*>(pTyp) )
,
pTxtAttr( 0 ), nLevel( 0 ),
- bAutoGenerated(FALSE),
- bMainEntry(FALSE)
+ bAutoGenerated(sal_False),
+ bMainEntry(sal_False)
{
}
@@ -292,18 +292,18 @@ SwTOXType::SwTOXType(const SwTOXType& rCopy)
SwForm::SwForm( TOXTypes eTyp ) // #i21237#
: eType( eTyp ), nFormMaxLevel( SwForm::GetFormMaxLevel( eTyp )),
// nFirstTabPos( lNumIndent ),
- bCommaSeparated(FALSE)
+ bCommaSeparated(sal_False)
{
//bHasFirstTabPos =
- bGenerateTabPos = FALSE;
- bIsRelTabPos = TRUE;
+ bGenerateTabPos = sal_False;
+ bIsRelTabPos = sal_True;
// Inhaltsverzeichnis hat entsprechend Anzahl Headlines + Ueberschrift
// Benutzer hat 10 Ebenen + Ueberschrift
// Stichwort hat 3 Ebenen + Ueberschrift + Trenner
// indexes of tables, objects illustrations and authorities consist of a heading and one level
- USHORT nPoolId;
+ sal_uInt16 nPoolId;
switch( eType )
{
case TOX_INDEX: nPoolId = STR_POOLCOLL_TOX_IDXH; break;
@@ -345,7 +345,7 @@ SwForm::SwForm( TOXTypes eTyp ) // #i21237#
if(TOX_INDEX == eType)
{
- for( USHORT i = 1; i < 5; ++i )
+ for( sal_uInt16 i = 1; i < 5; ++i )
{
if(1 == i)
{
@@ -364,7 +364,7 @@ SwForm::SwForm( TOXTypes eTyp ) // #i21237#
}
}
else
- for( USHORT i = 1; i < GetFormMax(); ++i, ++nPoolId ) // Nr 0 ist der Titel
+ for( sal_uInt16 i = 1; i < GetFormMax(); ++i, ++nPoolId ) // Nr 0 ist der Titel
{
if(TOX_AUTHORITIES == eType)
SetPattern(i, lcl_GetAuthPattern(i));
@@ -398,7 +398,7 @@ SwForm& SwForm::operator=(const SwForm& rForm)
bGenerateTabPos = rForm.bGenerateTabPos;
bIsRelTabPos = rForm.bIsRelTabPos;
bCommaSeparated = rForm.bCommaSeparated;
- for(USHORT i=0; i < nFormMaxLevel; ++i)
+ for(sal_uInt16 i=0; i < nFormMaxLevel; ++i)
{
aPattern[i] = rForm.aPattern[i];
aTemplate[i] = rForm.aTemplate[i];
@@ -406,9 +406,9 @@ SwForm& SwForm::operator=(const SwForm& rForm)
return *this;
}
-USHORT SwForm::GetFormMaxLevel( TOXTypes eTOXType )
+sal_uInt16 SwForm::GetFormMaxLevel( TOXTypes eTOXType )
{
- USHORT nRet = 0;
+ sal_uInt16 nRet = 0;
switch( eTOXType )
{
case TOX_INDEX: nRet = 5; break;
@@ -429,34 +429,34 @@ bool operator == (const SwFormToken & rToken, FormTokenType eType)
}
//-----------------------------------------------------------------------------
-void SwForm::AdjustTabStops(SwDoc& rDoc, BOOL bInsertNewTapStops) // #i21237#
+void SwForm::AdjustTabStops(SwDoc& rDoc, sal_Bool bInsertNewTapStops) // #i21237#
{
- for(USHORT nLevel = 1; nLevel < GetFormMax(); nLevel++)
+ for(sal_uInt16 nLevel = 1; nLevel < GetFormMax(); nLevel++)
{
const String& sTemplateName = GetTemplate(nLevel);
SwTxtFmtColl* pColl = rDoc.FindTxtFmtCollByName( sTemplateName );
if( !pColl )
{
- USHORT nId = SwStyleNameMapper::GetPoolIdFromUIName
+ sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName
( sTemplateName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL ); // #i21237#
if( USHRT_MAX != nId )
pColl = rDoc.GetTxtCollFromPool( nId );
}
const SvxTabStopItem* pTabStops = 0;
- USHORT nTabCount = 0;
+ sal_uInt16 nTabCount = 0;
if( pColl &&
- 0 != ( pTabStops = &pColl->GetTabStops(FALSE) ) &&
+ 0 != ( pTabStops = &pColl->GetTabStops(sal_False) ) &&
0 != ( nTabCount = pTabStops->Count() ) )
{
// #i21237#
SwFormTokens aCurrentPattern = GetPattern(nLevel);
SwFormTokens::iterator aIt = aCurrentPattern.begin();
- BOOL bChanged = FALSE;
+ sal_Bool bChanged = sal_False;
- for(USHORT nTab = 0; nTab < nTabCount; ++nTab)
+ for(sal_uInt16 nTab = 0; nTab < nTabCount; ++nTab)
{
const SvxTabStop& rTab = (*pTabStops)[nTab];
@@ -467,9 +467,9 @@ void SwForm::AdjustTabStops(SwDoc& rDoc, BOOL bInsertNewTapStops) // #i21237#
{
if ( SVX_TAB_ADJUST_DEFAULT != rTab.GetAdjustment() )
{
- bChanged = TRUE;
+ bChanged = sal_True;
SwFormToken aToken(TOKEN_TAB_STOP);
- aToken.bWithTab = FALSE;
+ aToken.bWithTab = sal_False;
aToken.nTabStopPosition = rTab.GetTabPos();
aToken.eTabAlign = rTab.GetAdjustment();
aToken.cTabFillChar = rTab.GetFill();
@@ -484,7 +484,7 @@ void SwForm::AdjustTabStops(SwDoc& rDoc, BOOL bInsertNewTapStops) // #i21237#
(TOKEN_TAB_STOP));
if ( aIt != aCurrentPattern.end() )
{
- bChanged = TRUE;
+ bChanged = sal_True;
aIt->nTabStopPosition = rTab.GetTabPos();
aIt->eTabAlign = nTab == nTabCount - 1 &&
SVX_TAB_ADJUST_RIGHT == rTab.GetAdjustment() ?
@@ -510,7 +510,7 @@ void SwForm::AdjustTabStops(SwDoc& rDoc, BOOL bInsertNewTapStops) // #i21237#
SwTOXBase::SwTOXBase(const SwTOXType* pTyp, const SwForm& rForm,
- USHORT nCreaType, const String& rTitle )
+ sal_uInt16 nCreaType, const String& rTitle )
: SwClient((SwModify*)pTyp),
aForm(rForm),
aTitle(rTitle),
@@ -518,10 +518,10 @@ SwTOXBase::SwTOXBase(const SwTOXType* pTyp, const SwForm& rForm,
nCreateType(nCreaType),
nOLEOptions(0),
eCaptionDisplay(CAPTION_COMPLETE),
- bProtected( TRUE ),
- bFromChapter(FALSE),
- bFromObjectNames(FALSE),
- bLevelFromChapter(FALSE)
+ bProtected( sal_True ),
+ bFromChapter(sal_False),
+ bFromObjectNames(sal_False),
+ bLevelFromChapter(sal_False)
{
aData.nOptions = 0;
}
@@ -540,15 +540,15 @@ SwTOXBase& SwTOXBase::CopyTOXBase( SwDoc* pDoc, const SwTOXBase& rSource )
{
// type not in pDoc, so create it now
const SwTOXTypes& rTypes = pDoc->GetTOXTypes();
- BOOL bFound = FALSE;
- for( USHORT n = rTypes.Count(); n; )
+ sal_Bool bFound = sal_False;
+ for( sal_uInt16 n = rTypes.Count(); n; )
{
const SwTOXType* pCmp = rTypes[ --n ];
if( pCmp->GetType() == pType->GetType() &&
pCmp->GetTypeName() == pType->GetTypeName() )
{
pType = (SwTOXType*)pCmp;
- bFound = TRUE;
+ bFound = sal_True;
break;
}
}
@@ -571,7 +571,7 @@ SwTOXBase& SwTOXBase::CopyTOXBase( SwDoc* pDoc, const SwTOXBase& rSource )
eLanguage = rSource.eLanguage;
sSortAlgorithm = rSource.sSortAlgorithm;
- for( USHORT i = 0; i < MAXLEVEL; ++i )
+ for( sal_uInt16 i = 0; i < MAXLEVEL; ++i )
aStyleNames[i] = rSource.aStyleNames[i];
// its the same data type!
@@ -608,7 +608,7 @@ SwTOXBase & SwTOXBase::operator = (const SwTOXBase & rSource)
aName = rSource.aName;
aTitle = rSource.aTitle;
sMainEntryCharStyle = rSource.sMainEntryCharStyle;
- for(USHORT nLevel = 0; nLevel < MAXLEVEL; nLevel++)
+ for(sal_uInt16 nLevel = 0; nLevel < MAXLEVEL; nLevel++)
aStyleNames[nLevel] = rSource.aStyleNames[nLevel];
sSequenceName = rSource.sSequenceName;
eLanguage = rSource.eLanguage;
@@ -660,7 +660,7 @@ String SwFormToken::GetString() const
{
String sRet;
- BOOL bAppend = TRUE;
+ sal_Bool bAppend = sal_True;
switch( eTokenType )
{
case TOKEN_ENTRY_NO:
@@ -739,7 +739,7 @@ String SwFormToken::GetString() const
sRet += TOX_STYLE_DELIMITER;
}
else
- bAppend = FALSE;
+ bAppend = sal_False;
}
else if(TOKEN_ENTRY_NO == eTokenType)
{
@@ -796,16 +796,16 @@ SwFormToken SwFormTokensHelper::BuildToken( const String & sPattern,
eRet.sCharStyleName = sToken.GetToken( 0, ',');
String sTmp( sToken.GetToken( 1, ',' ));
if( sTmp.Len() )
- eRet.nPoolId = static_cast<USHORT>(sTmp.ToInt32());
+ eRet.nPoolId = static_cast<sal_uInt16>(sTmp.ToInt32());
switch( eTokenType )
{
//i53420
case TOKEN_ENTRY_NO:
if( (sTmp = sToken.GetToken( 2, ',' ) ).Len() )
- eRet.nChapterFormat = static_cast<USHORT>(sTmp.ToInt32());
+ eRet.nChapterFormat = static_cast<sal_uInt16>(sTmp.ToInt32());
if( (sTmp = sToken.GetToken( 3, ',' ) ).Len() )
- eRet.nOutlineLevel = static_cast<USHORT>(sTmp.ToInt32()); //the maximum outline level to examine
+ eRet.nOutlineLevel = static_cast<sal_uInt16>(sTmp.ToInt32()); //the maximum outline level to examine
break;
case TOKEN_TEXT:
@@ -840,15 +840,15 @@ SwFormToken SwFormTokensHelper::BuildToken( const String & sPattern,
case TOKEN_CHAPTER_INFO:
if( (sTmp = sToken.GetToken( 2, ',' ) ).Len() )
- eRet.nChapterFormat = static_cast<USHORT>(sTmp.ToInt32()); //SwChapterFormat;
+ eRet.nChapterFormat = static_cast<sal_uInt16>(sTmp.ToInt32()); //SwChapterFormat;
//i53420
if( (sTmp = sToken.GetToken( 3, ',' ) ).Len() )
- eRet.nOutlineLevel = static_cast<USHORT>(sTmp.ToInt32()); //the maximum outline level to examine
+ eRet.nOutlineLevel = static_cast<sal_uInt16>(sTmp.ToInt32()); //the maximum outline level to examine
break;
case TOKEN_AUTHORITY:
- eRet.nAuthorityField = static_cast<USHORT>(sAuthFieldEnum.ToInt32());
+ eRet.nAuthorityField = static_cast<sal_uInt16>(sAuthFieldEnum.ToInt32());
break;
default: break;
}
@@ -859,7 +859,7 @@ String SwFormTokensHelper::SearchNextToken( const String & sPattern,
xub_StrLen nStt ) const
{
//it's not so easy - it doesn't work if the text part contains a '>'
- //USHORT nTokenEnd = sPattern.Search('>');
+ //sal_uInt16 nTokenEnd = sPattern.Search('>');
String aResult;
@@ -894,8 +894,8 @@ FormTokenType SwFormTokensHelper::GetTokenType(const String & sToken,
static struct
{
const sal_Char* pNm;
- USHORT nLen;
- USHORT nOffset;
+ sal_uInt16 nLen;
+ sal_uInt16 nOffset;
FormTokenType eToken;
} __READONLY_DATA aTokenArr[] = {
{ SwForm::aFormTab, SwForm::nFormEntryLen, 1, TOKEN_TAB_STOP },
@@ -932,13 +932,13 @@ FormTokenType SwFormTokensHelper::GetTokenType(const String & sToken,
// <- #i21237#
-void SwForm::SetPattern(USHORT nLevel, const SwFormTokens& rTokens)
+void SwForm::SetPattern(sal_uInt16 nLevel, const SwFormTokens& rTokens)
{
ASSERT(nLevel < GetFormMax(), "Index >= FORM_MAX");
aPattern[nLevel] = rTokens;
}
-void SwForm::SetPattern(USHORT nLevel, const String & rStr)
+void SwForm::SetPattern(sal_uInt16 nLevel, const String & rStr)
{
ASSERT(nLevel < GetFormMax(), "Index >= FORM_MAX");
@@ -946,7 +946,7 @@ void SwForm::SetPattern(USHORT nLevel, const String & rStr)
aPattern[nLevel] = aHelper.GetTokens();
}
-const SwFormTokens& SwForm::GetPattern(USHORT nLevel) const
+const SwFormTokens& SwForm::GetPattern(sal_uInt16 nLevel) const
{
ASSERT(nLevel < GetFormMax(), "Index >= FORM_MAX");
return aPattern[nLevel];