summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-11 10:11:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-06-11 14:38:37 +0200
commitd4d037619638e1915d15dba81c38a1c9b3157972 (patch)
tree93260b9952c2be6dbb56c7c67eccfb4960608627 /vcl/source
parent807d4382cb021d2ac3ea99d6757a7b368a32941d (diff)
loplugin:unusedmethods
Change-Id: I26a0da1ec9cda9030371977596053a45303756a0 Reviewed-on: https://gerrit.libreoffice.org/55609 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/gdi/svmconverter.cxx1318
1 files changed, 0 insertions, 1318 deletions
diff --git a/vcl/source/gdi/svmconverter.cxx b/vcl/source/gdi/svmconverter.cxx
index 039fd2d252ea..4ec0d5df17d7 100644
--- a/vcl/source/gdi/svmconverter.cxx
+++ b/vcl/source/gdi/svmconverter.cxx
@@ -47,12 +47,6 @@ void ImplReadRect( SvStream& rIStm, tools::Rectangle& rRect )
rRect = tools::Rectangle( aTL, aBR );
}
-void ImplWriteRect( SvStream& rOStm, const tools::Rectangle& rRect )
-{
- WritePair( rOStm, rRect.TopLeft() );
- WritePair( rOStm, rRect.BottomRight() );
-}
-
bool ImplReadPoly(SvStream& rIStm, tools::Polygon& rPoly)
{
sal_Int32 nSize32(0);
@@ -96,35 +90,6 @@ bool ImplReadPolyPoly(SvStream& rIStm, tools::PolyPolygon& rPolyPoly)
return bSuccess && rIStm.good();
}
-void ImplWritePolyPolyAction( SvStream& rOStm, const tools::PolyPolygon& rPolyPoly )
-{
- const sal_uInt16 nPoly = rPolyPoly.Count();
- sal_uInt16 nPoints = 0;
- sal_uInt16 n;
-
- for( n = 0; n < nPoly; n++ )
- nPoints = sal::static_int_cast<sal_uInt16>(nPoints + rPolyPoly[ n ].GetSize());
-
- rOStm.WriteInt16( GDI_POLYPOLYGON_ACTION );
- rOStm.WriteInt32( 8 + ( nPoly << 2 ) + ( nPoints << 3 ) );
- rOStm.WriteInt32( nPoly );
-
- for( n = 0; n < nPoly; n++ )
- {
- // #i102224# Here the possible curved nature of Polygon was
- // ignored (for all those years). Adapted to at least write
- // a polygon representing the curve as good as possible
- tools::Polygon aSimplePoly;
- rPolyPoly[n].AdaptiveSubdivide(aSimplePoly);
- const sal_uInt16 nSize(aSimplePoly.GetSize());
-
- rOStm.WriteInt32( nSize );
-
- for( sal_uInt16 j = 0; j < nSize; j++ )
- WritePair( rOStm, aSimplePoly[ j ] );
- }
-}
-
void ImplReadColor( SvStream& rIStm, Color& rColor )
{
sal_Int16 nVal(0);
@@ -134,20 +99,6 @@ void ImplReadColor( SvStream& rIStm, Color& rColor )
rIStm.ReadInt16( nVal ); rColor.SetBlue( sal::static_int_cast<sal_uInt8>(static_cast<sal_uInt16>(nVal) >> 8) );
}
-void ImplWriteColor( SvStream& rOStm, const Color& rColor )
-{
- sal_Int16 nVal;
-
- nVal = ( static_cast<sal_Int16>(rColor.GetRed()) << 8 ) | rColor.GetRed();
- rOStm.WriteInt16( nVal );
-
- nVal = ( static_cast<sal_Int16>(rColor.GetGreen()) << 8 ) | rColor.GetGreen();
- rOStm.WriteInt16( nVal );
-
- nVal = ( static_cast<sal_Int16>(rColor.GetBlue()) << 8 ) | rColor.GetBlue();
- rOStm.WriteInt16( nVal );
-}
-
bool ImplReadMapMode(SvStream& rIStm, MapMode& rMapMode)
{
sal_Int16 nUnit(0);
@@ -176,140 +127,6 @@ bool ImplReadMapMode(SvStream& rIStm, MapMode& rMapMode)
return true;
}
-void ImplWriteMapMode( SvStream& rOStm, const MapMode& rMapMode )
-{
- rOStm.WriteInt16( static_cast<sal_uInt16>(rMapMode.GetMapUnit()) );
- WritePair( rOStm, rMapMode.GetOrigin() );
- rOStm.WriteInt32( rMapMode.GetScaleX().GetNumerator() );
- rOStm.WriteInt32( rMapMode.GetScaleX().GetDenominator() );
- rOStm.WriteInt32( rMapMode.GetScaleY().GetNumerator() );
- rOStm.WriteInt32( rMapMode.GetScaleY().GetDenominator() );
-}
-
-void ImplWritePushAction( SvStream& rOStm )
-{
- rOStm.WriteInt16( GDI_PUSH_ACTION );
- rOStm.WriteInt32( 4 );
-}
-
-void ImplWritePopAction( SvStream& rOStm )
-{
- rOStm.WriteInt16( GDI_POP_ACTION );
- rOStm.WriteInt32( 4 );
-}
-
-void ImplWriteLineColor( SvStream& rOStm, const Color& rColor, sal_Int16 nStyle, sal_Int32 nWidth = 0 )
-{
- if( rColor.GetTransparency() > 127 )
- nStyle = 0;
-
- rOStm.WriteInt16( GDI_PEN_ACTION );
- rOStm.WriteInt32( 16 );
- ImplWriteColor( rOStm, rColor );
- rOStm.WriteInt32( nWidth );
- rOStm.WriteInt16( nStyle );
-}
-
-void ImplWriteFillColor( SvStream& rOStm, const Color& rColor, sal_Int16 nStyle )
-{
- rOStm.WriteInt16( GDI_FILLBRUSH_ACTION );
- rOStm.WriteInt32( 20 );
- ImplWriteColor( rOStm, rColor );
-
- if( rColor.GetTransparency() > 127 )
- nStyle = 0;
-
- if( nStyle > 1 )
- {
- ImplWriteColor( rOStm, COL_WHITE );
- rOStm.WriteInt16( nStyle );
- rOStm.WriteInt16( 1 );
- }
- else
- {
- ImplWriteColor( rOStm, COL_BLACK );
- rOStm.WriteInt16( nStyle );
- rOStm.WriteInt16( 0 );
- }
-}
-
-void ImplWriteFont( SvStream& rOStm, const vcl::Font& rFont,
- rtl_TextEncoding& rActualCharSet )
-{
- char aName[33];
- short nWeight;
-
- OString aByteName(OUStringToOString(rFont.GetFamilyName(),
- rOStm.GetStreamCharSet()));
- strncpy( aName, aByteName.getStr(), 32 );
- aName[32] = 0;
-
- switch ( rFont.GetWeight() )
- {
- case WEIGHT_THIN:
- case WEIGHT_ULTRALIGHT:
- case WEIGHT_LIGHT:
- nWeight = 1;
- break;
-
- case WEIGHT_NORMAL:
- case WEIGHT_MEDIUM:
- nWeight = 2;
- break;
-
- case WEIGHT_BOLD:
- case WEIGHT_ULTRABOLD:
- case WEIGHT_BLACK:
- nWeight = 3;
- break;
-
- default:
- nWeight = 0;
- break;
- }
-
- rOStm.WriteInt16( GDI_FONT_ACTION );
- rOStm.WriteInt32( 78 );
-
- rActualCharSet = GetStoreCharSet( rFont.GetCharSet() );
- ImplWriteColor( rOStm, rFont.GetColor() );
- ImplWriteColor( rOStm, rFont.GetFillColor() );
- rOStm.WriteBytes( aName, 32 );
- WritePair( rOStm, rFont.GetFontSize() );
- rOStm.WriteInt16( 0 ); // no character orientation anymore
- rOStm.WriteInt16( rFont.GetOrientation() );
- rOStm.WriteInt16( rActualCharSet );
- rOStm.WriteInt16( rFont.GetFamilyType() );
- rOStm.WriteInt16( rFont.GetPitch() );
- rOStm.WriteInt16( rFont.GetAlignment() );
- rOStm.WriteInt16( nWeight );
- rOStm.WriteInt16( rFont.GetUnderline() );
- rOStm.WriteInt16( rFont.GetStrikeout() );
- rOStm.WriteBool( rFont.GetItalic() != ITALIC_NONE );
- rOStm.WriteBool( rFont.IsOutline() );
- rOStm.WriteBool( rFont.IsShadow() );
- rOStm.WriteBool( rFont.IsTransparent() );
- if ( rActualCharSet == RTL_TEXTENCODING_DONTKNOW )
- rActualCharSet = osl_getThreadTextEncoding();
-}
-
-void ImplWriteRasterOpAction( SvStream& rOStm, sal_Int16 nRasterOp )
-{
- rOStm.WriteInt16( GDI_RASTEROP_ACTION ).WriteInt32( 6 ).WriteInt16( nRasterOp );
-}
-
-bool ImplWriteUnicodeComment( SvStream& rOStm, const OUString& rString )
-{
- sal_Int32 nStringLen = rString.getLength();
- if ( nStringLen )
- {
- sal_uInt32 nSize = ( nStringLen << 1 ) + 4;
- rOStm.WriteUInt16( GDI_UNICODE_COMMENT ).WriteUInt32( nSize );
- write_uInt16s_FromOUString(rOStm, rString);
- }
- return nStringLen != 0;
-}
-
void ImplReadUnicodeComment( sal_uInt32 nStrmPos, SvStream& rIStm, OUString& rString )
{
sal_uInt32 nOld = rIStm.Tell();
@@ -344,86 +161,6 @@ void ImplSkipActions(SvStream& rIStm, sal_uLong nSkipCount)
}
}
-bool ImplWriteExtendedPolyPolygonAction(SvStream& rOStm, const tools::PolyPolygon& rPolyPolygon)
-{
- const sal_uInt16 nPolygonCount(rPolyPolygon.Count());
-
- if(nPolygonCount)
- {
- sal_uInt32 nAllPolygonCount(0);
- sal_uInt32 nAllPointCount(0);
- sal_uInt32 nAllFlagCount(0);
- sal_uInt16 a(0);
-
- for(a = 0; a < nPolygonCount; a++)
- {
- const tools::Polygon& rCandidate = rPolyPolygon.GetObject(a);
- const sal_uInt16 nPointCount(rCandidate.GetSize());
-
- if(nPointCount)
- {
- nAllPolygonCount++;
- nAllPointCount += nPointCount;
-
- if(rCandidate.HasFlags())
- {
- nAllFlagCount += nPointCount;
- }
- }
- }
-
- if(nAllFlagCount)
- {
- rOStm.WriteInt16( 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
-
- rOStm.WriteInt32( nActionSize );
- rOStm.WriteUInt16( nAllPolygonCount );
-
- for(a = 0; a < nPolygonCount; a++)
- {
- const tools::Polygon& rCandidate = rPolyPolygon.GetObject(a);
- const sal_uInt16 nPointCount(rCandidate.GetSize());
-
- if(nPointCount)
- {
- rOStm.WriteUInt16( nPointCount );
-
- for(sal_uInt16 b(0); b < nPointCount; b++)
- {
- WritePair( rOStm, rCandidate[b] );
- }
-
- if(rCandidate.HasFlags())
- {
- rOStm.WriteBool( true );
-
- for(sal_uInt16 c(0); c < nPointCount; c++)
- {
- rOStm.WriteUChar( static_cast<sal_uInt8>(rCandidate.GetFlags(c)) );
- }
- }
- else
- {
- rOStm.WriteBool( false );
- }
- }
- }
-
- return true;
- }
- }
-
- return false;
-}
-
void ImplReadExtendedPolyPolygonAction(SvStream& rIStm, tools::PolyPolygon& rPolyPoly)
{
rPolyPoly.Clear();
@@ -1476,1059 +1213,4 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
rIStm.SetEndian( nOldFormat );
}
-sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile const & rMtf,
- VirtualDevice& rSaveVDev, bool& rRop_0_1,
- Color& rLineCol, ::std::stack< Color* >& rLineColStack,
- rtl_TextEncoding& rActualCharSet )
-{
- sal_uLong nCount = 0;
- for( size_t i = 0, nActionCount = rMtf.GetActionSize(); i < nActionCount; i++ )
- {
- const MetaAction* pAction = rMtf.GetAction( i );
-
- switch( pAction->GetType() )
- {
- case MetaActionType::PIXEL:
- {
- const MetaPixelAction* pAct = static_cast<const MetaPixelAction*>(pAction);
-
- rOStm.WriteInt16( GDI_PIXEL_ACTION );
- rOStm.WriteInt32( 18 );
- WritePair( rOStm, pAct->GetPoint() );
- ImplWriteColor( rOStm, pAct->GetColor() );
- nCount++;
- }
- break;
-
- case MetaActionType::POINT:
- {
- const MetaPointAction* pAct = static_cast<const MetaPointAction*>(pAction);
-
- rOStm.WriteInt16( GDI_POINT_ACTION );
- rOStm.WriteInt32( 12 );
- WritePair( rOStm, pAct->GetPoint() );
- nCount++;
- }
- break;
-
- case MetaActionType::LINE:
- {
- const MetaLineAction* pAct = static_cast<const MetaLineAction*>(pAction);
- const LineInfo& rInfo = pAct->GetLineInfo();
- const bool bFatLine(!rInfo.IsDefault() && (LineStyle::NONE != rInfo.GetStyle()));
- const bool bLineJoin(bFatLine && basegfx::B2DLineJoin::Round != rInfo.GetLineJoin());
- const bool bLineCap(bFatLine && css::drawing::LineCap_BUTT != rInfo.GetLineCap());
- const bool bLineDashDot(LineStyle::Dash == rInfo.GetStyle());
-
- if( bFatLine )
- {
- ImplWritePushAction( rOStm );
- ImplWriteLineColor( rOStm, rLineCol, 1, rInfo.GetWidth() );
-
- if(bLineJoin)
- {
- rOStm.WriteInt16( GDI_LINEJOIN_ACTION );
- rOStm.WriteInt32( 6 );
- rOStm.WriteInt16( static_cast<sal_Int16>(rInfo.GetLineJoin()) );
- }
-
- if(bLineCap)
- {
- rOStm.WriteInt16( GDI_LINECAP_ACTION );
- rOStm.WriteInt32( 6 );
- rOStm.WriteInt16( static_cast<sal_Int16>(rInfo.GetLineCap()) );
- }
- }
-
- if(bLineDashDot)
- {
- rOStm.WriteInt16( GDI_LINEDASHDOT_ACTION );
- rOStm.WriteInt32( 4 + 16 );
- rOStm.WriteInt16( rInfo.GetDashCount() );
- rOStm.WriteInt32( rInfo.GetDashLen() );
- rOStm.WriteInt16( rInfo.GetDotCount() );
- rOStm.WriteInt32( rInfo.GetDotLen() );
- rOStm.WriteInt32( rInfo.GetDistance() );
- }
-
- rOStm.WriteInt16( GDI_LINE_ACTION );
- rOStm.WriteInt32( 20 );
- WritePair( rOStm, pAct->GetStartPoint() );
- WritePair( rOStm, pAct->GetEndPoint() );
- nCount++;
-
- if( bFatLine )
- {
- ImplWritePopAction( rOStm );
- nCount += 3;
-
- if(bLineJoin)
- {
- nCount += 1;
- }
-
- if(bLineCap)
- {
- nCount += 1;
- }
- }
-
- if(bLineDashDot)
- {
- nCount += 1;
- }
- }
- break;
-
- case MetaActionType::RECT:
- {
- const MetaRectAction* pAct = static_cast<const MetaRectAction*>(pAction);
-
- rOStm.WriteInt16( GDI_RECT_ACTION );
- rOStm.WriteInt32( 28 );
- ImplWriteRect( rOStm, pAct->GetRect() );
- rOStm.WriteInt32( 0 );
- rOStm.WriteInt32( 0 );
- nCount++;
- }
- break;
-
- case MetaActionType::ROUNDRECT:
- {
- const MetaRoundRectAction* pAct = static_cast<const MetaRoundRectAction*>(pAction);
-
- rOStm.WriteInt16( GDI_RECT_ACTION );
- rOStm.WriteInt32( 28 );
- ImplWriteRect( rOStm, pAct->GetRect() );
- rOStm.WriteInt32( pAct->GetHorzRound() );
- rOStm.WriteInt32( pAct->GetVertRound() );
- nCount++;
- }
- break;
-
- case MetaActionType::ELLIPSE:
- {
- const MetaEllipseAction* pAct = static_cast<const MetaEllipseAction*>(pAction);
-
- rOStm.WriteInt16( GDI_ELLIPSE_ACTION );
- rOStm.WriteInt32( 20 );
- ImplWriteRect( rOStm, pAct->GetRect() );
- nCount++;
- }
- break;
-
- case MetaActionType::ARC:
- {
- const MetaArcAction* pAct = static_cast<const MetaArcAction*>(pAction);
-
- rOStm.WriteInt16( GDI_ARC_ACTION );
- rOStm.WriteInt32( 36 );
- ImplWriteRect( rOStm, pAct->GetRect() );
- WritePair( rOStm, pAct->GetStartPoint() );
- WritePair( rOStm, pAct->GetEndPoint() );
- nCount++;
- }
- break;
-
- case MetaActionType::PIE:
- {
- const MetaPieAction* pAct = static_cast<const MetaPieAction*>(pAction);
-
- rOStm.WriteInt16( GDI_PIE_ACTION );
- rOStm.WriteInt32( 36 );
- ImplWriteRect( rOStm, pAct->GetRect() );
- WritePair( rOStm, pAct->GetStartPoint() );
- WritePair( rOStm, pAct->GetEndPoint() );
- nCount++;
- }
- break;
-
- case MetaActionType::CHORD:
- {
- const MetaChordAction* pAct = static_cast<const MetaChordAction*>(pAction);
- tools::Polygon aChordPoly( pAct->GetRect(), pAct->GetStartPoint(),
- pAct->GetEndPoint(), PolyStyle::Chord );
- const sal_uInt16 nPoints = aChordPoly.GetSize();
-
- rOStm.WriteInt16( GDI_POLYGON_ACTION );
- rOStm.WriteInt32( 8 + ( nPoints << 3 ) );
- rOStm.WriteInt32( nPoints );
-
- for( sal_uInt16 n = 0; n < nPoints; n++ )
- WritePair( rOStm, aChordPoly[ n ] );
- nCount++;
- }
- break;
-
- case MetaActionType::POLYLINE:
- {
- // #i102224#
- const MetaPolyLineAction* pAct = static_cast<const MetaPolyLineAction*>(pAction);
- // #i102224# Here the possible curved nature of Polygon was
- // ignored (for all those years). Adapted to at least write
- // a polygon representing the curve as good as possible
- tools::Polygon aSimplePoly;
- pAct->GetPolygon().AdaptiveSubdivide(aSimplePoly);
- const LineInfo& rInfo = pAct->GetLineInfo();
- const sal_uInt16 nPoints(aSimplePoly.GetSize());
- const bool bFatLine(!rInfo.IsDefault() && (LineStyle::NONE != rInfo.GetStyle()));
- const bool bLineJoin(bFatLine && basegfx::B2DLineJoin::Round != rInfo.GetLineJoin());
- const bool bLineCap(bFatLine && css::drawing::LineCap_BUTT != rInfo.GetLineCap());
- const bool bLineDashDot(LineStyle::Dash == rInfo.GetStyle());
-
- if( bFatLine )
- {
- ImplWritePushAction( rOStm );
- ImplWriteLineColor( rOStm, rLineCol, 1, rInfo.GetWidth() );
-
- if(bLineJoin)
- {
- rOStm.WriteInt16( GDI_LINEJOIN_ACTION );
- rOStm.WriteInt32( 6 );
- rOStm.WriteInt16( static_cast<sal_Int16>(rInfo.GetLineJoin()) );
- }
-
- if(bLineCap)
- {
- rOStm.WriteInt16( GDI_LINECAP_ACTION );
- rOStm.WriteInt32( 6 );
- rOStm.WriteInt16( static_cast<sal_Int16>(rInfo.GetLineCap()) );
- }
- }
-
- if(bLineDashDot)
- {
- rOStm.WriteInt16( GDI_LINEDASHDOT_ACTION );
- rOStm.WriteInt32( 4 + 16 );
- rOStm.WriteInt16( rInfo.GetDashCount() );
- rOStm.WriteInt32( rInfo.GetDashLen() );
- rOStm.WriteInt16( rInfo.GetDotCount() );
- rOStm.WriteInt32( rInfo.GetDotLen() );
- rOStm.WriteInt32( rInfo.GetDistance() );
- }
-
- rOStm.WriteInt16( GDI_POLYLINE_ACTION );
- rOStm.WriteInt32( 8 + ( nPoints << 3 ) );
- rOStm.WriteInt32( nPoints );
-
- for( sal_uInt16 n = 0; n < nPoints; n++ )
- {
- WritePair( rOStm, aSimplePoly[ n ] );
- }
-
- nCount++;
-
- const tools::PolyPolygon aPolyPolygon(pAct->GetPolygon());
- if(ImplWriteExtendedPolyPolygonAction(rOStm, aPolyPolygon))
- {
- nCount++;
- }
-
- if( bFatLine )
- {
- ImplWritePopAction( rOStm );
- nCount += 3;
-
- if(bLineJoin)
- {
- nCount += 1;
- }
-
- if(bLineCap)
- {
- nCount += 1;
- }
- }
-
- if(bLineDashDot)
- {
- nCount += 1;
- }
- }
- break;
-
- case MetaActionType::POLYGON:
- {
- const MetaPolygonAction* pAct = static_cast<const MetaPolygonAction*>(pAction);
- // #i102224# Here the possible curved nature of Polygon was
- // ignored (for all those years). Adapted to at least write
- // a polygon representing the curve as good as possible
- tools::Polygon aSimplePoly;
- pAct->GetPolygon().AdaptiveSubdivide(aSimplePoly);
- const sal_uInt16 nPoints(aSimplePoly.GetSize());
-
- rOStm.WriteInt16( GDI_POLYGON_ACTION );
- rOStm.WriteInt32( 8 + ( nPoints << 3 ) );
- rOStm.WriteInt32( nPoints );
-
- for( sal_uInt16 n = 0; n < nPoints; n++ )
- WritePair( rOStm, aSimplePoly[ n ] );
-
- nCount++;
-
- const tools::PolyPolygon aPolyPolygon(pAct->GetPolygon());
- if(ImplWriteExtendedPolyPolygonAction(rOStm, aPolyPolygon))
- {
- nCount++;
- }
- }
- break;
-
- case MetaActionType::POLYPOLYGON:
- {
- const MetaPolyPolygonAction* pAct = static_cast<const MetaPolyPolygonAction*>(pAction);
- ImplWritePolyPolyAction( rOStm, pAct->GetPolyPolygon() );
- nCount++;
-
- if(ImplWriteExtendedPolyPolygonAction(rOStm, pAct->GetPolyPolygon()))
- {
- nCount++;
- }
- }
- break;
-
- case MetaActionType::TEXT:
- {
- const MetaTextAction* pAct = static_cast<const MetaTextAction*>(pAction);
- OUString aUniText( pAct->GetText() );
- OString aText(OUStringToOString(aUniText, rActualCharSet));
- const sal_Int32 nStrLen = aText.getLength();
-
- if ( ImplWriteUnicodeComment( rOStm, aUniText ) )
- nCount++;
-
- rOStm.WriteInt16( GDI_TEXT_ACTION );
- rOStm.WriteInt32( 24 + ( nStrLen + 1 ) );
- WritePair( rOStm, pAct->GetPoint() );
- rOStm.WriteInt32( pAct->GetIndex() );
- rOStm.WriteInt32( pAct->GetLen() );
- rOStm.WriteInt32( nStrLen );
- rOStm.WriteBytes( aText.getStr(), nStrLen + 1 );
- nCount++;
- }
- break;
-
- case MetaActionType::TEXTARRAY:
- {
- const MetaTextArrayAction* pAct = static_cast<const MetaTextArrayAction*>(pAction);
- OString aText(OUStringToOString(pAct->GetText(), rActualCharSet));
- OUString aUniText = pAct->GetText().copy(
- pAct->GetIndex(),
- std::min<sal_Int32>(pAct->GetText().getLength() - pAct->GetIndex(), pAct->GetLen()) );
- sal_Int32 nAryLen;
- sal_Int32 nLen = pAct->GetLen();
- const sal_Int32 nTextLen = aText.getLength();
- long* pDXArray = pAct->GetDXArray();
-
- if ( ImplWriteUnicodeComment( rOStm, aUniText ) )
- nCount++;
-
- if( ( nLen + pAct->GetIndex() ) > nTextLen )
- {
- if( pAct->GetIndex() <= nTextLen )
- nLen = nTextLen - pAct->GetIndex();
- else
- nLen = 0;
- }
-
- if( !pDXArray || !nLen )
- nAryLen = 0;
- else
- nAryLen = nLen; // #105987# Write out all of DX array
-
- rOStm.WriteInt16( GDI_TEXTARRAY_ACTION );
- rOStm.WriteInt32( 28 + ( nLen + 1 ) + ( nAryLen * 4 ) );
- WritePair( rOStm, pAct->GetPoint() );
- rOStm.WriteInt32( 0 );
- rOStm.WriteInt32( nLen );
- rOStm.WriteInt32( nLen );
- rOStm.WriteInt32( nAryLen );
- rOStm.WriteBytes( aText.getStr()+pAct->GetIndex(), nLen + 1 );
-
- for (sal_Int32 n = 0; n < nAryLen; ++n)
- rOStm.WriteInt32( pDXArray[ n ] );
-
- nCount++;
- }
- break;
-
- case MetaActionType::STRETCHTEXT:
- {
- const MetaStretchTextAction* pAct = static_cast<const MetaStretchTextAction*>(pAction);
- OUString aUniText( pAct->GetText() );
- OString aText(OUStringToOString(aUniText, rActualCharSet));
- const sal_Int32 nStrLen = aText.getLength();
-
- if ( ImplWriteUnicodeComment( rOStm, aUniText ) )
- nCount++;
-
- rOStm.WriteInt16( GDI_STRETCHTEXT_ACTION );
- rOStm.WriteInt32( 28 + ( nStrLen + 1 ) );
- WritePair( rOStm, pAct->GetPoint() );
- rOStm.WriteInt32( pAct->GetIndex() );
- rOStm.WriteInt32( pAct->GetLen() );
- rOStm.WriteInt32( nStrLen );
- rOStm.WriteInt32( pAct->GetWidth() );
- rOStm.WriteBytes( aText.getStr(), nStrLen + 1 );
- nCount++;
- }
- break;
-
- case MetaActionType::BMP:
- {
- const MetaBmpAction* pAct = static_cast<const MetaBmpAction*>(pAction);
-
- rOStm.WriteInt16( GDI_BITMAP_ACTION );
- rOStm.WriteInt32( 12 );
- WritePair( rOStm, pAct->GetPoint() );
- WriteDIB(pAct->GetBitmap(), rOStm, false, true);
- nCount++;
- }
- break;
-
- case MetaActionType::BMPSCALE:
- {
- const MetaBmpScaleAction* pAct = static_cast<const MetaBmpScaleAction*>(pAction);
-
- rOStm.WriteInt16( GDI_BITMAPSCALE_ACTION );
- rOStm.WriteInt32( 20 );
- WritePair( rOStm, pAct->GetPoint() );
- WritePair( rOStm, pAct->GetSize() );
- WriteDIB(pAct->GetBitmap(), rOStm, false, true);
- nCount++;
- }
- break;
-
- case MetaActionType::BMPSCALEPART:
- {
- const MetaBmpScalePartAction* pAct = static_cast<const MetaBmpScalePartAction*>(pAction);
-
- rOStm.WriteInt16( GDI_BITMAPSCALEPART_ACTION );
- rOStm.WriteInt32( 36 );
- WritePair( rOStm, pAct->GetDestPoint() );
- WritePair( rOStm, pAct->GetDestSize() );
- WritePair( rOStm, pAct->GetSrcPoint() );
- WritePair( rOStm, pAct->GetSrcSize() );
- WriteDIB(pAct->GetBitmap(), rOStm, false, true);
- nCount++;
- }
- break;
-
- case MetaActionType::BMPEX:
- {
- const MetaBmpExAction* pAct = static_cast<const MetaBmpExAction*>(pAction);
- const BitmapEx aBmp( pAct->GetBitmapEx() );
-
- rOStm.WriteInt16( GDI_BITMAP_ACTION );
- rOStm.WriteInt32( 12 );
- WritePair( rOStm, pAct->GetPoint() );
- WriteDIB(aBmp, rOStm, false);
- nCount++;
- }
- break;
-
- case MetaActionType::BMPEXSCALE:
- {
- const MetaBmpExScaleAction* pAct = static_cast<const MetaBmpExScaleAction*>(pAction);
- const BitmapEx aBmp( pAct->GetBitmapEx() );
-
- rOStm.WriteInt16( GDI_BITMAPSCALE_ACTION );
- rOStm.WriteInt32( 20 );
- WritePair( rOStm, pAct->GetPoint() );
- WritePair( rOStm, pAct->GetSize() );
- WriteDIB(aBmp, rOStm, false);
- nCount++;
- }
- break;
-
- case MetaActionType::BMPEXSCALEPART:
- {
- const MetaBmpExScalePartAction* pAct = static_cast<const MetaBmpExScalePartAction*>(pAction);
- const BitmapEx aBmp( pAct->GetBitmapEx() );
-
- rOStm.WriteInt16( GDI_BITMAPSCALEPART_ACTION );
- rOStm.WriteInt32( 36 );
- WritePair( rOStm, pAct->GetDestPoint() );
- WritePair( rOStm, pAct->GetDestSize() );
- WritePair( rOStm, pAct->GetSrcPoint() );
- WritePair( rOStm, pAct->GetSrcSize() );
- WriteDIB(aBmp, rOStm, false);
- nCount++;
- }
- break;
-
- case MetaActionType::GRADIENT:
- {
- const MetaGradientAction* pAct = static_cast<const MetaGradientAction*>(pAction);
- const Gradient& rGrad = pAct->GetGradient();
-
- rOStm.WriteInt16( GDI_GRADIENT_ACTION );
- rOStm.WriteInt32( 46 );
- ImplWriteRect( rOStm, pAct->GetRect() );
- rOStm.WriteInt16( static_cast<sal_Int16>(rGrad.GetStyle()) );
- ImplWriteColor( rOStm, rGrad.GetStartColor() );
- ImplWriteColor( rOStm, rGrad.GetEndColor() );
- rOStm.WriteInt16( rGrad.GetAngle() );
- rOStm.WriteInt16( rGrad.GetBorder() );
- rOStm.WriteInt16( rGrad.GetOfsX() );
- rOStm.WriteInt16( rGrad.GetOfsY() );
- rOStm.WriteInt16( rGrad.GetStartIntensity() );
- rOStm.WriteInt16( rGrad.GetEndIntensity() );
- nCount++;
- }
- break;
-
- case MetaActionType::GRADIENTEX:
- {
- const MetaGradientExAction* pA = static_cast<const MetaGradientExAction*>(pAction);
- sal_uLong nOldPos, nNewPos;
-
- // write RefPoint comment
- rOStm.WriteInt16( GDI_GRADIENTEX_COMMENT );
-
- // we'll write the ActionSize later
- nOldPos = rOStm.Tell();
- rOStm.SeekRel( 4 );
-
- // write data
- WritePolyPolygon( rOStm, pA->GetPolyPolygon() );
- WriteGradient( rOStm, pA->GetGradient() );
- rOStm.WriteInt32( 0 ); // number of actions that follow this comment
-
- // calculate and write ActionSize of comment
- nNewPos = rOStm.Tell();
- rOStm.Seek( nOldPos );
- rOStm.WriteInt32( nNewPos - nOldPos );
- rOStm.Seek( nNewPos );
-
- nCount++;
- }
- break;
-
- case MetaActionType::WALLPAPER:
- {
- const MetaWallpaperAction* pAct = static_cast<const MetaWallpaperAction*>(pAction);
- const Color& rColor = pAct->GetWallpaper().GetColor();
-
- ImplWritePushAction( rOStm );
- ImplWriteLineColor( rOStm, rColor, 1 );
- ImplWriteFillColor( rOStm, rColor, 1 );
-
- rOStm.WriteInt16( GDI_RECT_ACTION );
- rOStm.WriteInt32( 28 );
- ImplWriteRect( rOStm, pAct->GetRect() );
- rOStm.WriteInt32( 0 );
- rOStm.WriteInt32( 0 );
-
- ImplWritePopAction( rOStm );
- nCount += 5;
- }
- break;
-
- case MetaActionType::CLIPREGION:
- {
- const MetaClipRegionAction* pAct = static_cast<const MetaClipRegionAction*>(pAction);
- const vcl::Region& rRegion = pAct->GetRegion();
- tools::Rectangle aClipRect;
-
- rOStm.WriteInt16( GDI_CLIPREGION_ACTION );
- rOStm.WriteInt32( 24 );
-
- if( pAct->IsClipping() )
- {
- aClipRect = rRegion.GetBoundRect();
- rOStm.WriteInt16( 1 );
- }
- else
- rOStm.WriteInt16( 0 );
-
- rOStm.WriteInt16( 0 );
- ImplWriteRect( rOStm, aClipRect );
-
- if( pAct->IsClipping() )
- ImplWriteRect( rOStm, aClipRect );
-
- nCount++;
- }
- break;
-
- case MetaActionType::ISECTRECTCLIPREGION:
- {
- const MetaISectRectClipRegionAction* pAct = static_cast<const MetaISectRectClipRegionAction*>(pAction);
-
- rOStm.WriteInt16( GDI_ISECTCLIPREGION_ACTION );
- rOStm.WriteInt32( 20 );
- WriteRectangle( rOStm, pAct->GetRect() );
- nCount++;
- }
- break;
-
- case MetaActionType::MOVECLIPREGION:
- {
- const MetaMoveClipRegionAction* pAct = static_cast<const MetaMoveClipRegionAction*>(pAction);
-
- rOStm.WriteInt16( GDI_MOVECLIPREGION_ACTION );
- rOStm.WriteInt32( 12 );
- rOStm.WriteInt32( pAct->GetHorzMove() );
- rOStm.WriteInt32( pAct->GetVertMove() );
- nCount++;
- }
- break;
-
- case MetaActionType::LINECOLOR:
- {
- const MetaLineColorAction* pAct = static_cast<const MetaLineColorAction*>(pAction);
- ImplWriteLineColor( rOStm, rLineCol = pAct->GetColor(), pAct->IsSetting() ? 1 : 0 );
- nCount++;
- }
- break;
-
- case MetaActionType::FILLCOLOR:
- {
- const MetaFillColorAction* pAct = static_cast<const MetaFillColorAction*>(pAction);
- ImplWriteFillColor( rOStm, pAct->GetColor(), pAct->IsSetting() ? 1 : 0 );
- nCount++;
- }
- break;
-
- case MetaActionType::FONT:
- {
- rSaveVDev.SetFont( static_cast<const MetaFontAction*>(pAction)->GetFont() );
- ImplWriteFont( rOStm, rSaveVDev.GetFont(), rActualCharSet );
- nCount++;
- }
- break;
-
- case MetaActionType::TEXTCOLOR:
- {
- vcl::Font aSaveFont( rSaveVDev.GetFont() );
-
- aSaveFont.SetColor( static_cast<const MetaTextColorAction*>(pAction)->GetColor() );
- rSaveVDev.SetFont( aSaveFont );
- ImplWriteFont( rOStm, rSaveVDev.GetFont(), rActualCharSet );
- nCount++;
- }
- break;
-
- case MetaActionType::TEXTFILLCOLOR:
- {
- const MetaTextFillColorAction* pAct = static_cast<const MetaTextFillColorAction*>(pAction);
- vcl::Font aSaveFont( rSaveVDev.GetFont() );
-
- if( pAct->IsSetting() )
- aSaveFont.SetFillColor( pAct->GetColor() );
- else
- aSaveFont.SetFillColor( COL_TRANSPARENT );
-
- rSaveVDev.SetFont( aSaveFont );
- ImplWriteFont( rOStm, rSaveVDev.GetFont(), rActualCharSet );
- nCount++;
- }
- break;
-
- case MetaActionType::TEXTALIGN:
- {
- vcl::Font aSaveFont( rSaveVDev.GetFont() );
-
- aSaveFont.SetAlignment( static_cast<const MetaTextAlignAction*>(pAction)->GetTextAlign() );
- rSaveVDev.SetFont( aSaveFont );
- ImplWriteFont( rOStm, rSaveVDev.GetFont(), rActualCharSet );
- nCount++;
- }
- break;
-
- case MetaActionType::MAPMODE:
- {
- const MetaMapModeAction* pAct = static_cast<const MetaMapModeAction*>(pAction);
-
- rOStm.WriteInt16( GDI_MAPMODE_ACTION );
- rOStm.WriteInt32( 30 );
- ImplWriteMapMode( rOStm, pAct->GetMapMode() );
- nCount++;
- }
- break;
-
- case MetaActionType::PUSH:
- {
- ImplWritePushAction( rOStm );
- rLineColStack.push( new Color( rLineCol ) );
- rSaveVDev.Push();
- nCount++;
- }
- break;
-
- case MetaActionType::POP:
- {
- Color* pCol;
- if (rLineColStack.empty())
- pCol = nullptr;
- else
- {
- pCol = rLineColStack.top();
- rLineColStack.pop();
- }
-
- if( pCol )
- {
- rLineCol = *pCol;
- delete pCol;
- }
-
- ImplWritePopAction( rOStm );
- rSaveVDev.Pop();
- nCount++;
- }
- break;
-
- case MetaActionType::RASTEROP:
- {
- const MetaRasterOpAction* pAct = static_cast<const MetaRasterOpAction*>(pAction);
-
- if( ( pAct->GetRasterOp() != RasterOp::N0 ) && ( pAct->GetRasterOp() != RasterOp::N1 ) )
- {
- sal_Int16 nRasterOp;
-
- // If RasterOp::N0/1 was set earlier, restore old state
- // via a Pop first
- if( rRop_0_1 )
- {
- ImplWritePopAction( rOStm );
- rSaveVDev.Pop();
- rRop_0_1 = false;
- nCount++;
- }
-
- switch( pAct->GetRasterOp() )
- {
- case RasterOp::OverPaint : nRasterOp = 0; break;
- case RasterOp::Xor : nRasterOp = 4; break;
- case RasterOp::Invert: nRasterOp = 1; break;
- default: nRasterOp = 0; break;
- }
-
- ImplWriteRasterOpAction( rOStm, nRasterOp );
- nCount++;
- }
- else
- {
- ImplWritePushAction( rOStm );
- rSaveVDev.Push();
-
- if( pAct->GetRasterOp() == RasterOp::N0 )
- {
- ImplWriteLineColor( rOStm, COL_BLACK, 1 );
- ImplWriteFillColor( rOStm, COL_BLACK, 1 );
- }
- else
- {
- ImplWriteLineColor( rOStm, COL_WHITE, 1 );
- ImplWriteFillColor( rOStm, COL_WHITE, 1 );
- }
-
- ImplWriteRasterOpAction( rOStm, 0 );
- rRop_0_1 = true;
- nCount += 4;
- }
- }
- break;
-
- case MetaActionType::Transparent:
- {
- const tools::PolyPolygon& rPolyPoly = static_cast<const MetaTransparentAction*>(pAction)->GetPolyPolygon();
- const sal_Int16 nTrans = static_cast<const MetaTransparentAction*>(pAction)->GetTransparence();
- const sal_Int16 nBrushStyle = ( nTrans < 38 ) ? 8 : ( nTrans < 63 ) ? 9 : 10;
- sal_uLong nOldPos, nNewPos;
-
- // write transparence comment
- rOStm.WriteInt16( GDI_TRANSPARENT_COMMENT );
-
- // we'll write the ActionSize later
- nOldPos = rOStm.Tell();
- rOStm.SeekRel( 4 );
-
- // write comment data
- WritePolyPolygon( rOStm, rPolyPoly );
- rOStm.WriteInt16( nTrans );
- rOStm.WriteInt32( 15 ); // number of actions that follow this comment
-
- // calculate and write ActionSize of comment
- nNewPos = rOStm.Tell();
- rOStm.Seek( nOldPos );
- rOStm.WriteInt32( nNewPos - nOldPos );
- rOStm.Seek( nNewPos );
-
- {
- // write actions for transparence
- ImplWritePushAction( rOStm );
- {
- ImplWriteRasterOpAction( rOStm, 4 );
- ImplWritePolyPolyAction( rOStm, rPolyPoly );
-
- ImplWritePushAction( rOStm );
- {
- ImplWriteRasterOpAction( rOStm, 2 );
- ImplWriteFillColor( rOStm, COL_BLACK, nBrushStyle );
- ImplWritePolyPolyAction( rOStm, rPolyPoly );
- }
- ImplWritePopAction( rOStm );
-
- ImplWriteRasterOpAction( rOStm, 4 );
- ImplWritePolyPolyAction( rOStm, rPolyPoly );
- }
- ImplWritePopAction( rOStm );
-
- ImplWritePushAction( rOStm );
- {
- ImplWriteFillColor( rOStm, Color(), 0 );
- ImplWritePolyPolyAction( rOStm, rPolyPoly );
- }
- ImplWritePopAction( rOStm );
-
- nCount += 15;
- }
-
- nCount++;
- }
- break;
-
- case MetaActionType::FLOATTRANSPARENT:
- {
- const MetaFloatTransparentAction* pA = static_cast<const MetaFloatTransparentAction*>(pAction);
- const GDIMetaFile& rTransMtf = pA->GetGDIMetaFile();
- const Point& rPos = pA->GetPoint();
- const Size& rSize = pA->GetSize();
- const Gradient& rGradient = pA->GetGradient();
- sal_uLong nOldPos, nNewPos;
-
- // write RefPoint comment
- rOStm.WriteInt16( GDI_FLOATTRANSPARENT_COMMENT );
-
- // we'll write the ActionSize later
- nOldPos = rOStm.Tell();
- rOStm.SeekRel( 4 );
-
- // write comment data
- WriteGDIMetaFile( rOStm, rTransMtf );
- WritePair( rOStm, rPos );
- WritePair( rOStm, rSize );
- WriteGradient( rOStm, rGradient );
-
- // calculate and write ActionSize of comment
- nNewPos = rOStm.Tell();
- rOStm.Seek( nOldPos );
- rOStm.WriteInt32( nNewPos - nOldPos + 4 );
- rOStm.Seek( ( nOldPos = nNewPos ) + 4 );
-
- {
- // write actions for float transparence
- sal_uLong nAddCount;
- GDIMetaFile aMtf( rTransMtf );
- const Size aSrcSize( rTransMtf.GetPrefSize() );
- Point aSrcPt( rTransMtf.GetPrefMapMode().GetOrigin() );
- const double fScaleX = aSrcSize.Width() ? static_cast<double>(rSize.Width()) / aSrcSize.Width() : 1.0;
- const double fScaleY = aSrcSize.Height() ? static_cast<double>(rSize.Height()) / aSrcSize.Height() : 1.0;
- long nMoveX, nMoveY;
-
- if( fScaleX != 1.0 || fScaleY != 1.0 )
- {
- aMtf.Scale( fScaleX, fScaleY );
- aSrcPt.setX( FRound( aSrcPt.X() * fScaleX ) );
- aSrcPt.setY( FRound( aSrcPt.Y() * fScaleY ) );
- }
-
- nMoveX = rPos.X() - aSrcPt.X();
- nMoveY = rPos.Y() - aSrcPt.Y();
-
- if( nMoveX || nMoveY )
- aMtf.Move( nMoveX, nMoveY );
-
- nAddCount = ImplWriteActions( rOStm, aMtf, rSaveVDev, rRop_0_1, rLineCol, rLineColStack, rActualCharSet );
- nNewPos = rOStm.Tell();
- rOStm.Seek( nOldPos );
- rOStm.WriteInt32( nAddCount );
- rOStm.Seek( nNewPos );
-
- nCount += nAddCount;
- }
-
- nCount++;
- }
- break;
-
- case MetaActionType::HATCH:
- {
- const MetaHatchAction* pA = static_cast<const MetaHatchAction*>(pAction);
- const tools::PolyPolygon& rPolyPoly = pA->GetPolyPolygon();
- const Hatch& rHatch = pA->GetHatch();
- sal_uLong nOldPos, nNewPos, nAddCount;
-
- // write hatch comment
- rOStm.WriteInt16( GDI_HATCH_COMMENT );
-
- // we'll write the ActionSize later
- nOldPos = rOStm.Tell();
- rOStm.SeekRel( 4 );
-
- // write comment data
- WritePolyPolygon( rOStm, rPolyPoly );
- WriteHatch( rOStm, rHatch );
-
- // calculate and write ActionSize of comment
- nNewPos = rOStm.Tell();
- rOStm.Seek( nOldPos );
- rOStm.WriteInt32( nNewPos - nOldPos + 4 );
- rOStm.Seek( ( nOldPos = nNewPos ) + 4 );
-
- {
- // write actions for hatch
- ScopedVclPtrInstance< VirtualDevice > aVDev;
- GDIMetaFile aTmpMtf;
-
- aVDev->AddHatchActions( rPolyPoly, rHatch, aTmpMtf );
- nAddCount = ImplWriteActions( rOStm, aTmpMtf, rSaveVDev, rRop_0_1, rLineCol, rLineColStack, rActualCharSet );
- nNewPos = rOStm.Tell();
- rOStm.Seek( nOldPos );
- rOStm.WriteInt32( nAddCount );
- rOStm.Seek( nNewPos );
-
- nCount += nAddCount;
- }
-
- nCount++;
- }
- break;
-
- case MetaActionType::REFPOINT:
- {
- const MetaRefPointAction* pA = static_cast<const MetaRefPointAction*>(pAction);
- const Point& rRefPoint = pA->GetRefPoint();
- const bool bSet = pA->IsSetting();
- sal_uLong nOldPos, nNewPos;
-
- // write RefPoint comment
- rOStm.WriteInt16( GDI_REFPOINT_COMMENT );
-
- // we'll write the ActionSize later
- nOldPos = rOStm.Tell();
- rOStm.SeekRel( 4 );
-
- // write data
- WritePair( rOStm, rRefPoint );
- rOStm.WriteBool( bSet );
- rOStm.WriteInt32( 0 ); // number of actions that follow this comment
-
- // calculate and write ActionSize of comment
- nNewPos = rOStm.Tell();
- rOStm.Seek( nOldPos );
- rOStm.WriteInt32( nNewPos - nOldPos );
- rOStm.Seek( nNewPos );
-
- nCount++;
- }
- break;
-
- case MetaActionType::TEXTLINECOLOR:
- {
- const MetaTextLineColorAction* pA = static_cast<const MetaTextLineColorAction*>(pAction);
- const Color& rColor = pA->GetColor();
- const bool bSet = pA->IsSetting();
- sal_uLong nOldPos, nNewPos;
-
- // write RefPoint comment
- rOStm.WriteInt16( GDI_TEXTLINECOLOR_COMMENT );
-
- // we'll write the ActionSize later
- nOldPos = rOStm.Tell();
- rOStm.SeekRel( 4 );
-
- // write data
- WriteColor( rOStm, rColor );
- rOStm.WriteBool( bSet );
- rOStm.WriteInt32( 0 ); // number of actions that follow this comment
-
- // calculate and write ActionSize of comment
- nNewPos = rOStm.Tell();
- rOStm.Seek( nOldPos );
- rOStm.WriteInt32( nNewPos - nOldPos );
- rOStm.Seek( nNewPos );
-
- nCount++;
- }
- break;
-
- case MetaActionType::TEXTLINE:
- {
- const MetaTextLineAction* pA = static_cast<const MetaTextLineAction*>(pAction);
- const Point& rStartPt = pA->GetStartPoint();
- const sal_Int32 nWidth = static_cast<sal_Int32>(pA->GetWidth());
- const FontStrikeout eStrikeout = pA->GetStrikeout();
- const FontLineStyle eUnderline = pA->GetUnderline();
- sal_uLong nOldPos, nNewPos;
-
- // write RefPoint comment
- rOStm.WriteInt16( GDI_TEXTLINE_COMMENT );
-
- // we'll write the ActionSize later
- nOldPos = rOStm.Tell();
- rOStm.SeekRel( 4 );
-
- // write data
- WritePair( rOStm, rStartPt );
- rOStm.WriteInt32( nWidth ).WriteUInt32( eStrikeout ).WriteUInt32( eUnderline );
- rOStm.WriteInt32( 0 ); // number of actions that follow this comment
-
- // calculate and write ActionSize of comment
- nNewPos = rOStm.Tell();
- rOStm.Seek( nOldPos );
- rOStm.WriteInt32( nNewPos - nOldPos );
- rOStm.Seek( nNewPos );
-
- nCount++;
- }
- break;
-
- case MetaActionType::EPS:
- break;
-
- case MetaActionType::COMMENT:
- {
- const MetaCommentAction* pA = static_cast<const MetaCommentAction*>(pAction);
- const sal_uInt32 nDataSize = pA->GetDataSize();
- sal_uLong nOldPos, nNewPos;
-
- // write RefPoint comment
- rOStm.WriteInt16( GDI_COMMENT_COMMENT );
-
- // we'll write the ActionSize later
- nOldPos = rOStm.Tell();
- rOStm.SeekRel( 4 );
-
- // write data
- write_uInt16_lenPrefixed_uInt8s_FromOString(rOStm, pA->GetComment());
- rOStm.WriteInt32( pA->GetValue() ).WriteUInt32( nDataSize );
-
- if( nDataSize )
- rOStm.WriteBytes( pA->GetData(), nDataSize );
-
- rOStm.WriteInt32( 0 ); // number of actions that follow this comment
-
- // calculate and write ActionSize of comment
- nNewPos = rOStm.Tell();
- rOStm.Seek( nOldPos );
- rOStm.WriteInt32( nNewPos - nOldPos );
- rOStm.Seek( nNewPos );
-
- nCount++;
- }
- break;
-
- default:
- SAL_WARN( "vcl", "Missing implementation for Action#: " << static_cast<sal_Int32>(pAction->GetType()) );
- break;
- }
- }
-
- return nCount;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */