summaryrefslogtreecommitdiff
path: root/filter/source/graphicfilter/ios2met/ios2met.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'filter/source/graphicfilter/ios2met/ios2met.cxx')
-rw-r--r--filter/source/graphicfilter/ios2met/ios2met.cxx542
1 files changed, 271 insertions, 271 deletions
diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx
index e0ffce9c6081..248bd97f1b83 100644
--- a/filter/source/graphicfilter/ios2met/ios2met.cxx
+++ b/filter/source/graphicfilter/ios2met/ios2met.cxx
@@ -219,19 +219,19 @@ enum PenStyle { PEN_NULL, PEN_SOLID, PEN_DOT, PEN_DASH, PEN_DASHDOT };
struct OSPalette {
OSPalette * pSucc;
sal_uInt32 * p0RGB; // Darf auch NULL sein!
- USHORT nSize;
+ sal_uInt16 nSize;
};
struct OSArea {
OSArea * pSucc;
- BYTE nFlags;
+ sal_uInt8 nFlags;
PolyPolygon aPPoly;
- BOOL bClosed;
+ sal_Bool bClosed;
Color aCol;
Color aBgCol;
RasterOp eMix;
RasterOp eBgMix;
- BOOL bFill;
+ sal_Bool bFill;
OSArea(){} ~OSArea(){}
};
@@ -240,8 +240,8 @@ struct OSPath
OSPath* pSucc;
sal_uInt32 nID;
PolyPolygon aPPoly;
- BOOL bClosed;
- BOOL bStroke;
+ sal_Bool bClosed;
+ sal_Bool bStroke;
OSPath(){}
~OSPath(){}
@@ -249,28 +249,28 @@ struct OSPath
struct OSFont {
OSFont * pSucc;
- ULONG nID;
+ sal_uLong nID;
Font aFont;
OSFont(){} ~OSFont(){}
};
struct OSBitmap {
OSBitmap * pSucc;
- ULONG nID;
+ sal_uLong nID;
Bitmap aBitmap;
// Waehrend des Lesens der Bitmap benoetigt:
SvStream * pBMP; // Zeiger auf temporaere Windows-BMP-Datei oder NULL
sal_uInt32 nWidth, nHeight;
- USHORT nBitsPerPixel;
- ULONG nMapPos;
+ sal_uInt16 nBitsPerPixel;
+ sal_uLong nMapPos;
OSBitmap(){} ~OSBitmap(){}
};
struct OSAttr {
OSAttr * pSucc;
- USHORT nPushOrder;
- BYTE nIvAttrA, nIvAttrP; // Spezialvariablen fuer den Order "GOrdPIvAtr"
+ sal_uInt16 nPushOrder;
+ sal_uInt8 nIvAttrA, nIvAttrP; // Spezialvariablen fuer den Order "GOrdPIvAtr"
Color aLinCol;
Color aLinBgCol;
@@ -296,29 +296,29 @@ struct OSAttr {
short nChrAng;
// long nChrBreakExtra;
Size aChrCellSize;
-// BYTE nChrDir;
+// sal_uInt8 nChrDir;
// long nChrExtra;
-// BYTE nChrPrec;
- ULONG nChrSet;
+// sal_uInt8 nChrPrec;
+ sal_uLong nChrSet;
// Size aChrShear;
Point aCurPos;
// long nFracLinWidth;
-// BYTE nLinEnd;
-// BYTE nLinJoin;
+// sal_uInt8 nLinEnd;
+// sal_uInt8 nLinJoin;
PenStyle eLinStyle;
- USHORT nLinWidth;
+ sal_uInt16 nLinWidth;
Size aMrkCellSize;
- BYTE nMrkPrec;
- BYTE nMrkSet;
- BYTE nMrkSymbol;
+ sal_uInt8 nMrkPrec;
+ sal_uInt8 nMrkSet;
+ sal_uInt8 nMrkSymbol;
// //... aModTransform;
// Point aPatRef;
-// BYTE nPatSet;
- BOOL bFill;
-// ULONG nPickId;
+// sal_uInt8 nPatSet;
+ sal_Bool bFill;
+// sal_uLong nPickId;
// //... aSegBound;
- USHORT nStrLinWidth;
-// BYTE nTxtAlignHor,nTxtAlignVer;
+ sal_uInt16 nStrLinWidth;
+// sal_uInt8 nTxtAlignHor,nTxtAlignVer;
// //... aViewTransform;
// //... aViewWindow;
OSAttr(){} ~OSAttr(){}
@@ -334,12 +334,12 @@ private:
VirtualDevice * pVirDev; // Hier werden die Drawing-Methoden aufgerufen.
// Dabei findet ein Recording in das GDIMetaFile
// statt.
- ULONG nOrigPos; // Anfaengliche Position in pOS2MET
- UINT16 nOrigNumberFormat; // Anfaengliches Nummern-Format von pOS2MET
+ sal_uLong nOrigPos; // Anfaengliche Position in pOS2MET
+ sal_uInt16 nOrigNumberFormat; // Anfaengliches Nummern-Format von pOS2MET
Rectangle aBoundingRect; // Boundingrectangle wie in Datei angegeben
Rectangle aCalcBndRect; // selbst ermitteltes Boundingrectangle
MapMode aGlobMapMode; // Aufloesung des Bildes
- BOOL bCoord32;
+ sal_Bool bCoord32;
OSPalette * pPaletteStack;
@@ -360,53 +360,53 @@ private:
SvStream * pOrdFile;
- BOOL Callback(USHORT nPercent);
+ sal_Bool Callback(sal_uInt16 nPercent);
void AddPointsToPath(const Polygon & rPoly);
void AddPointsToArea(const Polygon & rPoly);
void CloseFigure();
- void PushAttr(USHORT nPushOrder);
+ void PushAttr(sal_uInt16 nPushOrder);
void PopAttr();
- void ChangeBrush( const Color& rPatColor, const Color& rBGColor, BOOL bFill );
- void SetPen( const Color& rColor, USHORT nStrLinWidth = 0, PenStyle ePenStyle = PEN_SOLID );
+ void ChangeBrush( const Color& rPatColor, const Color& rBGColor, sal_Bool bFill );
+ void SetPen( const Color& rColor, sal_uInt16 nStrLinWidth = 0, PenStyle ePenStyle = PEN_SOLID );
void SetRasterOp(RasterOp eROP);
- void SetPalette0RGB(USHORT nIndex, ULONG nCol);
+ void SetPalette0RGB(sal_uInt16 nIndex, sal_uLong nCol);
sal_uInt32 GetPalette0RGB(sal_uInt32 nIndex);
// Holt Farbe aus der Palette, oder, wenn nicht vorhanden,
// interpretiert nIndex als direkten RGB-Wert.
Color GetPaletteColor(sal_uInt32 nIndex);
- BOOL IsLineInfo();
+ sal_Bool IsLineInfo();
void DrawPolyLine( const Polygon& rPolygon );
void DrawPolygon( const Polygon& rPolygon );
void DrawPolyPolygon( const PolyPolygon& rPolygon );
- USHORT ReadBigEndianWord();
- ULONG ReadBigEndian3BytesLong();
- ULONG ReadLittleEndian3BytesLong();
- long ReadCoord(BOOL b32);
- Point ReadPoint( const BOOL bAdjustBoundRect = TRUE );
- RasterOp OS2MixToRasterOp(BYTE nMix);
- void ReadLine(BOOL bGivenPos, USHORT nOrderLen);
- void ReadRelLine(BOOL bGivenPos, USHORT nOrderLen);
- void ReadBox(BOOL bGivenPos);
+ sal_uInt16 ReadBigEndianWord();
+ sal_uLong ReadBigEndian3BytesLong();
+ sal_uLong ReadLittleEndian3BytesLong();
+ long ReadCoord(sal_Bool b32);
+ Point ReadPoint( const sal_Bool bAdjustBoundRect = sal_True );
+ RasterOp OS2MixToRasterOp(sal_uInt8 nMix);
+ void ReadLine(sal_Bool bGivenPos, sal_uInt16 nOrderLen);
+ void ReadRelLine(sal_Bool bGivenPos, sal_uInt16 nOrderLen);
+ void ReadBox(sal_Bool bGivenPos);
void ReadBitBlt();
- void ReadChrStr(BOOL bGivenPos, BOOL bMove, BOOL bExtra, USHORT nOrderLen);
- void ReadArc(BOOL bGivenPos);
- void ReadFullArc(BOOL bGivenPos, USHORT nOrderSize);
- void ReadPartialArc(BOOL bGivenPos, USHORT nOrderSize);
+ void ReadChrStr(sal_Bool bGivenPos, sal_Bool bMove, sal_Bool bExtra, sal_uInt16 nOrderLen);
+ void ReadArc(sal_Bool bGivenPos);
+ void ReadFullArc(sal_Bool bGivenPos, sal_uInt16 nOrderSize);
+ void ReadPartialArc(sal_Bool bGivenPos, sal_uInt16 nOrderSize);
void ReadPolygons();
- void ReadBezier(BOOL bGivenPos, USHORT nOrderLen);
- void ReadFillet(BOOL bGivenPos, USHORT nOrderLen);
- void ReadFilletSharp(BOOL bGivenPos, USHORT nOrderLen);
- void ReadMarker(BOOL bGivenPos, USHORT nOrderLen);
- void ReadOrder(USHORT nOrderID, USHORT nOrderLen);
- void ReadDsc(USHORT nDscID, USHORT nDscLen);
- void ReadImageData(USHORT nDataID, USHORT nDataLen);
- void ReadFont(USHORT nFieldSize);
- void ReadField(USHORT nFieldType, USHORT nFieldSize);
+ void ReadBezier(sal_Bool bGivenPos, sal_uInt16 nOrderLen);
+ void ReadFillet(sal_Bool bGivenPos, sal_uInt16 nOrderLen);
+ void ReadFilletSharp(sal_Bool bGivenPos, sal_uInt16 nOrderLen);
+ void ReadMarker(sal_Bool bGivenPos, sal_uInt16 nOrderLen);
+ void ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen);
+ void ReadDsc(sal_uInt16 nDscID, sal_uInt16 nDscLen);
+ void ReadImageData(sal_uInt16 nDataID, sal_uInt16 nDataLen);
+ void ReadFont(sal_uInt16 nFieldSize);
+ void ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize);
public:
@@ -420,17 +420,17 @@ public:
//=================== Methoden von OS2METReader ==============================
-BOOL OS2METReader::Callback(USHORT /*nPercent*/)
+sal_Bool OS2METReader::Callback(sal_uInt16 /*nPercent*/)
{
/*
if (pCallback!=NULL) {
- if (((*pCallback)(pCallerData,nPercent))==TRUE) {
+ if (((*pCallback)(pCallerData,nPercent))==sal_True) {
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
- return TRUE;
+ return sal_True;
}
}
*/
- return FALSE;
+ return sal_False;
}
OS2METReader::OS2METReader()
@@ -441,7 +441,7 @@ OS2METReader::~OS2METReader()
{
}
-BOOL OS2METReader::IsLineInfo()
+sal_Bool OS2METReader::IsLineInfo()
{
return ( ! ( aLineInfo.IsDefault() || ( aLineInfo.GetStyle() == LINE_NONE ) || ( pVirDev->GetLineColor() == COL_TRANSPARENT ) ) );
}
@@ -476,7 +476,7 @@ void OS2METReader::DrawPolyPolygon( const PolyPolygon& rPolyPolygon )
pVirDev->SetLineColor( COL_TRANSPARENT );
pVirDev->DrawPolyPolygon( rPolyPolygon );
pVirDev->Pop();
- for ( USHORT i = 0; i < rPolyPolygon.Count(); i++ )
+ for ( sal_uInt16 i = 0; i < rPolyPolygon.Count(); i++ )
pVirDev->DrawPolyLine( rPolyPolygon.GetObject( i ), aLineInfo );
}
else
@@ -485,11 +485,11 @@ void OS2METReader::DrawPolyPolygon( const PolyPolygon& rPolyPolygon )
void OS2METReader::AddPointsToArea(const Polygon & rPoly)
{
- USHORT nOldSize, nNewSize,i;
+ sal_uInt16 nOldSize, nNewSize,i;
if (pAreaStack==NULL || rPoly.GetSize()==0) return;
PolyPolygon * pPP=&(pAreaStack->aPPoly);
- if (pPP->Count()==0 || pAreaStack->bClosed==TRUE) pPP->Insert(rPoly);
+ if (pPP->Count()==0 || pAreaStack->bClosed==sal_True) pPP->Insert(rPoly);
else {
Polygon aLastPoly(pPP->GetObject(pPP->Count()-1));
nOldSize=aLastPoly.GetSize();
@@ -501,16 +501,16 @@ void OS2METReader::AddPointsToArea(const Polygon & rPoly)
}
pPP->Replace(aLastPoly,pPP->Count()-1);
}
- pAreaStack->bClosed=FALSE;
+ pAreaStack->bClosed=sal_False;
}
void OS2METReader::AddPointsToPath(const Polygon & rPoly)
{
- USHORT nOldSize, nNewSize,i;
+ sal_uInt16 nOldSize, nNewSize,i;
if (pPathStack==NULL || rPoly.GetSize()==0) return;
PolyPolygon * pPP=&(pPathStack->aPPoly);
- if (pPP->Count()==0 /*|| pPathStack->bClosed==TRUE*/) pPP->Insert(rPoly);
+ if (pPP->Count()==0 /*|| pPathStack->bClosed==sal_True*/) pPP->Insert(rPoly);
else {
Polygon aLastPoly(pPP->GetObject(pPP->Count()-1));
nOldSize=aLastPoly.GetSize();
@@ -525,16 +525,16 @@ void OS2METReader::AddPointsToPath(const Polygon & rPoly)
pPP->Replace(aLastPoly,pPP->Count()-1);
}
}
- pPathStack->bClosed=FALSE;
+ pPathStack->bClosed=sal_False;
}
void OS2METReader::CloseFigure()
{
- if (pAreaStack!=NULL) pAreaStack->bClosed=TRUE;
- else if (pPathStack!=NULL) pPathStack->bClosed=TRUE;
+ if (pAreaStack!=NULL) pAreaStack->bClosed=sal_True;
+ else if (pPathStack!=NULL) pPathStack->bClosed=sal_True;
}
-void OS2METReader::PushAttr(USHORT nPushOrder)
+void OS2METReader::PushAttr(sal_uInt16 nPushOrder)
{
OSAttr * p;
p=new OSAttr;
@@ -651,7 +651,7 @@ void OS2METReader::PopAttr()
delete p;
}
-void OS2METReader::ChangeBrush(const Color& rPatColor, const Color& /*rBGColor*/, BOOL bFill )
+void OS2METReader::ChangeBrush(const Color& rPatColor, const Color& /*rBGColor*/, sal_Bool bFill )
{
Color aColor;
@@ -664,7 +664,7 @@ void OS2METReader::ChangeBrush(const Color& rPatColor, const Color& /*rBGColor*/
pVirDev->SetFillColor( aColor );
}
-void OS2METReader::SetPen( const Color& rColor, USHORT nLineWidth, PenStyle ePenStyle )
+void OS2METReader::SetPen( const Color& rColor, sal_uInt16 nLineWidth, PenStyle ePenStyle )
{
LineStyle eLineStyle( LINE_SOLID );
@@ -672,8 +672,8 @@ void OS2METReader::SetPen( const Color& rColor, USHORT nLineWidth, PenStyle ePen
pVirDev->SetLineColor( rColor );
aLineInfo.SetWidth( nLineWidth );
- USHORT nDotCount = 0;
- USHORT nDashCount = 0;
+ sal_uInt16 nDotCount = 0;
+ sal_uInt16 nDashCount = 0;
switch ( ePenStyle )
{
case PEN_NULL :
@@ -705,7 +705,7 @@ void OS2METReader::SetRasterOp(RasterOp eROP)
}
-void OS2METReader::SetPalette0RGB(USHORT nIndex, ULONG nCol)
+void OS2METReader::SetPalette0RGB(sal_uInt16 nIndex, sal_uLong nCol)
{
if (pPaletteStack==NULL) {
pPaletteStack=new OSPalette;
@@ -715,7 +715,7 @@ void OS2METReader::SetPalette0RGB(USHORT nIndex, ULONG nCol)
}
if (pPaletteStack->p0RGB==NULL || nIndex>=pPaletteStack->nSize) {
sal_uInt32 * pOld0RGB=pPaletteStack->p0RGB;
- USHORT i,nOldSize=pPaletteStack->nSize;
+ sal_uInt16 i,nOldSize=pPaletteStack->nSize;
if (pOld0RGB==NULL) nOldSize=0;
pPaletteStack->nSize=2*(nIndex+1);
if (pPaletteStack->nSize<256) pPaletteStack->nSize=256;
@@ -740,37 +740,37 @@ sal_uInt32 OS2METReader::GetPalette0RGB(sal_uInt32 nIndex)
Color OS2METReader::GetPaletteColor(sal_uInt32 nIndex)
{
nIndex=GetPalette0RGB(nIndex);
- return Color(sal::static_int_cast< UINT8 >((nIndex>>16)&0xff),
- sal::static_int_cast< UINT8 >((nIndex>>8)&0xff),
- sal::static_int_cast< UINT8 >(nIndex&0xff));
+ return Color(sal::static_int_cast< sal_uInt8 >((nIndex>>16)&0xff),
+ sal::static_int_cast< sal_uInt8 >((nIndex>>8)&0xff),
+ sal::static_int_cast< sal_uInt8 >(nIndex&0xff));
}
-USHORT OS2METReader::ReadBigEndianWord()
+sal_uInt16 OS2METReader::ReadBigEndianWord()
{
- BYTE nLo,nHi;
+ sal_uInt8 nLo,nHi;
*pOS2MET >> nHi >> nLo;
- return (((USHORT)nHi)<<8)|(((USHORT)nLo)&0x00ff);
+ return (((sal_uInt16)nHi)<<8)|(((sal_uInt16)nLo)&0x00ff);
}
-ULONG OS2METReader::ReadBigEndian3BytesLong()
+sal_uLong OS2METReader::ReadBigEndian3BytesLong()
{
- USHORT nLo;
- BYTE nHi;
+ sal_uInt16 nLo;
+ sal_uInt8 nHi;
*pOS2MET >> nHi;
nLo=ReadBigEndianWord();
- return ((((ULONG)nHi)<<16)&0x00ff0000)|((ULONG)nLo);
+ return ((((sal_uLong)nHi)<<16)&0x00ff0000)|((sal_uLong)nLo);
}
-ULONG OS2METReader::ReadLittleEndian3BytesLong()
+sal_uLong OS2METReader::ReadLittleEndian3BytesLong()
{
- BYTE nHi,nMed,nLo;
+ sal_uInt8 nHi,nMed,nLo;
*pOS2MET >> nLo >> nMed >> nHi;
- return ((((ULONG)nHi)&0xff)<<16)|((((ULONG)nMed)&0xff)<<8)|(((ULONG)nLo)&0xff);
+ return ((((sal_uLong)nHi)&0xff)<<16)|((((sal_uLong)nMed)&0xff)<<8)|(((sal_uLong)nLo)&0xff);
}
-long OS2METReader::ReadCoord(BOOL b32)
+long OS2METReader::ReadCoord(sal_Bool b32)
{
long l;
short s;
@@ -780,7 +780,7 @@ long OS2METReader::ReadCoord(BOOL b32)
return l;
}
-Point OS2METReader::ReadPoint( const BOOL bAdjustBoundRect )
+Point OS2METReader::ReadPoint( const sal_Bool bAdjustBoundRect )
{
long x,y;
@@ -795,7 +795,7 @@ Point OS2METReader::ReadPoint( const BOOL bAdjustBoundRect )
return Point(x,y);
}
-RasterOp OS2METReader::OS2MixToRasterOp(BYTE nMix)
+RasterOp OS2METReader::OS2MixToRasterOp(sal_uInt8 nMix)
{
switch (nMix) {
case 0x0c: return ROP_INVERT;
@@ -805,9 +805,9 @@ RasterOp OS2METReader::OS2MixToRasterOp(BYTE nMix)
}
}
-void OS2METReader::ReadLine(BOOL bGivenPos, USHORT nOrderLen)
+void OS2METReader::ReadLine(sal_Bool bGivenPos, sal_uInt16 nOrderLen)
{
- USHORT i,nPolySize;
+ sal_uInt16 i,nPolySize;
if (bCoord32) nPolySize=nOrderLen/8; else nPolySize=nOrderLen/4;
if (!bGivenPos) nPolySize++;
@@ -828,9 +828,9 @@ void OS2METReader::ReadLine(BOOL bGivenPos, USHORT nOrderLen)
}
}
-void OS2METReader::ReadRelLine(BOOL bGivenPos, USHORT nOrderLen)
+void OS2METReader::ReadRelLine(sal_Bool bGivenPos, sal_uInt16 nOrderLen)
{
- USHORT i,nPolySize;
+ sal_uInt16 i,nPolySize;
Point aP0;
@@ -844,11 +844,11 @@ void OS2METReader::ReadRelLine(BOOL bGivenPos, USHORT nOrderLen)
Polygon aPolygon(nPolySize);
for (i=0; i<nPolySize; i++) {
#if defined SOLARIS && defined PPC
- UINT8 nunsignedbyte;
- *pOS2MET >> nunsignedbyte; aP0.X()+=(INT8)nunsignedbyte;
- *pOS2MET >> nunsignedbyte; aP0.Y()+=(INT8)nunsignedbyte;
+ sal_uInt8 nunsignedbyte;
+ *pOS2MET >> nunsignedbyte; aP0.X()+=(sal_Int8)nunsignedbyte;
+ *pOS2MET >> nunsignedbyte; aP0.Y()+=(sal_Int8)nunsignedbyte;
#else
- INT8 nsignedbyte;
+ sal_Int8 nsignedbyte;
*pOS2MET >> nsignedbyte; aP0.X()+=(long)nsignedbyte;
*pOS2MET >> nsignedbyte; aP0.Y()-=(long)nsignedbyte;
#endif
@@ -866,9 +866,9 @@ void OS2METReader::ReadRelLine(BOOL bGivenPos, USHORT nOrderLen)
}
}
-void OS2METReader::ReadBox(BOOL bGivenPos)
+void OS2METReader::ReadBox(sal_Bool bGivenPos)
{
- BYTE nFlags;
+ sal_uInt8 nFlags;
Point P0;
long nHRound,nVRound;
@@ -904,7 +904,7 @@ void OS2METReader::ReadBox(BOOL bGivenPos)
}
else
{
- ChangeBrush( Color( COL_TRANSPARENT ), Color( COL_TRANSPARENT ), FALSE );
+ ChangeBrush( Color( COL_TRANSPARENT ), Color( COL_TRANSPARENT ), sal_False );
SetRasterOp(aAttr.eLinMix);
}
@@ -949,10 +949,10 @@ void OS2METReader::ReadBitBlt()
}
}
-void OS2METReader::ReadChrStr(BOOL bGivenPos, BOOL bMove, BOOL bExtra, USHORT nOrderLen)
+void OS2METReader::ReadChrStr(sal_Bool bGivenPos, sal_Bool bMove, sal_Bool bExtra, sal_uInt16 nOrderLen)
{
Point aP0;
- USHORT i, nLen;
+ sal_uInt16 i, nLen;
char * pChr;
OSFont * pF;
Font aFont;
@@ -974,8 +974,8 @@ void OS2METReader::ReadChrStr(BOOL bGivenPos, BOOL bMove, BOOL bExtra, USHORT nO
if (bExtra)
{
pOS2MET->SeekRel(2);
- ReadPoint( FALSE );
- ReadPoint( FALSE );
+ ReadPoint( sal_False );
+ ReadPoint( sal_False );
*pOS2MET >> nLen;
}
else
@@ -1022,7 +1022,7 @@ void OS2METReader::ReadChrStr(BOOL bGivenPos, BOOL bMove, BOOL bExtra, USHORT nO
delete[] pChr;
}
-void OS2METReader::ReadArc(BOOL bGivenPos)
+void OS2METReader::ReadArc(sal_Bool bGivenPos)
{
Point aP1, aP2, aP3;
double x1,y1,x2,y2,x3,y3,p,q,cx,cy,ncx,ncy,r,rx,ry,w1,w3;
@@ -1067,12 +1067,12 @@ void OS2METReader::ReadArc(BOOL bGivenPos)
}
}
-void OS2METReader::ReadFullArc(BOOL bGivenPos, USHORT nOrderSize)
+void OS2METReader::ReadFullArc(sal_Bool bGivenPos, sal_uInt16 nOrderSize)
{
Point aCenter;
long nP,nQ,nR,nS;
Rectangle aRect;
- sal_uInt32 nMul; USHORT nMulS;
+ sal_uInt32 nMul; sal_uInt16 nMulS;
if (bGivenPos) {
aCenter=ReadPoint();
@@ -1086,7 +1086,7 @@ void OS2METReader::ReadFullArc(BOOL bGivenPos, USHORT nOrderSize)
if (nR<0) nR=-nR;
if (nS<0) nS=-nS;
if (nOrderSize>=4) *pOS2MET >> nMul;
- else { *pOS2MET >> nMulS; nMul=((ULONG)nMulS)<<8; }
+ else { *pOS2MET >> nMulS; nMul=((sal_uLong)nMulS)<<8; }
if (nMul!=0x00010000) {
nP=(nP*nMul)>>16;
nQ=(nQ*nMul)>>16;
@@ -1109,18 +1109,18 @@ void OS2METReader::ReadFullArc(BOOL bGivenPos, USHORT nOrderSize)
else
{
SetPen( aAttr.aLinCol, aAttr.nStrLinWidth, aAttr.eLinStyle );
- ChangeBrush(Color( COL_TRANSPARENT ),Color( COL_TRANSPARENT ),FALSE);
+ ChangeBrush(Color( COL_TRANSPARENT ),Color( COL_TRANSPARENT ),sal_False);
SetRasterOp(aAttr.eLinMix);
}
pVirDev->DrawEllipse(aRect);
}
-void OS2METReader::ReadPartialArc(BOOL bGivenPos, USHORT nOrderSize)
+void OS2METReader::ReadPartialArc(sal_Bool bGivenPos, sal_uInt16 nOrderSize)
{
Point aP0, aCenter,aPStart,aPEnd;
long nP,nQ,nR,nS,nStart, nSweep;
Rectangle aRect;
- sal_uInt32 nMul; USHORT nMulS;
+ sal_uInt32 nMul; sal_uInt16 nMulS;
double fStart, fEnd;
if (bGivenPos) {
@@ -1136,7 +1136,7 @@ void OS2METReader::ReadPartialArc(BOOL bGivenPos, USHORT nOrderSize)
if (nR<0) nR=-nR;
if (nS<0) nS=-nS;
if (nOrderSize>=12) *pOS2MET >> nMul;
- else { *pOS2MET >> nMulS; nMul=((ULONG)nMulS)<<8; }
+ else { *pOS2MET >> nMulS; nMul=((sal_uLong)nMulS)<<8; }
if (nMul!=0x00010000) {
nP=(nP*nMul)>>16;
nQ=(nQ*nMul)>>16;
@@ -1170,7 +1170,7 @@ void OS2METReader::ReadPolygons()
PolyPolygon aPolyPoly;
Polygon aPoly;
Point aPoint;
- BYTE nFlags;
+ sal_uInt8 nFlags;
*pOS2MET >> nFlags >> nNumPolys;
for (i=0; i<nNumPolys; i++) {
@@ -1195,9 +1195,9 @@ void OS2METReader::ReadPolygons()
DrawPolyPolygon( aPolyPoly );
}
-void OS2METReader::ReadBezier(BOOL bGivenPos, USHORT nOrderLen)
+void OS2METReader::ReadBezier(sal_Bool bGivenPos, sal_uInt16 nOrderLen)
{
- USHORT i, nNumPoints = nOrderLen / ( bCoord32 ? 8 : 4 );
+ sal_uInt16 i, nNumPoints = nOrderLen / ( bCoord32 ? 8 : 4 );
if( !bGivenPos )
nNumPoints++;
@@ -1218,18 +1218,18 @@ void OS2METReader::ReadBezier(BOOL bGivenPos, USHORT nOrderLen)
if( !( nNumPoints % 4 ) )
{
// create bezier polygon
- const USHORT nSegPoints = 25;
- const USHORT nSegments = aPolygon.GetSize() >> 2;
+ const sal_uInt16 nSegPoints = 25;
+ const sal_uInt16 nSegments = aPolygon.GetSize() >> 2;
Polygon aBezPoly( nSegments * nSegPoints );
- USHORT nSeg, nBezPos, nStartPos;
+ sal_uInt16 nSeg, nBezPos, nStartPos;
for( nSeg = 0, nBezPos = 0, nStartPos = 0; nSeg < nSegments; nSeg++, nStartPos += 4 )
{
const Polygon aSegPoly( aPolygon[ nStartPos ], aPolygon[ nStartPos + 1 ],
aPolygon[ nStartPos + 3 ], aPolygon[ nStartPos + 2 ],
nSegPoints );
- for( USHORT nSegPos = 0; nSegPos < nSegPoints; )
+ for( sal_uInt16 nSegPos = 0; nSegPos < nSegPoints; )
aBezPoly[ nBezPos++ ] = aSegPoly[ nSegPos++ ];
}
@@ -1255,9 +1255,9 @@ void OS2METReader::ReadBezier(BOOL bGivenPos, USHORT nOrderLen)
}
}
-void OS2METReader::ReadFillet(BOOL bGivenPos, USHORT nOrderLen)
+void OS2METReader::ReadFillet(sal_Bool bGivenPos, sal_uInt16 nOrderLen)
{
- USHORT i,nNumPoints;
+ sal_uInt16 i,nNumPoints;
if (bCoord32) nNumPoints=nOrderLen/8; else nNumPoints=nOrderLen/4;
if (!bGivenPos) nNumPoints++;
@@ -1277,9 +1277,9 @@ void OS2METReader::ReadFillet(BOOL bGivenPos, USHORT nOrderLen)
}
}
-void OS2METReader::ReadFilletSharp(BOOL bGivenPos, USHORT nOrderLen)
+void OS2METReader::ReadFilletSharp(sal_Bool bGivenPos, sal_uInt16 nOrderLen)
{
- USHORT i,nNumPoints;
+ sal_uInt16 i,nNumPoints;
if (bGivenPos) {
aAttr.aCurPos=ReadPoint();
@@ -1301,20 +1301,20 @@ void OS2METReader::ReadFilletSharp(BOOL bGivenPos, USHORT nOrderLen)
}
}
-void OS2METReader::ReadMarker(BOOL bGivenPos, USHORT nOrderLen)
+void OS2METReader::ReadMarker(sal_Bool bGivenPos, sal_uInt16 nOrderLen)
{
- USHORT i,nNumPoints;
+ sal_uInt16 i,nNumPoints;
long x,y;
SetPen( aAttr.aMrkCol );
SetRasterOp(aAttr.eMrkMix);
if (aAttr.nMrkSymbol>=5 && aAttr.nMrkSymbol<=9)
{
- ChangeBrush(aAttr.aMrkCol,aAttr.aMrkCol,TRUE);
+ ChangeBrush(aAttr.aMrkCol,aAttr.aMrkCol,sal_True);
}
else
{
- ChangeBrush(Color(COL_TRANSPARENT),Color(COL_TRANSPARENT),FALSE);
+ ChangeBrush(Color(COL_TRANSPARENT),Color(COL_TRANSPARENT),sal_False);
}
if (bCoord32) nNumPoints=nOrderLen/8; else nNumPoints=nOrderLen/4;
if (!bGivenPos) nNumPoints++;
@@ -1401,46 +1401,46 @@ void OS2METReader::ReadMarker(BOOL bGivenPos, USHORT nOrderLen)
}
}
-void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
+void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen)
{
switch (nOrderID) {
- case GOrdGivArc: ReadArc(TRUE); break;
- case GOrdCurArc: ReadArc(FALSE); break;
+ case GOrdGivArc: ReadArc(sal_True); break;
+ case GOrdCurArc: ReadArc(sal_False); break;
- case GOrdGivBzr: ReadBezier(TRUE,nOrderLen); break;
- case GOrdCurBzr: ReadBezier(FALSE,nOrderLen); break;
+ case GOrdGivBzr: ReadBezier(sal_True,nOrderLen); break;
+ case GOrdCurBzr: ReadBezier(sal_False,nOrderLen); break;
- case GOrdGivBox: ReadBox(TRUE); break;
- case GOrdCurBox: ReadBox(FALSE); break;
+ case GOrdGivBox: ReadBox(sal_True); break;
+ case GOrdCurBox: ReadBox(sal_False); break;
- case GOrdGivFil: ReadFillet(TRUE,nOrderLen); break;
- case GOrdCurFil: ReadFillet(FALSE,nOrderLen); break;
+ case GOrdGivFil: ReadFillet(sal_True,nOrderLen); break;
+ case GOrdCurFil: ReadFillet(sal_False,nOrderLen); break;
- case GOrdGivCrc: ReadFullArc(TRUE,nOrderLen); break;
- case GOrdCurCrc: ReadFullArc(FALSE,nOrderLen); break;
+ case GOrdGivCrc: ReadFullArc(sal_True,nOrderLen); break;
+ case GOrdCurCrc: ReadFullArc(sal_False,nOrderLen); break;
- case GOrdGivLin: ReadLine(TRUE, nOrderLen); break;
- case GOrdCurLin: ReadLine(FALSE, nOrderLen); break;
+ case GOrdGivLin: ReadLine(sal_True, nOrderLen); break;
+ case GOrdCurLin: ReadLine(sal_False, nOrderLen); break;
- case GOrdGivMrk: ReadMarker(TRUE, nOrderLen); break;
- case GOrdCurMrk: ReadMarker(FALSE, nOrderLen); break;
+ case GOrdGivMrk: ReadMarker(sal_True, nOrderLen); break;
+ case GOrdCurMrk: ReadMarker(sal_False, nOrderLen); break;
- case GOrdGivArP: ReadPartialArc(TRUE,nOrderLen); break;
- case GOrdCurArP: ReadPartialArc(FALSE,nOrderLen); break;
+ case GOrdGivArP: ReadPartialArc(sal_True,nOrderLen); break;
+ case GOrdCurArP: ReadPartialArc(sal_False,nOrderLen); break;
- case GOrdGivRLn: ReadRelLine(TRUE,nOrderLen); break;
- case GOrdCurRLn: ReadRelLine(FALSE,nOrderLen); break;
+ case GOrdGivRLn: ReadRelLine(sal_True,nOrderLen); break;
+ case GOrdCurRLn: ReadRelLine(sal_False,nOrderLen); break;
- case GOrdGivSFl: ReadFilletSharp(TRUE,nOrderLen); break;
- case GOrdCurSFl: ReadFilletSharp(FALSE,nOrderLen); break;
+ case GOrdGivSFl: ReadFilletSharp(sal_True,nOrderLen); break;
+ case GOrdCurSFl: ReadFilletSharp(sal_False,nOrderLen); break;
- case GOrdGivStM: ReadChrStr(TRUE , TRUE , FALSE, nOrderLen); break;
- case GOrdCurStM: ReadChrStr(FALSE, TRUE , FALSE, nOrderLen); break;
- case GOrdGivStr: ReadChrStr(TRUE , FALSE, FALSE, nOrderLen); break;
- case GOrdCurStr: ReadChrStr(FALSE, FALSE, FALSE, nOrderLen); break;
- case GOrdGivStx: ReadChrStr(TRUE , FALSE, TRUE , nOrderLen); break;
- case GOrdCurStx: ReadChrStr(FALSE, FALSE, TRUE , nOrderLen); break;
+ case GOrdGivStM: ReadChrStr(sal_True , sal_True , sal_False, nOrderLen); break;
+ case GOrdCurStM: ReadChrStr(sal_False, sal_True , sal_False, nOrderLen); break;
+ case GOrdGivStr: ReadChrStr(sal_True , sal_False, sal_False, nOrderLen); break;
+ case GOrdCurStr: ReadChrStr(sal_False, sal_False, sal_False, nOrderLen); break;
+ case GOrdGivStx: ReadChrStr(sal_True , sal_False, sal_True , nOrderLen); break;
+ case GOrdCurStx: ReadChrStr(sal_False, sal_False, sal_True , nOrderLen); break;
case GOrdGivImg: OOODEBUG("GOrdGivImg",0);
break;
@@ -1453,7 +1453,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdBegAra: {
OSArea * p=new OSArea;
- p->bClosed=FALSE;
+ p->bClosed=sal_False;
p->pSucc=pAreaStack; pAreaStack=p;
*pOS2MET >> (p->nFlags);
p->aCol=aAttr.aPatCol;
@@ -1471,7 +1471,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
pAreaStack = p->pSucc;
if ( pPathStack )
{
- for ( USHORT i=0; i<p->aPPoly.Count(); i++ )
+ for ( sal_uInt16 i=0; i<p->aPPoly.Count(); i++ )
{
AddPointsToPath( p->aPPoly.GetObject( i ) );
CloseFigure();
@@ -1503,8 +1503,8 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
p->pSucc=pPathStack; pPathStack=p;
pOS2MET->SeekRel(2);
*pOS2MET >> p->nID;
- p->bClosed=FALSE;
- p->bStroke=FALSE;
+ p->bClosed=sal_False;
+ p->bStroke=sal_False;
break;
}
case GOrdEndPth: {
@@ -1528,7 +1528,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdFilPth:
{
sal_uInt32 nID;
- UINT16 nDummy;
+ sal_uInt16 nDummy;
OSPath* p = pPathList;
*pOS2MET >> nDummy
@@ -1544,11 +1544,11 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
if( p->bStroke )
{
SetPen( aAttr.aPatCol, aAttr.nStrLinWidth, PEN_SOLID );
- ChangeBrush(Color(COL_TRANSPARENT),Color(COL_TRANSPARENT),FALSE);
+ ChangeBrush(Color(COL_TRANSPARENT),Color(COL_TRANSPARENT),sal_False);
SetRasterOp( aAttr.ePatMix );
if ( IsLineInfo() )
{
- for ( USHORT i = 0; i < p->aPPoly.Count(); i++ )
+ for ( sal_uInt16 i = 0; i < p->aPPoly.Count(); i++ )
pVirDev->DrawPolyLine( p->aPPoly.GetObject( i ), aLineInfo );
}
else
@@ -1574,14 +1574,14 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
p = p->pSucc;
if( p )
- p->bStroke = TRUE;
+ p->bStroke = sal_True;
}
break;
case GOrdOutPth:
{
sal_uInt32 nID;
- USHORT i,nC;
+ sal_uInt16 i,nC;
OSPath* p=pPathList;
pOS2MET->SeekRel(2);
*pOS2MET >> nID;
@@ -1592,11 +1592,11 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
{
SetPen( aAttr.aLinCol, aAttr.nStrLinWidth, aAttr.eLinStyle );
SetRasterOp(aAttr.eLinMix);
- ChangeBrush(Color(COL_TRANSPARENT),Color(COL_TRANSPARENT),FALSE);
+ ChangeBrush(Color(COL_TRANSPARENT),Color(COL_TRANSPARENT),sal_False);
nC=p->aPPoly.Count();
for (i=0; i<nC; i++)
{
- if (i+1<nC || p->bClosed==TRUE)
+ if (i+1<nC || p->bClosed==sal_True)
DrawPolygon( p->aPPoly.GetObject( i ) );
else
DrawPolyLine( p->aPPoly.GetObject( i ) );
@@ -1648,8 +1648,8 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPIvAtr: PushAttr(nOrderID);
case GOrdSIvAtr: {
- BYTE nA, nP, nFlags, nMix;
- ULONG nVal;
+ sal_uInt8 nA, nP, nFlags, nMix;
+ sal_uLong nVal;
Color aCol;
RasterOp eROP;
*pOS2MET >> nA >> nP >> nFlags;
@@ -1737,8 +1737,8 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
}
case GOrdPIxCol: PushAttr(nOrderID);
case GOrdSIxCol: {
- BYTE nFlags;
- ULONG nVal;
+ sal_uInt8 nFlags;
+ sal_uLong nVal;
Color aCol;
*pOS2MET >> nFlags;
if ((nFlags&0x80)!=0) {
@@ -1765,11 +1765,11 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPXtCol: PushAttr(nOrderID);
case GOrdSColor:
case GOrdSXtCol: {
- BYTE nbyte;
- USHORT nVal;
+ sal_uInt8 nbyte;
+ sal_uInt16 nVal;
Color aCol;
if (nOrderID==GOrdPColor || nOrderID==GOrdSColor) {
- *pOS2MET >> nbyte; nVal=((USHORT)nbyte)|0xff00;
+ *pOS2MET >> nbyte; nVal=((sal_uInt16)nbyte)|0xff00;
}
else *pOS2MET >> nVal;
if (nVal==0x0000 || nVal==0xff00) {
@@ -1783,7 +1783,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
if (nVal==0x0007) aCol=Color(COL_WHITE);
else if (nVal==0x0008) aCol=Color(COL_BLACK);
else if (nVal==0xff08) aCol=GetPaletteColor(1);
- else aCol=GetPaletteColor(((ULONG)nVal) & 0x000000ff);
+ else aCol=GetPaletteColor(((sal_uLong)nVal) & 0x000000ff);
aAttr.aLinCol = aAttr.aChrCol = aAttr.aMrkCol = aAttr.aPatCol =
aAttr.aImgCol = aCol;
}
@@ -1792,7 +1792,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPBgCol: PushAttr(nOrderID);
case GOrdSBgCol: {
- USHORT nVal;
+ sal_uInt16 nVal;
Color aCol;
*pOS2MET >> nVal;
if (nVal==0x0000 || nVal==0xff00) {
@@ -1806,7 +1806,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
if (nVal==0x0007) aCol=Color(COL_WHITE);
else if (nVal==0x0008) aCol=Color(COL_BLACK);
else if (nVal==0xff08) aCol=GetPaletteColor(0);
- else aCol=GetPaletteColor(((ULONG)nVal) & 0x000000ff);
+ else aCol=GetPaletteColor(((sal_uLong)nVal) & 0x000000ff);
aAttr.aLinBgCol = aAttr.aChrBgCol = aAttr.aMrkBgCol =
aAttr.aPatBgCol = aAttr.aImgBgCol = aCol;
}
@@ -1814,8 +1814,8 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
}
case GOrdPBxCol: PushAttr(nOrderID);
case GOrdSBxCol: {
- BYTE nFlags;
- ULONG nVal;
+ sal_uInt8 nFlags;
+ sal_uLong nVal;
Color aCol;
*pOS2MET >> nFlags;
if ((nFlags&0x80)!=0) {
@@ -1840,7 +1840,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPMixMd: PushAttr(nOrderID);
case GOrdSMixMd: {
- BYTE nMix;
+ sal_uInt8 nMix;
*pOS2MET >> nMix;
if (nMix==0) {
aAttr.eLinMix=aDefAttr.eLinMix;
@@ -1857,7 +1857,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
}
case GOrdPBgMix: PushAttr(nOrderID);
case GOrdSBgMix: {
- BYTE nMix;
+ sal_uInt8 nMix;
*pOS2MET >> nMix;
if (nMix==0) {
aAttr.eLinBgMix=aDefAttr.eLinBgMix;
@@ -1878,7 +1878,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPPtSym: PushAttr(nOrderID);
case GOrdSPtSym: {
- BYTE nPatt;
+ sal_uInt8 nPatt;
*pOS2MET >> nPatt;
aAttr.bFill = ( nPatt != 0x0f );
break;
@@ -1898,7 +1898,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPLnTyp: PushAttr(nOrderID);
case GOrdSLnTyp: {
- BYTE nType;
+ sal_uInt8 nType;
*pOS2MET >> nType;
switch (nType) {
case 0: aAttr.eLinStyle=aDefAttr.eLinStyle; break;
@@ -1912,10 +1912,10 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
}
case GOrdPLnWdt: PushAttr(nOrderID);
case GOrdSLnWdt: {
- BYTE nbyte;
+ sal_uInt8 nbyte;
*pOS2MET >> nbyte;
if (nbyte==0) aAttr.nLinWidth=aDefAttr.nLinWidth;
- else aAttr.nLinWidth=(USHORT)nbyte-1;
+ else aAttr.nLinWidth=(sal_uInt16)nbyte-1;
break;
}
case GOrdPFrLWd: PushAttr(nOrderID);
@@ -1925,7 +1925,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPStLWd: PushAttr(nOrderID);
case GOrdSStLWd :
{
- BYTE nFlags;
+ sal_uInt8 nFlags;
long nWd;
*pOS2MET >> nFlags;
@@ -1937,7 +1937,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
nWd = ReadCoord( bCoord32 );
if ( nWd < 0 )
nWd = -nWd;
- aAttr.nStrLinWidth = (USHORT)nWd;
+ aAttr.nStrLinWidth = (sal_uInt16)nWd;
}
break;
}
@@ -1951,8 +1951,8 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPChSet: PushAttr(nOrderID);
case GOrdSChSet: {
- BYTE nbyte; *pOS2MET >> nbyte;
- aAttr.nChrSet=((ULONG)nbyte)&0xff;
+ sal_uInt8 nbyte; *pOS2MET >> nbyte;
+ aAttr.nChrSet=((sal_uLong)nbyte)&0xff;
break;
}
case GOrdPChAng: PushAttr(nOrderID);
@@ -1973,8 +1973,8 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPChCel: PushAttr(nOrderID);
case GOrdSChCel: {
- BYTE nbyte;
- USHORT nLen=nOrderLen;
+ sal_uInt8 nbyte;
+ sal_uInt16 nLen=nOrderLen;
aAttr.aChrCellSize.Width()=ReadCoord(bCoord32);
aAttr.aChrCellSize.Height()=ReadCoord(bCoord32);
if (bCoord32) nLen-=8; else nLen-=4;
@@ -2002,7 +2002,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPMkPrc: PushAttr(nOrderID);
case GOrdSMkPrc: {
- BYTE nbyte;
+ sal_uInt8 nbyte;
*pOS2MET >> nbyte;
if (nbyte==0) aAttr.nMrkPrec=aDefAttr.nMrkPrec;
else aAttr.nMrkPrec=nbyte;
@@ -2011,7 +2011,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPMkSet: PushAttr(nOrderID);
case GOrdSMkSet: {
- BYTE nbyte;
+ sal_uInt8 nbyte;
*pOS2MET >> nbyte;
if (nbyte==0) aAttr.nMrkSet=aDefAttr.nMrkSet;
else aAttr.nMrkSet=nbyte;
@@ -2020,7 +2020,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPMkSym: PushAttr(nOrderID);
case GOrdSMkSym: {
- BYTE nbyte;
+ sal_uInt8 nbyte;
*pOS2MET >> nbyte;
if (nbyte==0) aAttr.nMrkSymbol=aDefAttr.nMrkSymbol;
else aAttr.nMrkSymbol=nbyte;
@@ -2029,8 +2029,8 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPMkCel: PushAttr(nOrderID);
case GOrdSMkCel: {
- BYTE nbyte;
- USHORT nLen=nOrderLen;
+ sal_uInt8 nbyte;
+ sal_uInt16 nLen=nOrderLen;
aAttr.aMrkCellSize.Width()=ReadCoord(bCoord32);
aAttr.aMrkCellSize.Height()=ReadCoord(bCoord32);
if (bCoord32) nLen-=8; else nLen-=4;
@@ -2073,15 +2073,15 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
}
}
-void OS2METReader::ReadDsc(USHORT nDscID, USHORT /*nDscLen*/)
+void OS2METReader::ReadDsc(sal_uInt16 nDscID, sal_uInt16 /*nDscLen*/)
{
switch (nDscID) {
case 0x00f7: { // 'Specify GVM Subset'
- BYTE nbyte;
+ sal_uInt8 nbyte;
pOS2MET->SeekRel(6);
*pOS2MET >> nbyte;
- if (nbyte==0x05) bCoord32=TRUE;
- else if (nbyte==0x04) bCoord32=FALSE;
+ if (nbyte==0x05) bCoord32=sal_True;
+ else if (nbyte==0x04) bCoord32=sal_False;
else {
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
ErrorCode=1;
@@ -2091,20 +2091,20 @@ void OS2METReader::ReadDsc(USHORT nDscID, USHORT /*nDscLen*/)
case 0x00f6:
{
// 'Set Picture Descriptor'
- BOOL b32;
- BYTE nbyte,nUnitType;
+ sal_Bool b32;
+ sal_uInt8 nbyte,nUnitType;
long x1,y1,x2,y2,nt,xr,yr;
pOS2MET->SeekRel(2);
*pOS2MET >> nbyte;
if (nbyte==0x05)
- b32=TRUE;
+ b32=sal_True;
else if(nbyte==0x04)
- b32=FALSE;
+ b32=sal_False;
else
{
- b32 = FALSE; // -Wall added the case.
+ b32 = sal_False; // -Wall added the case.
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
ErrorCode=2;
}
@@ -2157,7 +2157,7 @@ void OS2METReader::ReadDsc(USHORT nDscID, USHORT /*nDscLen*/)
}
}
-void OS2METReader::ReadImageData(USHORT nDataID, USHORT nDataLen)
+void OS2METReader::ReadImageData(sal_uInt16 nDataID, sal_uInt16 nDataLen)
{
OSBitmap * p=pBitmapList; if (p==NULL) return; // Nanu ?
@@ -2179,7 +2179,7 @@ void OS2METReader::ReadImageData(USHORT nDataID, USHORT nDataLen)
break;
case 0x0096: { // Image IDE-Size
- BYTE nbyte;
+ sal_uInt8 nbyte;
*pOS2MET >> nbyte; p->nBitsPerPixel=nbyte;
break;
}
@@ -2203,22 +2203,22 @@ void OS2METReader::ReadImageData(USHORT nDataID, USHORT nDataLen)
}
// Schreibe (Windows-)BITMAPINFOHEADER:
*(p->pBMP) << ((sal_uInt32)40) << p->nWidth << p->nHeight;
- *(p->pBMP) << ((USHORT)1) << p->nBitsPerPixel;
+ *(p->pBMP) << ((sal_uInt16)1) << p->nBitsPerPixel;
*(p->pBMP) << ((sal_uInt32)0) << ((sal_uInt32)0) << ((sal_uInt32)0) << ((sal_uInt32)0);
*(p->pBMP) << ((sal_uInt32)0) << ((sal_uInt32)0);
// Schreibe Farbtabelle:
if (p->nBitsPerPixel<=8) {
- USHORT i, nColTabSize=1<<(p->nBitsPerPixel);
+ sal_uInt16 i, nColTabSize=1<<(p->nBitsPerPixel);
for (i=0; i<nColTabSize; i++) *(p->pBMP) << GetPalette0RGB(i);
}
}
// OK, nun werden die Map-Daten ruebergeschoben. Leider haben OS2 und
// BMP eine unterschiedliche Reihenfolge von RGB bei 24-Bit.
- BYTE * pBuf=new BYTE[nDataLen];
+ sal_uInt8 * pBuf=new sal_uInt8[nDataLen];
pOS2MET->Read(pBuf,nDataLen);
if (p->nBitsPerPixel==24) {
- ULONG i, j, nAlign, nBytesPerLine;
- BYTE nTemp;
+ sal_uLong i, j, nAlign, nBytesPerLine;
+ sal_uInt8 nTemp;
nBytesPerLine=(p->nWidth*3+3)&0xfffffffc;
nAlign=p->nMapPos-(p->nMapPos % nBytesPerLine);
i=0;
@@ -2246,22 +2246,22 @@ void OS2METReader::ReadImageData(USHORT nDataID, USHORT nDataLen)
}
}
-void OS2METReader::ReadFont(USHORT nFieldSize)
+void OS2METReader::ReadFont(sal_uInt16 nFieldSize)
{
- ULONG nPos, nMaxPos;
- USHORT nLen;
- BYTE nByte, nTripType, nTripType2;
+ sal_uLong nPos, nMaxPos;
+ sal_uInt16 nLen;
+ sal_uInt8 nByte, nTripType, nTripType2;
OSFont * pF=new OSFont;
pF->pSucc=pFontList; pFontList=pF;
pF->nID=0;
- pF->aFont.SetTransparent(TRUE);
+ pF->aFont.SetTransparent(sal_True);
pF->aFont.SetAlign(ALIGN_BASELINE);
nPos=pOS2MET->Tell();
- nMaxPos=nPos+(ULONG)nFieldSize;
+ nMaxPos=nPos+(sal_uLong)nFieldSize;
pOS2MET->SeekRel(2); nPos+=2;
while (nPos<nMaxPos && pOS2MET->GetError()==0) {
- *pOS2MET >> nByte; nLen =((USHORT)nByte) & 0x00ff;
+ *pOS2MET >> nByte; nLen =((sal_uInt16)nByte) & 0x00ff;
*pOS2MET >> nTripType;
switch (nTripType) {
case 0x02:
@@ -2287,7 +2287,7 @@ void OS2METReader::ReadFont(USHORT nFieldSize)
switch (nTripType2) {
case 0x05: //Icid
*pOS2MET >> nByte;
- pF->nID=((ULONG)nByte)&0xff;
+ pF->nID=((sal_uLong)nByte)&0xff;
break;
}
break;
@@ -2295,7 +2295,7 @@ void OS2METReader::ReadFont(USHORT nFieldSize)
break;
case 0x1f: { // Font Attributes
FontWeight eWeight;
- BYTE nbyte;
+ sal_uInt8 nbyte;
*pOS2MET >> nbyte;
switch (nbyte) {
case 1: eWeight=WEIGHT_THIN; break;
@@ -2317,7 +2317,7 @@ void OS2METReader::ReadFont(USHORT nFieldSize)
}
}
-void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
+void OS2METReader::ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize)
{
switch (nFieldType) {
case BegDocumnMagic:
@@ -2333,21 +2333,21 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
case EndColAtrMagic:
break;
case BlkColAtrMagic: {
- ULONG nPos, nMaxPos;
- BYTE nbyte;
- ULONG nCol;
- USHORT nStartIndex, nEndIndex, i, nElemLen, nBytesPerCol;
+ sal_uLong nPos, nMaxPos;
+ sal_uInt8 nbyte;
+ sal_uLong nCol;
+ sal_uInt16 nStartIndex, nEndIndex, i, nElemLen, nBytesPerCol;
nPos=pOS2MET->Tell();
- nMaxPos=nPos+(ULONG)nFieldSize;
+ nMaxPos=nPos+(sal_uLong)nFieldSize;
pOS2MET->SeekRel(3); nPos+=3;
while (nPos<nMaxPos && pOS2MET->GetError()==0) {
- *pOS2MET >> nbyte; nElemLen=((USHORT)nbyte) & 0x00ff;
+ *pOS2MET >> nbyte; nElemLen=((sal_uInt16)nbyte) & 0x00ff;
if (nElemLen>11) {
pOS2MET->SeekRel(4);
nStartIndex=ReadBigEndianWord();
pOS2MET->SeekRel(3);
- *pOS2MET >> nbyte; nBytesPerCol=((USHORT)nbyte) & 0x00ff;
+ *pOS2MET >> nbyte; nBytesPerCol=((sal_uInt16)nbyte) & 0x00ff;
nEndIndex=nStartIndex+(nElemLen-11)/nBytesPerCol;
for (i=nStartIndex; i<nEndIndex; i++) {
if (nBytesPerCol > 3) pOS2MET->SeekRel(nBytesPerCol-3);
@@ -2359,7 +2359,7 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
ErrorCode=4;
}
- nPos+=(ULONG)nElemLen;
+ nPos+=(sal_uLong)nElemLen;
pOS2MET->Seek(nPos);
}
break;
@@ -2373,12 +2373,12 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
pB->pBMP=NULL; pB->nWidth=0; pB->nHeight=0; pB->nBitsPerPixel=0;
pB->nMapPos=0;
// ID der Bitmap ermitteln:
- BYTE i,nbyte,nbyte2;
+ sal_uInt8 i,nbyte,nbyte2;
pB->nID=0;
for (i=0; i<4; i++) {
*pOS2MET >> nbyte >> nbyte2;
nbyte=((nbyte-0x30)<<4)|(nbyte2-0x30);
- pB->nID=(pB->nID>>8)|(((ULONG)nbyte)<<24);
+ pB->nID=(pB->nID>>8)|(((sal_uLong)nbyte)<<24);
}
// neue Palette auf den Paletten-Stack bringen: (wird spaeter gefuellt)
OSPalette * pP=new OSPalette;
@@ -2396,7 +2396,7 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
}
pBitmapList->pBMP->Seek(0);
- pBitmapList->aBitmap.Read( *( pBitmapList->pBMP ), FALSE );
+ pBitmapList->aBitmap.Read( *( pBitmapList->pBMP ), sal_False );
if (pBitmapList->pBMP->GetError()!=0) {
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
@@ -2415,26 +2415,26 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
case DscImgObjMagic:
break;
case DatImgObjMagic: {
- USHORT nDataID, nDataLen;
- BYTE nbyte;
- ULONG nPos, nMaxPos;
+ sal_uInt16 nDataID, nDataLen;
+ sal_uInt8 nbyte;
+ sal_uLong nPos, nMaxPos;
nPos=pOS2MET->Tell();
- nMaxPos=nPos+(ULONG)nFieldSize;
+ nMaxPos=nPos+(sal_uLong)nFieldSize;
while (nPos<nMaxPos && pOS2MET->GetError()==0) {
- *pOS2MET >> nbyte; nDataID=((USHORT)nbyte)&0x00ff;
+ *pOS2MET >> nbyte; nDataID=((sal_uInt16)nbyte)&0x00ff;
if (nDataID==0x00fe) {
*pOS2MET >> nbyte;
- nDataID=(nDataID<<8)|(((USHORT)nbyte)&0x00ff);
+ nDataID=(nDataID<<8)|(((sal_uInt16)nbyte)&0x00ff);
nDataLen=ReadBigEndianWord();
nPos+=4;
}
else {
- *pOS2MET >> nbyte; nDataLen=((USHORT)nbyte)&0x00ff;
+ *pOS2MET >> nbyte; nDataLen=((sal_uInt16)nbyte)&0x00ff;
nPos+=2;
}
ReadImageData(nDataID, nDataLen);
- nPos+=(ULONG)nDataLen;
+ nPos+=(sal_uLong)nDataLen;
pOS2MET->Seek(nPos);
}
break;
@@ -2448,9 +2448,9 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
break;
case EndGrfObjMagic: {
SvStream * pSave;
- ULONG nPos, nMaxPos;
- USHORT nOrderID, nOrderLen;
- BYTE nbyte;
+ sal_uLong nPos, nMaxPos;
+ sal_uInt16 nOrderID, nOrderLen;
+ sal_uInt8 nbyte;
if (pOrdFile==NULL) break;
@@ -2473,10 +2473,10 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
// Schleife ueber Order:
while (pOS2MET->Tell()<nMaxPos && pOS2MET->GetError()==0) {
- *pOS2MET >> nbyte; nOrderID=((USHORT)nbyte) & 0x00ff;
+ *pOS2MET >> nbyte; nOrderID=((sal_uInt16)nbyte) & 0x00ff;
if (nOrderID==0x00fe) {
*pOS2MET >> nbyte;
- nOrderID=(nOrderID << 8) | (((USHORT)nbyte) & 0x00ff);
+ nOrderID=(nOrderID << 8) | (((sal_uInt16)nbyte) & 0x00ff);
}
if (nOrderID>0x00ff || nOrderID==GOrdPolygn) {
// ooo: Laut OS2-Doku sollte die Orderlaenge nun als Big-Endian-Word
@@ -2484,13 +2484,13 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
// Tatsaechlich gibt es aber Dateien, die die Laenge als
// Little-Endian-Word angeben (zu mindestens fuer nOrderID==GOrdPolygn).
// Also werfen wir eine Muenze oder was ?
- *pOS2MET >> nbyte; nOrderLen=(USHORT)nbyte&0x00ff;
- *pOS2MET >> nbyte; if (nbyte!=0) nOrderLen=nOrderLen<<8|(((USHORT)nbyte)&0x00ff);
+ *pOS2MET >> nbyte; nOrderLen=(sal_uInt16)nbyte&0x00ff;
+ *pOS2MET >> nbyte; if (nbyte!=0) nOrderLen=nOrderLen<<8|(((sal_uInt16)nbyte)&0x00ff);
}
else if (nOrderID==GOrdSTxAlg || nOrderID==GOrdPTxAlg) nOrderLen=2;
else if ((nOrderID&0xff88)==0x0008) nOrderLen=1;
else if (nOrderID==0x0000 || nOrderID==0x00ff) nOrderLen=0;
- else { *pOS2MET >> nbyte; nOrderLen=((USHORT)nbyte) & 0x00ff; }
+ else { *pOS2MET >> nbyte; nOrderLen=((sal_uInt16)nbyte) & 0x00ff; }
nPos=pOS2MET->Tell();
ReadOrder(nOrderID, nOrderLen);
if (nPos+nOrderLen < pOS2MET->Tell()) {
@@ -2512,14 +2512,14 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
break;
}
case DscGrfObjMagic: {
- ULONG nPos, nMaxPos;
- USHORT nDscID, nDscLen;
- BYTE nbyte;
+ sal_uLong nPos, nMaxPos;
+ sal_uInt16 nDscID, nDscLen;
+ sal_uInt8 nbyte;
- nMaxPos=pOS2MET->Tell()+(ULONG)nFieldSize;
+ nMaxPos=pOS2MET->Tell()+(sal_uLong)nFieldSize;
while (pOS2MET->Tell()<nMaxPos && pOS2MET->GetError()==0) {
- *pOS2MET >> nbyte; nDscID =((USHORT)nbyte) & 0x00ff;
- *pOS2MET >> nbyte; nDscLen=((USHORT)nbyte) & 0x00ff;
+ *pOS2MET >> nbyte; nDscID =((sal_uInt16)nbyte) & 0x00ff;
+ *pOS2MET >> nbyte; nDscLen=((sal_uInt16)nbyte) & 0x00ff;
nPos=pOS2MET->Tell();
ReadDsc(nDscID, nDscLen);
pOS2MET->Seek(nPos+nDscLen);
@@ -2531,7 +2531,7 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
pOrdFile = new SvMemoryStream;
pOrdFile->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
}
- BYTE * pBuf; pBuf = new BYTE[nFieldSize];
+ sal_uInt8 * pBuf; pBuf = new sal_uInt8[nFieldSize];
pOS2MET->Read(pBuf,nFieldSize);
pOrdFile->Write(pBuf,nFieldSize);
delete[] pBuf;
@@ -2548,10 +2548,10 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaFile )
{
- USHORT nFieldSize;
- USHORT nFieldType;
- ULONG nPos, nStartPos, nEndPos, nPercent, nLastPercent;
- BYTE nMagicByte;
+ sal_uInt16 nFieldSize;
+ sal_uInt16 nFieldType;
+ sal_uLong nPos, nStartPos, nEndPos, nPercent, nLastPercent;
+ sal_uInt8 nMagicByte;
ErrorCode=0;
@@ -2559,7 +2559,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
nOrigPos = pOS2MET->Tell();
nOrigNumberFormat = pOS2MET->GetNumberFormatInt();
- bCoord32 = TRUE;
+ bCoord32 = sal_True;
pPaletteStack=NULL;
pAreaStack=NULL;
pPathStack=NULL;
@@ -2602,7 +2602,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
aDefAttr.nMrkPrec =0x01;
aDefAttr.nMrkSet =0xff;
aDefAttr.nMrkSymbol =0x01;
- aDefAttr.bFill =TRUE;
+ aDefAttr.bFill =sal_True;
aDefAttr.nStrLinWidth=0;
aAttr=aDefAttr;
@@ -2610,7 +2610,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
pOrdFile=NULL;
pVirDev = new VirtualDevice();
- pVirDev->EnableOutput(FALSE);
+ pVirDev->EnableOutput(sal_False);
rGDIMetaFile.Record(pVirDev);
pOS2MET->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
@@ -2630,7 +2630,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
nPercent=(nPos-nStartPos)*100/(nEndPos-nStartPos);
if (nLastPercent+4<=nPercent) {
- if (Callback((USHORT)nPercent)==TRUE) break;
+ if (Callback((sal_uInt16)nPercent)==sal_True) break;
nLastPercent=nPercent;
}
@@ -2658,7 +2658,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
ReadField(nFieldType, nFieldSize);
- nPos+=(ULONG)nFieldSize;
+ nPos+=(sal_uLong)nFieldSize;
if (pOS2MET->Tell()>nPos) {
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
ErrorCode=9;
@@ -2738,18 +2738,18 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
//================== GraphicImport - die exportierte Funktion ================
-extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, BOOL )
+extern "C" sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool )
{
OS2METReader aOS2METReader;
GDIMetaFile aMTF;
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
aOS2METReader.ReadOS2MET( rStream, aMTF );
if ( !rStream.GetError() )
{
rGraphic=Graphic( aMTF );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;