summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/wrtw8num.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/filter/ww8/wrtw8num.cxx')
-rw-r--r--sw/source/filter/ww8/wrtw8num.cxx134
1 files changed, 67 insertions, 67 deletions
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx
index 47316c867e33..e8cb9a755087 100644
--- a/sw/source/filter/ww8/wrtw8num.cxx
+++ b/sw/source/filter/ww8/wrtw8num.cxx
@@ -59,9 +59,9 @@ using namespace ::com::sun::star;
using namespace sw::types;
using namespace sw::util;
-USHORT MSWordExportBase::DuplicateNumRule( const SwNumRule *pRule, BYTE nLevel, USHORT nVal )
+sal_uInt16 MSWordExportBase::DuplicateNumRule( const SwNumRule *pRule, sal_uInt8 nLevel, sal_uInt16 nVal )
{
- USHORT nNumId = USHRT_MAX;
+ sal_uInt16 nNumId = USHRT_MAX;
String sPrefix( CREATE_CONST_ASC( "WW8TempExport" ) );
sPrefix += String::CreateFromInt32( nUniqueList++ );
// --> OD 2008-02-11 #newlistlevelattrs#
@@ -71,7 +71,7 @@ USHORT MSWordExportBase::DuplicateNumRule( const SwNumRule *pRule, BYTE nLevel,
// <--
pUsedNumTbl->Insert( pMyNumRule, pUsedNumTbl->Count() );
- for ( USHORT i = 0; i < MAXLEVEL; i++ )
+ for ( sal_uInt16 i = 0; i < MAXLEVEL; i++ )
{
const SwNumFmt& rSubRule = pRule->Get(i);
pMyNumRule->Set( i, rSubRule );
@@ -89,7 +89,7 @@ USHORT MSWordExportBase::DuplicateNumRule( const SwNumRule *pRule, BYTE nLevel,
return nNumId;
}
-USHORT MSWordExportBase::GetId( const SwNumRule& rNumRule )
+sal_uInt16 MSWordExportBase::GetId( const SwNumRule& rNumRule )
{
if ( !pUsedNumTbl )
{
@@ -98,7 +98,7 @@ USHORT MSWordExportBase::GetId( const SwNumRule& rNumRule )
// --> OD 2005-10-17 #126238# - Check, if the outline rule is
// already inserted into <pUsedNumTbl>. If yes, do not insert it again.
bool bOutlineRuleAdded( false );
- for ( USHORT n = pUsedNumTbl->Count(); n; )
+ for ( sal_uInt16 n = pUsedNumTbl->Count(); n; )
{
const SwNumRule& rRule = *pUsedNumTbl->GetObject( --n );
if ( !pDoc->IsUsed( rRule ) )
@@ -120,12 +120,12 @@ USHORT MSWordExportBase::GetId( const SwNumRule& rNumRule )
// <--
}
SwNumRule* p = (SwNumRule*)&rNumRule;
- USHORT nRet = pUsedNumTbl->GetPos(p);
+ sal_uInt16 nRet = pUsedNumTbl->GetPos(p);
//Is this list now duplicated into a new list which we should use
// --> OD 2007-05-30 #i77812#
// perform 'deep' search in duplication map
- ::std::map<USHORT,USHORT>::const_iterator aResult = aRuleDuplicates.end();
+ ::std::map<sal_uInt16,sal_uInt16>::const_iterator aResult = aRuleDuplicates.end();
do {
aResult = aRuleDuplicates.find(nRet);
if ( aResult != aRuleDuplicates.end() )
@@ -175,7 +175,7 @@ void WW8Export::WriteNumbering()
OutListNamesTab();
}
-void WW8AttributeOutput::NumberingDefinition( USHORT nId, const SwNumRule &rRule )
+void WW8AttributeOutput::NumberingDefinition( sal_uInt16 nId, const SwNumRule &rRule )
{
SwWW8Writer::WriteLong( *m_rWW8Export.pTableStrm, nId );
SwWW8Writer::WriteLong( *m_rWW8Export.pTableStrm, nId );
@@ -184,7 +184,7 @@ void WW8AttributeOutput::NumberingDefinition( USHORT nId, const SwNumRule &rRule
for ( int i = 0; i < WW8ListManager::nMaxLevel; ++i )
SwWW8Writer::WriteShort( *m_rWW8Export.pTableStrm, 0xFFF );
- BYTE nFlags = 0, nDummy = 0;
+ sal_uInt8 nFlags = 0, nDummy = 0;
if ( rRule.IsContinusNum() )
nFlags |= 0x1;
@@ -196,10 +196,10 @@ void MSWordExportBase::NumberingDefinitions()
if ( !pUsedNumTbl )
return; // no numbering is used
- USHORT nCount = pUsedNumTbl->Count();
+ sal_uInt16 nCount = pUsedNumTbl->Count();
// Write static data of SwNumRule - LSTF
- for ( USHORT n = 0; n < nCount; ++n )
+ for ( sal_uInt16 n = 0; n < nCount; ++n )
{
const SwNumRule& rRule = *pUsedNumTbl->GetObject( n );
@@ -207,12 +207,12 @@ void MSWordExportBase::NumberingDefinitions()
}
}
-void WW8AttributeOutput::NumberingLevel( BYTE /*nLevel*/,
- USHORT nStart,
- USHORT nNumberingType,
+void WW8AttributeOutput::NumberingLevel( sal_uInt8 /*nLevel*/,
+ sal_uInt16 nStart,
+ sal_uInt16 nNumberingType,
SvxAdjust eAdjust,
- const BYTE *pNumLvlPos,
- BYTE nFollow,
+ const sal_uInt8 *pNumLvlPos,
+ sal_uInt8 nFollow,
const wwFont *pFont,
const SfxItemSet *pOutSet,
sal_Int16 nIndentAt,
@@ -228,7 +228,7 @@ void WW8AttributeOutput::NumberingLevel( BYTE /*nLevel*/,
*m_rWW8Export.pTableStrm << WW8Export::GetNumId( nNumberingType );
// Justification
- BYTE nAlign;
+ sal_uInt8 nAlign;
switch ( eAdjust )
{
case SVX_ADJUST_CENTER: nAlign = 1; break;
@@ -255,7 +255,7 @@ void WW8AttributeOutput::NumberingLevel( BYTE /*nLevel*/,
m_rWW8Export.pO = &aCharAtrs;
if ( pFont )
{
- USHORT nFontID = m_rWW8Export.maFontHelper.GetId( *pFont );
+ sal_uInt16 nFontID = m_rWW8Export.maFontHelper.GetId( *pFont );
if ( m_rWW8Export.bWrtWW8 )
{
@@ -272,21 +272,21 @@ void WW8AttributeOutput::NumberingLevel( BYTE /*nLevel*/,
m_rWW8Export.pO = pOldpO;
}
- *m_rWW8Export.pTableStrm << BYTE( aCharAtrs.Count() );
+ *m_rWW8Export.pTableStrm << sal_uInt8( aCharAtrs.Count() );
// cbGrpprlPapx
- BYTE aPapSprms [] = {
+ sal_uInt8 aPapSprms [] = {
0x5e, 0x84, 0, 0, // sprmPDxaLeft
0x60, 0x84, 0, 0, // sprmPDxaLeft1
0x15, 0xc6, 0x05, 0x00, 0x01, 0, 0, 0x06
};
- *m_rWW8Export.pTableStrm << BYTE( sizeof( aPapSprms ) );
+ *m_rWW8Export.pTableStrm << sal_uInt8( sizeof( aPapSprms ) );
// reserved
SwWW8Writer::WriteShort( *m_rWW8Export.pTableStrm, 0 );
// pap sprms
- BYTE* pData = aPapSprms + 2;
+ sal_uInt8* pData = aPapSprms + 2;
Set_UInt16( pData, nIndentAt );
pData += 2;
Set_UInt16( pData, nFirstLineIndex );
@@ -306,8 +306,8 @@ void WW8AttributeOutput::NumberingLevel( BYTE /*nLevel*/,
void MSWordExportBase::AbstractNumberingDefinitions()
{
- USHORT nCount = pUsedNumTbl->Count();
- USHORT n;
+ sal_uInt16 nCount = pUsedNumTbl->Count();
+ sal_uInt16 n;
// prepare the NodeNum to generate the NumString
SwNumberTree::tNumberVector aNumVector;
@@ -320,17 +320,17 @@ void MSWordExportBase::AbstractNumberingDefinitions()
AttrOutput().StartAbstractNumbering( n + 1 );
const SwNumRule& rRule = *pUsedNumTbl->GetObject( n );
- BYTE nLvl;
- BYTE nLevels = static_cast< BYTE >(rRule.IsContinusNum() ?
+ sal_uInt8 nLvl;
+ sal_uInt8 nLevels = static_cast< sal_uInt8 >(rRule.IsContinusNum() ?
WW8ListManager::nMinLevel : WW8ListManager::nMaxLevel);
for( nLvl = 0; nLvl < nLevels; ++nLvl )
{
// write the static data of the SwNumFmt of this level
- BYTE aNumLvlPos[WW8ListManager::nMaxLevel] = { 0,0,0,0,0,0,0,0,0 };
+ sal_uInt8 aNumLvlPos[WW8ListManager::nMaxLevel] = { 0,0,0,0,0,0,0,0,0 };
const SwNumFmt& rFmt = rRule.Get( nLvl );
- BYTE nFollow = 0;
+ sal_uInt8 nFollow = 0;
// --> OD 2008-06-03 #i86652#
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
@@ -411,20 +411,20 @@ void MSWordExportBase::AbstractNumberingDefinitions()
{
if (SVX_NUM_NUMBER_NONE != rFmt.GetNumberingType())
{
- BYTE* pLvlPos = aNumLvlPos;
+ sal_uInt8* pLvlPos = aNumLvlPos;
// --> OD 2005-10-17 #126238# - the numbering string
// has to be restrict to the level currently working on.
sNumStr = rRule.MakeNumString(aNumVector, false, true, nLvl);
// <--
// now search the nums in the string
- for( BYTE i = 0; i <= nLvl; ++i )
+ for( sal_uInt8 i = 0; i <= nLvl; ++i )
{
String sSrch( String::CreateFromInt32( i ));
xub_StrLen nFnd = sNumStr.Search( sSrch );
if( STRING_NOTFOUND != nFnd )
{
- *pLvlPos = (BYTE)(nFnd + rFmt.GetPrefix().Len() + 1 );
+ *pLvlPos = (sal_uInt8)(nFnd + rFmt.GetPrefix().Len() + 1 );
++pLvlPos;
sNumStr.SetChar( nFnd, (char)i );
}
@@ -518,8 +518,8 @@ void WW8Export::OutOverrideListTab()
return ; // no numbering is used
// write the "list format override" - LFO
- USHORT nCount = pUsedNumTbl->Count();
- USHORT n;
+ sal_uInt16 nCount = pUsedNumTbl->Count();
+ sal_uInt16 n;
pFib->fcPlfLfo = pTableStrm->Tell();
SwWW8Writer::WriteLong( *pTableStrm, nCount );
@@ -542,7 +542,7 @@ void WW8Export::OutListNamesTab()
return ; // no numbering is used
// write the "list format override" - LFO
- USHORT nNms = 0, nCount = pUsedNumTbl->Count();
+ sal_uInt16 nNms = 0, nCount = pUsedNumTbl->Count();
pFib->fcSttbListNames = pTableStrm->Tell();
SwWW8Writer::WriteShort( *pTableStrm, -1 );
@@ -574,41 +574,41 @@ void WW8Export::OutputOlst( const SwNumRule& rRule )
if ( bWrtWW8 )
return;
- static BYTE __READONLY_DATA aAnlvBase[] = { // Defaults
+ static sal_uInt8 __READONLY_DATA aAnlvBase[] = { // Defaults
1,0,0, // Upper Roman
0x0C, // Hanging Indent, fPrev
0,0,1,0x80,0,0,1,0,0x1b,1,0,0 };
- static BYTE __READONLY_DATA aSprmOlstHdr[] = { 133, 212 };
+ static sal_uInt8 __READONLY_DATA aSprmOlstHdr[] = { 133, 212 };
pO->Insert( aSprmOlstHdr, sizeof( aSprmOlstHdr ), pO->Count() );
WW8_OLST aOlst;
memset( &aOlst, 0, sizeof(aOlst) );
- BYTE* pC = aOlst.rgch;
- BYTE* pChars = (BYTE*)pC;
- USHORT nCharLen = 64;
+ sal_uInt8* pC = aOlst.rgch;
+ sal_uInt8* pChars = (sal_uInt8*)pC;
+ sal_uInt16 nCharLen = 64;
- for (USHORT j = 0; j < WW8ListManager::nMaxLevel; j++ ) // 9 variable ANLVs
+ for (sal_uInt16 j = 0; j < WW8ListManager::nMaxLevel; j++ ) // 9 variable ANLVs
{
memcpy( &aOlst.rganlv[j], aAnlvBase, sizeof( WW8_ANLV ) ); // Defaults
const SwNumFmt* pFmt = rRule.GetNumFmt( j );
if( pFmt )
BuildAnlvBase( aOlst.rganlv[j], pChars, nCharLen, rRule,
- *pFmt, (BYTE)j );
+ *pFmt, (sal_uInt8)j );
}
- pO->Insert( (BYTE*)&aOlst, sizeof( aOlst ), pO->Count() );
+ pO->Insert( (sal_uInt8*)&aOlst, sizeof( aOlst ), pO->Count() );
}
-void WW8Export::Out_WwNumLvl( BYTE nWwLevel )
+void WW8Export::Out_WwNumLvl( sal_uInt8 nWwLevel )
{
pO->Insert( 13, pO->Count() );
pO->Insert( nWwLevel, pO->Count() );
}
-void WW8Export::Out_SwNumLvl( BYTE nSwLevel )
+void WW8Export::Out_SwNumLvl( sal_uInt8 nSwLevel )
{
// --> OD 2008-04-02 #refactorlists#
// ASSERT(IsNum(nSwLevel), "numbered?");
@@ -617,12 +617,12 @@ void WW8Export::Out_SwNumLvl( BYTE nSwLevel )
Out_WwNumLvl( nSwLevel + 1 );
}
-void WW8Export::BuildAnlvBulletBase(WW8_ANLV& rAnlv, BYTE*& rpCh,
- USHORT& rCharLen, const SwNumFmt& rFmt)
+void WW8Export::BuildAnlvBulletBase(WW8_ANLV& rAnlv, sal_uInt8*& rpCh,
+ sal_uInt16& rCharLen, const SwNumFmt& rFmt)
{
ByteToSVBT8(11, rAnlv.nfc);
- BYTE nb = 0; // Zahlentyp
+ sal_uInt8 nb = 0; // Zahlentyp
switch (rFmt.GetNumAdjust())
{
case SVX_ADJUST_RIGHT:
@@ -662,7 +662,7 @@ void WW8Export::BuildAnlvBulletBase(WW8_ANLV& rAnlv, BYTE*& rpCh,
rtl_TextEncoding eChrSet = rFont.GetCharSet();
String sFontName = rFont.GetName();
- USHORT nFontId;
+ sal_uInt16 nFontId;
if (sw::util::IsStarSymbol(sFontName))
{
/*
@@ -691,7 +691,7 @@ void WW8Export::BuildAnlvBulletBase(WW8_ANLV& rAnlv, BYTE*& rpCh,
if ( (eChrSet == RTL_TEXTENCODING_SYMBOL) && (cChar >= 0xF000) && (
cChar <= 0xF0FF) )
{
- *rpCh = static_cast< BYTE >(cChar - 0xF000);
+ *rpCh = static_cast< sal_uInt8 >(cChar - 0xF000);
}
else
*rpCh = ByteString::ConvertFromUnicode(cChar, eChrSet);
@@ -772,17 +772,17 @@ void MSWordExportBase::SubstituteBullet( String& rNumStr,
delete pConvert;
}
-static void SwWw8_InsertAnlText( const String& rStr, BYTE*& rpCh,
- USHORT& rCharLen, SVBT8& r8Len )
+static void SwWw8_InsertAnlText( const String& rStr, sal_uInt8*& rpCh,
+ sal_uInt16& rCharLen, SVBT8& r8Len )
{
- BYTE nb = 0;
+ sal_uInt8 nb = 0;
WW8Bytes aO;
SwWW8Writer::InsAsString8( aO, rStr, RTL_TEXTENCODING_MS_1252 );
- USHORT nCnt = aO.Count();
+ sal_uInt16 nCnt = aO.Count();
if( nCnt && nCnt < rCharLen )
{
- nb = (BYTE)nCnt;
+ nb = (sal_uInt8)nCnt;
memcpy( rpCh, aO.GetData(), nCnt );
rpCh += nCnt;
rCharLen = rCharLen - nCnt;
@@ -790,13 +790,13 @@ static void SwWw8_InsertAnlText( const String& rStr, BYTE*& rpCh,
ByteToSVBT8( nb, r8Len );
}
-void WW8Export::BuildAnlvBase(WW8_ANLV& rAnlv, BYTE*& rpCh,
- USHORT& rCharLen, const SwNumRule& rRul, const SwNumFmt& rFmt,
- BYTE nSwLevel)
+void WW8Export::BuildAnlvBase(WW8_ANLV& rAnlv, sal_uInt8*& rpCh,
+ sal_uInt16& rCharLen, const SwNumRule& rRul, const SwNumFmt& rFmt,
+ sal_uInt8 nSwLevel)
{
ByteToSVBT8(WW8Export::GetNumId(rFmt.GetNumberingType()), rAnlv.nfc);
- BYTE nb = 0;
+ sal_uInt8 nb = 0;
switch (rFmt.GetNumAdjust())
{
case SVX_ADJUST_RIGHT:
@@ -828,7 +828,7 @@ void WW8Export::BuildAnlvBase(WW8_ANLV& rAnlv, BYTE*& rpCh,
&& (nSwLevel<= WW8ListManager::nMaxLevel )
&& (rFmt.GetNumberingType() != SVX_NUM_NUMBER_NONE ) ) // UEberhaupt Nummerierung ?
{ // -> suche, ob noch Zahlen davor
- BYTE nUpper = rFmt.GetIncludeUpperLevels();
+ sal_uInt8 nUpper = rFmt.GetIncludeUpperLevels();
if( (nUpper <= WW8ListManager::nMaxLevel) &&
(rRul.Get(nUpper).GetNumberingType() != SVX_NUM_NUMBER_NONE ) ) // Nummerierung drueber ?
{
@@ -863,21 +863,21 @@ void WW8Export::BuildAnlvBase(WW8_ANLV& rAnlv, BYTE*& rpCh,
}
void WW8Export::Out_NumRuleAnld( const SwNumRule& rRul, const SwNumFmt& rFmt,
- BYTE nSwLevel )
+ sal_uInt8 nSwLevel )
{
- static BYTE __READONLY_DATA aSprmAnldDefault[54] = {
+ static sal_uInt8 __READONLY_DATA aSprmAnldDefault[54] = {
12, 52,
1,0,0,0x0c,0,0,1,0x80,0,0,1,0,0x1b,1,0,0,0x2e,
0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
- BYTE aSprmAnld[54];
+ sal_uInt8 aSprmAnld[54];
memcpy( aSprmAnld, aSprmAnldDefault, sizeof( aSprmAnld ) );
WW8_ANLD* pA = (WW8_ANLD*)(aSprmAnld + 2); // handlicher Pointer
- BYTE* pChars = (BYTE*)(pA->rgchAnld);
- USHORT nCharLen = 31;
+ sal_uInt8* pChars = (sal_uInt8*)(pA->rgchAnld);
+ sal_uInt16 nCharLen = 31;
if( nSwLevel == 11 )
BuildAnlvBulletBase( pA->eAnlv, pChars, nCharLen, rFmt );
@@ -885,7 +885,7 @@ void WW8Export::Out_NumRuleAnld( const SwNumRule& rRul, const SwNumFmt& rFmt,
BuildAnlvBase( pA->eAnlv, pChars, nCharLen, rRul, rFmt, nSwLevel );
// ... und raus damit
- OutSprmBytes( (BYTE*)&aSprmAnld, sizeof( aSprmAnld ) );
+ OutSprmBytes( (sal_uInt8*)&aSprmAnld, sizeof( aSprmAnld ) );
}
@@ -896,12 +896,12 @@ bool WW8Export::Out_SwNum(const SwTxtNode* pNd)
if (nLevel < 0 || nLevel >= MAXLEVEL)
{
- ASSERT(FALSE, "Invalid level");
+ ASSERT(sal_False, "Invalid level");
return false;
}
- BYTE nSwLevel = static_cast< BYTE >(nLevel);
+ sal_uInt8 nSwLevel = static_cast< sal_uInt8 >(nLevel);
const SwNumRule* pRul = pNd->GetNumRule();
if( !pRul || nSwLevel == WW8ListManager::nMaxLevel)