summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/dump/ww8scan.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/filter/ww8/dump/ww8scan.cxx')
-rw-r--r--sw/source/filter/ww8/dump/ww8scan.cxx598
1 files changed, 299 insertions, 299 deletions
diff --git a/sw/source/filter/ww8/dump/ww8scan.cxx b/sw/source/filter/ww8/dump/ww8scan.cxx
index cd211520e083..b099ea590022 100644
--- a/sw/source/filter/ww8/dump/ww8scan.cxx
+++ b/sw/source/filter/ww8/dump/ww8scan.cxx
@@ -753,52 +753,52 @@ SprmInfo wwSprmParser::GetSprmInfo(sal_uInt16 nId) const
//-end
-inline BYTE Get_Byte( BYTE *& p )
+inline sal_uInt8 Get_Byte( sal_uInt8 *& p )
{
- BYTE n = SVBT8ToByte( *(SVBT8*)p );
+ sal_uInt8 n = SVBT8ToByte( *(SVBT8*)p );
p += 1;
return n;
}
-inline USHORT Get_UShort( BYTE *& p )
+inline sal_uInt16 Get_UShort( sal_uInt8 *& p )
{
- USHORT n = SVBT16ToShort( *(SVBT16*)p );
+ sal_uInt16 n = SVBT16ToShort( *(SVBT16*)p );
p += 2;
return n;
}
-inline short Get_Short( BYTE *& p )
+inline short Get_Short( sal_uInt8 *& p )
{
return Get_UShort(p);
}
-inline ULONG Get_ULong( BYTE *& p )
+inline sal_uLong Get_ULong( sal_uInt8 *& p )
{
- ULONG n = SVBT32ToUInt32( *(SVBT32*)p );
+ sal_uLong n = SVBT32ToUInt32( *(SVBT32*)p );
p += 4;
return n;
}
-inline long Get_Long( BYTE *& p )
+inline long Get_Long( sal_uInt8 *& p )
{
return Get_ULong(p);
}
-WW8SprmIter::WW8SprmIter(const BYTE* pSprms_, long nLen_,
+WW8SprmIter::WW8SprmIter(const sal_uInt8* pSprms_, long nLen_,
const wwSprmParser &rParser)
: mrSprmParser(rParser), pSprms( pSprms_), nRemLen( nLen_)
{
UpdateMyMembers();
}
-void WW8SprmIter::SetSprms(const BYTE* pSprms_, long nLen_)
+void WW8SprmIter::SetSprms(const sal_uInt8* pSprms_, long nLen_)
{
pSprms = pSprms_;
nRemLen = nLen_;
UpdateMyMembers();
}
-const BYTE* WW8SprmIter::operator ++( int )
+const sal_uInt8* WW8SprmIter::operator ++( int )
{
if (nRemLen > 0)
{
@@ -826,7 +826,7 @@ void WW8SprmIter::UpdateMyMembers()
}
}
-const BYTE* WW8SprmIter::FindSprm(USHORT nId)
+const sal_uInt8* WW8SprmIter::FindSprm(sal_uInt16 nId)
{
while(GetSprms())
{
@@ -845,7 +845,7 @@ const BYTE* WW8SprmIter::FindSprm(USHORT nId)
// eigenen Iteratoren. Alle sich auf Iteratoren beziehenden Methoden
// sind deshalb Dummies.
-WW8PLCFx_PCDAttrs::WW8PLCFx_PCDAttrs(BYTE nVersion, WW8PLCFx_PCD* pPLCFx_PCD,
+WW8PLCFx_PCDAttrs::WW8PLCFx_PCDAttrs(sal_uInt8 nVersion, WW8PLCFx_PCD* pPLCFx_PCD,
const WW8ScannerBase* pBase)
: WW8PLCFx(nVersion, true), pPcdI(pPLCFx_PCD->GetPLCFIter()),
pPcd(pPLCFx_PCD), pGrpprls(pBase->pPieceGrpprls),
@@ -853,12 +853,12 @@ WW8PLCFx_PCDAttrs::WW8PLCFx_PCDAttrs(BYTE nVersion, WW8PLCFx_PCD* pPLCFx_PCD,
{
}
-ULONG WW8PLCFx_PCDAttrs::GetIdx() const
+sal_uLong WW8PLCFx_PCDAttrs::GetIdx() const
{
return 0;
}
-void WW8PLCFx_PCDAttrs::SetIdx( ULONG )
+void WW8PLCFx_PCDAttrs::SetIdx( sal_uLong )
{
}
@@ -891,11 +891,11 @@ void WW8PLCFx_PCDAttrs::GetSprms(WW8PLCFxDesc* p)
return;
}
- UINT16 nPrm = SVBT16ToShort( ( (WW8_PCD*)pData )->prm );
+ sal_uInt16 nPrm = SVBT16ToShort( ( (WW8_PCD*)pData )->prm );
if ( nPrm & 1 )
{
// PRM Variant 2
- UINT16 nSprmIdx = nPrm >> 1;
+ sal_uInt16 nSprmIdx = nPrm >> 1;
if( nSprmIdx >= nGrpprls )
{
@@ -905,7 +905,7 @@ void WW8PLCFx_PCDAttrs::GetSprms(WW8PLCFxDesc* p)
p->nSprmsLen = 0;
return;
}
- const BYTE* pSprms = pGrpprls[ nSprmIdx ];
+ const sal_uInt8* pSprms = pGrpprls[ nSprmIdx ];
p->nSprmsLen = SVBT16ToShort( pSprms ); // Length
pSprms += 2;
@@ -920,8 +920,8 @@ void WW8PLCFx_PCDAttrs::GetSprms(WW8PLCFxDesc* p)
if(8 > GetVersion())
{
- aShortSprm[0] = (BYTE)( ( nPrm & 0xfe) >> 1 );
- aShortSprm[1] = (BYTE)( nPrm >> 8 );
+ aShortSprm[0] = (sal_uInt8)( ( nPrm & 0xfe) >> 1 );
+ aShortSprm[1] = (sal_uInt8)( nPrm >> 8 );
p->nSprmsLen = ( nPrm ) ? 2 : 0; // Laenge
// store Postion of internal mini storage in Data Pointer
@@ -931,7 +931,7 @@ void WW8PLCFx_PCDAttrs::GetSprms(WW8PLCFxDesc* p)
{
p->pMemPos = 0;
p->nSprmsLen = 0;
- BYTE nSprmListIdx = (BYTE)((nPrm & 0xfe) >> 1);
+ sal_uInt8 nSprmListIdx = (sal_uInt8)((nPrm & 0xfe) >> 1);
if( nSprmListIdx )
{
// process Sprm Id Matching as explained in MS Doku
@@ -940,7 +940,7 @@ void WW8PLCFx_PCDAttrs::GetSprms(WW8PLCFxDesc* p)
// see file: s62f39.htm
//
// Since isprm is 7 bits, rgsprmPrm can hold 0x80 entries.
- static const USHORT aSprmId[0x80] =
+ static const sal_uInt16 aSprmId[0x80] =
{
// sprmNoop, sprmNoop, sprmNoop, sprmNoop
0x0000,0x0000,0x0000,0x0000,
@@ -1012,14 +1012,14 @@ void WW8PLCFx_PCDAttrs::GetSprms(WW8PLCFxDesc* p)
};
// find real Sprm Id:
- USHORT nSprmId = aSprmId[ nSprmListIdx ];
+ sal_uInt16 nSprmId = aSprmId[ nSprmListIdx ];
if( nSprmId )
{
// move Sprm Id and Sprm Param to internal mini storage:
- aShortSprm[0] = (BYTE)( ( nSprmId & 0x00ff) );
- aShortSprm[1] = (BYTE)( ( nSprmId & 0xff00) >> 8 );
- aShortSprm[2] = (BYTE)( nPrm >> 8 );
+ aShortSprm[0] = (sal_uInt8)( ( nSprmId & 0x00ff) );
+ aShortSprm[1] = (sal_uInt8)( ( nSprmId & 0xff00) >> 8 );
+ aShortSprm[2] = (sal_uInt8)( nPrm >> 8 );
// store Sprm Length in member:
p->nSprmsLen = ( nPrm ) ? 3 : 0;
@@ -1034,7 +1034,7 @@ void WW8PLCFx_PCDAttrs::GetSprms(WW8PLCFxDesc* p)
//------------------------------------------------------------------------
-WW8PLCFx_PCD::WW8PLCFx_PCD(BYTE nVersion, WW8PLCFpcd* pPLCFpcd,
+WW8PLCFx_PCD::WW8PLCFx_PCD(sal_uInt8 nVersion, WW8PLCFpcd* pPLCFpcd,
WW8_CP nStartCp, bool bVer67P)
: WW8PLCFx(nVersion, false), nClipStart(-1)
{
@@ -1049,17 +1049,17 @@ WW8PLCFx_PCD::~WW8PLCFx_PCD()
delete pPcdI;
}
-ULONG WW8PLCFx_PCD::GetIMax() const
+sal_uLong WW8PLCFx_PCD::GetIMax() const
{
return pPcdI ? pPcdI->GetIMax() : 0;
}
-ULONG WW8PLCFx_PCD::GetIdx() const
+sal_uLong WW8PLCFx_PCD::GetIdx() const
{
return pPcdI ? pPcdI->GetIdx() : 0;
}
-void WW8PLCFx_PCD::SetIdx( ULONG nIdx )
+void WW8PLCFx_PCD::SetIdx( sal_uLong nIdx )
{
if (pPcdI)
pPcdI->SetIdx( nIdx );
@@ -1146,11 +1146,11 @@ WW8_CP WW8PLCFx_PCD::AktPieceStartFc2Cp( WW8_FC nStartPos )
return LONG_MAX;
}
bool bIsUnicode = false;
- INT32 nFcStart = SVBT32ToUInt32( ((WW8_PCD*)pData)->fc );
+ sal_Int32 nFcStart = SVBT32ToUInt32( ((WW8_PCD*)pData)->fc );
if( !bVer67 )
nFcStart = WW8PLCFx_PCD::TransformPieceAddress( nFcStart, bIsUnicode );
- INT32 nUnicodeFactor = bIsUnicode ? 2 : 1;
+ sal_Int32 nUnicodeFactor = bIsUnicode ? 2 : 1;
if( nStartPos < nFcStart )
nStartPos = nFcStart;
@@ -1184,22 +1184,22 @@ DateTime WW8ScannerBase::WW8DTTM2DateTime(long lDTTM)
DateTime aDateTime(Date( 0 ), Time( 0 ));
if( lDTTM )
{
- USHORT lMin = (USHORT)(lDTTM & 0x0000003F);
+ sal_uInt16 lMin = (sal_uInt16)(lDTTM & 0x0000003F);
lDTTM >>= 6;
- USHORT lHour= (USHORT)(lDTTM & 0x0000001F);
+ sal_uInt16 lHour= (sal_uInt16)(lDTTM & 0x0000001F);
lDTTM >>= 5;
- USHORT lDay = (USHORT)(lDTTM & 0x0000001F);
+ sal_uInt16 lDay = (sal_uInt16)(lDTTM & 0x0000001F);
lDTTM >>= 5;
- USHORT lMon = (USHORT)(lDTTM & 0x0000000F);
+ sal_uInt16 lMon = (sal_uInt16)(lDTTM & 0x0000000F);
lDTTM >>= 4;
- USHORT lYear= (USHORT)(lDTTM & 0x000001FF) + 1900;
+ sal_uInt16 lYear= (sal_uInt16)(lDTTM & 0x000001FF) + 1900;
aDateTime = DateTime(Date(lDay, lMon, lYear), Time(lHour, lMin));
}
return aDateTime;
}
short WW8_BRC::DetermineBorderProperties(bool bVer67, short *pSpace,
- BYTE *pCol, short *pIdx) const
+ sal_uInt8 *pCol, short *pIdx) const
{
/*
Word does not factor the width of the border into the width/height
@@ -1208,11 +1208,11 @@ short WW8_BRC::DetermineBorderProperties(bool bVer67, short *pSpace,
our calculations
*/
short nMSTotalWidth;
- BYTE nCol;
+ sal_uInt8 nCol;
short nIdx,nSpace;
if( bVer67 )
{
- UINT16 aBrc1 = SVBT16ToShort(aBits1);
+ sal_uInt16 aBrc1 = SVBT16ToShort(aBits1);
nCol = ((aBrc1 >> 6) & 0x1f); // aBor.ico
nSpace = (aBrc1 & 0xF800) >> 11;
@@ -1423,7 +1423,7 @@ WW8_CP WW8ScannerBase::WW8Fc2Cp( WW8_FC nFcPos ) const
bool bIsUnicode = false;
if( pPieceIter ) // Complex File ?
{
- ULONG nOldPos = pPieceIter->GetIdx();
+ sal_uLong nOldPos = pPieceIter->GetIdx();
for (pPieceIter->SetIdx(0);
pPieceIter->GetIdx() < pPieceIter->GetIMax();(*pPieceIter)++)
@@ -1435,11 +1435,11 @@ WW8_CP WW8ScannerBase::WW8Fc2Cp( WW8_FC nFcPos ) const
ASSERT( !this, "PLCFpcd-WW8Fc2Cp() ging schief" );
break;
}
- INT32 nFcStart = SVBT32ToUInt32( ((WW8_PCD*)pData)->fc );
+ sal_Int32 nFcStart = SVBT32ToUInt32( ((WW8_PCD*)pData)->fc );
if( 8 <= pWw8Fib->nVersion )
nFcStart = WW8PLCFx_PCD::TransformPieceAddress( nFcStart,
bIsUnicode );
- INT32 nLen = (nCpEnd - nCpStart) * (bIsUnicode ? 2 : 1);
+ sal_Int32 nLen = (nCpEnd - nCpStart) * (bIsUnicode ? 2 : 1);
/*
If this cp is inside this piece, or its the last piece and we are
@@ -1546,10 +1546,10 @@ WW8PLCFpcd* WW8ScannerBase::OpenPieceTable( SvStream* pStr, const WW8Fib* pWwF )
return 0;
WW8_FC nClxPos = pWwF->fcClx;
- INT32 nClxLen = pWwF->lcbClx;
- INT32 nLeft = nClxLen;
- INT16 nGrpprl = 0;
- BYTE clxt;
+ sal_Int32 nClxLen = pWwF->lcbClx;
+ sal_Int32 nLeft = nClxLen;
+ sal_Int16 nGrpprl = 0;
+ sal_uInt8 clxt;
pStr->Seek( nClxPos );
while( 1 ) // Zaehle Zahl der Grpprls
@@ -1560,7 +1560,7 @@ WW8PLCFpcd* WW8ScannerBase::OpenPieceTable( SvStream* pStr, const WW8Fib* pWwF )
break; // PLCFfpcd gefunden
if( 1 == clxt ) // clxtGrpprl ?
nGrpprl++;
- UINT16 nLen;
+ sal_uInt16 nLen;
*pStr >> nLen;
nLeft -= 2 + nLen;
if( nLeft < 0 )
@@ -1569,24 +1569,24 @@ WW8PLCFpcd* WW8ScannerBase::OpenPieceTable( SvStream* pStr, const WW8Fib* pWwF )
}
pStr->Seek( nClxPos );
nLeft = nClxLen;
- pPieceGrpprls = new BYTE*[nGrpprl + 1];
+ pPieceGrpprls = new sal_uInt8*[nGrpprl + 1];
memset( pPieceGrpprls, 0, ( nGrpprl + 1 ) * 4 );
nPieceGrpprls = nGrpprl;
- INT16 nAktGrpprl = 0; // lies Grpprls ein
+ sal_Int16 nAktGrpprl = 0; // lies Grpprls ein
while( 1 )
{
*pStr >> clxt;
nLeft--;
if( 2 == clxt) // PLCFfpcd ?
break; // PLCFfpcd gefunden
- UINT16 nLen;
+ sal_uInt16 nLen;
*pStr >> nLen;
nLeft -= 2 + nLen;
if( nLeft < 0 )
return 0; // schiefgegangen
if( 1 == clxt ) // clxtGrpprl ?
{
- BYTE* p = new BYTE[nLen+2]; // alloziere
+ sal_uInt8* p = new sal_uInt8[nLen+2]; // alloziere
ShortToSVBT16(nLen, p); // trage Laenge ein
pStr->Read( p+2, nLen ); // lies grpprl
pPieceGrpprls[nAktGrpprl++] = p; // trage in Array ein
@@ -1595,7 +1595,7 @@ WW8PLCFpcd* WW8ScannerBase::OpenPieceTable( SvStream* pStr, const WW8Fib* pWwF )
pStr->SeekRel( nLen ); // ueberlies nicht-Grpprl
}
// lies Piece Table PLCF ein
- INT32 nPLCFfLen;
+ sal_Int32 nPLCFfLen;
*pStr >> nPLCFfLen;
ASSERT( 65536 > nPLCFfLen, "PLCFfpcd ueber 64 k" );
return new WW8PLCFpcd( pStr, pStr->Tell(), nPLCFfLen, 8 );
@@ -1605,7 +1605,7 @@ void WW8ScannerBase::DeletePieceTable()
{
if( pPieceGrpprls )
{
- for( BYTE** p = pPieceGrpprls; *p; p++ )
+ for( sal_uInt8** p = pPieceGrpprls; *p; p++ )
delete[] (*p);
delete[] pPieceGrpprls;
pPieceGrpprls = 0;
@@ -1781,14 +1781,14 @@ static bool WW8SkipField(WW8PLCFspecial& rPLCF)
rPLCF++;
- if((((BYTE*)pData)[0] & 0x1f ) != 0x13 ) // Kein Anfang ?
+ if((((sal_uInt8*)pData)[0] & 0x1f ) != 0x13 ) // Kein Anfang ?
return true; // Bei Fehler nicht abbrechen
if( !rPLCF.Get( nP, pData ) )
return false;
- while((((BYTE*)pData)[0] & 0x1f ) == 0x13 )
+ while((((sal_uInt8*)pData)[0] & 0x1f ) == 0x13 )
{
// immer noch neue (nested) Anfaenge ?
WW8SkipField( rPLCF ); // nested Field im Beschreibungsteil
@@ -1796,7 +1796,7 @@ static bool WW8SkipField(WW8PLCFspecial& rPLCF)
return false;
}
- if((((BYTE*)pData)[0] & 0x1f ) == 0x14 )
+ if((((sal_uInt8*)pData)[0] & 0x1f ) == 0x14 )
{
// Field Separator ?
@@ -1805,7 +1805,7 @@ static bool WW8SkipField(WW8PLCFspecial& rPLCF)
if( !rPLCF.Get( nP, pData ) )
return false;
- while ((((BYTE*)pData)[0] & 0x1f ) == 0x13)
+ while ((((sal_uInt8*)pData)[0] & 0x1f ) == 0x13)
{
// immer noch neue (nested) Anfaenge ?
WW8SkipField( rPLCF ); // nested Field im Resultatteil
@@ -1821,7 +1821,7 @@ static bool WW8SkipField(WW8PLCFspecial& rPLCF)
static bool WW8GetFieldPara(WW8PLCFspecial& rPLCF, WW8FieldDesc& rF)
{
void* pData;
- ULONG nOldIdx = rPLCF.GetIdx();
+ sal_uLong nOldIdx = rPLCF.GetIdx();
rF.nLen = rF.nId = rF.nOpt = rF.bCodeNest = rF.bResNest = 0;
@@ -1830,10 +1830,10 @@ static bool WW8GetFieldPara(WW8PLCFspecial& rPLCF, WW8FieldDesc& rF)
rPLCF++;
- if((((BYTE*)pData)[0] & 0x1f ) != 0x13 ) // Kein Anfang ?
+ if((((sal_uInt8*)pData)[0] & 0x1f ) != 0x13 ) // Kein Anfang ?
goto Err;
- rF.nId = ((BYTE*)pData)[1];
+ rF.nId = ((sal_uInt8*)pData)[1];
if( !rPLCF.Get( rF.nLCode, pData ) )
goto Err;
@@ -1842,7 +1842,7 @@ static bool WW8GetFieldPara(WW8PLCFspecial& rPLCF, WW8FieldDesc& rF)
rF.nSCode++; // ohne Marken
rF.nLCode -= rF.nSCode; // Pos zu Laenge
- while((((BYTE*)pData)[0] & 0x1f ) == 0x13 )
+ while((((sal_uInt8*)pData)[0] & 0x1f ) == 0x13 )
{
// immer noch neue (nested) Anfaenge ?
WW8SkipField( rPLCF ); // nested Field im Beschreibungsteil
@@ -1851,13 +1851,13 @@ static bool WW8GetFieldPara(WW8PLCFspecial& rPLCF, WW8FieldDesc& rF)
goto Err;
}
- if((((BYTE*)pData)[0] & 0x1f ) == 0x14 ){ // Field Separator ?
+ if((((sal_uInt8*)pData)[0] & 0x1f ) == 0x14 ){ // Field Separator ?
rPLCF++;
if( !rPLCF.Get( rF.nLRes, pData ) )
goto Err;
- while((((BYTE*)pData)[0] & 0x1f ) == 0x13 )
+ while((((sal_uInt8*)pData)[0] & 0x1f ) == 0x13 )
{
// immer noch neue (nested) Anfaenge ?
WW8SkipField( rPLCF ); // nested Field im Resultatteil
@@ -1876,11 +1876,11 @@ static bool WW8GetFieldPara(WW8PLCFspecial& rPLCF, WW8FieldDesc& rF)
}
rPLCF++;
- if((((BYTE*)pData)[0] & 0x1f ) == 0x15 )
+ if((((sal_uInt8*)pData)[0] & 0x1f ) == 0x15 )
{
// Field Ende ?
// INDEX-Fld hat Bit7 gesetzt!?!
- rF.nOpt = ((BYTE*)pData)[1]; // Ja -> Flags uebernehmen
+ rF.nOpt = ((sal_uInt8*)pData)[1]; // Ja -> Flags uebernehmen
}else{
rF.nId = 0; // Nein -> Feld ungueltig
}
@@ -1903,7 +1903,7 @@ String WW8ReadPString(SvStream& rStrm, rtl_TextEncoding eEnc,
bool bAtEndSeekRel1)
{
ByteString aByteStr;
- UINT8 b;
+ sal_uInt8 b;
rStrm >> b;
if (b)
@@ -1911,7 +1911,7 @@ String WW8ReadPString(SvStream& rStrm, rtl_TextEncoding eEnc,
// Alloc methode automatically sets Zero at the end
sal_Char* pByteData = aByteStr.AllocBuffer( b );
- ULONG nWasRead = rStrm.Read( pByteData, b );
+ sal_uLong nWasRead = rStrm.Read( pByteData, b );
if( nWasRead != b )
aByteStr.ReleaseBufferAccess(static_cast<xub_StrLen>(nWasRead));
}
@@ -1923,9 +1923,9 @@ String WW8ReadPString(SvStream& rStrm, rtl_TextEncoding eEnc,
return String( aByteStr, eEnc );
}
-String WW8Read_xstz(SvStream& rStrm, USHORT nChars, bool bAtEndSeekRel1)
+String WW8Read_xstz(SvStream& rStrm, sal_uInt16 nChars, bool bAtEndSeekRel1)
{
- UINT16 b;
+ sal_uInt16 b;
if( nChars )
b = nChars;
@@ -1938,16 +1938,16 @@ String WW8Read_xstz(SvStream& rStrm, USHORT nChars, bool bAtEndSeekRel1)
// Alloc methode automatically sets Zero at the end
sal_Unicode* pData = aStr.AllocBuffer( b );
- ULONG nWasRead = rStrm.Read( (sal_Char*)pData, b * 2 );
- if( nWasRead != static_cast<ULONG>(b*2) )
+ sal_uLong nWasRead = rStrm.Read( (sal_Char*)pData, b * 2 );
+ if( nWasRead != static_cast<sal_uLong>(b*2) )
{
- b = static_cast<UINT16>(nWasRead / 2);
+ b = static_cast<sal_uInt16>(nWasRead / 2);
aStr.ReleaseBufferAccess( b );
pData = aStr.GetBufferAccess();
}
#ifdef OSL_BIGENDIAN
- ULONG n;
+ sal_uLong n;
sal_Unicode *pWork;
for( n = 0, pWork = pData; n < b; ++n, ++pWork )
*pWork = SWAPSHORT( *pWork );
@@ -1960,9 +1960,9 @@ String WW8Read_xstz(SvStream& rStrm, USHORT nChars, bool bAtEndSeekRel1)
return aStr;
}
-static ULONG SafeReadString(ByteString &rStr,USHORT nLen,SvStream &rStrm)
+static sal_uLong SafeReadString(ByteString &rStr,sal_uInt16 nLen,SvStream &rStrm)
{
- ULONG nWasRead=0;
+ sal_uLong nWasRead=0;
if (nLen)
{
nWasRead = rStrm.Read( rStr.AllocBuffer( nLen ), nLen);
@@ -1972,7 +1972,7 @@ static ULONG SafeReadString(ByteString &rStr,USHORT nLen,SvStream &rStrm)
return nWasRead;
}
-USHORT WW8ScannerBase::WW8ReadString( SvStream& rStrm, String& rStr,
+sal_uInt16 WW8ScannerBase::WW8ReadString( SvStream& rStrm, String& rStr,
WW8_CP nAktStartCp, long nTotalLen, rtl_TextEncoding eEnc ) const
{
// Klartext einlesen, der sich ueber mehrere Pieces erstrecken kann
@@ -2002,12 +2002,12 @@ USHORT WW8ScannerBase::WW8ReadString( SvStream& rStrm, String& rStr,
nLen = USHRT_MAX - 1;
if( bIsUnicode )
- rStr.Append(WW8Read_xstz(rStrm, (USHORT)nLen, false));
+ rStr.Append(WW8Read_xstz(rStrm, (sal_uInt16)nLen, false));
else
{
// Alloc method automatically sets Zero at the end
ByteString aByteStr;
- SafeReadString(aByteStr,(USHORT)nLen,rStrm);
+ SafeReadString(aByteStr,(sal_uInt16)nLen,rStrm);
rStr += String( aByteStr, eEnc );
}
nTotalRead += nLen;
@@ -2031,7 +2031,7 @@ WW8PLCFspecial::WW8PLCFspecial(SvStream* pSt, long nFilePos, long nPLCF,
{
nIMax = ( nPLCF - 4 ) / ( 4 + nStruct );
// Pointer auf Pos- u. Struct-Array
- pPLCF_PosArray = new INT32[ ( nPLCF + 3 ) / 4 ];
+ pPLCF_PosArray = new sal_Int32[ ( nPLCF + 3 ) / 4 ];
long nOldPos = pSt->Tell();
@@ -2045,7 +2045,7 @@ WW8PLCFspecial::WW8PLCFspecial(SvStream* pSt, long nFilePos, long nPLCF,
if( bNoEnd )
nIMax++;
if( nStruct ) // Pointer auf Inhalts-Array
- pPLCF_Contents = (BYTE*)&pPLCF_PosArray[nIMax + 1];
+ pPLCF_Contents = (sal_uInt8*)&pPLCF_PosArray[nIMax + 1];
else
pPLCF_Contents = 0; // kein Inhalt
if( nStartPos >= 0 )
@@ -2183,7 +2183,7 @@ WW8PLCF::WW8PLCF( SvStream* pSt, long nFilePos, long nPLCF, long nStruct,
void WW8PLCF::ReadPLCF( SvStream* pSt, long nFilePos, long nPLCF )
{
// Pointer auf Pos-Array
- pPLCF_PosArray = new INT32[ ( nPLCF + 3 ) / 4 ];
+ pPLCF_PosArray = new sal_Int32[ ( nPLCF + 3 ) / 4 ];
long nOldPos = pSt->Tell();
@@ -2195,7 +2195,7 @@ void WW8PLCF::ReadPLCF( SvStream* pSt, long nFilePos, long nPLCF )
nIdx = 0;
#endif // OSL_BIGENDIAN
// Pointer auf Inhalts-Array
- pPLCF_Contents = (BYTE*)&pPLCF_PosArray[nIMax + 1];
+ pPLCF_Contents = (sal_uInt8*)&pPLCF_PosArray[nIMax + 1];
pSt->Seek( nOldPos );
}
@@ -2205,28 +2205,28 @@ void WW8PLCF::GeneratePLCF( SvStream* pSt, long nPN, long ncpN )
ASSERT( nIMax < (long)ncpN, "Pcl.Fkp: Warum ist PLCF zu gross ?" );
nIMax = ncpN;
long nSiz = 6 * nIMax + 4;
- pPLCF_PosArray = new INT32[ ( nSiz + 3 ) / 4 ]; // Pointer auf Pos-Array
+ pPLCF_PosArray = new sal_Int32[ ( nSiz + 3 ) / 4 ]; // Pointer auf Pos-Array
memset( pPLCF_PosArray, 0, (size_t)nSiz );
- INT32 nFc;
- USHORT i;
+ sal_Int32 nFc;
+ sal_uInt16 i;
for( i = 0; i < ncpN; i++ ){ // Baue FC-Eintraege
pSt->Seek( ( nPN + i ) << 9 ); // erster FC-Eintrag jedes Fkp
*pSt >> nFc;
pPLCF_PosArray[i] = nFc;
}
- ULONG nLastFkpPos = ( ( nPN + nIMax - 1 ) << 9 );
+ sal_uLong nLastFkpPos = ( ( nPN + nIMax - 1 ) << 9 );
pSt->Seek( nLastFkpPos + 511 ); // Anz. Fkp-Eintraege des letzten Fkp
- BYTE nb;
+ sal_uInt8 nb;
*pSt >> nb;
pSt->Seek( nLastFkpPos + nb * 4 ); // letzer FC-Eintrag des letzten Fkp
*pSt >> nFc;
pPLCF_PosArray[nIMax] = nFc; // Ende des letzten Fkp
// Pointer auf Inhalts-Array
- pPLCF_Contents = (BYTE*)&pPLCF_PosArray[nIMax + 1];
- BYTE* p = pPLCF_Contents;
+ pPLCF_Contents = (sal_uInt8*)&pPLCF_PosArray[nIMax + 1];
+ sal_uInt8* p = pPLCF_Contents;
for( i = 0; i < ncpN; i++ ) // Baue PNs
{
@@ -2300,7 +2300,7 @@ WW8PLCFpcd::WW8PLCFpcd( SvStream* pSt, long nFilePos, long nPLCF, long nStruct )
:nStru( nStruct )
{
nIMax = ( nPLCF - 4 ) / ( 4 + nStruct );
- pPLCF_PosArray = new INT32[ ( nPLCF + 3 ) / 4 ]; // Pointer auf Pos-Array
+ pPLCF_PosArray = new sal_Int32[ ( nPLCF + 3 ) / 4 ]; // Pointer auf Pos-Array
long nOldPos = pSt->Tell();
@@ -2312,7 +2312,7 @@ WW8PLCFpcd::WW8PLCFpcd( SvStream* pSt, long nFilePos, long nPLCF, long nStruct )
#endif // OSL_BIGENDIAN
// Pointer auf Inhalts-Array
- pPLCF_Contents = (BYTE*)&pPLCF_PosArray[nIMax + 1];
+ pPLCF_Contents = (sal_uInt8*)&pPLCF_PosArray[nIMax + 1];
pSt->Seek( nOldPos );
}
@@ -2386,7 +2386,7 @@ bool WW8PLCFx_Fc_FKP::WW8Fkp::Entry::operator<
return (mnFC < rSecond.mnFC);
}
-WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(BYTE nFibVer, SvStream* pSt, SvStream* pDataSt,
+WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(sal_uInt8 nFibVer, SvStream* pSt, SvStream* pDataSt,
long _nFilePos, long nItemSiz, ePLCFT ePl, WW8_FC nStartFc)
: nItemSize(nItemSiz), nFilePos(_nFilePos), nIdx(0), ePLCF(ePl),
maSprmParser(nFibVer)
@@ -2403,7 +2403,7 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(BYTE nFibVer, SvStream* pSt, SvStream* pDataSt,
for (nIdx = 0; nIdx < nIMax; ++nIdx)
{
- USHORT nOfs = (*(pOfs + nIdx * nItemSize)) * 2;
+ sal_uInt16 nOfs = (*(pOfs + nIdx * nItemSize)) * 2;
Entry aEntry(Get_Long(pStart));
if (nOfs)
@@ -2428,13 +2428,13 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(BYTE nFibVer, SvStream* pSt, SvStream* pDataSt,
aEntry.mpData = maRawData + nOfs + 3+ nDelta;
- USHORT nSpId = maSprmParser.GetSprmId(aEntry.mpData);
+ sal_uInt16 nSpId = maSprmParser.GetSprmId(aEntry.mpData);
if (0x6645 == nSpId || 0x6646 == nSpId)
{
- UINT32 nCurr = pDataSt->Tell();
+ sal_uInt32 nCurr = pDataSt->Tell();
- UINT32 nPos = SVBT32ToUInt32(aEntry.mpData + 2);
+ sal_uInt32 nPos = SVBT32ToUInt32(aEntry.mpData + 2);
pDataSt->Seek(nPos);
*pDataSt >> aEntry.mnLen;
aEntry.mpData = new sal_uInt8[aEntry.mnLen];
@@ -2548,7 +2548,7 @@ bool WW8PLCFx_Fc_FKP::WW8Fkp::SeekPos(WW8_FC nFc)
return false;
}
-BYTE* WW8PLCFx_Fc_FKP::WW8Fkp::Get( WW8_FC& rStart, WW8_FC& rEnd, long& rLen )
+sal_uInt8* WW8PLCFx_Fc_FKP::WW8Fkp::Get( WW8_FC& rStart, WW8_FC& rEnd, long& rLen )
const
{
rLen = 0;
@@ -2562,42 +2562,42 @@ BYTE* WW8PLCFx_Fc_FKP::WW8Fkp::Get( WW8_FC& rStart, WW8_FC& rEnd, long& rLen )
rStart = maEntries[nIdx].mnFC;
rEnd = maEntries[nIdx + 1].mnFC;
- BYTE* pSprms = GetLenAndIStdAndSprms( rLen );
+ sal_uInt8* pSprms = GetLenAndIStdAndSprms( rLen );
return pSprms;
}
-void WW8PLCFx_Fc_FKP::WW8Fkp::SetIdx( ULONG nI )
+void WW8PLCFx_Fc_FKP::WW8Fkp::SetIdx( sal_uLong nI )
{
if( nI < nIMax)
nIdx = (short)nI;
}
-BYTE* WW8PLCFx_Fc_FKP::WW8Fkp::GetLenAndIStdAndSprms(long& rLen) const
+sal_uInt8* WW8PLCFx_Fc_FKP::WW8Fkp::GetLenAndIStdAndSprms(long& rLen) const
{
rLen = maEntries[nIdx].mnLen;
return maEntries[nIdx].mpData;
}
-const BYTE* WW8PLCFx_Fc_FKP::WW8Fkp::HasSprm( USHORT nId )
+const sal_uInt8* WW8PLCFx_Fc_FKP::WW8Fkp::HasSprm( sal_uInt16 nId )
{
if( nIdx >= nIMax )
return 0;
long nLen;
- BYTE* pSprms = GetLenAndIStdAndSprms( nLen );
+ sal_uInt8* pSprms = GetLenAndIStdAndSprms( nLen );
WW8SprmIter aIter(pSprms, nLen, maSprmParser);
return aIter.FindSprm(nId);
}
-bool WW8PLCFx_Fc_FKP::WW8Fkp::HasSprm(USHORT nId,
- std::vector<const BYTE *> &rResult)
+bool WW8PLCFx_Fc_FKP::WW8Fkp::HasSprm(sal_uInt16 nId,
+ std::vector<const sal_uInt8 *> &rResult)
{
if (nIdx >= nIMax)
return false;
long nLen;
- BYTE* pSprms = GetLenAndIStdAndSprms( nLen );
+ sal_uInt8* pSprms = GetLenAndIStdAndSprms( nLen );
WW8SprmIter aIter(pSprms, nLen, maSprmParser);
@@ -2630,12 +2630,12 @@ long WW8PLCFx::GetNoSprms( long& rStart, long& rEnd, long& rLen )
}
// ...Idx2: Default: ignorieren
-ULONG WW8PLCFx::GetIdx2() const
+sal_uLong WW8PLCFx::GetIdx2() const
{
return 0;
}
-void WW8PLCFx::SetIdx2(ULONG )
+void WW8PLCFx::SetIdx2(sal_uLong )
{
}
@@ -2686,7 +2686,7 @@ bool WW8PLCFx_Fc_FKP::NewFkp()
return false; // PLCF fertig abgearbeitet
}
(*pPLCF)++;
- long nPo = SVBT16ToShort( (BYTE *)pPage );
+ long nPo = SVBT16ToShort( (sal_uInt8 *)pPage );
nPo <<= 9; // shift als LONG
long nAktFkpFilePos = pFkp ? pFkp->GetFilePos() : -1;
@@ -2746,15 +2746,15 @@ WW8PLCFx_Fc_FKP::~WW8PLCFx_Fc_FKP()
delete pPCDAttrs;
}
-ULONG WW8PLCFx_Fc_FKP::GetIdx() const
+sal_uLong WW8PLCFx_Fc_FKP::GetIdx() const
{
- ULONG u = pPLCF->GetIdx() << 8;
+ sal_uLong u = pPLCF->GetIdx() << 8;
if (pFkp)
u |= pFkp->GetIdx();
return u;
}
-void WW8PLCFx_Fc_FKP::SetIdx( ULONG nIdx )
+void WW8PLCFx_Fc_FKP::SetIdx( sal_uLong nIdx )
{
if( !( nIdx & 0xffffff00L ) )
{
@@ -2783,7 +2783,7 @@ bool WW8PLCFx_Fc_FKP::SeekPos(WW8_FC nFcPos)
void* pPage;
if( pFkp && pPLCF->Get( nPLCFStart, nPLCFEnd, pPage ) )
{
- long nPo = SVBT16ToShort( (BYTE *)pPage );
+ long nPo = SVBT16ToShort( (sal_uInt8 *)pPage );
nPo <<= 9; // shift als LONG
if (nPo != pFkp->GetFilePos())
pFkp = 0;
@@ -2808,7 +2808,7 @@ WW8_FC WW8PLCFx_Fc_FKP::Where()
return Where(); // am einfachsten rekursiv
}
-BYTE* WW8PLCFx_Fc_FKP::GetSprmsAndPos(WW8_FC& rStart, WW8_FC& rEnd, long& rLen)
+sal_uInt8* WW8PLCFx_Fc_FKP::GetSprmsAndPos(WW8_FC& rStart, WW8_FC& rEnd, long& rLen)
{
rLen = 0; // Default
rStart = rEnd = LONG_MAX;
@@ -2819,7 +2819,7 @@ BYTE* WW8PLCFx_Fc_FKP::GetSprmsAndPos(WW8_FC& rStart, WW8_FC& rEnd, long& rLen)
return 0;
}
- BYTE* pPos = pFkp->Get( rStart, rEnd, rLen );
+ sal_uInt8* pPos = pFkp->Get( rStart, rEnd, rLen );
if( rStart == LONG_MAX ) //Not found
return 0;
return pPos;
@@ -2840,7 +2840,7 @@ WW8PLCFx& WW8PLCFx_Fc_FKP::operator ++( int )
return *this;
}
-USHORT WW8PLCFx_Fc_FKP::GetIstd() const
+sal_uInt16 WW8PLCFx_Fc_FKP::GetIstd() const
{
return pFkp ? pFkp->GetIstd() : 0xFFFF;
}
@@ -2862,7 +2862,7 @@ void WW8PLCFx_Fc_FKP::GetPCDSprms( WW8PLCFxDesc& rDesc )
}
}
-const BYTE* WW8PLCFx_Fc_FKP::HasSprm( USHORT nId )
+const sal_uInt8* WW8PLCFx_Fc_FKP::HasSprm( sal_uInt16 nId )
{
// const waere schoener, aber dafuer muesste NewFkp() ersetzt werden oder
// wegfallen
@@ -2874,7 +2874,7 @@ const BYTE* WW8PLCFx_Fc_FKP::HasSprm( USHORT nId )
return 0;
}
- const BYTE* pRes = pFkp->HasSprm( nId );
+ const sal_uInt8* pRes = pFkp->HasSprm( nId );
if( !pRes )
{
@@ -2892,7 +2892,7 @@ const BYTE* WW8PLCFx_Fc_FKP::HasSprm( USHORT nId )
return pRes;
}
-bool WW8PLCFx_Fc_FKP::HasSprm(USHORT nId, std::vector<const BYTE *> &rResult)
+bool WW8PLCFx_Fc_FKP::HasSprm(sal_uInt16 nId, std::vector<const sal_uInt8 *> &rResult)
{
// const waere schoener, aber dafuer muesste NewFkp() ersetzt werden oder
// wegfallen
@@ -2965,17 +2965,17 @@ void WW8PLCFx_Cp_FKP::ResetAttrStartEnd()
bLineEnd = false;
}
-ULONG WW8PLCFx_Cp_FKP::GetPCDIMax() const
+sal_uLong WW8PLCFx_Cp_FKP::GetPCDIMax() const
{
return pPcd ? pPcd->GetIMax() : 0;
}
-ULONG WW8PLCFx_Cp_FKP::GetPCDIdx() const
+sal_uLong WW8PLCFx_Cp_FKP::GetPCDIdx() const
{
return pPcd ? pPcd->GetIdx() : 0;
}
-void WW8PLCFx_Cp_FKP::SetPCDIdx( ULONG nIdx )
+void WW8PLCFx_Cp_FKP::SetPCDIdx( sal_uLong nIdx )
{
if( pPcd )
pPcd->SetIdx( nIdx );
@@ -3026,7 +3026,7 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p)
Otherwise our cool fastsave algorithm can be brought to bear on the
problem.
*/
- ULONG nOldPos = pPieceIter->GetIdx();
+ sal_uLong nOldPos = pPieceIter->GetIdx();
bool bOk = pPieceIter->SeekPos(nOrigCp);
pPieceIter->SetIdx( nOldPos );
if (!bOk)
@@ -3053,7 +3053,7 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p)
//We set the piece iterator to the piece that contains the
//character, now we have the correct piece for this character
- ULONG nOldPos = pPieceIter->GetIdx();
+ sal_uLong nOldPos = pPieceIter->GetIdx();
p->nStartPos = nOrigCp;
pPieceIter->SeekPos( p->nStartPos);
@@ -3130,7 +3130,7 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p)
break;
}
bIsUnicode = false;
- INT32 nFcStart=SVBT32ToUInt32(((WW8_PCD*)pData)->fc);
+ sal_Int32 nFcStart=SVBT32ToUInt32(((WW8_PCD*)pData)->fc);
if( 8 <= GetVersion() )
{
@@ -3212,7 +3212,7 @@ WW8PLCFx_SEPX::WW8PLCFx_SEPX(SvStream* pSt, SvStream* pTblSt,
? new WW8PLCF(pTblSt, rFib.fcPlcfsed, rFib.lcbPlcfsed, 12, nStartCp)
: 0;
- pSprms = new BYTE[nArrMax]; // maximum length
+ pSprms = new sal_uInt8[nArrMax]; // maximum length
}
WW8PLCFx_SEPX::~WW8PLCFx_SEPX()
@@ -3221,12 +3221,12 @@ WW8PLCFx_SEPX::~WW8PLCFx_SEPX()
delete[] pSprms;
}
-ULONG WW8PLCFx_SEPX::GetIdx() const
+sal_uLong WW8PLCFx_SEPX::GetIdx() const
{
return pPLCF ? pPLCF->GetIdx() : 0;
}
-void WW8PLCFx_SEPX::SetIdx( ULONG nIdx )
+void WW8PLCFx_SEPX::SetIdx( sal_uLong nIdx )
{
if( pPLCF ) pPLCF->SetIdx( nIdx );
}
@@ -3256,7 +3256,7 @@ void WW8PLCFx_SEPX::GetSprms(WW8PLCFxDesc* p)
}
else
{
- long nPo = SVBT32ToUInt32( (BYTE*)pData+2 );
+ long nPo = SVBT32ToUInt32( (sal_uInt8*)pData+2 );
if (nPo == -1L)
{
p->nStartPos = p->nEndPos = LONG_MAX; // Sepx empty
@@ -3272,7 +3272,7 @@ void WW8PLCFx_SEPX::GetSprms(WW8PLCFxDesc* p)
{ // passt nicht
delete[] pSprms;
nArrMax = nSprmSiz; // Hole mehr Speicher
- pSprms = new BYTE[nArrMax];
+ pSprms = new sal_uInt8[nArrMax];
}
pStrm->Read( pSprms, nSprmSiz ); // read Sprms
@@ -3289,15 +3289,15 @@ WW8PLCFx& WW8PLCFx_SEPX::operator ++( int )
return *this;
}
-const BYTE* WW8PLCFx_SEPX::HasSprm( USHORT nId ) const
+const sal_uInt8* WW8PLCFx_SEPX::HasSprm( sal_uInt16 nId ) const
{
return HasSprm( nId, pSprms, nSprmSiz);
}
-const BYTE* WW8PLCFx_SEPX::HasSprm( USHORT nId, const BYTE* pOtherSprms,
+const sal_uInt8* WW8PLCFx_SEPX::HasSprm( sal_uInt16 nId, const sal_uInt8* pOtherSprms,
long nOtherSprmSiz ) const
{
- const BYTE *pRet = 0;
+ const sal_uInt8 *pRet = 0;
if (pPLCF)
{
WW8SprmIter aIter(pOtherSprms, nOtherSprmSiz, maSprmParser);
@@ -3306,8 +3306,8 @@ const BYTE* WW8PLCFx_SEPX::HasSprm( USHORT nId, const BYTE* pOtherSprms,
return pRet;
}
-bool WW8PLCFx_SEPX::Find4Sprms(USHORT nId1,USHORT nId2,USHORT nId3,USHORT nId4,
- BYTE*& p1, BYTE*& p2, BYTE*& p3, BYTE*& p4) const
+bool WW8PLCFx_SEPX::Find4Sprms(sal_uInt16 nId1,sal_uInt16 nId2,sal_uInt16 nId3,sal_uInt16 nId4,
+ sal_uInt8*& p1, sal_uInt8*& p2, sal_uInt8*& p3, sal_uInt8*& p4) const
{
if( !pPLCF )
return 0;
@@ -3318,12 +3318,12 @@ bool WW8PLCFx_SEPX::Find4Sprms(USHORT nId1,USHORT nId2,USHORT nId3,USHORT nId4,
p3 = 0;
p4 = 0;
- BYTE* pSp = pSprms;
- USHORT i=0;
+ sal_uInt8* pSp = pSprms;
+ sal_uInt16 i=0;
while (i + maSprmParser.MinSprmLen() <= nSprmSiz)
{
// Sprm gefunden?
- USHORT nAktId = maSprmParser.GetSprmId(pSp);
+ sal_uInt16 nAktId = maSprmParser.GetSprmId(pSp);
bool bOk = true;
if( nAktId == nId1 )
p1 = pSp + maSprmParser.DistanceToData(nId1);
@@ -3337,33 +3337,33 @@ bool WW8PLCFx_SEPX::Find4Sprms(USHORT nId1,USHORT nId2,USHORT nId3,USHORT nId4,
bOk = false;
bFound |= bOk;
// erhoehe Zeiger, so dass er auf naechsten Sprm zeigt
- USHORT x = maSprmParser.GetSprmSize(nAktId, pSp);
+ sal_uInt16 x = maSprmParser.GetSprmSize(nAktId, pSp);
i += x;
pSp += x;
}
return bFound;
}
-const BYTE* WW8PLCFx_SEPX::HasSprm( USHORT nId, BYTE n2nd ) const
+const sal_uInt8* WW8PLCFx_SEPX::HasSprm( sal_uInt16 nId, sal_uInt8 n2nd ) const
{
if( !pPLCF )
return 0;
- BYTE* pSp = pSprms;
+ sal_uInt8* pSp = pSprms;
- USHORT i=0;
+ sal_uInt16 i=0;
while (i + maSprmParser.MinSprmLen() <= nSprmSiz)
{
// Sprm gefunden?
- USHORT nAktId = maSprmParser.GetSprmId(pSp);
+ sal_uInt16 nAktId = maSprmParser.GetSprmId(pSp);
if (nAktId == nId)
{
- BYTE *pRet = pSp + maSprmParser.DistanceToData(nId);
+ sal_uInt8 *pRet = pSp + maSprmParser.DistanceToData(nId);
if (*pRet == n2nd)
return pRet;
}
// erhoehe Zeiger, so dass er auf naechsten Sprm zeigt
- USHORT x = maSprmParser.GetSprmSize(nAktId, pSp);
+ sal_uInt16 x = maSprmParser.GetSprmSize(nAktId, pSp);
i += x;
pSp += x;
}
@@ -3372,7 +3372,7 @@ const BYTE* WW8PLCFx_SEPX::HasSprm( USHORT nId, BYTE n2nd ) const
}
//-----------------------------------------
-WW8PLCFx_SubDoc::WW8PLCFx_SubDoc(SvStream* pSt, BYTE nVersion,
+WW8PLCFx_SubDoc::WW8PLCFx_SubDoc(SvStream* pSt, sal_uInt8 nVersion,
WW8_CP nStartCp, long nFcRef, long nLenRef, long nFcTxt, long nLenTxt,
long nStruct)
: WW8PLCFx(nVersion, false), pRef(0), pTxt(0)
@@ -3390,7 +3390,7 @@ WW8PLCFx_SubDoc::~WW8PLCFx_SubDoc()
delete pTxt;
}
-ULONG WW8PLCFx_SubDoc::GetIdx() const
+sal_uLong WW8PLCFx_SubDoc::GetIdx() const
{
// Wahrscheinlich pTxt... nicht noetig
if( pRef )
@@ -3398,7 +3398,7 @@ ULONG WW8PLCFx_SubDoc::GetIdx() const
return 0;
}
-void WW8PLCFx_SubDoc::SetIdx( ULONG nIdx )
+void WW8PLCFx_SubDoc::SetIdx( sal_uLong nIdx )
{
if( pRef )
{
@@ -3431,7 +3431,7 @@ long WW8PLCFx_SubDoc::GetNoSprms( WW8_CP& rStart, long& rEnd, long& rLen )
return -1;
}
- ULONG nNr = pRef->GetIdx();
+ sal_uLong nNr = pRef->GetIdx();
if (!pRef->Get( rStart, nE, pData ))
{
@@ -3512,12 +3512,12 @@ WW8PLCFx_FLD::~WW8PLCFx_FLD()
delete pPLCF;
}
-ULONG WW8PLCFx_FLD::GetIdx() const
+sal_uLong WW8PLCFx_FLD::GetIdx() const
{
return pPLCF ? pPLCF->GetIdx() : 0;
}
-void WW8PLCFx_FLD::SetIdx( ULONG nIdx )
+void WW8PLCFx_FLD::SetIdx( sal_uLong nIdx )
{
if( pPLCF )
pPLCF->SetIdx( nIdx );
@@ -3539,7 +3539,7 @@ bool WW8PLCFx_FLD::StartPosIsFieldStart()
long nTest;
if (
(!pPLCF || !pPLCF->Get(nTest, pData) ||
- ((((BYTE*)pData)[0] & 0x1f) != 0x13))
+ ((((sal_uInt8*)pData)[0] & 0x1f) != 0x13))
)
return false;
return true;
@@ -3557,7 +3557,7 @@ bool WW8PLCFx_FLD::EndPosIsFieldEnd()
void* pData;
long nTest;
- if ( pPLCF->Get(nTest, pData) && ((((BYTE*)pData)[0] & 0x1f) == 0x15) )
+ if ( pPLCF->Get(nTest, pData) && ((((sal_uInt8*)pData)[0] & 0x1f) == 0x15) )
bRet = true;
pPLCF->SetIdx(n);
@@ -3631,20 +3631,20 @@ bool WW8PLCFx_FLD::GetPara(long nIdx, WW8FieldDesc& rF)
//-----------------------------------------
/* to be optimized like this: */
-void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, UINT32 nStart, INT32 nLen,
- USHORT nExtraLen, rtl_TextEncoding eCS, std::vector<String> &rArray,
+void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen,
+ sal_uInt16 nExtraLen, rtl_TextEncoding eCS, std::vector<String> &rArray,
std::vector<String>* pExtraArray)
{
- ULONG nOldPos = rStrm.Tell();
+ sal_uLong nOldPos = rStrm.Tell();
rStrm.Seek( nStart );
- UINT16 nLen2;
+ sal_uInt16 nLen2;
rStrm >> nLen2; // bVer67: total length of structure
// bVer8 : count of strings
if( bVer8 )
{
- UINT16 nStrings;
+ sal_uInt16 nStrings;
bool bUnicode = (0xFFFF == nLen2);
if( bUnicode )
rStrm >> nStrings;
@@ -3653,13 +3653,13 @@ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, UINT32 nStart, INT32 nLen,
rStrm >> nExtraLen;
- for( USHORT i=0; i < nStrings; i++ )
+ for( sal_uInt16 i=0; i < nStrings; i++ )
{
if( bUnicode )
rArray.push_back(WW8Read_xstz(rStrm, 0, false));
else
{
- BYTE nBChar;
+ sal_uInt8 nBChar;
rStrm >> nBChar;
ByteString aTmp;
SafeReadString(aTmp,nBChar,rStrm);
@@ -3682,7 +3682,7 @@ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, UINT32 nStart, INT32 nLen,
}
else
{
- BYTE nBChar;
+ sal_uInt8 nBChar;
if( nLen2 != nLen )
{
ASSERT( nLen2 == nLen, "Fib length and read length are different" );
@@ -3690,9 +3690,9 @@ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, UINT32 nStart, INT32 nLen,
nLen = USHRT_MAX;
else if (nLen < 2 )
nLen = 2;
- nLen2 = static_cast<UINT16>(nLen);
+ nLen2 = static_cast<sal_uInt16>(nLen);
}
- ULONG nRead = 0;
+ sal_uLong nRead = 0;
for( nLen2 -= 2; nRead < nLen2; )
{
rStrm >> nBChar; ++nRead;
@@ -3763,28 +3763,28 @@ WW8PLCFx_Book::~WW8PLCFx_Book()
delete pBook[0];
}
-ULONG WW8PLCFx_Book::GetIdx() const
+sal_uLong WW8PLCFx_Book::GetIdx() const
{
return nIMax ? pBook[0]->GetIdx() : 0;
}
-void WW8PLCFx_Book::SetIdx( ULONG nI )
+void WW8PLCFx_Book::SetIdx( sal_uLong nI )
{
if( nIMax )
pBook[0]->SetIdx( nI );
}
-ULONG WW8PLCFx_Book::GetIdx2() const
+sal_uLong WW8PLCFx_Book::GetIdx2() const
{
return nIMax ? ( pBook[1]->GetIdx() | ( ( nIsEnd ) ? 0x80000000 : 0 ) ) : 0;
}
-void WW8PLCFx_Book::SetIdx2( ULONG nI )
+void WW8PLCFx_Book::SetIdx2( sal_uLong nI )
{
if( nIMax )
{
pBook[1]->SetIdx( nI & 0x7fffffff );
- nIsEnd = (USHORT)( ( nI >> 31 ) & 1 ); // 0 oder 1
+ nIsEnd = (sal_uInt16)( ( nI >> 31 ) & 1 ); // 0 oder 1
}
}
@@ -3839,8 +3839,8 @@ WW8PLCFx& WW8PLCFx_Book::operator ++( int )
{
(*pBook[nIsEnd])++;
- ULONG l0 = pBook[0]->Where();
- ULONG l1 = pBook[1]->Where();
+ sal_uLong l0 = pBook[0]->Where();
+ sal_uLong l1 = pBook[1]->Where();
if( l0 < l1 )
nIsEnd = 0;
else if( l1 < l0 )
@@ -3865,13 +3865,13 @@ long WW8PLCFx_Book::GetLen() const
ASSERT( !this, "Falscher Aufruf (2) von PLCF_Book::GetLen()" );
return 0;
}
- USHORT nEndIdx = SVBT16ToShort( *((SVBT16*)p) );
+ sal_uInt16 nEndIdx = SVBT16ToShort( *((SVBT16*)p) );
long nNum = pBook[1]->GetPos( nEndIdx );
nNum -= nStartPos;
return nNum;
}
-void WW8PLCFx_Book::SetStatus(USHORT nIndex, eBookStatus eStat )
+void WW8PLCFx_Book::SetStatus(sal_uInt16 nIndex, eBookStatus eStat )
{
ASSERT(nIndex < nIMax, "set status of non existing bookmark!");
pStatus[nIndex] = (eBookStatus)( pStatus[nIndex] | eStat );
@@ -3901,17 +3901,17 @@ long WW8PLCFx_Book::GetHandle() const
}
}
-String WW8PLCFx_Book::GetBookmark(long nStart,long nEnd, USHORT &nIndex)
+String WW8PLCFx_Book::GetBookmark(long nStart,long nEnd, sal_uInt16 &nIndex)
{
bool bFound = false;
- USHORT i = 0;
+ sal_uInt16 i = 0;
if( pBook[0] && pBook[1] )
{
WW8_CP nStartAkt, nEndAkt;
do
{
void* p;
- USHORT nEndIdx;
+ sal_uInt16 nEndIdx;
if( pBook[0]->GetData( i, nStartAkt, p ) && p )
nEndIdx = SVBT16ToShort( *((SVBT16*)p) );
@@ -3942,12 +3942,12 @@ bool WW8PLCFx_Book::MapName(String& rName)
return false;
bool bFound = false;
- USHORT i = 0;
+ sal_uInt16 i = 0;
WW8_CP nStartAkt, nEndAkt;
do
{
void* p;
- USHORT nEndIdx;
+ sal_uInt16 nEndIdx;
if( pBook[0]->GetData( i, nStartAkt, p ) && p )
nEndIdx = SVBT16ToShort( *((SVBT16*)p) );
@@ -4078,9 +4078,9 @@ void WW8PLCFMan::GetNewNoSprms( WW8PLCFxDesc& rDesc )
rDesc.nOrigSprmsLen = rDesc.nSprmsLen;
}
-USHORT WW8PLCFMan::GetId(const WW8PLCFxDesc* p) const
+sal_uInt16 WW8PLCFMan::GetId(const WW8PLCFxDesc* p) const
{
- USHORT nId;
+ sal_uInt16 nId;
if (p == pFld)
nId = eFLD;
@@ -4103,7 +4103,7 @@ WW8PLCFMan::WW8PLCFMan(WW8ScannerBase* pBase, short nType, long nStartCp,
memset( aD, 0, sizeof( aD ) );
nLineEnd = LONG_MAX;
nManType = nType;
- USHORT i;
+ sal_uInt16 i;
if( MAN_MAINTEXT == nType )
{
@@ -4253,7 +4253,7 @@ WW8PLCFMan::WW8PLCFMan(WW8ScannerBase* pBase, short nType, long nStartCp,
if( p->pPLCFx->IsSprm() )
{
// Vorsicht: nEndPos muss bereits
- p->pIdStk = new std::stack<USHORT>;
+ p->pIdStk = new std::stack<sal_uInt16>;
if ((p == pChp) || (p == pPap))
{
WW8_CP nTemp = p->nEndPos+p->nCpOfs;
@@ -4275,20 +4275,20 @@ WW8PLCFMan::WW8PLCFMan(WW8ScannerBase* pBase, short nType, long nStartCp,
WW8PLCFMan::~WW8PLCFMan()
{
- for( USHORT i=0; i<nPLCF; i++)
+ for( sal_uInt16 i=0; i<nPLCF; i++)
delete aD[i].pIdStk;
}
// 0. welche Attr.-Klasse,
// 1. ob ein Attr.-Start ist,
// 2. CP, wo ist naechste Attr.-Aenderung
-USHORT WW8PLCFMan::WhereIdx(bool* pbStart, long* pPos) const
+sal_uInt16 WW8PLCFMan::WhereIdx(bool* pbStart, long* pPos) const
{
ASSERT(nPLCF,"What the hell");
long nNext = LONG_MAX; // SuchReihenfolge:
- USHORT nNextIdx = nPLCF;// first ending found ( CHP, PAP, ( SEP ) ),
+ sal_uInt16 nNextIdx = nPLCF;// first ending found ( CHP, PAP, ( SEP ) ),
bool bStart = true; // dann Anfaenge finden ( ( SEP ), PAP, CHP )
- USHORT i;
+ sal_uInt16 i;
const WW8PLCFxDesc* pD;
for (i=0; i < nPLCF; i++)
{
@@ -4345,7 +4345,7 @@ void WW8PLCFMan::SeekPos( long nNewCp )
void WW8PLCFMan::SaveAllPLCFx( WW8PLCFxSaveAll& rSave ) const
{
- USHORT i, n=0;
+ sal_uInt16 i, n=0;
if( pPcd )
pPcd->Save( rSave.aS[n++] );
if( pPcdA )
@@ -4358,7 +4358,7 @@ void WW8PLCFMan::SaveAllPLCFx( WW8PLCFxSaveAll& rSave ) const
void WW8PLCFMan::RestoreAllPLCFx( const WW8PLCFxSaveAll& rSave )
{
- USHORT i, n=0;
+ sal_uInt16 i, n=0;
if( pPcd )
pPcd->Restore( rSave.aS[n++] );
if( pPcdA )
@@ -4456,7 +4456,7 @@ void WW8PLCFMan::GetNoSprmEnd( short nIdx, WW8PLCFManResult* pRes ) const
pRes->nSprmId = 0;
}
-bool WW8PLCFMan::TransferOpenSprms(std::stack<USHORT> &rStack)
+bool WW8PLCFMan::TransferOpenSprms(std::stack<sal_uInt16> &rStack)
{
for (int i = 0; i < nPLCF; ++i)
{
@@ -4479,7 +4479,7 @@ void WW8PLCFMan::AdvSprm(short nIdx, bool bStart)
p->bFirstSprm = false;
if( bStart )
{
- USHORT nLastId = GetId(p);
+ sal_uInt16 nLastId = GetId(p);
p->pIdStk->push(nLastId); // merke Id fuer Attribut-Ende
if( p->nSprmsLen )
@@ -4489,7 +4489,7 @@ void WW8PLCFMan::AdvSprm(short nIdx, bool bStart)
if( p->pMemPos )
{
// Length of last sprm
- USHORT nSprmL = maSprmParser.GetSprmSize(nLastId, p->pMemPos);
+ sal_uInt16 nSprmL = maSprmParser.GetSprmSize(nLastId, p->pMemPos);
// Gesamtlaenge Sprms um SprmLaenge verringern
p->nSprmsLen -= nSprmL;
@@ -4642,7 +4642,7 @@ void WW8PLCFMan::AdvNoSprm(short nIdx, bool bStart)
WW8PLCFMan& WW8PLCFMan::operator ++(int)
{
bool bStart;
- USHORT nIdx = WhereIdx(&bStart);
+ sal_uInt16 nIdx = WhereIdx(&bStart);
if (nIdx < nPLCF)
{
WW8PLCFxDesc* p = &aD[nIdx];
@@ -4665,7 +4665,7 @@ bool WW8PLCFMan::Get(WW8PLCFManResult* pRes) const
{
memset( pRes, 0, sizeof( WW8PLCFManResult ) );
bool bStart;
- USHORT nIdx = WhereIdx(&bStart);
+ sal_uInt16 nIdx = WhereIdx(&bStart);
if( nIdx >= nPLCF )
{
@@ -4701,7 +4701,7 @@ bool WW8PLCFMan::Get(WW8PLCFManResult* pRes) const
}
}
-USHORT WW8PLCFMan::GetColl() const
+sal_uInt16 WW8PLCFMan::GetColl() const
{
if( pPap->pPLCFx )
return pPap->pPLCFx->GetIstd();
@@ -4717,18 +4717,18 @@ WW8PLCFx_FLD* WW8PLCFMan::GetFld() const
return (WW8PLCFx_FLD*)pFld->pPLCFx;
}
-const BYTE* WW8PLCFMan::HasParaSprm( USHORT nId ) const
+const sal_uInt8* WW8PLCFMan::HasParaSprm( sal_uInt16 nId ) const
{
return ((WW8PLCFx_Cp_FKP*)pPap->pPLCFx)->HasSprm( nId );
}
-const BYTE* WW8PLCFMan::HasCharSprm( USHORT nId ) const
+const sal_uInt8* WW8PLCFMan::HasCharSprm( sal_uInt16 nId ) const
{
return ((WW8PLCFx_Cp_FKP*)pChp->pPLCFx)->HasSprm( nId );
}
-bool WW8PLCFMan::HasCharSprm(USHORT nId,
- std::vector<const BYTE *> &rResult) const
+bool WW8PLCFMan::HasCharSprm(sal_uInt16 nId,
+ std::vector<const sal_uInt8 *> &rResult) const
{
return ((WW8PLCFx_Cp_FKP*)pChp->pPLCFx)->HasSprm(nId, rResult);
}
@@ -4750,12 +4750,12 @@ void WW8PLCFx::Restore( const WW8PLCFxSave1& rSave )
SetStartFc( rSave.nStartFC );
}
-ULONG WW8PLCFx_Cp_FKP::GetIdx2() const
+sal_uLong WW8PLCFx_Cp_FKP::GetIdx2() const
{
return GetPCDIdx();
}
-void WW8PLCFx_Cp_FKP::SetIdx2( ULONG nIdx )
+void WW8PLCFx_Cp_FKP::SetIdx2( sal_uLong nIdx )
{
SetPCDIdx( nIdx );
}
@@ -4828,12 +4828,12 @@ void WW8PLCFxDesc::Restore( const WW8PLCFxSave1& rSave )
//-----------------------------------------
-WW8Fib::WW8Fib( SvStream& rSt, BYTE nWantedVersion,UINT32 nOffset )
+WW8Fib::WW8Fib( SvStream& rSt, sal_uInt8 nWantedVersion,sal_uInt32 nOffset )
: nFibError( 0 )
{
- BYTE aBits1;
- BYTE aBits2;
- BYTE aVer8Bits1; // nur ab WinWord 8 benutzt
+ sal_uInt8 aBits1;
+ sal_uInt8 aBits2;
+ sal_uInt8 aVer8Bits1; // nur ab WinWord 8 benutzt
rSt.Seek( nOffset );
/*
Wunsch-Nr vermerken, File-Versionsnummer ermitteln
@@ -4845,8 +4845,8 @@ WW8Fib::WW8Fib( SvStream& rSt, BYTE nWantedVersion,UINT32 nOffset )
rSt >> nProduct;
if( 0 != rSt.GetError() )
{
- INT16 nFibMin;
- INT16 nFibMax;
+ sal_Int16 nFibMin;
+ sal_Int16 nFibMax;
// note: 6 stands for "6 OR 7", 7 stands for "ONLY 7"
switch( nVersion )
{
@@ -4884,10 +4884,10 @@ WW8Fib::WW8Fib( SvStream& rSt, BYTE nWantedVersion,UINT32 nOffset )
bool bVer8 = (8 == nVersion);
// Hilfs-Varis fuer Ver67:
- INT16 pnChpFirst_Ver67=0;
- INT16 pnPapFirst_Ver67=0;
- INT16 cpnBteChp_Ver67=0;
- INT16 cpnBtePap_Ver67=0;
+ sal_Int16 pnChpFirst_Ver67=0;
+ sal_Int16 pnPapFirst_Ver67=0;
+ sal_Int16 cpnBteChp_Ver67=0;
+ sal_Int16 cpnBtePap_Ver67=0;
// und auf gehts: FIB einlesen
rSt >> lid;
@@ -4901,12 +4901,12 @@ WW8Fib::WW8Fib( SvStream& rSt, BYTE nWantedVersion,UINT32 nOffset )
rSt >> aVer8Bits1; // unter Ver67 nur leeres Reservefeld
// Inhalt von aVer8Bits1
//
- // BYTE fMac :1;
- // BYTE fEmptySpecial :1;
- // BYTE fLoadOverridePage :1;
- // BYTE fFuturesavedUndo :1;
- // BYTE fWord97Saved :1;
- // BYTE :3;
+ // sal_uInt8 fMac :1;
+ // sal_uInt8 fEmptySpecial :1;
+ // sal_uInt8 fLoadOverridePage :1;
+ // sal_uInt8 fFuturesavedUndo :1;
+ // sal_uInt8 fWord97Saved :1;
+ // sal_uInt8 :3;
rSt >> chse;
rSt >> chseTables;
rSt >> fcMin;
@@ -4922,7 +4922,7 @@ WW8Fib::WW8Fib( SvStream& rSt, BYTE nWantedVersion,UINT32 nOffset )
rSt >> wMagicRevised;
rSt >> wMagicCreatedPrivate;
rSt >> wMagicRevisedPrivate;
- rSt.SeekRel( 9 * sizeof( INT16 ) );
+ rSt.SeekRel( 9 * sizeof( sal_Int16 ) );
/*
// dies sind die 9 unused Felder:
@@ -4946,11 +4946,11 @@ WW8Fib::WW8Fib( SvStream& rSt, BYTE nWantedVersion,UINT32 nOffset )
rSt >> cbMac;
// 2 Longs uebergehen, da unwichtiger Quatsch
- rSt.SeekRel( 2 * sizeof( INT32) );
+ rSt.SeekRel( 2 * sizeof( sal_Int32) );
// weitere 2 Longs nur bei Ver67 ueberspringen
if( bVer67 )
- rSt.SeekRel( 2 * sizeof( INT32) );
+ rSt.SeekRel( 2 * sizeof( sal_Int32) );
rSt >> ccpText;
rSt >> ccpFtn;
@@ -4963,7 +4963,7 @@ WW8Fib::WW8Fib( SvStream& rSt, BYTE nWantedVersion,UINT32 nOffset )
// weiteres Long nur bei Ver67 ueberspringen
if( bVer67 )
- rSt.SeekRel( 1 * sizeof( INT32) );
+ rSt.SeekRel( 1 * sizeof( sal_Int32) );
else
{
// Einschub fuer WW8 *****************************************************
@@ -5064,7 +5064,7 @@ WW8Fib::WW8Fib( SvStream& rSt, BYTE nWantedVersion,UINT32 nOffset )
// weiteres short nur bei Ver67 ueberspringen
if (bVer67)
{
- rSt.SeekRel( 1*sizeof( INT16) );
+ rSt.SeekRel( 1*sizeof( sal_Int16) );
// folgende 4 Shorts existieren nur bei Ver67;
rSt >> pnChpFirst_Ver67;
@@ -5192,7 +5192,7 @@ WW8Fib::WW8Fib( SvStream& rSt, BYTE nWantedVersion,UINT32 nOffset )
}
-WW8Fib::WW8Fib(BYTE nVer)
+WW8Fib::WW8Fib(sal_uInt8 nVer)
{
memset(this, 0, sizeof(*this));
nVersion = nVer;
@@ -5234,13 +5234,13 @@ WW8Fib::WW8Fib(BYTE nVer)
bool WW8Fib::Write(SvStream& rStrm)
{
- BYTE *pDataPtr = new BYTE[ fcMin ];
- BYTE *pData = pDataPtr;
+ sal_uInt8 *pDataPtr = new sal_uInt8[ fcMin ];
+ sal_uInt8 *pData = pDataPtr;
memset( pData, 0, fcMin );
bool bVer8 = 8 == nVersion;
- ULONG nPos = rStrm.Tell();
+ sal_uLong nPos = rStrm.Tell();
cbMac = rStrm.Seek( STREAM_SEEK_TO_END );
rStrm.Seek( nPos );
@@ -5250,7 +5250,7 @@ bool WW8Fib::Write(SvStream& rStrm)
Set_UInt16( pData, lid );
Set_UInt16( pData, pnNext );
- UINT16 nBits16 = 0;
+ sal_uInt16 nBits16 = 0;
if( fDot ) nBits16 |= 0x0001;
if( fGlsy) nBits16 |= 0x0002;
if( fComplex ) nBits16 |= 0x0004;
@@ -5266,7 +5266,7 @@ bool WW8Fib::Write(SvStream& rStrm)
Set_UInt16( pData, lKey2 );
Set_UInt8( pData, envr );
- BYTE nBits8 = 0;
+ sal_uInt8 nBits8 = 0;
if( bVer8 )
{
if( fMac ) nBits8 |= 0x0001;
@@ -5294,7 +5294,7 @@ bool WW8Fib::Write(SvStream& rStrm)
Set_UInt16( pData, wMagicRevised );
Set_UInt16( pData, wMagicCreatedPrivate );
Set_UInt16( pData, wMagicRevisedPrivate );
- pData += 9 * sizeof( INT16 );
+ pData += 9 * sizeof( sal_Int16 );
Set_UInt16( pData, lidFE );
Set_UInt16( pData, clw );
}
@@ -5305,11 +5305,11 @@ bool WW8Fib::Write(SvStream& rStrm)
Set_UInt32( pData, cbMac );
// 2 Longs uebergehen, da unwichtiger Quatsch
- pData += 2 * sizeof( INT32);
+ pData += 2 * sizeof( sal_Int32);
// weitere 2 Longs nur bei Ver67 ueberspringen
if( !bVer8 )
- pData += 2 * sizeof( INT32);
+ pData += 2 * sizeof( sal_Int32);
Set_UInt32( pData, ccpText );
Set_UInt32( pData, ccpFtn );
@@ -5322,7 +5322,7 @@ bool WW8Fib::Write(SvStream& rStrm)
// weiteres Long nur bei Ver67 ueberspringen
if( !bVer8 )
- pData += 1 * sizeof( INT32);
+ pData += 1 * sizeof( sal_Int32);
// Einschub fuer WW8 *****************************************************
if( bVer8 )
@@ -5423,11 +5423,11 @@ bool WW8Fib::Write(SvStream& rStrm)
// weiteres short nur bei Ver67 ueberspringen
if( !bVer8 )
{
- pData += 1*sizeof( INT16);
- Set_UInt16( pData, (UINT16)pnChpFirst );
- Set_UInt16( pData, (UINT16)pnPapFirst );
- Set_UInt16( pData, (UINT16)cpnBteChp );
- Set_UInt16( pData, (UINT16)cpnBtePap );
+ pData += 1*sizeof( sal_Int16);
+ Set_UInt16( pData, (sal_uInt16)pnChpFirst );
+ Set_UInt16( pData, (sal_uInt16)pnPapFirst );
+ Set_UInt16( pData, (sal_uInt16)cpnBteChp );
+ Set_UInt16( pData, (sal_uInt16)cpnBtePap );
}
Set_UInt32( pData, fcPlcfdoaMom ); // nur bei Ver67, in Ver8 unused
@@ -5498,8 +5498,8 @@ bool WW8Fib::Write(SvStream& rStrm)
Set_UInt32( pData, lcbMagicTable );
pData += 0x3FA - 0x38A;
- Set_UInt16( pData, (UINT16)0x0002);
- Set_UInt16( pData, (UINT16)0x00D9);
+ Set_UInt16( pData, (sal_uInt16)0x0002);
+ Set_UInt16( pData, (sal_uInt16)0x00D9);
}
rStrm.Write( pDataPtr, fcMin );
@@ -5507,13 +5507,13 @@ bool WW8Fib::Write(SvStream& rStrm)
return 0 == rStrm.GetError();
}
-rtl_TextEncoding WW8Fib::GetFIBCharset(UINT16 chs)
+rtl_TextEncoding WW8Fib::GetFIBCharset(sal_uInt16 chs)
{
ASSERT(chs <= 0x100, "overflowed winword charset set");
rtl_TextEncoding eCharSet =
(0x0100 == chs)
? RTL_TEXTENCODING_APPLE_ROMAN
- : rtl_getTextEncodingFromWindowsCharset( static_cast<BYTE>(chs) );
+ : rtl_getTextEncodingFromWindowsCharset( static_cast<sal_uInt8>(chs) );
return eCharSet;
}
@@ -5527,7 +5527,7 @@ WW8Style::WW8Style(SvStream& rStream, WW8Fib& rFibPara)
rSt.Seek(nStyleStart);
- USHORT cbStshi = 0; // 2 bytes size of the following STSHI structure
+ sal_uInt16 cbStshi = 0; // 2 bytes size of the following STSHI structure
// alte Version ?
if (rFib.nFib < 67)
@@ -5536,10 +5536,10 @@ WW8Style::WW8Style(SvStream& rStream, WW8Fib& rFibPara)
// lies die Laenge der in der Datei gespeicherten Struktur
rSt >> cbStshi;
- UINT16 nRead = cbStshi;
+ sal_uInt16 nRead = cbStshi;
do
{
- UINT16 a16Bit;
+ sal_uInt16 a16Bit;
if( 2 > nRead ) break;
rSt >> cstd;
@@ -5590,10 +5590,10 @@ WW8_STD* WW8Style::Read1STDFixed( short& rSkip, short* pcbStd )
{
WW8_STD* pStd = 0;
- UINT16 cbStd;
+ sal_uInt16 cbStd;
rSt >> cbStd; // lies Laenge
- UINT16 nRead = cbSTDBaseInFile;
+ sal_uInt16 nRead = cbSTDBaseInFile;
if( cbStd >= cbSTDBaseInFile )
{
// Fixed part vollst. vorhanden
@@ -5604,7 +5604,7 @@ WW8_STD* WW8Style::Read1STDFixed( short& rSkip, short* pcbStd )
do
{
- UINT16 a16Bit;
+ sal_uInt16 a16Bit;
if( 2 > nRead ) break;
rSt >> a16Bit;
@@ -5737,7 +5737,7 @@ struct WW8_FFN_Ver8 : public WW8_FFN_BASE
sal_Char fs[ 24 ]; // 0x10 FONTSIGNATURE
// ab Ver8 als Unicode
- UINT16 szFfn[65]; // 0x6 bzw. 0x40 ab Ver8 zero terminated string that
+ sal_uInt16 szFfn[65]; // 0x6 bzw. 0x40 ab Ver8 zero terminated string that
// records name of font.
// Maximal size of szFfn is 65 characters.
// Vorsicht: Dieses Array kann auch kleiner sein!!!
@@ -5763,7 +5763,7 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
rSt.Seek( rFib.fcSttbfffn );
// allocate Font Array
- BYTE* pA = new BYTE[ rFib.lcbSttbfffn - 2 ];
+ sal_uInt8* pA = new sal_uInt8[ rFib.lcbSttbfffn - 2 ];
WW8_FFN* p = (WW8_FFN*)pA;
if( !bVer67 )
@@ -5797,7 +5797,7 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
if( nLeft < 1 ) // can we read the given ammount of bytes ?
break;
// increase p by nNextSiz Bytes
- p = (WW8_FFN *)( ( (BYTE*)p ) + nNextSiz );
+ p = (WW8_FFN *)( ( (sal_uInt8*)p ) + nNextSiz );
}
}
@@ -5810,11 +5810,11 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
if( bVer67 )
{
WW8_FFN_Ver6* pVer6 = (WW8_FFN_Ver6*)pA;
- BYTE c2;
- for(USHORT i=0; i<nMax; ++i, ++p)
+ sal_uInt8 c2;
+ for(sal_uInt16 i=0; i<nMax; ++i, ++p)
{
p->cbFfnM1 = pVer6->cbFfnM1;
- c2 = *(((BYTE*)pVer6) + 1);
+ c2 = *(((sal_uInt8*)pVer6) + 1);
p->prg = c2 & 0x02;
p->fTrueType = (c2 & 0x04) >> 2;
@@ -5840,17 +5840,17 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
p->sFontname += String(pVer6->szFfn+p->ibszAlt, eEnc);
// RTL_TEXTENCODING_MS_1252 );
}
- pVer6 = (WW8_FFN_Ver6*)( ((BYTE*)pVer6) + pVer6->cbFfnM1 + 1 );
+ pVer6 = (WW8_FFN_Ver6*)( ((sal_uInt8*)pVer6) + pVer6->cbFfnM1 + 1 );
}
}
else
{
WW8_FFN_Ver8* pVer8 = (WW8_FFN_Ver8*)pA;
- BYTE c2;
- for(USHORT i=0; i<nMax; ++i, ++p)
+ sal_uInt8 c2;
+ for(sal_uInt16 i=0; i<nMax; ++i, ++p)
{
p->cbFfnM1 = pVer8->cbFfnM1;
- c2 = *(((BYTE*)pVer8) + 1);
+ c2 = *(((sal_uInt8*)pVer8) + 1);
p->prg = c2 & 0x02;
p->fTrueType = (c2 & 0x04) >> 2;
@@ -5863,8 +5863,8 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
#ifdef __WW8_NEEDS_COPY
{
- BYTE nLen = 0x28;
- for( UINT16* pTmp = pVer8->szFfn;
+ sal_uInt8 nLen = 0x28;
+ for( sal_uInt16* pTmp = pVer8->szFfn;
nLen < pVer8->cbFfnM1 + 1 ; ++pTmp, nLen+=2 )
{
*pTmp = SVBT16ToShort( *(SVBT16*)pTmp );
@@ -5880,14 +5880,14 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
}
// Zeiger auf Ursprungsarray einen Font nach hinten setzen
- pVer8 = (WW8_FFN_Ver8*)( ((BYTE*)pVer8) + pVer8->cbFfnM1 + 1 );
+ pVer8 = (WW8_FFN_Ver8*)( ((sal_uInt8*)pVer8) + pVer8->cbFfnM1 + 1 );
}
}
}
delete[] pA;
}
-const WW8_FFN* WW8Fonts::GetFont( USHORT nNum ) const
+const WW8_FFN* WW8Fonts::GetFont( sal_uInt16 nNum ) const
{
if( !pFontA || nNum >= nMax )
return 0;
@@ -5930,7 +5930,7 @@ WW8PLCF_HdFt::WW8PLCF_HdFt( SvStream* pSt, WW8Fib& rFib, WW8Dop& rDop )
to point to the beginning of the next section's group of headers and
footers in this PLCF, UpdateIndex does that task.
*/
- for( BYTE nI = 0x1; nI <= 0x20; nI <<= 1 )
+ for( sal_uInt8 nI = 0x1; nI <= 0x20; nI <<= 1 )
if( nI & rDop.grpfIhdt ) // Bit gesetzt ?
nIdxOffset++;
@@ -5938,10 +5938,10 @@ WW8PLCF_HdFt::WW8PLCF_HdFt( SvStream* pSt, WW8Fib& rFib, WW8Dop& rDop )
// und der Fussnoten
}
-bool WW8PLCF_HdFt::GetTextPos(BYTE grpfIhdt, BYTE nWhich, WW8_CP& rStart,
+bool WW8PLCF_HdFt::GetTextPos(sal_uInt8 grpfIhdt, sal_uInt8 nWhich, WW8_CP& rStart,
long& rLen)
{
- BYTE nI = 0x01;
+ sal_uInt8 nI = 0x01;
short nIdx = nIdxOffset;
while (true)
{
@@ -5976,10 +5976,10 @@ bool WW8PLCF_HdFt::GetTextPosExact(short nIdx, WW8_CP& rStart, long& rLen)
return true;
}
-void WW8PLCF_HdFt::UpdateIndex( BYTE grpfIhdt )
+void WW8PLCF_HdFt::UpdateIndex( sal_uInt8 grpfIhdt )
{
// Caution: Description is not correct
- for( BYTE nI = 0x01; nI <= 0x20; nI <<= 1 )
+ for( sal_uInt8 nI = 0x01; nI <= 0x20; nI <<= 1 )
if( nI & grpfIhdt )
nIdxOffset++;
}
@@ -5988,12 +5988,12 @@ void WW8PLCF_HdFt::UpdateIndex( BYTE grpfIhdt )
// WW8Dop
//-----------------------------------------
-WW8Dop::WW8Dop( SvStream& rSt, INT16 nFib, INT32 nPos, INT32 nSize )
+WW8Dop::WW8Dop( SvStream& rSt, sal_Int16 nFib, sal_Int32 nPos, sal_Int32 nSize )
{
- BYTE* pDataPtr = new BYTE[ 500 ];
- BYTE* pData = pDataPtr;
+ sal_uInt8* pDataPtr = new sal_uInt8[ 500 ];
+ sal_uInt8* pData = pDataPtr;
- UINT32 nRead = 500 < nSize ? 500 : nSize;
+ sal_uInt32 nRead = 500 < nSize ? 500 : nSize;
rSt.Seek( nPos );
if( 2 > nSize || nRead != rSt.Read( pData, nRead ))
{
@@ -6006,9 +6006,9 @@ WW8Dop::WW8Dop( SvStream& rSt, INT16 nFib, INT32 nPos, INT32 nSize )
memset( pData + nRead, 0, 500 - nRead );
// dann mal die Daten auswerten
- UINT32 a32Bit;
- UINT16 a16Bit;
- BYTE a8Bit;
+ sal_uInt32 a32Bit;
+ sal_uInt16 a16Bit;
+ sal_uInt8 a8Bit;
a16Bit = Get_UShort( pData );
fFacingPages = 0 != ( a16Bit & 0x0001 ) ;
@@ -6239,9 +6239,9 @@ WW8Dop::WW8Dop()
cDBCFtnEdn = /**!!**/ 0;
}
-UINT32 WW8Dop::GetCompatabilityOptions() const
+sal_uInt32 WW8Dop::GetCompatabilityOptions() const
{
- UINT32 a32Bit = 0;
+ sal_uInt32 a32Bit = 0;
if (fNoTabForInd) a32Bit |= 0x00000001;
if (fNoSpaceRaiseLower) a32Bit |= 0x00000002;
if (fSupressSpbfAfterPageBreak) a32Bit |= 0x00000004;
@@ -6265,17 +6265,17 @@ UINT32 WW8Dop::GetCompatabilityOptions() const
bool WW8Dop::Write(SvStream& rStrm, WW8Fib& rFib) const
{
- INT32 nLen = 8 == rFib.nVersion ? 0x220 : 84;
+ sal_Int32 nLen = 8 == rFib.nVersion ? 0x220 : 84;
rFib.fcDop = rStrm.Tell();
rFib.lcbDop = nLen;
- BYTE aData[ 0x220 ];
+ sal_uInt8 aData[ 0x220 ];
memset( aData, 0, 0x220 );
- BYTE* pData = aData;
+ sal_uInt8* pData = aData;
// dann mal die Daten auswerten
- UINT16 a16Bit;
- BYTE a8Bit;
+ sal_uInt16 a16Bit;
+ sal_uInt8 a8Bit;
a16Bit = 0;
if (fFacingPages)
@@ -6446,9 +6446,9 @@ bool WW8Dop::Write(SvStream& rStrm, WW8Fib& rFib) const
return 0 == rStrm.GetError();
}
-void WW8DopTypography::ReadFromMem(BYTE *&pData)
+void WW8DopTypography::ReadFromMem(sal_uInt8 *&pData)
{
- USHORT a16Bit = Get_UShort(pData);
+ sal_uInt16 a16Bit = Get_UShort(pData);
fKerningPunct = (a16Bit & 0x0001);
iJustification = (a16Bit & 0x0006) >> 1;
iLevelOfKinsoku = (a16Bit & 0x0018) >> 3;
@@ -6459,7 +6459,7 @@ void WW8DopTypography::ReadFromMem(BYTE *&pData)
cchFollowingPunct = Get_Short(pData);
cchLeadingPunct = Get_Short(pData);
- INT16 i;
+ sal_Int16 i;
for (i=0; i < nMaxFollowing; ++i)
rgxchFPunct[i] = Get_Short(pData);
for (i=0; i < nMaxLeading; ++i)
@@ -6469,9 +6469,9 @@ void WW8DopTypography::ReadFromMem(BYTE *&pData)
rgxchLPunct[cchLeadingPunct]=0;
}
-void WW8DopTypography::WriteToMem(BYTE *&pData) const
+void WW8DopTypography::WriteToMem(sal_uInt8 *&pData) const
{
- USHORT a16Bit = fKerningPunct;
+ sal_uInt16 a16Bit = fKerningPunct;
a16Bit |= (iJustification << 1) & 0x0006;
a16Bit |= (iLevelOfKinsoku << 3) & 0x0018;
a16Bit |= (f2on1 << 5) & 0x002;
@@ -6482,16 +6482,16 @@ void WW8DopTypography::WriteToMem(BYTE *&pData) const
Set_UInt16(pData,cchFollowingPunct);
Set_UInt16(pData,cchLeadingPunct);
- INT16 i;
+ sal_Int16 i;
for (i=0; i < nMaxFollowing; ++i)
Set_UInt16(pData,rgxchFPunct[i]);
for (i=0; i < nMaxLeading; ++i)
Set_UInt16(pData,rgxchLPunct[i]);
}
-USHORT WW8DopTypography::GetConvertedLang() const
+sal_uInt16 WW8DopTypography::GetConvertedLang() const
{
- USHORT nLang;
+ sal_uInt16 nLang;
//I have assumed peoples republic/taiwan == simplified/traditional
//This isn't a documented issue, so we might have it all wrong,
@@ -6534,11 +6534,11 @@ USHORT WW8DopTypography::GetConvertedLang() const
//-----------------------------------------
// Sprms
//-----------------------------------------
-USHORT wwSprmParser::GetSprmTailLen(sal_uInt16 nId, const sal_uInt8* pSprm)
+sal_uInt16 wwSprmParser::GetSprmTailLen(sal_uInt16 nId, const sal_uInt8* pSprm)
const
{
SprmInfo aSprm = GetSprmInfo(nId);
- USHORT nL = 0; // number of Bytes to read
+ sal_uInt16 nL = 0; // number of Bytes to read
//sprmPChgTabs
switch( nId )
@@ -6549,8 +6549,8 @@ USHORT wwSprmParser::GetSprmTailLen(sal_uInt16 nId, const sal_uInt8* pSprm)
nL = pSprm[1 + mnDelta] + aSprm.nLen;
else
{
- BYTE nDel = pSprm[2 + mnDelta];
- BYTE nIns = pSprm[3 + mnDelta + 4 * nDel];
+ sal_uInt8 nDel = pSprm[2 + mnDelta];
+ sal_uInt8 nIns = pSprm[3 + mnDelta + 4 * nDel];
nL = 2 + 4 * nDel + 3 * nIns;
}
@@ -6586,16 +6586,16 @@ USHORT wwSprmParser::GetSprmTailLen(sal_uInt16 nId, const sal_uInt8* pSprm)
int wwSprmParser::CountSprms(const sal_uInt8* pSp, long nSprmSiz,
const wwSprmSequence* pIgnoreSprms) const
{
- USHORT nMySprms = 0;
- USHORT i=0;
+ sal_uInt16 nMySprms = 0;
+ sal_uInt16 i=0;
while (i+1+mnDelta < nSprmSiz)
{
- USHORT nSpId = GetSprmId(pSp);
+ sal_uInt16 nSpId = GetSprmId(pSp);
if( !nSpId )
break;
- USHORT nSpLen = GetSprmSize(nSpId, pSp);
+ sal_uInt16 nSpLen = GetSprmSize(nSpId, pSp);
// increase pointers so to point to next sprm
i += nSpLen;
pSp += nSpLen;
@@ -6607,11 +6607,11 @@ int wwSprmParser::CountSprms(const sal_uInt8* pSp, long nSprmSiz,
}
// one or two bytes at the beginning at the sprm id
-USHORT wwSprmParser::GetSprmId(const sal_uInt8* pSp) const
+sal_uInt16 wwSprmParser::GetSprmId(const sal_uInt8* pSp) const
{
ASSERT_RET_ON_FAIL(pSp, "Why GetSprmId with pSp of 0", 0);
- USHORT nId = 0;
+ sal_uInt16 nId = 0;
switch (mnVersion) // 6 stands for "6 OR 7", 7 stands for "ONLY 7"
{
case 6:
@@ -6631,17 +6631,17 @@ USHORT wwSprmParser::GetSprmId(const sal_uInt8* pSp) const
}
// with tokens and length byte
-USHORT wwSprmParser::GetSprmSize(sal_uInt16 nId, const sal_uInt8* pSprm) const
+sal_uInt16 wwSprmParser::GetSprmSize(sal_uInt16 nId, const sal_uInt8* pSprm) const
{
return GetSprmTailLen(nId, pSprm) + 1 + mnDelta + SprmDataOfs(nId);
}
-BYTE wwSprmParser::SprmDataOfs(USHORT nId) const
+sal_uInt8 wwSprmParser::SprmDataOfs(sal_uInt16 nId) const
{
return GetSprmInfo(nId).nVari;
}
-USHORT wwSprmParser::DistanceToData(USHORT nId) const
+sal_uInt16 wwSprmParser::DistanceToData(sal_uInt16 nId) const
{
return 1 + mnDelta + SprmDataOfs(nId);
}