diff options
Diffstat (limited to 'vcl/source/gdi/cvtsvm.cxx')
-rw-r--r-- | vcl/source/gdi/cvtsvm.cxx | 422 |
1 files changed, 211 insertions, 211 deletions
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx index b32f4933ace7..a2bbd6ee0e6e 100644 --- a/vcl/source/gdi/cvtsvm.cxx +++ b/vcl/source/gdi/cvtsvm.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -75,7 +75,7 @@ void ImplWriteRect( SvStream& rOStm, const Rectangle& rRect ) void ImplReadPoly( SvStream& rIStm, Polygon& rPoly ) { - INT32 nSize; + INT32 nSize; rIStm >> nSize; rPoly = Polygon( (USHORT) nSize ); @@ -89,7 +89,7 @@ void ImplReadPoly( SvStream& rIStm, Polygon& rPoly ) void ImplReadPolyPoly( SvStream& rIStm, PolyPolygon& rPolyPoly ) { Polygon aPoly; - INT32 nPolyCount; + INT32 nPolyCount; rIStm >> nPolyCount; @@ -104,9 +104,9 @@ void ImplReadPolyPoly( SvStream& rIStm, PolyPolygon& rPolyPoly ) void ImplWritePolyPolyAction( SvStream& rOStm, const PolyPolygon& rPolyPoly ) { - const USHORT nPoly = rPolyPoly.Count(); - USHORT nPoints = 0; - USHORT n; + const USHORT nPoly = rPolyPoly.Count(); + USHORT nPoints = 0; + USHORT n; for( n = 0; n < nPoly; n++ ) nPoints = sal::static_int_cast<USHORT>(nPoints + rPolyPoly[ n ].GetSize()); @@ -162,12 +162,12 @@ void ImplWriteColor( SvStream& rOStm, const Color& rColor ) void ImplReadMapMode( SvStream& rIStm, MapMode& rMapMode ) { - Point aOrg; - INT32 nXNum; - INT32 nXDenom; - INT32 nYNum; - INT32 nYDenom; - INT16 nUnit; + Point aOrg; + INT32 nXNum; + INT32 nXDenom; + INT32 nYNum; + INT32 nYDenom; + INT16 nUnit; rIStm >> nUnit >> aOrg >> nXNum >> nXDenom >> nYNum >> nYDenom; rMapMode = MapMode( (MapUnit) nUnit, aOrg, Fraction( nXNum, nXDenom ), Fraction( nYNum, nYDenom ) ); @@ -245,8 +245,8 @@ void ImplWriteFillColor( SvStream& rOStm, const Color& rColor, INT16 nStyle ) void ImplWriteFont( SvStream& rOStm, const Font& rFont, rtl_TextEncoding& rActualCharSet ) { - char aName[32]; - short nWeight; + char aName[32]; + short nWeight; ByteString aByteName( rFont.GetName(), rOStm.GetStreamCharSet() ); strncpy( aName, aByteName.GetBuffer(), 32 ); @@ -314,8 +314,8 @@ sal_Bool ImplWriteUnicodeComment( SvStream& rOStm, const String& rString ) xub_StrLen i, nStringLen = rString.Len(); if ( nStringLen ) { - sal_uInt32 nSize = ( nStringLen << 1 ) + 4; - sal_uInt16 nType = GDI_UNICODE_COMMENT; + sal_uInt32 nSize = ( nStringLen << 1 ) + 4; + sal_uInt16 nType = GDI_UNICODE_COMMENT; rOStm << nType << nSize; for ( i = 0; i < nStringLen; i++ ) @@ -334,12 +334,12 @@ void ImplReadUnicodeComment( sal_uInt32 nStrmPos, SvStream& rIStm, String& rStri sal_uInt32 nOld = rIStm.Tell(); if ( nStrmPos ) { - sal_uInt16 nType; - sal_uInt32 nActionSize; + sal_uInt16 nType; + sal_uInt32 nActionSize; xub_StrLen nStringLen; - + rIStm.Seek( nStrmPos ); - rIStm >> nType + rIStm >> nType >> nActionSize; nStringLen = sal::static_int_cast<xub_StrLen>(( nActionSize - 4 ) >> 1); @@ -401,14 +401,14 @@ bool ImplWriteExtendedPolyPolygonAction(SvStream& rOStm, const PolyPolygon& rPol if((bOnlyWhenCurve && nAllFlagCount) || (!bOnlyWhenCurve && nAllPointCount)) { rOStm << (INT16) GDI_EXTENDEDPOLYGON_ACTION; - + const sal_Int32 nActionSize( - 4 + // Action size - 2 + // PolygonCount - (nAllPolygonCount * 2) + // Points per polygon - (nAllPointCount << 3) + // Points themselves - nAllPolygonCount + // Bool if (when poly has points) it has flags, too - nAllFlagCount); // Flags themselves + 4 + // Action size + 2 + // PolygonCount + (nAllPolygonCount * 2) + // Points per polygon + (nAllPointCount << 3) + // Points themselves + nAllPolygonCount + // Bool if (when poly has points) it has flags, too + nAllFlagCount); // Flags themselves rOStm << nActionSize; rOStm << (sal_uInt16)nAllPolygonCount; @@ -509,26 +509,26 @@ SVMConverter::SVMConverter( SvStream& rStm, GDIMetaFile& rMtf, ULONG nConvertMod void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) { - const ULONG nPos = rIStm.Tell(); - const USHORT nOldFormat = rIStm.GetNumberFormatInt(); + const ULONG nPos = rIStm.Tell(); + const USHORT nOldFormat = rIStm.GetNumberFormatInt(); rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); - char aCode[ 5 ]; - Size aPrefSz; - INT16 nSize; - INT16 nVersion; + char aCode[ 5 ]; + Size aPrefSz; + INT16 nSize; + INT16 nVersion; // read header - rIStm.Read( (char*) &aCode, sizeof( aCode ) ); // Kennung - rIStm >> nSize; // Size - rIStm >> nVersion; // Version - rIStm >> aPrefSz.Width(); // PrefSize.Width() - rIStm >> aPrefSz.Height(); // PrefSize.Height() + rIStm.Read( (char*) &aCode, sizeof( aCode ) ); // Kennung + rIStm >> nSize; // Size + rIStm >> nVersion; // Version + rIStm >> aPrefSz.Width(); // PrefSize.Width() + rIStm >> aPrefSz.Height(); // PrefSize.Height() // check header-magic and version if( rIStm.GetError() - || ( memcmp( aCode, "SVGDI", sizeof( aCode ) ) != 0 ) + || ( memcmp( aCode, "SVGDI", sizeof( aCode ) ) != 0 ) || ( nVersion != 200 ) ) { rIStm.SetError( SVSTREAM_FILEFORMAT_ERROR ); @@ -537,28 +537,28 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) return; } - LineInfo aLineInfo( LINE_NONE, 0 ); - Stack aLIStack; - VirtualDevice aFontVDev; - rtl_TextEncoding eActualCharSet = gsl_getSystemTextEncoding(); - BOOL bFatLine = FALSE; + LineInfo aLineInfo( LINE_NONE, 0 ); + Stack aLIStack; + VirtualDevice aFontVDev; + rtl_TextEncoding eActualCharSet = gsl_getSystemTextEncoding(); + BOOL bFatLine = FALSE; // TODO: fix reindentation below if you can accept being blamed by the SCM MapMode aMapMode; - Polygon aActionPoly; - Rectangle aRect; - Point aPt, aPt1; - Size aSz; - Color aActionColor; - INT32 nTmp, nTmp1, nActionSize; - INT32 nActions; - INT16 nType; + Polygon aActionPoly; + Rectangle aRect; + Point aPt, aPt1; + Size aSz; + Color aActionColor; + INT32 nTmp, nTmp1, nActionSize; + INT32 nActions; + INT16 nType; - sal_uInt32 nUnicodeCommentStreamPos = 0; - INT32 nUnicodeCommentActionNumber = 0; + sal_uInt32 nUnicodeCommentStreamPos = 0; + INT32 nUnicodeCommentActionNumber = 0; - ImplReadMapMode( rIStm, aMapMode ); // MapMode - rIStm >> nActions; // Action count + ImplReadMapMode( rIStm, aMapMode ); // MapMode + rIStm >> nActions; // Action count rMtf.SetPrefSize( aPrefSz ); rMtf.SetPrefMapMode( aMapMode ); @@ -567,7 +567,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) for( INT32 i = 0L; i < nActions; i++ ) { rIStm >> nType; - sal_Int32 nActBegin = rIStm.Tell(); + sal_Int32 nActBegin = rIStm.Tell(); rIStm >> nActionSize; DBG_ASSERT( ( nType <= 33 ) || ( nType >= 1024 ), "Unknown GDIMetaAction while converting!" ); @@ -644,7 +644,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) { rMtf.ReplaceAction( new MetaPolyLineAction( - aInputPolyPolygon.GetObject(0), + aInputPolyPolygon.GetObject(0), pPolyLineAction->GetLineInfo()), nLastPolygonAction); pPolyLineAction->Delete(); @@ -834,12 +834,12 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) case( GDI_FONT_ACTION ): { - Font aFont; - char aName[ 32 ]; - INT32 nWidth, nHeight; - INT16 nCharSet, nFamily, nPitch, nAlign, nWeight, nUnderline, nStrikeout; - INT16 nCharOrient, nLineOrient; - BOOL bItalic, bOutline, bShadow, bTransparent; + Font aFont; + char aName[ 32 ]; + INT32 nWidth, nHeight; + INT16 nCharSet, nFamily, nPitch, nAlign, nWeight, nUnderline, nStrikeout; + INT16 nCharOrient, nLineOrient; + BOOL bItalic, bOutline, bShadow, bTransparent; ImplReadColor( rIStm, aActionColor ); aFont.SetColor( aActionColor ); ImplReadColor( rIStm, aActionColor ); aFont.SetFillColor( aActionColor ); @@ -868,7 +868,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) eActualCharSet = aFont.GetCharSet(); if ( eActualCharSet == RTL_TEXTENCODING_DONTKNOW ) eActualCharSet = gsl_getSystemTextEncoding(); - + rMtf.AddAction( new MetaFontAction( aFont ) ); rMtf.AddAction( new MetaTextAlignAction( aFont.GetAlign() ) ); rMtf.AddAction( new MetaTextColorAction( aFont.GetColor() ) ); @@ -881,9 +881,9 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) case( GDI_TEXT_ACTION ): { - ByteString aByteStr; - INT32 nIndex, nLen; - + ByteString aByteStr; + INT32 nIndex, nLen; + rIStm >> aPt >> nIndex >> nLen >> nTmp; if ( nTmp && ( static_cast< sal_uInt32 >( nTmp ) < ( SAL_MAX_UINT16 - 1 ) ) ) { @@ -899,9 +899,9 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) case( GDI_TEXTARRAY_ACTION ): { - ByteString aByteStr; - sal_Int32* pDXAry = NULL; - INT32 nIndex, nLen, nAryLen; + ByteString aByteStr; + sal_Int32* pDXAry = NULL; + INT32 nIndex, nLen, nAryLen; rIStm >> aPt >> nIndex >> nLen >> nTmp >> nAryLen; if ( nTmp && ( static_cast< sal_uInt32 >( nTmp ) < ( SAL_MAX_UINT16 - 1 ) ) ) @@ -926,7 +926,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) sal_Int32* pTmpAry = new sal_Int32[nStrLen]; aFontVDev.GetTextArray( aStr, pTmpAry, (USHORT) nIndex, (USHORT) nLen ); - + // now, the difference between the // last and the second last DX array // is the advancement for the last @@ -960,8 +960,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) case( GDI_STRETCHTEXT_ACTION ): { - ByteString aByteStr; - INT32 nIndex, nLen, nWidth; + ByteString aByteStr; + INT32 nIndex, nLen, nWidth; rIStm >> aPt >> nIndex >> nLen >> nTmp >> nWidth; if ( nTmp && ( static_cast< sal_uInt32 >( nTmp ) < ( SAL_MAX_INT16 - 1 ) ) ) @@ -996,8 +996,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) case( GDI_BITMAPSCALEPART_ACTION ): { - Bitmap aBmp; - Size aSz2; + Bitmap aBmp; + Size aSz2; rIStm >> aPt >> aSz >> aPt1 >> aSz2 >> aBmp; rMtf.AddAction( new MetaBmpScalePartAction( aPt, aSz, aPt1, aSz2, aBmp ) ); @@ -1044,10 +1044,10 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) case( GDI_CLIPREGION_ACTION ): { - Region aRegion; - INT16 nRegType; - INT16 bIntersect; - BOOL bClip = FALSE; + Region aRegion; + INT16 nRegType; + INT16 bIntersect; + BOOL bClip = FALSE; rIStm >> nRegType >> bIntersect; ImplReadRect( rIStm, aRect ); @@ -1078,7 +1078,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) case( 3 ): { PolyPolygon aPolyPoly; - INT32 nPolyCount; + INT32 nPolyCount; rIStm >> nPolyCount; @@ -1117,8 +1117,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) case( GDI_RASTEROP_ACTION ): { - RasterOp eRasterOp; - INT16 nRasterOp; + RasterOp eRasterOp; + INT16 nRasterOp; rIStm >> nRasterOp; @@ -1174,15 +1174,15 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) case( GDI_GRADIENT_ACTION ): { - Color aStartCol; - Color aEndCol; - INT16 nStyle; - INT16 nAngle; - INT16 nBorder; - INT16 nOfsX; - INT16 nOfsY; - INT16 nIntensityStart; - INT16 nIntensityEnd; + Color aStartCol; + Color aEndCol; + INT16 nStyle; + INT16 nAngle; + INT16 nBorder; + INT16 nOfsX; + INT16 nOfsY; + INT16 nIntensityStart; + INT16 nIntensityEnd; ImplReadRect( rIStm, aRect ); rIStm >> nStyle; @@ -1205,8 +1205,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) case( GDI_TRANSPARENT_COMMENT ): { PolyPolygon aPolyPoly; - INT32 nFollowingActionCount; - INT16 nTrans; + INT32 nFollowingActionCount; + INT16 nTrans; rIStm >> aPolyPoly >> nTrans >> nFollowingActionCount; ImplSkipActions( rIStm, nFollowingActionCount ); @@ -1221,10 +1221,10 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) case( GDI_FLOATTRANSPARENT_COMMENT ): { GDIMetaFile aMtf; - Point aPos; - Size aSize; - Gradient aGradient; - INT32 nFollowingActionCount; + Point aPos; + Size aSize; + Gradient aGradient; + INT32 nFollowingActionCount; rIStm >> aMtf >> aPos >> aSize >> aGradient >> nFollowingActionCount; ImplSkipActions( rIStm, nFollowingActionCount ); @@ -1239,8 +1239,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) case( GDI_HATCH_COMMENT ): { PolyPolygon aPolyPoly; - Hatch aHatch; - INT32 nFollowingActionCount; + Hatch aHatch; + INT32 nFollowingActionCount; rIStm >> aPolyPoly >> aHatch >> nFollowingActionCount; ImplSkipActions( rIStm, nFollowingActionCount ); @@ -1254,9 +1254,9 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) case( GDI_REFPOINT_COMMENT ): { - Point aRefPoint; - BOOL bSet; - INT32 nFollowingActionCount; + Point aRefPoint; + BOOL bSet; + INT32 nFollowingActionCount; rIStm >> aRefPoint >> bSet >> nFollowingActionCount; ImplSkipActions( rIStm, nFollowingActionCount ); @@ -1276,9 +1276,9 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) case( GDI_TEXTLINECOLOR_COMMENT ): { - Color aColor; - BOOL bSet; - INT32 nFollowingActionCount; + Color aColor; + BOOL bSet; + INT32 nFollowingActionCount; rIStm >> aColor >> bSet >> nFollowingActionCount; ImplSkipActions( rIStm, nFollowingActionCount ); @@ -1292,11 +1292,11 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) case( GDI_TEXTLINE_COMMENT ): { - Point aStartPt; - long nWidth; + Point aStartPt; + long nWidth; sal_uInt32 nStrikeout; sal_uInt32 nUnderline; - INT32 nFollowingActionCount; + INT32 nFollowingActionCount; rIStm >> aStartPt >> nWidth >> nStrikeout >> nUnderline >> nFollowingActionCount; ImplSkipActions( rIStm, nFollowingActionCount ); @@ -1314,8 +1314,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) case( GDI_GRADIENTEX_COMMENT ): { PolyPolygon aPolyPoly; - Gradient aGradient; - INT32 nFollowingActionCount; + Gradient aGradient; + INT32 nFollowingActionCount; rIStm >> aPolyPoly >> aGradient >> nFollowingActionCount; ImplSkipActions( rIStm, nFollowingActionCount ); @@ -1329,11 +1329,11 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) case( GDI_COMMENT_COMMENT ): { - ByteString aComment; - sal_Int32 nValue; - sal_uInt32 nDataSize; - BYTE* pData; - INT32 nFollowingActionCount; + ByteString aComment; + sal_Int32 nValue; + sal_uInt32 nDataSize; + BYTE* pData; + INT32 nFollowingActionCount; rIStm >> aComment >> nValue >> nDataSize; @@ -1380,24 +1380,24 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) void SVMConverter::ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf ) { - ULONG nPos; - ULONG nCountPos; - Font aSaveFont; - const USHORT nOldFormat = rOStm.GetNumberFormatInt(); - rtl_TextEncoding eActualCharSet = gsl_getSystemTextEncoding(); - const Size aPrefSize( rMtf.GetPrefSize() ); - BOOL bRop_0_1 = FALSE; - VirtualDevice aSaveVDev; - Color aLineCol( COL_BLACK ); - Stack aLineColStack; + ULONG nPos; + ULONG nCountPos; + Font aSaveFont; + const USHORT nOldFormat = rOStm.GetNumberFormatInt(); + rtl_TextEncoding eActualCharSet = gsl_getSystemTextEncoding(); + const Size aPrefSize( rMtf.GetPrefSize() ); + BOOL bRop_0_1 = FALSE; + VirtualDevice aSaveVDev; + Color aLineCol( COL_BLACK ); + Stack aLineColStack; rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); //MagicCode schreiben rOStm << "SVGDI"; // Kennung nPos = rOStm.Tell(); - rOStm << (INT16) 42; // HeaderSize - rOStm << (INT16) 200; // VERSION + rOStm << (INT16) 42; // HeaderSize + rOStm << (INT16) 200; // VERSION rOStm << (INT32) aPrefSize.Width(); rOStm << (INT32) aPrefSize.Height(); ImplWriteMapMode( rOStm, rMtf.GetPrefMapMode() ); @@ -1498,12 +1498,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, { ImplWritePopAction( rOStm ); nCount += 3; - + if(bLineJoin) { nCount += 1; } - + if(bLineDashDot) { nCount += 1; @@ -1577,10 +1577,10 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_CHORD_ACTION ): { - MetaChordAction* pAct = (MetaChordAction*) pAction; - Polygon aChordPoly( pAct->GetRect(), pAct->GetStartPoint(), + MetaChordAction* pAct = (MetaChordAction*) pAction; + Polygon aChordPoly( pAct->GetRect(), pAct->GetStartPoint(), pAct->GetEndPoint(), POLY_CHORD ); - const USHORT nPoints = aChordPoly.GetSize(); + const USHORT nPoints = aChordPoly.GetSize(); rOStm << (INT16) GDI_POLYGON_ACTION; rOStm << (INT32) ( 8 + ( nPoints << 3 ) ); @@ -1652,13 +1652,13 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, { ImplWritePopAction( rOStm ); nCount += 3; - + if(bLineJoin) { nCount += 1; } } - + if(bLineDashDot) { nCount += 1; @@ -1684,7 +1684,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, rOStm << aSimplePoly[ n ]; nCount++; - + const PolyPolygon aPolyPolygon(pAct->GetPolygon()); if(ImplWriteExtendedPolyPolygonAction(rOStm, aPolyPolygon, true)) { @@ -1698,7 +1698,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, MetaPolyPolygonAction* pAct = (MetaPolyPolygonAction*) pAction; ImplWritePolyPolyAction( rOStm, pAct->GetPolyPolygon() ); nCount++; - + if(ImplWriteExtendedPolyPolygonAction(rOStm, pAct->GetPolyPolygon(), true)) { nCount++; @@ -1709,9 +1709,9 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_TEXT_ACTION ): { MetaTextAction* pAct = (MetaTextAction*) pAction; - String aUniText( pAct->GetText() ); - ByteString aText( aUniText, rActualCharSet ); - const ULONG nStrLen = aText.Len(); + String aUniText( pAct->GetText() ); + ByteString aText( aUniText, rActualCharSet ); + const ULONG nStrLen = aText.Len(); if ( ImplWriteUnicodeComment( rOStm, aUniText ) ) nCount++; @@ -1729,13 +1729,13 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_TEXTARRAY_ACTION ): { - MetaTextArrayAction* pAct = (MetaTextArrayAction*)pAction; - ByteString aText( pAct->GetText(), rActualCharSet ); - String aUniText( pAct->GetText(), pAct->GetIndex(), pAct->GetLen() ); - ULONG nAryLen; - ULONG nLen = pAct->GetLen(); - const ULONG nTextLen = aText.Len(); - sal_Int32* pDXArray = pAct->GetDXArray(); + MetaTextArrayAction* pAct = (MetaTextArrayAction*)pAction; + ByteString aText( pAct->GetText(), rActualCharSet ); + String aUniText( pAct->GetText(), pAct->GetIndex(), pAct->GetLen() ); + ULONG nAryLen; + ULONG nLen = pAct->GetLen(); + const ULONG nTextLen = aText.Len(); + sal_Int32* pDXArray = pAct->GetDXArray(); if ( ImplWriteUnicodeComment( rOStm, aUniText ) ) nCount++; @@ -1751,7 +1751,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, if( !pDXArray || !nLen ) nAryLen = 0; else - nAryLen = nLen; // #105987# Write out all of DX array + nAryLen = nLen; // #105987# Write out all of DX array rOStm << (INT16) GDI_TEXTARRAY_ACTION; rOStm << (INT32) ( 28 + ( nLen + 1 ) + ( nAryLen * 4 ) ); @@ -1771,10 +1771,10 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_STRETCHTEXT_ACTION ): { - MetaStretchTextAction* pAct = (MetaStretchTextAction*) pAction; - String aUniText( pAct->GetText() ); - ByteString aText( aUniText, rActualCharSet ); - const ULONG nStrLen = aText.Len(); + MetaStretchTextAction* pAct = (MetaStretchTextAction*) pAction; + String aUniText( pAct->GetText() ); + ByteString aText( aUniText, rActualCharSet ); + const ULONG nStrLen = aText.Len(); if ( ImplWriteUnicodeComment( rOStm, aUniText ) ) nCount++; @@ -1833,8 +1833,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_BMPEX_ACTION ): { - MetaBmpExAction* pAct = (MetaBmpExAction*) pAction; - const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() ); + MetaBmpExAction* pAct = (MetaBmpExAction*) pAction; + const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() ); rOStm << (INT16) GDI_BITMAP_ACTION; rOStm << (INT32) 12; @@ -1846,8 +1846,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_BMPEXSCALE_ACTION ): { - MetaBmpExScaleAction* pAct = (MetaBmpExScaleAction*) pAction; - const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() ); + MetaBmpExScaleAction* pAct = (MetaBmpExScaleAction*) pAction; + const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() ); rOStm << (INT16) GDI_BITMAPSCALE_ACTION; rOStm << (INT32) 20; @@ -1861,7 +1861,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_BMPEXSCALEPART_ACTION ): { MetaBmpExScalePartAction* pAct = (MetaBmpExScalePartAction*) pAction; - const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() ); + const Bitmap aBmp( Graphic( pAct->GetBitmapEx() ).GetBitmap() ); rOStm << (INT16) GDI_BITMAPSCALEPART_ACTION; rOStm << (INT32) 36; @@ -1877,7 +1877,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_GRADIENT_ACTION ): { MetaGradientAction* pAct = (MetaGradientAction*) pAction; - const Gradient& rGrad = pAct->GetGradient(); + const Gradient& rGrad = pAct->GetGradient(); rOStm << (INT16) GDI_GRADIENT_ACTION; rOStm << (INT32) 46; @@ -1898,7 +1898,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_GRADIENTEX_ACTION ): { const MetaGradientExAction* pA = (MetaGradientExAction*) pAction; - ULONG nOldPos, nNewPos; + ULONG nOldPos, nNewPos; // write RefPoint comment rOStm << (INT16) GDI_GRADIENTEX_COMMENT; @@ -1923,8 +1923,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_WALLPAPER_ACTION ): { - MetaWallpaperAction* pAct = (MetaWallpaperAction*) pAction; - const Color& rColor = pAct->GetWallpaper().GetColor(); + MetaWallpaperAction* pAct = (MetaWallpaperAction*) pAction; + const Color& rColor = pAct->GetWallpaper().GetColor(); ImplWritePushAction( rOStm ); ImplWriteLineColor( rOStm, rColor, 1 ); @@ -1943,9 +1943,9 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_CLIPREGION_ACTION ): { - MetaClipRegionAction* pAct = (MetaClipRegionAction*) pAction; - const Region& rRegion = pAct->GetRegion(); - Rectangle aClipRect; + MetaClipRegionAction* pAct = (MetaClipRegionAction*) pAction; + const Region& rRegion = pAct->GetRegion(); + Rectangle aClipRect; rOStm << (INT16) GDI_CLIPREGION_ACTION; rOStm << (INT32) 24; @@ -2028,8 +2028,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_TEXTFILLCOLOR_ACTION ): { - MetaTextFillColorAction* pAct = (MetaTextFillColorAction*) pAction; - Font aSaveFont( rSaveVDev.GetFont() ); + MetaTextFillColorAction* pAct = (MetaTextFillColorAction*) pAction; + Font aSaveFont( rSaveVDev.GetFont() ); if( pAct->IsSetting() ) aSaveFont.SetFillColor( pAct->GetColor() ); @@ -2110,9 +2110,9 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, switch( pAct->GetRasterOp() ) { case( ROP_OVERPAINT ) : nRasterOp = 0; break; - case( ROP_XOR ) : nRasterOp = 4; break; - case( ROP_INVERT ): nRasterOp = 1; break; - default: nRasterOp = 0; break; + case( ROP_XOR ) : nRasterOp = 4; break; + case( ROP_INVERT ): nRasterOp = 1; break; + default: nRasterOp = 0; break; } ImplWriteRasterOpAction( rOStm, nRasterOp ); @@ -2143,10 +2143,10 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_TRANSPARENT_ACTION ): { - const PolyPolygon& rPolyPoly = ( (MetaTransparentAction*) pAction )->GetPolyPolygon(); - const INT16 nTrans = ( (MetaTransparentAction*) pAction )->GetTransparence(); - const INT16 nBrushStyle = ( nTrans < 38 ) ? 8 : ( nTrans < 63 ) ? 9 : 10; - ULONG nOldPos, nNewPos; + const PolyPolygon& rPolyPoly = ( (MetaTransparentAction*) pAction )->GetPolyPolygon(); + const INT16 nTrans = ( (MetaTransparentAction*) pAction )->GetTransparence(); + const INT16 nBrushStyle = ( nTrans < 38 ) ? 8 : ( nTrans < 63 ) ? 9 : 10; + ULONG nOldPos, nNewPos; // write transparence comment rOStm << (INT16) GDI_TRANSPARENT_COMMENT; @@ -2204,12 +2204,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_FLOATTRANSPARENT_ACTION ): { - const MetaFloatTransparentAction* pA = (MetaFloatTransparentAction*) pAction; - const GDIMetaFile& rTransMtf = pA->GetGDIMetaFile(); - const Point& rPos = pA->GetPoint(); - const Size& rSize = pA->GetSize(); - const Gradient& rGradient = pA->GetGradient(); - ULONG nOldPos, nNewPos; + const MetaFloatTransparentAction* pA = (MetaFloatTransparentAction*) pAction; + const GDIMetaFile& rTransMtf = pA->GetGDIMetaFile(); + const Point& rPos = pA->GetPoint(); + const Size& rSize = pA->GetSize(); + const Gradient& rGradient = pA->GetGradient(); + ULONG nOldPos, nNewPos; // write RefPoint comment rOStm << (INT16) GDI_FLOATTRANSPARENT_COMMENT; @@ -2229,13 +2229,13 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, { // write actions for float transparence - ULONG nAddCount; - GDIMetaFile aMtf( rTransMtf ); - const Size aSrcSize( rTransMtf.GetPrefSize() ); - Point aSrcPt( rTransMtf.GetPrefMapMode().GetOrigin() ); - const double fScaleX = aSrcSize.Width() ? (double) rSize.Width() / aSrcSize.Width() : 1.0; - const double fScaleY = aSrcSize.Height() ? (double) rSize.Height() / aSrcSize.Height() : 1.0; - long nMoveX, nMoveY; + ULONG nAddCount; + GDIMetaFile aMtf( rTransMtf ); + const Size aSrcSize( rTransMtf.GetPrefSize() ); + Point aSrcPt( rTransMtf.GetPrefMapMode().GetOrigin() ); + const double fScaleX = aSrcSize.Width() ? (double) rSize.Width() / aSrcSize.Width() : 1.0; + const double fScaleY = aSrcSize.Height() ? (double) rSize.Height() / aSrcSize.Height() : 1.0; + long nMoveX, nMoveY; if( fScaleX != 1.0 || fScaleY != 1.0 ) { @@ -2265,10 +2265,10 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_HATCH_ACTION ): { - const MetaHatchAction* pA = (MetaHatchAction*) pAction; - const PolyPolygon& rPolyPoly = pA->GetPolyPolygon(); - const Hatch& rHatch = pA->GetHatch(); - ULONG nOldPos, nNewPos, nAddCount; + const MetaHatchAction* pA = (MetaHatchAction*) pAction; + const PolyPolygon& rPolyPoly = pA->GetPolyPolygon(); + const Hatch& rHatch = pA->GetHatch(); + ULONG nOldPos, nNewPos, nAddCount; // write hatch comment rOStm << (INT16) GDI_HATCH_COMMENT; @@ -2289,8 +2289,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, { // write actions for hatch - VirtualDevice aVDev; - GDIMetaFile aTmpMtf; + VirtualDevice aVDev; + GDIMetaFile aTmpMtf; aVDev.AddHatchActions( rPolyPoly, rHatch, aTmpMtf ); nAddCount = ImplWriteActions( rOStm, aTmpMtf, rSaveVDev, rRop_0_1, rLineCol, rLineColStack, rActualCharSet ); @@ -2310,10 +2310,10 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_REFPOINT_ACTION ): { - const MetaRefPointAction* pA = (MetaRefPointAction*) pAction; - const Point& rRefPoint = pA->GetRefPoint(); - const BOOL bSet = pA->IsSetting(); - ULONG nOldPos, nNewPos; + const MetaRefPointAction* pA = (MetaRefPointAction*) pAction; + const Point& rRefPoint = pA->GetRefPoint(); + const BOOL bSet = pA->IsSetting(); + ULONG nOldPos, nNewPos; // write RefPoint comment rOStm << (INT16) GDI_REFPOINT_COMMENT; @@ -2338,10 +2338,10 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_TEXTLINECOLOR_ACTION ): { - const MetaTextLineColorAction* pA = (MetaTextLineColorAction*) pAction; - const Color& rColor = pA->GetColor(); - const BOOL bSet = pA->IsSetting(); - ULONG nOldPos, nNewPos; + const MetaTextLineColorAction* pA = (MetaTextLineColorAction*) pAction; + const Color& rColor = pA->GetColor(); + const BOOL bSet = pA->IsSetting(); + ULONG nOldPos, nNewPos; // write RefPoint comment rOStm << (INT16) GDI_TEXTLINECOLOR_COMMENT; @@ -2366,12 +2366,12 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_TEXTLINE_ACTION ): { - const MetaTextLineAction* pA = (MetaTextLineAction*) pAction; - const Point& rStartPt = pA->GetStartPoint(); - const long nWidth = pA->GetWidth(); - const FontStrikeout eStrikeout = pA->GetStrikeout(); - const FontUnderline eUnderline = pA->GetUnderline(); - ULONG nOldPos, nNewPos; + const MetaTextLineAction* pA = (MetaTextLineAction*) pAction; + const Point& rStartPt = pA->GetStartPoint(); + const long nWidth = pA->GetWidth(); + const FontStrikeout eStrikeout = pA->GetStrikeout(); + const FontUnderline eUnderline = pA->GetUnderline(); + ULONG nOldPos, nNewPos; // write RefPoint comment rOStm << (INT16) GDI_TEXTLINE_COMMENT; @@ -2381,8 +2381,8 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, rOStm.SeekRel( 4 ); // write data - rOStm << rStartPt << nWidth << - static_cast<sal_uInt32>(eStrikeout) << + rOStm << rStartPt << nWidth << + static_cast<sal_uInt32>(eStrikeout) << static_cast<sal_uInt32>(eUnderline); rOStm << (INT32) 0; // number of actions that follow this comment @@ -2401,9 +2401,9 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, case( META_COMMENT_ACTION ): { - const MetaCommentAction* pA = (MetaCommentAction*) pAction; - const sal_uInt32 nDataSize = pA->GetDataSize(); - ULONG nOldPos, nNewPos; + const MetaCommentAction* pA = (MetaCommentAction*) pAction; + const sal_uInt32 nDataSize = pA->GetDataSize(); + ULONG nOldPos, nNewPos; // write RefPoint comment rOStm << (INT16) GDI_COMMENT_COMMENT; |