LCOV - code coverage report
Current view: top level - vcl/source/gdi - metaact.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 772 2000 38.6 %
Date: 2014-04-11 Functions: 247 573 43.1 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include <algorithm>
      21             : #include <string.h>
      22             : #include <osl/thread.h>
      23             : #include <tools/stream.hxx>
      24             : #include <tools/vcompat.hxx>
      25             : #include <tools/helpers.hxx>
      26             : #include <vcl/dibtools.hxx>
      27             : #include <vcl/outdev.hxx>
      28             : #include <vcl/metaact.hxx>
      29             : #include <vcl/graphictools.hxx>
      30             : #include <basegfx/matrix/b2dhommatrixtools.hxx>
      31             : #include <unotools/fontdefs.hxx>
      32             : 
      33           0 : inline void ImplScalePoint( Point& rPt, double fScaleX, double fScaleY )
      34             : {
      35           0 :     rPt.X() = FRound( fScaleX * rPt.X() );
      36           0 :     rPt.Y() = FRound( fScaleY * rPt.Y() );
      37           0 : }
      38             : 
      39           0 : inline void ImplScaleRect( Rectangle& rRect, double fScaleX, double fScaleY )
      40             : {
      41           0 :     Point aTL( rRect.TopLeft() );
      42           0 :     Point aBR( rRect.BottomRight() );
      43             : 
      44           0 :     ImplScalePoint( aTL, fScaleX, fScaleY );
      45           0 :     ImplScalePoint( aBR, fScaleX, fScaleY );
      46             : 
      47           0 :     rRect = Rectangle( aTL, aBR );
      48           0 :     rRect.Justify();
      49           0 : }
      50             : 
      51           0 : inline void ImplScalePoly( Polygon& rPoly, double fScaleX, double fScaleY )
      52             : {
      53           0 :     for( sal_uInt16 i = 0, nCount = rPoly.GetSize(); i < nCount; i++ )
      54           0 :         ImplScalePoint( rPoly[ i ], fScaleX, fScaleY );
      55           0 : }
      56             : 
      57           0 : inline void ImplScaleLineInfo( LineInfo& rLineInfo, double fScaleX, double fScaleY )
      58             : {
      59           0 :     if( !rLineInfo.IsDefault() )
      60             :     {
      61           0 :         const double fScale = ( fabs(fScaleX) + fabs(fScaleY) ) * 0.5;
      62             : 
      63           0 :         rLineInfo.SetWidth( FRound( fScale * rLineInfo.GetWidth() ) );
      64           0 :         rLineInfo.SetDashLen( FRound( fScale * rLineInfo.GetDashLen() ) );
      65           0 :         rLineInfo.SetDotLen( FRound( fScale * rLineInfo.GetDotLen() ) );
      66           0 :         rLineInfo.SetDistance( FRound( fScale * rLineInfo.GetDistance() ) );
      67             :     }
      68           0 : }
      69             : 
      70             : #define COMPAT( _def_rIStm ) VersionCompat aCompat( ( _def_rIStm ), STREAM_READ );
      71             : #define WRITE_BASE_COMPAT( _def_rOStm, _def_nVer, _pWriteData )         \
      72             :     MetaAction::Write( ( _def_rOStm ), _pWriteData );                   \
      73             :     VersionCompat aCompat( ( _def_rOStm ), STREAM_WRITE, ( _def_nVer ) );
      74             : 
      75           0 : MetaAction::MetaAction() :
      76             :     mnRefCount( 1 ),
      77           0 :     mnType( META_NULL_ACTION )
      78             : {
      79           0 : }
      80             : 
      81      932000 : MetaAction::MetaAction( sal_uInt16 nType ) :
      82             :     mnRefCount( 1 ),
      83      932000 :     mnType( nType )
      84             : {
      85      932000 : }
      86             : 
      87      931887 : MetaAction::~MetaAction()
      88             : {
      89      931887 : }
      90             : 
      91           0 : void MetaAction::Execute( OutputDevice* )
      92             : {
      93           0 : }
      94             : 
      95           0 : MetaAction* MetaAction::Clone()
      96             : {
      97           0 :     return new MetaAction;
      98             : }
      99             : 
     100        4849 : void MetaAction::Move( long, long )
     101             : {
     102        4849 : }
     103             : 
     104           0 : void MetaAction::Scale( double, double )
     105             : {
     106           0 : }
     107             : 
     108           0 : bool MetaAction::Compare( const MetaAction& ) const
     109             : {
     110           0 :     return true;
     111             : }
     112             : 
     113      376573 : void MetaAction::Write( SvStream& rOStm, ImplMetaWriteData* )
     114             : {
     115      376573 :     rOStm.WriteUInt16( mnType );
     116      376573 : }
     117             : 
     118           0 : void MetaAction::Read( SvStream&, ImplMetaReadData* )
     119             : {
     120             :     // DO NOT read mnType - ReadMetaAction already did that!
     121           0 : }
     122             : 
     123      322698 : MetaAction* MetaAction::ReadMetaAction( SvStream& rIStm, ImplMetaReadData* pData )
     124             : {
     125      322698 :     MetaAction* pAction = NULL;
     126      322698 :     sal_uInt16 nType = 0;
     127             : 
     128      322698 :     rIStm.ReadUInt16( nType );
     129             : 
     130             :     SAL_INFO("vcl.gdi", "ReadMetaAction " << nType);
     131             : 
     132      322698 :     switch( nType )
     133             :     {
     134           0 :         case( META_NULL_ACTION ): pAction = new MetaAction; break;
     135           0 :         case( META_PIXEL_ACTION ): pAction = new MetaPixelAction; break;
     136           0 :         case( META_POINT_ACTION ): pAction = new MetaPointAction; break;
     137           0 :         case( META_LINE_ACTION ): pAction = new MetaLineAction; break;
     138        1963 :         case( META_RECT_ACTION ): pAction = new MetaRectAction; break;
     139           0 :         case( META_ROUNDRECT_ACTION ): pAction = new MetaRoundRectAction; break;
     140           0 :         case( META_ELLIPSE_ACTION ): pAction = new MetaEllipseAction; break;
     141           0 :         case( META_ARC_ACTION ): pAction = new MetaArcAction; break;
     142           0 :         case( META_PIE_ACTION ): pAction = new MetaPieAction; break;
     143           0 :         case( META_CHORD_ACTION ): pAction = new MetaChordAction; break;
     144          28 :         case( META_POLYLINE_ACTION ): pAction = new MetaPolyLineAction; break;
     145           0 :         case( META_POLYGON_ACTION ): pAction = new MetaPolygonAction; break;
     146          13 :         case( META_POLYPOLYGON_ACTION ): pAction = new MetaPolyPolygonAction; break;
     147           0 :         case( META_TEXT_ACTION ): pAction = new MetaTextAction; break;
     148          53 :         case( META_TEXTARRAY_ACTION ): pAction = new MetaTextArrayAction; break;
     149       37563 :         case( META_STRETCHTEXT_ACTION ): pAction = new MetaStretchTextAction; break;
     150           0 :         case( META_TEXTRECT_ACTION ): pAction = new MetaTextRectAction; break;
     151           0 :         case( META_TEXTLINE_ACTION ): pAction = new MetaTextLineAction; break;
     152           0 :         case( META_BMP_ACTION ): pAction = new MetaBmpAction; break;
     153         336 :         case( META_BMPSCALE_ACTION ): pAction = new MetaBmpScaleAction; break;
     154           0 :         case( META_BMPSCALEPART_ACTION ): pAction = new MetaBmpScalePartAction; break;
     155           0 :         case( META_BMPEX_ACTION ): pAction = new MetaBmpExAction; break;
     156           0 :         case( META_BMPEXSCALE_ACTION ): pAction = new MetaBmpExScaleAction; break;
     157           0 :         case( META_BMPEXSCALEPART_ACTION ): pAction = new MetaBmpExScalePartAction; break;
     158           0 :         case( META_MASK_ACTION ): pAction = new MetaMaskAction; break;
     159           0 :         case( META_MASKSCALE_ACTION ): pAction = new MetaMaskScaleAction; break;
     160           0 :         case( META_MASKSCALEPART_ACTION ): pAction = new MetaMaskScalePartAction; break;
     161           0 :         case( META_GRADIENT_ACTION ): pAction = new MetaGradientAction; break;
     162           0 :         case( META_GRADIENTEX_ACTION ): pAction = new MetaGradientExAction; break;
     163           0 :         case( META_HATCH_ACTION ): pAction = new MetaHatchAction; break;
     164           0 :         case( META_WALLPAPER_ACTION ): pAction = new MetaWallpaperAction; break;
     165           1 :         case( META_CLIPREGION_ACTION ): pAction = new MetaClipRegionAction; break;
     166        5005 :         case( META_ISECTRECTCLIPREGION_ACTION ): pAction = new MetaISectRectClipRegionAction; break;
     167         448 :         case( META_ISECTREGIONCLIPREGION_ACTION ): pAction = new MetaISectRegionClipRegionAction; break;
     168           0 :         case( META_MOVECLIPREGION_ACTION ): pAction = new MetaMoveClipRegionAction; break;
     169        2028 :         case( META_LINECOLOR_ACTION ): pAction = new MetaLineColorAction; break;
     170        2000 :         case( META_FILLCOLOR_ACTION ): pAction = new MetaFillColorAction; break;
     171       40259 :         case( META_TEXTCOLOR_ACTION ): pAction = new MetaTextColorAction; break;
     172       39576 :         case( META_TEXTFILLCOLOR_ACTION ): pAction = new MetaTextFillColorAction; break;
     173           2 :         case( META_TEXTLINECOLOR_ACTION ): pAction = new MetaTextLineColorAction; break;
     174           2 :         case( META_OVERLINECOLOR_ACTION ): pAction = new MetaOverlineColorAction; break;
     175       39575 :         case( META_TEXTALIGN_ACTION ): pAction = new MetaTextAlignAction; break;
     176           0 :         case( META_MAPMODE_ACTION ): pAction = new MetaMapModeAction; break;
     177       39575 :         case( META_FONT_ACTION ): pAction = new MetaFontAction; break;
     178       44982 :         case( META_PUSH_ACTION ): pAction = new MetaPushAction; break;
     179       44982 :         case( META_POP_ACTION ): pAction = new MetaPopAction; break;
     180           7 :         case( META_RASTEROP_ACTION ): pAction = new MetaRasterOpAction; break;
     181           0 :         case( META_TRANSPARENT_ACTION ): pAction = new MetaTransparentAction; break;
     182           0 :         case( META_FLOATTRANSPARENT_ACTION ): pAction = new MetaFloatTransparentAction; break;
     183           0 :         case( META_EPS_ACTION ): pAction = new MetaEPSAction; break;
     184           0 :         case( META_REFPOINT_ACTION ): pAction = new MetaRefPointAction; break;
     185         124 :         case( META_COMMENT_ACTION ): pAction = new MetaCommentAction; break;
     186        9580 :         case( META_LAYOUTMODE_ACTION ): pAction = new MetaLayoutModeAction; break;
     187       14596 :         case( META_TEXTLANGUAGE_ACTION ): pAction = new MetaTextLanguageAction; break;
     188             : 
     189             :         default:
     190             :         {
     191             :             // Action ueberlesen durch Kombination Ctor/Dtor,
     192             :             // new/delete, weil Compiler sonst vielleicht wegoptimieren
     193           0 :             delete ( new VersionCompat( rIStm, STREAM_READ ) );
     194             :         }
     195           0 :         break;
     196             :     }
     197             : 
     198      322698 :     if( pAction )
     199      322698 :         pAction->Read( rIStm, pData );
     200             : 
     201      322698 :     return pAction;
     202             : }
     203             : 
     204           0 : IMPL_META_ACTION( Pixel, META_PIXEL_ACTION )
     205             : 
     206           0 : MetaPixelAction::MetaPixelAction( const Point& rPt, const Color& rColor ) :
     207             :     MetaAction  ( META_PIXEL_ACTION ),
     208             :     maPt        ( rPt ),
     209           0 :     maColor     ( rColor )
     210             : {
     211           0 : }
     212             : 
     213           0 : void MetaPixelAction::Execute( OutputDevice* pOut )
     214             : {
     215           0 :     pOut->DrawPixel( maPt, maColor );
     216           0 : }
     217             : 
     218           0 : MetaAction* MetaPixelAction::Clone()
     219             : {
     220           0 :     MetaAction* pClone = (MetaAction*) new MetaPixelAction( *this );
     221           0 :     pClone->ResetRefCount();
     222           0 :     return pClone;
     223             : }
     224             : 
     225           0 : void MetaPixelAction::Move( long nHorzMove, long nVertMove )
     226             : {
     227           0 :     maPt.Move( nHorzMove, nVertMove );
     228           0 : }
     229             : 
     230           0 : void MetaPixelAction::Scale( double fScaleX, double fScaleY )
     231             : {
     232           0 :     ImplScalePoint( maPt, fScaleX, fScaleY );
     233           0 : }
     234             : 
     235           0 : bool MetaPixelAction::Compare( const MetaAction& rMetaAction ) const
     236             : {
     237           0 :     return ( maPt == ((MetaPixelAction&)rMetaAction).maPt ) &&
     238           0 :            ( maColor == ((MetaPixelAction&)rMetaAction).maColor );
     239             : }
     240             : 
     241           0 : void MetaPixelAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     242             : {
     243           0 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
     244           0 :     WritePair( rOStm, maPt );
     245           0 :     maColor.Write( rOStm, true );
     246           0 : }
     247             : 
     248           0 : void MetaPixelAction::Read( SvStream& rIStm, ImplMetaReadData* )
     249             : {
     250           0 :     COMPAT( rIStm );
     251           0 :     ReadPair( rIStm, maPt );
     252           0 :     maColor.Read( rIStm, true );
     253           0 : }
     254             : 
     255        4606 : IMPL_META_ACTION( Point, META_POINT_ACTION )
     256             : 
     257        2303 : MetaPointAction::MetaPointAction( const Point& rPt ) :
     258             :     MetaAction  ( META_POINT_ACTION ),
     259        2303 :     maPt        ( rPt )
     260             : {
     261        2303 : }
     262             : 
     263        2303 : void MetaPointAction::Execute( OutputDevice* pOut )
     264             : {
     265        2303 :     pOut->DrawPixel( maPt );
     266        2303 : }
     267             : 
     268           0 : MetaAction* MetaPointAction::Clone()
     269             : {
     270           0 :     MetaAction* pClone = (MetaAction*) new MetaPointAction( *this );
     271           0 :     pClone->ResetRefCount();
     272           0 :     return pClone;
     273             : }
     274             : 
     275           0 : void MetaPointAction::Move( long nHorzMove, long nVertMove )
     276             : {
     277           0 :     maPt.Move( nHorzMove, nVertMove );
     278           0 : }
     279             : 
     280           0 : void MetaPointAction::Scale( double fScaleX, double fScaleY )
     281             : {
     282           0 :     ImplScalePoint( maPt, fScaleX, fScaleY );
     283           0 : }
     284             : 
     285           0 : bool MetaPointAction::Compare( const MetaAction& rMetaAction ) const
     286             : {
     287           0 :     return maPt == ((MetaPointAction&)rMetaAction).maPt;
     288             : }
     289             : 
     290           0 : void MetaPointAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     291             : {
     292           0 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
     293           0 :     WritePair( rOStm, maPt );
     294           0 : }
     295             : 
     296           0 : void MetaPointAction::Read( SvStream& rIStm, ImplMetaReadData* )
     297             : {
     298           0 :     COMPAT( rIStm );
     299           0 :     ReadPair( rIStm, maPt );
     300           0 : }
     301             : 
     302       69432 : IMPL_META_ACTION( Line, META_LINE_ACTION )
     303             : 
     304       34051 : MetaLineAction::MetaLineAction( const Point& rStart, const Point& rEnd ) :
     305             :     MetaAction  ( META_LINE_ACTION ),
     306             :     maStartPt   ( rStart ),
     307       34051 :     maEndPt     ( rEnd )
     308             : {
     309       34051 : }
     310             : 
     311         665 : MetaLineAction::MetaLineAction( const Point& rStart, const Point& rEnd,
     312             :                                 const LineInfo& rLineInfo ) :
     313             :     MetaAction  ( META_LINE_ACTION ),
     314             :     maLineInfo  ( rLineInfo ),
     315             :     maStartPt   ( rStart ),
     316         665 :     maEndPt     ( rEnd )
     317             : {
     318         665 : }
     319             : 
     320       33430 : void MetaLineAction::Execute( OutputDevice* pOut )
     321             : {
     322       33430 :     if( maLineInfo.IsDefault() )
     323       33336 :         pOut->DrawLine( maStartPt, maEndPt );
     324             :     else
     325          94 :         pOut->DrawLine( maStartPt, maEndPt, maLineInfo );
     326       33430 : }
     327             : 
     328           0 : MetaAction* MetaLineAction::Clone()
     329             : {
     330           0 :     MetaAction* pClone = (MetaAction*) new MetaLineAction( *this );
     331           0 :     pClone->ResetRefCount();
     332           0 :     return pClone;
     333             : }
     334             : 
     335          94 : void MetaLineAction::Move( long nHorzMove, long nVertMove )
     336             : {
     337          94 :     maStartPt.Move( nHorzMove, nVertMove );
     338          94 :     maEndPt.Move( nHorzMove, nVertMove );
     339          94 : }
     340             : 
     341           0 : void MetaLineAction::Scale( double fScaleX, double fScaleY )
     342             : {
     343           0 :     ImplScalePoint( maStartPt, fScaleX, fScaleY );
     344           0 :     ImplScalePoint( maEndPt, fScaleX, fScaleY );
     345           0 :     ImplScaleLineInfo( maLineInfo, fScaleX, fScaleY );
     346           0 : }
     347             : 
     348           0 : bool MetaLineAction::Compare( const MetaAction& rMetaAction ) const
     349             : {
     350           0 :     return ( maLineInfo == ((MetaLineAction&)rMetaAction).maLineInfo ) &&
     351           0 :            ( maStartPt == ((MetaLineAction&)rMetaAction).maStartPt ) &&
     352           0 :            ( maEndPt == ((MetaLineAction&)rMetaAction).maEndPt );
     353             : }
     354             : 
     355        2022 : void MetaLineAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     356             : {
     357        2022 :     WRITE_BASE_COMPAT( rOStm, 2, pData );
     358             : 
     359        2022 :     WritePair( rOStm, maStartPt );
     360        2022 :     WritePair( rOStm, maEndPt );  // Version 1
     361        2022 :     WriteLineInfo( rOStm, maLineInfo );            // Version 2
     362        2022 : }
     363             : 
     364           0 : void MetaLineAction::Read( SvStream& rIStm, ImplMetaReadData* )
     365             : {
     366           0 :     COMPAT( rIStm );
     367             : 
     368             :     // Version 1
     369           0 :     ReadPair( rIStm, maStartPt );
     370           0 :     ReadPair( rIStm, maEndPt );
     371             : 
     372             :     // Version 2
     373           0 :     if( aCompat.GetVersion() >= 2 )
     374             :     {
     375           0 :         ReadLineInfo( rIStm, maLineInfo );
     376           0 :     }
     377           0 : }
     378             : 
     379       28561 : IMPL_META_ACTION( Rect, META_RECT_ACTION )
     380             : 
     381       11336 : MetaRectAction::MetaRectAction( const Rectangle& rRect ) :
     382             :     MetaAction  ( META_RECT_ACTION ),
     383       11336 :     maRect      ( rRect )
     384             : {
     385       11336 : }
     386             : 
     387        8247 : void MetaRectAction::Execute( OutputDevice* pOut )
     388             : {
     389        8247 :     pOut->DrawRect( maRect );
     390        8247 : }
     391             : 
     392           0 : MetaAction* MetaRectAction::Clone()
     393             : {
     394           0 :     MetaAction* pClone = (MetaAction*) new MetaRectAction( *this );
     395           0 :     pClone->ResetRefCount();
     396           0 :     return pClone;
     397             : }
     398             : 
     399         156 : void MetaRectAction::Move( long nHorzMove, long nVertMove )
     400             : {
     401         156 :     maRect.Move( nHorzMove, nVertMove );
     402         156 : }
     403             : 
     404           0 : void MetaRectAction::Scale( double fScaleX, double fScaleY )
     405             : {
     406           0 :     ImplScaleRect( maRect, fScaleX, fScaleY );
     407           0 : }
     408             : 
     409           0 : bool MetaRectAction::Compare( const MetaAction& rMetaAction ) const
     410             : {
     411           0 :     return maRect == ((MetaRectAction&)rMetaAction).maRect;
     412             : }
     413             : 
     414        6080 : void MetaRectAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     415             : {
     416        6080 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
     417        6080 :     WriteRectangle( rOStm, maRect );
     418        6080 : }
     419             : 
     420        1963 : void MetaRectAction::Read( SvStream& rIStm, ImplMetaReadData* )
     421             : {
     422        1963 :     COMPAT( rIStm );
     423        1963 :     ReadRectangle( rIStm, maRect );
     424        1963 : }
     425             : 
     426           0 : IMPL_META_ACTION( RoundRect, META_ROUNDRECT_ACTION )
     427             : 
     428           0 : MetaRoundRectAction::MetaRoundRectAction( const Rectangle& rRect,
     429             :                                           sal_uInt32 nHorzRound, sal_uInt32 nVertRound ) :
     430             :     MetaAction  ( META_ROUNDRECT_ACTION ),
     431             :     maRect      ( rRect ),
     432             :     mnHorzRound ( nHorzRound ),
     433           0 :     mnVertRound ( nVertRound )
     434             : {
     435           0 : }
     436             : 
     437           0 : void MetaRoundRectAction::Execute( OutputDevice* pOut )
     438             : {
     439           0 :     pOut->DrawRect( maRect, mnHorzRound, mnVertRound );
     440           0 : }
     441             : 
     442           0 : MetaAction* MetaRoundRectAction::Clone()
     443             : {
     444           0 :     MetaAction* pClone = (MetaAction*) new MetaRoundRectAction( *this );
     445           0 :     pClone->ResetRefCount();
     446           0 :     return pClone;
     447             : }
     448             : 
     449           0 : void MetaRoundRectAction::Move( long nHorzMove, long nVertMove )
     450             : {
     451           0 :     maRect.Move( nHorzMove, nVertMove );
     452           0 : }
     453             : 
     454           0 : void MetaRoundRectAction::Scale( double fScaleX, double fScaleY )
     455             : {
     456           0 :     ImplScaleRect( maRect, fScaleX, fScaleY );
     457           0 :     mnHorzRound = FRound( mnHorzRound * fabs(fScaleX) );
     458           0 :     mnVertRound = FRound( mnVertRound * fabs(fScaleY) );
     459           0 : }
     460             : 
     461           0 : bool MetaRoundRectAction::Compare( const MetaAction& rMetaAction ) const
     462             : {
     463           0 :     return ( maRect == ((MetaRoundRectAction&)rMetaAction).maRect ) &&
     464           0 :            ( mnHorzRound == ((MetaRoundRectAction&)rMetaAction).mnHorzRound ) &&
     465           0 :            ( mnVertRound == ((MetaRoundRectAction&)rMetaAction).mnVertRound );
     466             : }
     467             : 
     468           0 : void MetaRoundRectAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     469             : {
     470           0 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
     471           0 :     WriteRectangle( rOStm, maRect );
     472           0 :     rOStm.WriteUInt32( mnHorzRound ).WriteUInt32( mnVertRound );
     473           0 : }
     474             : 
     475           0 : void MetaRoundRectAction::Read( SvStream& rIStm, ImplMetaReadData* )
     476             : {
     477           0 :     COMPAT( rIStm );
     478           0 :     ReadRectangle( rIStm, maRect ).ReadUInt32( mnHorzRound ).ReadUInt32( mnVertRound );
     479           0 : }
     480             : 
     481           2 : IMPL_META_ACTION( Ellipse, META_ELLIPSE_ACTION )
     482             : 
     483           1 : MetaEllipseAction::MetaEllipseAction( const Rectangle& rRect ) :
     484             :     MetaAction  ( META_ELLIPSE_ACTION ),
     485           1 :     maRect      ( rRect )
     486             : {
     487           1 : }
     488             : 
     489           0 : void MetaEllipseAction::Execute( OutputDevice* pOut )
     490             : {
     491           0 :     pOut->DrawEllipse( maRect );
     492           0 : }
     493             : 
     494           0 : MetaAction* MetaEllipseAction::Clone()
     495             : {
     496           0 :     MetaAction* pClone = (MetaAction*) new MetaEllipseAction( *this );
     497           0 :     pClone->ResetRefCount();
     498           0 :     return pClone;
     499             : }
     500             : 
     501           0 : void MetaEllipseAction::Move( long nHorzMove, long nVertMove )
     502             : {
     503           0 :     maRect.Move( nHorzMove, nVertMove );
     504           0 : }
     505             : 
     506           0 : void MetaEllipseAction::Scale( double fScaleX, double fScaleY )
     507             : {
     508           0 :     ImplScaleRect( maRect, fScaleX, fScaleY );
     509           0 : }
     510             : 
     511           0 : bool MetaEllipseAction::Compare( const MetaAction& rMetaAction ) const
     512             : {
     513           0 :     return maRect == ((MetaEllipseAction&)rMetaAction).maRect;
     514             : }
     515             : 
     516           0 : void MetaEllipseAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     517             : {
     518           0 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
     519           0 :     WriteRectangle( rOStm, maRect );
     520           0 : }
     521             : 
     522           0 : void MetaEllipseAction::Read( SvStream& rIStm, ImplMetaReadData* )
     523             : {
     524           0 :     COMPAT( rIStm );
     525           0 :     ReadRectangle( rIStm, maRect );
     526           0 : }
     527             : 
     528           0 : IMPL_META_ACTION( Arc, META_ARC_ACTION )
     529             : 
     530           0 : MetaArcAction::MetaArcAction( const Rectangle& rRect,
     531             :                               const Point& rStart, const Point& rEnd ) :
     532             :     MetaAction  ( META_ARC_ACTION ),
     533             :     maRect      ( rRect ),
     534             :     maStartPt   ( rStart ),
     535           0 :     maEndPt     ( rEnd )
     536             : {
     537           0 : }
     538             : 
     539           0 : void MetaArcAction::Execute( OutputDevice* pOut )
     540             : {
     541           0 :     pOut->DrawArc( maRect, maStartPt, maEndPt );
     542           0 : }
     543             : 
     544           0 : MetaAction* MetaArcAction::Clone()
     545             : {
     546           0 :     MetaAction* pClone = (MetaAction*) new MetaArcAction( *this );
     547           0 :     pClone->ResetRefCount();
     548           0 :     return pClone;
     549             : }
     550             : 
     551           0 : void MetaArcAction::Move( long nHorzMove, long nVertMove )
     552             : {
     553           0 :     maRect.Move(  nHorzMove, nVertMove );
     554           0 :     maStartPt.Move(  nHorzMove, nVertMove );
     555           0 :     maEndPt.Move(  nHorzMove, nVertMove );
     556           0 : }
     557             : 
     558           0 : void MetaArcAction::Scale( double fScaleX, double fScaleY )
     559             : {
     560           0 :     ImplScaleRect( maRect, fScaleX, fScaleY );
     561           0 :     ImplScalePoint( maStartPt, fScaleX, fScaleY );
     562           0 :     ImplScalePoint( maEndPt, fScaleX, fScaleY );
     563           0 : }
     564             : 
     565           0 : bool MetaArcAction::Compare( const MetaAction& rMetaAction ) const
     566             : {
     567           0 :     return ( maRect == ((MetaArcAction&)rMetaAction).maRect ) &&
     568           0 :            ( maStartPt == ((MetaArcAction&)rMetaAction).maStartPt ) &&
     569           0 :            ( maEndPt == ((MetaArcAction&)rMetaAction).maEndPt );
     570             : }
     571             : 
     572           0 : void MetaArcAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     573             : {
     574           0 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
     575           0 :     WriteRectangle( rOStm, maRect );
     576           0 :     WritePair( rOStm, maStartPt );
     577           0 :     WritePair( rOStm, maEndPt );
     578           0 : }
     579             : 
     580           0 : void MetaArcAction::Read( SvStream& rIStm, ImplMetaReadData* )
     581             : {
     582           0 :     COMPAT( rIStm );
     583           0 :     ReadRectangle( rIStm, maRect );
     584           0 :     ReadPair( rIStm, maStartPt );
     585           0 :     ReadPair( rIStm, maEndPt );
     586           0 : }
     587             : 
     588           0 : IMPL_META_ACTION( Pie, META_PIE_ACTION )
     589             : 
     590           0 : MetaPieAction::MetaPieAction( const Rectangle& rRect,
     591             :                               const Point& rStart, const Point& rEnd ) :
     592             :     MetaAction  ( META_PIE_ACTION ),
     593             :     maRect      ( rRect ),
     594             :     maStartPt   ( rStart ),
     595           0 :     maEndPt     ( rEnd )
     596             : {
     597           0 : }
     598             : 
     599           0 : void MetaPieAction::Execute( OutputDevice* pOut )
     600             : {
     601           0 :     pOut->DrawPie( maRect, maStartPt, maEndPt );
     602           0 : }
     603             : 
     604           0 : MetaAction* MetaPieAction::Clone()
     605             : {
     606           0 :     MetaAction* pClone = (MetaAction*) new MetaPieAction( *this );
     607           0 :     pClone->ResetRefCount();
     608           0 :     return pClone;
     609             : }
     610             : 
     611           0 : void MetaPieAction::Move( long nHorzMove, long nVertMove )
     612             : {
     613           0 :     maRect.Move(  nHorzMove, nVertMove );
     614           0 :     maStartPt.Move(  nHorzMove, nVertMove );
     615           0 :     maEndPt.Move(  nHorzMove, nVertMove );
     616           0 : }
     617             : 
     618           0 : void MetaPieAction::Scale( double fScaleX, double fScaleY )
     619             : {
     620           0 :     ImplScaleRect( maRect, fScaleX, fScaleY );
     621           0 :     ImplScalePoint( maStartPt, fScaleX, fScaleY );
     622           0 :     ImplScalePoint( maEndPt, fScaleX, fScaleY );
     623           0 : }
     624             : 
     625           0 : bool MetaPieAction::Compare( const MetaAction& rMetaAction ) const
     626             : {
     627           0 :     return ( maRect == ((MetaPieAction&)rMetaAction).maRect ) &&
     628           0 :            ( maStartPt == ((MetaPieAction&)rMetaAction).maStartPt ) &&
     629           0 :            ( maEndPt == ((MetaPieAction&)rMetaAction).maEndPt );
     630             : }
     631             : 
     632           0 : void MetaPieAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     633             : {
     634           0 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
     635           0 :     WriteRectangle( rOStm, maRect );
     636           0 :     WritePair( rOStm, maStartPt );
     637           0 :     WritePair( rOStm, maEndPt );
     638           0 : }
     639             : 
     640           0 : void MetaPieAction::Read( SvStream& rIStm, ImplMetaReadData* )
     641             : {
     642           0 :     COMPAT( rIStm );
     643           0 :     ReadRectangle( rIStm, maRect );
     644           0 :     ReadPair( rIStm, maStartPt );
     645           0 :     ReadPair( rIStm, maEndPt );
     646           0 : }
     647             : 
     648           0 : IMPL_META_ACTION( Chord, META_CHORD_ACTION )
     649             : 
     650           0 : MetaChordAction::MetaChordAction( const Rectangle& rRect,
     651             :                                   const Point& rStart, const Point& rEnd ) :
     652             :     MetaAction  ( META_CHORD_ACTION ),
     653             :     maRect      ( rRect ),
     654             :     maStartPt   ( rStart ),
     655           0 :     maEndPt     ( rEnd )
     656             : {
     657           0 : }
     658             : 
     659           0 : void MetaChordAction::Execute( OutputDevice* pOut )
     660             : {
     661           0 :     pOut->DrawChord( maRect, maStartPt, maEndPt );
     662           0 : }
     663             : 
     664           0 : MetaAction* MetaChordAction::Clone()
     665             : {
     666           0 :     MetaAction* pClone = (MetaAction*) new MetaChordAction( *this );
     667           0 :     pClone->ResetRefCount();
     668           0 :     return pClone;
     669             : }
     670             : 
     671           0 : void MetaChordAction::Move( long nHorzMove, long nVertMove )
     672             : {
     673           0 :     maRect.Move(  nHorzMove, nVertMove );
     674           0 :     maStartPt.Move(  nHorzMove, nVertMove );
     675           0 :     maEndPt.Move(  nHorzMove, nVertMove );
     676           0 : }
     677             : 
     678           0 : void MetaChordAction::Scale( double fScaleX, double fScaleY )
     679             : {
     680           0 :     ImplScaleRect( maRect, fScaleX, fScaleY );
     681           0 :     ImplScalePoint( maStartPt, fScaleX, fScaleY );
     682           0 :     ImplScalePoint( maEndPt, fScaleX, fScaleY );
     683           0 : }
     684             : 
     685           0 : bool MetaChordAction::Compare( const MetaAction& rMetaAction ) const
     686             : {
     687           0 :     return ( maRect == ((MetaChordAction&)rMetaAction).maRect ) &&
     688           0 :            ( maStartPt == ((MetaChordAction&)rMetaAction).maStartPt ) &&
     689           0 :            ( maEndPt == ((MetaChordAction&)rMetaAction).maEndPt );
     690             : }
     691             : 
     692           0 : void MetaChordAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     693             : {
     694           0 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
     695           0 :     WriteRectangle( rOStm, maRect );
     696           0 :     WritePair( rOStm, maStartPt );
     697           0 :     WritePair( rOStm, maEndPt );
     698           0 : }
     699             : 
     700           0 : void MetaChordAction::Read( SvStream& rIStm, ImplMetaReadData* )
     701             : {
     702           0 :     COMPAT( rIStm );
     703           0 :     ReadRectangle( rIStm, maRect );
     704           0 :     ReadPair( rIStm, maStartPt );
     705           0 :     ReadPair( rIStm, maEndPt );
     706           0 : }
     707             : 
     708        3388 : IMPL_META_ACTION( PolyLine, META_POLYLINE_ACTION )
     709             : 
     710           0 : MetaPolyLineAction::MetaPolyLineAction( const Polygon& rPoly ) :
     711             :     MetaAction  ( META_POLYLINE_ACTION ),
     712           0 :     maPoly      ( rPoly )
     713             : {
     714           0 : }
     715             : 
     716        1688 : MetaPolyLineAction::MetaPolyLineAction( const Polygon& rPoly, const LineInfo& rLineInfo ) :
     717             :     MetaAction  ( META_POLYLINE_ACTION ),
     718             :     maLineInfo  ( rLineInfo ),
     719        1688 :     maPoly      ( rPoly )
     720             : {
     721        1688 : }
     722             : 
     723         677 : void MetaPolyLineAction::Execute( OutputDevice* pOut )
     724             : {
     725         677 :     if( maLineInfo.IsDefault() )
     726         607 :         pOut->DrawPolyLine( maPoly );
     727             :     else
     728          70 :         pOut->DrawPolyLine( maPoly, maLineInfo );
     729         677 : }
     730             : 
     731           0 : MetaAction* MetaPolyLineAction::Clone()
     732             : {
     733           0 :     MetaAction* pClone = (MetaAction*) new MetaPolyLineAction( *this );
     734           0 :     pClone->ResetRefCount();
     735           0 :     return pClone;
     736             : }
     737             : 
     738         589 : void MetaPolyLineAction::Move( long nHorzMove, long nVertMove )
     739             : {
     740         589 :     maPoly.Move( nHorzMove, nVertMove );
     741         589 : }
     742             : 
     743           0 : void MetaPolyLineAction::Scale( double fScaleX, double fScaleY )
     744             : {
     745           0 :     ImplScalePoly( maPoly, fScaleX, fScaleY );
     746           0 :     ImplScaleLineInfo( maLineInfo, fScaleX, fScaleY );
     747           0 : }
     748             : 
     749           0 : bool MetaPolyLineAction::Compare( const MetaAction& rMetaAction ) const
     750             : {
     751           0 :     bool bIsEqual = true;
     752           0 :     if ( maLineInfo != ((MetaPolyLineAction&)rMetaAction).maLineInfo )
     753           0 :         bIsEqual = false;
     754             :     else
     755           0 :         bIsEqual = maPoly.IsEqual(((MetaPolyLineAction&)rMetaAction).maPoly );
     756           0 :     return bIsEqual;
     757             : 
     758             : }
     759             : 
     760         712 : void MetaPolyLineAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     761             : {
     762         712 :     WRITE_BASE_COMPAT( rOStm, 3, pData );
     763             : 
     764        1424 :     Polygon aSimplePoly;
     765         712 :     maPoly.AdaptiveSubdivide( aSimplePoly );
     766             : 
     767         712 :     WritePolygon( rOStm, aSimplePoly );                               // Version 1
     768         712 :     WriteLineInfo( rOStm, maLineInfo );                                // Version 2
     769             : 
     770         712 :     sal_uInt8 bHasPolyFlags = maPoly.HasFlags();        // Version 3
     771         712 :     rOStm.WriteUChar( bHasPolyFlags );
     772         712 :     if ( bHasPolyFlags )
     773         717 :         maPoly.Write( rOStm );
     774         712 : }
     775             : 
     776          28 : void MetaPolyLineAction::Read( SvStream& rIStm, ImplMetaReadData* )
     777             : {
     778          28 :     COMPAT( rIStm );
     779             : 
     780             :     // Version 1
     781          28 :     ReadPolygon( rIStm, maPoly );
     782             : 
     783             :     // Version 2
     784          28 :     if( aCompat.GetVersion() >= 2 )
     785          28 :         ReadLineInfo( rIStm, maLineInfo );
     786          28 :     if ( aCompat.GetVersion() >= 3 )
     787             :     {
     788          28 :         sal_uInt8 bHasPolyFlags(0);
     789          28 :         rIStm.ReadUChar( bHasPolyFlags );
     790          28 :         if ( bHasPolyFlags )
     791           3 :             maPoly.Read( rIStm );
     792          28 :     }
     793          28 : }
     794             : 
     795        1340 : IMPL_META_ACTION( Polygon, META_POLYGON_ACTION )
     796             : 
     797         685 : MetaPolygonAction::MetaPolygonAction( const Polygon& rPoly ) :
     798             :     MetaAction  ( META_POLYGON_ACTION ),
     799         685 :     maPoly      ( rPoly )
     800             : {
     801         685 : }
     802             : 
     803           0 : void MetaPolygonAction::Execute( OutputDevice* pOut )
     804             : {
     805           0 :     pOut->DrawPolygon( maPoly );
     806           0 : }
     807             : 
     808           0 : MetaAction* MetaPolygonAction::Clone()
     809             : {
     810           0 :     MetaAction* pClone = (MetaAction*) new MetaPolygonAction( *this );
     811           0 :     pClone->ResetRefCount();
     812           0 :     return pClone;
     813             : }
     814             : 
     815           0 : void MetaPolygonAction::Move( long nHorzMove, long nVertMove )
     816             : {
     817           0 :     maPoly.Move( nHorzMove, nVertMove );
     818           0 : }
     819             : 
     820           0 : void MetaPolygonAction::Scale( double fScaleX, double fScaleY )
     821             : {
     822           0 :     ImplScalePoly( maPoly, fScaleX, fScaleY );
     823           0 : }
     824             : 
     825           0 : bool MetaPolygonAction::Compare( const MetaAction& rMetaAction ) const
     826             : {
     827           0 :     return maPoly.IsEqual(((MetaPolygonAction&)rMetaAction).maPoly );
     828             : }
     829             : 
     830        1503 : void MetaPolygonAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     831             : {
     832        1503 :     WRITE_BASE_COMPAT( rOStm, 2, pData );
     833             : 
     834        3006 :     Polygon aSimplePoly;                            // Version 1
     835        1503 :     maPoly.AdaptiveSubdivide( aSimplePoly );
     836        1503 :     WritePolygon( rOStm, aSimplePoly );
     837             : 
     838        1503 :     sal_uInt8 bHasPolyFlags = maPoly.HasFlags();    // Version 2
     839        1503 :     rOStm.WriteUChar( bHasPolyFlags );
     840        1503 :     if ( bHasPolyFlags )
     841        1515 :         maPoly.Write( rOStm );
     842        1503 : }
     843             : 
     844           0 : void MetaPolygonAction::Read( SvStream& rIStm, ImplMetaReadData* )
     845             : {
     846           0 :     COMPAT( rIStm );
     847             : 
     848           0 :     ReadPolygon( rIStm, maPoly );                    // Version 1
     849             : 
     850           0 :     if( aCompat.GetVersion() >= 2 )     // Version 2
     851             :     {
     852           0 :         sal_uInt8 bHasPolyFlags(0);
     853           0 :         rIStm.ReadUChar( bHasPolyFlags );
     854           0 :         if ( bHasPolyFlags )
     855           0 :             maPoly.Read( rIStm );
     856           0 :     }
     857           0 : }
     858             : 
     859        2663 : IMPL_META_ACTION( PolyPolygon, META_POLYPOLYGON_ACTION )
     860             : 
     861        1314 : MetaPolyPolygonAction::MetaPolyPolygonAction( const PolyPolygon& rPolyPoly ) :
     862             :     MetaAction  ( META_POLYPOLYGON_ACTION ),
     863        1314 :     maPolyPoly  ( rPolyPoly )
     864             : {
     865        1314 : }
     866             : 
     867         127 : void MetaPolyPolygonAction::Execute( OutputDevice* pOut )
     868             : {
     869         127 :     pOut->DrawPolyPolygon( maPolyPoly );
     870         127 : }
     871             : 
     872           0 : MetaAction* MetaPolyPolygonAction::Clone()
     873             : {
     874           0 :     MetaAction* pClone = (MetaAction*) new MetaPolyPolygonAction( *this );
     875           0 :     pClone->ResetRefCount();
     876           0 :     return pClone;
     877             : }
     878             : 
     879         407 : void MetaPolyPolygonAction::Move( long nHorzMove, long nVertMove )
     880             : {
     881         407 :     maPolyPoly.Move( nHorzMove, nVertMove );
     882         407 : }
     883             : 
     884           0 : void MetaPolyPolygonAction::Scale( double fScaleX, double fScaleY )
     885             : {
     886           0 :     for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
     887           0 :         ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
     888           0 : }
     889             : 
     890           0 : bool MetaPolyPolygonAction::Compare( const MetaAction& rMetaAction ) const
     891             : {
     892           0 :     return maPolyPoly.IsEqual(((MetaPolyPolygonAction&)rMetaAction).maPolyPoly );
     893             : }
     894             : 
     895         965 : void MetaPolyPolygonAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     896             : {
     897         965 :     WRITE_BASE_COMPAT( rOStm, 2, pData );
     898             : 
     899         965 :     sal_uInt16 nNumberOfComplexPolygons = 0;
     900         965 :     sal_uInt16 i, nPolyCount = maPolyPoly.Count();
     901             : 
     902        1930 :     Polygon aSimplePoly;                                // Version 1
     903         965 :     rOStm.WriteUInt16( nPolyCount );
     904        2405 :     for ( i = 0; i < nPolyCount; i++ )
     905             :     {
     906        1440 :         const Polygon& rPoly = maPolyPoly.GetObject( i );
     907        1440 :         if ( rPoly.HasFlags() )
     908          96 :             nNumberOfComplexPolygons++;
     909        1440 :         rPoly.AdaptiveSubdivide( aSimplePoly );
     910        1440 :         WritePolygon( rOStm, aSimplePoly );
     911             :     }
     912             : 
     913         965 :     rOStm.WriteUInt16( nNumberOfComplexPolygons );                  // Version 2
     914        1067 :     for ( i = 0; nNumberOfComplexPolygons && ( i < nPolyCount ); i++ )
     915             :     {
     916         102 :         const Polygon& rPoly = maPolyPoly.GetObject( i );
     917         102 :         if ( rPoly.HasFlags() )
     918             :         {
     919          96 :             rOStm.WriteUInt16( i );
     920          96 :             rPoly.Write( rOStm );
     921             : 
     922          96 :             nNumberOfComplexPolygons--;
     923             :         }
     924         965 :     }
     925         965 : }
     926             : 
     927          13 : void MetaPolyPolygonAction::Read( SvStream& rIStm, ImplMetaReadData* )
     928             : {
     929          13 :     COMPAT( rIStm );
     930          13 :     ReadPolyPolygon( rIStm, maPolyPoly );                // Version 1
     931             : 
     932          13 :     if ( aCompat.GetVersion() >= 2 )    // Version 2
     933             :     {
     934          13 :         sal_uInt16 nNumberOfComplexPolygons(0);
     935          13 :         rIStm.ReadUInt16( nNumberOfComplexPolygons );
     936          15 :         for (sal_uInt16 i = 0; i < nNumberOfComplexPolygons; ++i)
     937             :         {
     938           2 :             sal_uInt16 nIndex(0);
     939           2 :             rIStm.ReadUInt16( nIndex );
     940           2 :             Polygon aPoly;
     941           2 :             aPoly.Read( rIStm );
     942           2 :             maPolyPoly.Replace( aPoly, nIndex );
     943           2 :         }
     944          13 :     }
     945          13 : }
     946             : 
     947        6422 : IMPL_META_ACTION( Text, META_TEXT_ACTION )
     948             : 
     949        3211 : MetaTextAction::MetaTextAction( const Point& rPt, const OUString& rStr,
     950             :                                 sal_Int32 nIndex, sal_Int32 nLen ) :
     951             :     MetaAction  ( META_TEXT_ACTION ),
     952             :     maPt        ( rPt ),
     953             :     maStr       ( rStr ),
     954             :     mnIndex     ( nIndex ),
     955        3211 :     mnLen       ( nLen )
     956             : {
     957        3211 : }
     958             : 
     959        1871 : void MetaTextAction::Execute( OutputDevice* pOut )
     960             : {
     961        1871 :     pOut->DrawText( maPt, maStr, mnIndex, mnLen );
     962        1871 : }
     963             : 
     964           0 : MetaAction* MetaTextAction::Clone()
     965             : {
     966           0 :     MetaAction* pClone = (MetaAction*) new MetaTextAction( *this );
     967           0 :     pClone->ResetRefCount();
     968           0 :     return pClone;
     969             : }
     970             : 
     971           0 : void MetaTextAction::Move( long nHorzMove, long nVertMove )
     972             : {
     973           0 :     maPt.Move( nHorzMove, nVertMove );
     974           0 : }
     975             : 
     976           0 : void MetaTextAction::Scale( double fScaleX, double fScaleY )
     977             : {
     978           0 :     ImplScalePoint( maPt, fScaleX, fScaleY );
     979           0 : }
     980             : 
     981           0 : bool MetaTextAction::Compare( const MetaAction& rMetaAction ) const
     982             : {
     983           0 :     return ( maPt == ((MetaTextAction&)rMetaAction).maPt ) &&
     984           0 :            ( maStr == ((MetaTextAction&)rMetaAction).maStr ) &&
     985           0 :            ( mnIndex == ((MetaTextAction&)rMetaAction).mnIndex ) &&
     986           0 :            ( mnLen == ((MetaTextAction&)rMetaAction).mnLen );
     987             : }
     988             : 
     989        3089 : void MetaTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     990             : {
     991        3089 :     WRITE_BASE_COMPAT( rOStm, 2, pData );
     992        3089 :     WritePair( rOStm, maPt );
     993        3089 :     rOStm.WriteUniOrByteString( maStr, pData->meActualCharSet );
     994        3089 :     rOStm.WriteUInt16(mnIndex);
     995        3089 :     rOStm.WriteUInt16(mnLen);
     996             : 
     997        3089 :     write_uInt16_lenPrefixed_uInt16s_FromOUString(rOStm, maStr); // version 2
     998        3089 : }
     999             : 
    1000           0 : void MetaTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
    1001             : {
    1002           0 :     COMPAT( rIStm );
    1003           0 :     ReadPair( rIStm, maPt );
    1004           0 :     maStr = rIStm.ReadUniOrByteString(pData->meActualCharSet);
    1005           0 :     sal_uInt16 nTmpIndex(0);
    1006           0 :     rIStm.ReadUInt16(nTmpIndex);
    1007           0 :     mnIndex = nTmpIndex;
    1008           0 :     sal_uInt16 nTmpLen(0);
    1009           0 :     rIStm.ReadUInt16(nTmpLen);
    1010           0 :     mnLen = nTmpLen;
    1011             : 
    1012           0 :     if ( aCompat.GetVersion() >= 2 )                            // Version 2
    1013           0 :         maStr = read_uInt16_lenPrefixed_uInt16s_ToOUString(rIStm);
    1014           0 : }
    1015             : 
    1016          53 : MetaTextArrayAction::MetaTextArrayAction() :
    1017             :     MetaAction  ( META_TEXTARRAY_ACTION ),
    1018             :     mpDXAry     ( NULL ),
    1019             :     mnIndex     ( 0 ),
    1020          53 :     mnLen       ( 0 )
    1021             : {
    1022          53 : }
    1023             : 
    1024           0 : MetaTextArrayAction::MetaTextArrayAction( const MetaTextArrayAction& rAction ) :
    1025             :     MetaAction  ( META_TEXTARRAY_ACTION ),
    1026             :     maStartPt   ( rAction.maStartPt ),
    1027             :     maStr       ( rAction.maStr ),
    1028             :     mnIndex     ( rAction.mnIndex ),
    1029           0 :     mnLen       ( rAction.mnLen )
    1030             : {
    1031           0 :     if( rAction.mpDXAry )
    1032             :     {
    1033           0 :         const sal_uLong nAryLen = mnLen;
    1034             : 
    1035           0 :         mpDXAry = new sal_Int32[ nAryLen ];
    1036           0 :         memcpy( mpDXAry, rAction.mpDXAry, nAryLen * sizeof( sal_Int32 ) );
    1037             :     }
    1038             :     else
    1039           0 :         mpDXAry = NULL;
    1040           0 : }
    1041             : 
    1042        2374 : MetaTextArrayAction::MetaTextArrayAction( const Point& rStartPt,
    1043             :                                           const OUString& rStr,
    1044             :                                           const sal_Int32* pDXAry,
    1045             :                                           sal_Int32 nIndex,
    1046             :                                           sal_Int32 nLen ) :
    1047             :     MetaAction  ( META_TEXTARRAY_ACTION ),
    1048             :     maStartPt   ( rStartPt ),
    1049             :     maStr       ( rStr ),
    1050             :     mnIndex     ( nIndex ),
    1051        2374 :     mnLen       ( nLen )
    1052             : {
    1053        2374 :     const sal_uLong nAryLen = pDXAry ? mnLen : 0;
    1054             : 
    1055        2374 :     if( nAryLen )
    1056             :     {
    1057        2374 :         mpDXAry = new sal_Int32[ nAryLen ];
    1058        2374 :         memcpy( mpDXAry, pDXAry, nAryLen * sizeof( sal_Int32 ) );
    1059             :     }
    1060             :     else
    1061           0 :         mpDXAry = NULL;
    1062        2374 : }
    1063             : 
    1064        7239 : MetaTextArrayAction::~MetaTextArrayAction()
    1065             : {
    1066        2413 :     delete[] mpDXAry;
    1067        4826 : }
    1068             : 
    1069         712 : void MetaTextArrayAction::Execute( OutputDevice* pOut )
    1070             : {
    1071         712 :     pOut->DrawTextArray( maStartPt, maStr, mpDXAry, mnIndex, mnLen );
    1072         712 : }
    1073             : 
    1074           0 : MetaAction* MetaTextArrayAction::Clone()
    1075             : {
    1076           0 :     MetaAction* pClone = (MetaAction*) new MetaTextArrayAction( *this );
    1077           0 :     pClone->ResetRefCount();
    1078           0 :     return pClone;
    1079             : }
    1080             : 
    1081         349 : void MetaTextArrayAction::Move( long nHorzMove, long nVertMove )
    1082             : {
    1083         349 :     maStartPt.Move( nHorzMove, nVertMove );
    1084         349 : }
    1085             : 
    1086           0 : void MetaTextArrayAction::Scale( double fScaleX, double fScaleY )
    1087             : {
    1088           0 :     ImplScalePoint( maStartPt, fScaleX, fScaleY );
    1089             : 
    1090           0 :     if ( mpDXAry && mnLen )
    1091             :     {
    1092           0 :         for ( sal_uInt16 i = 0, nCount = mnLen; i < nCount; i++ )
    1093           0 :             mpDXAry[ i ] = FRound( mpDXAry[ i ] * fabs(fScaleX) );
    1094             :     }
    1095           0 : }
    1096             : 
    1097           0 : bool MetaTextArrayAction::Compare( const MetaAction& rMetaAction ) const
    1098             : {
    1099           0 :     return ( maStartPt == ((MetaTextArrayAction&)rMetaAction).maStartPt ) &&
    1100           0 :            ( maStr == ((MetaTextArrayAction&)rMetaAction).maStr ) &&
    1101           0 :            ( mnIndex == ((MetaTextArrayAction&)rMetaAction).mnIndex ) &&
    1102           0 :            ( mnLen == ((MetaTextArrayAction&)rMetaAction).mnLen ) &&
    1103           0 :            ( memcmp( mpDXAry, ((MetaTextArrayAction&)rMetaAction).mpDXAry, mnLen ) == 0 );
    1104             : }
    1105             : 
    1106        4934 : void MetaTextArrayAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    1107             : {
    1108        4934 :     const sal_Int32 nAryLen = mpDXAry ? mnLen : 0;
    1109             : 
    1110        4934 :     WRITE_BASE_COMPAT( rOStm, 2, pData );
    1111        4934 :     WritePair( rOStm, maStartPt );
    1112        4934 :     rOStm.WriteUniOrByteString( maStr, pData->meActualCharSet );
    1113        4934 :     rOStm.WriteUInt16(mnIndex);
    1114        4934 :     rOStm.WriteUInt16(mnLen);
    1115        4934 :     rOStm.WriteUInt16(nAryLen);
    1116             : 
    1117       31401 :     for (sal_Int32 i = 0; i < nAryLen; ++i)
    1118       26467 :         rOStm.WriteInt32( mpDXAry[ i ] );
    1119             : 
    1120        4934 :     write_uInt16_lenPrefixed_uInt16s_FromOUString(rOStm, maStr); // version 2
    1121        4934 : }
    1122             : 
    1123          53 : void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
    1124             : {
    1125             :     sal_Int32 nAryLen;
    1126             : 
    1127          53 :     delete[] mpDXAry;
    1128             : 
    1129          53 :     COMPAT( rIStm );
    1130          53 :     ReadPair( rIStm, maStartPt );
    1131          53 :     maStr = rIStm.ReadUniOrByteString(pData->meActualCharSet);
    1132          53 :     sal_uInt16 nTmpIndex(0);
    1133          53 :     rIStm.ReadUInt16(nTmpIndex);
    1134          53 :     mnIndex = nTmpIndex;
    1135          53 :     sal_uInt16 nTmpLen(0);
    1136          53 :     rIStm.ReadUInt16(nTmpLen);
    1137          53 :     mnLen = nTmpLen;
    1138          53 :     sal_uInt16 nTmpAryLen(0);
    1139          53 :     rIStm.ReadUInt16(nTmpAryLen);
    1140          53 :     nAryLen = nTmpAryLen;
    1141             : 
    1142          53 :     if ( mnIndex + mnLen > maStr.getLength() )
    1143             :     {
    1144           0 :         mnIndex = 0;
    1145           0 :         mpDXAry = 0;
    1146           0 :         return;
    1147             :     }
    1148             : 
    1149          53 :     if( nAryLen )
    1150             :     {
    1151             :         // #i9762#, #106172# Ensure that DX array is at least mnLen entries long
    1152          53 :         if ( mnLen >= nAryLen )
    1153             :         {
    1154          53 :             mpDXAry = new (std::nothrow)sal_Int32[ mnLen ];
    1155          53 :             if ( mpDXAry )
    1156             :             {
    1157             :                 sal_Int32 i;
    1158         133 :                 for( i = 0; i < nAryLen; i++ )
    1159          80 :                     rIStm.ReadInt32( mpDXAry[ i ] );
    1160             : 
    1161             :                 // #106172# setup remainder
    1162          53 :                 for( ; i < mnLen; i++ )
    1163           0 :                     mpDXAry[ i ] = 0;
    1164             :             }
    1165             :         }
    1166             :         else
    1167             :         {
    1168           0 :             mpDXAry = NULL;
    1169           0 :             return;
    1170             :         }
    1171             :     }
    1172             :     else
    1173           0 :         mpDXAry = NULL;
    1174             : 
    1175          53 :     if ( aCompat.GetVersion() >= 2 )                            // Version 2
    1176             :     {
    1177          53 :         maStr = read_uInt16_lenPrefixed_uInt16s_ToOUString(rIStm);
    1178             : 
    1179          53 :         if ( mnIndex + mnLen > maStr.getLength() )
    1180             :         {
    1181           6 :             mnIndex = 0;
    1182           6 :             delete[] mpDXAry, mpDXAry = NULL;
    1183             :         }
    1184          53 :     }
    1185             : }
    1186             : 
    1187      187817 : IMPL_META_ACTION( StretchText, META_STRETCHTEXT_ACTION )
    1188             : 
    1189       37564 : MetaStretchTextAction::MetaStretchTextAction( const Point& rPt, sal_uInt32 nWidth,
    1190             :                                               const OUString& rStr,
    1191             :                                               sal_Int32 nIndex, sal_Int32 nLen ) :
    1192             :     MetaAction  ( META_STRETCHTEXT_ACTION ),
    1193             :     maPt        ( rPt ),
    1194             :     maStr       ( rStr ),
    1195             :     mnWidth     ( nWidth ),
    1196             :     mnIndex     ( nIndex ),
    1197       37564 :     mnLen       ( nLen )
    1198             : {
    1199       37564 : }
    1200             : 
    1201         348 : void MetaStretchTextAction::Execute( OutputDevice* pOut )
    1202             : {
    1203         348 :     pOut->DrawStretchText( maPt, mnWidth, maStr, mnIndex, mnLen );
    1204         348 : }
    1205             : 
    1206           0 : MetaAction* MetaStretchTextAction::Clone()
    1207             : {
    1208           0 :     MetaAction* pClone = (MetaAction*) new MetaStretchTextAction( *this );
    1209           0 :     pClone->ResetRefCount();
    1210           0 :     return pClone;
    1211             : }
    1212             : 
    1213           0 : void MetaStretchTextAction::Move( long nHorzMove, long nVertMove )
    1214             : {
    1215           0 :     maPt.Move( nHorzMove, nVertMove );
    1216           0 : }
    1217             : 
    1218           0 : void MetaStretchTextAction::Scale( double fScaleX, double fScaleY )
    1219             : {
    1220           0 :     ImplScalePoint( maPt, fScaleX, fScaleY );
    1221           0 :     mnWidth = (sal_uLong)FRound( mnWidth * fabs(fScaleX) );
    1222           0 : }
    1223             : 
    1224           0 : bool MetaStretchTextAction::Compare( const MetaAction& rMetaAction ) const
    1225             : {
    1226           0 :     return ( maPt == ((MetaStretchTextAction&)rMetaAction).maPt ) &&
    1227           0 :            ( maStr == ((MetaStretchTextAction&)rMetaAction).maStr ) &&
    1228           0 :            ( mnWidth == ((MetaStretchTextAction&)rMetaAction).mnWidth ) &&
    1229           0 :            ( mnIndex == ((MetaStretchTextAction&)rMetaAction).mnIndex ) &&
    1230           0 :            ( mnLen == ((MetaStretchTextAction&)rMetaAction).mnLen );
    1231             : }
    1232             : 
    1233       37562 : void MetaStretchTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    1234             : {
    1235       37562 :     WRITE_BASE_COMPAT( rOStm, 2, pData );
    1236       37562 :     WritePair( rOStm, maPt );
    1237       37562 :     rOStm.WriteUniOrByteString( maStr, pData->meActualCharSet );
    1238       37562 :     rOStm.WriteUInt32( mnWidth );
    1239       37562 :     rOStm.WriteUInt16( mnIndex );
    1240       37562 :     rOStm.WriteUInt16( mnLen );
    1241             : 
    1242       37562 :     write_uInt16_lenPrefixed_uInt16s_FromOUString(rOStm, maStr); // version 2
    1243       37562 : }
    1244             : 
    1245       37563 : void MetaStretchTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
    1246             : {
    1247       37563 :     COMPAT( rIStm );
    1248       37563 :     ReadPair( rIStm, maPt );
    1249       37563 :     maStr = rIStm.ReadUniOrByteString(pData->meActualCharSet);
    1250       37563 :     rIStm.ReadUInt32( mnWidth );
    1251       37563 :     sal_uInt16 nTmpIndex(0);
    1252       37563 :     rIStm.ReadUInt16(nTmpIndex);
    1253       37563 :     mnIndex = nTmpIndex;
    1254       37563 :     sal_uInt16 nTmpLen(0);
    1255       37563 :     rIStm.ReadUInt16(nTmpLen);
    1256       37563 :     mnLen = nTmpLen;
    1257             : 
    1258       37563 :     if ( aCompat.GetVersion() >= 2 )                            // Version 2
    1259       37563 :         maStr = read_uInt16_lenPrefixed_uInt16s_ToOUString(rIStm);
    1260       37563 : }
    1261             : 
    1262        2044 : IMPL_META_ACTION( TextRect, META_TEXTRECT_ACTION )
    1263             : 
    1264        1022 : MetaTextRectAction::MetaTextRectAction( const Rectangle& rRect,
    1265             :                                         const OUString& rStr, sal_uInt16 nStyle ) :
    1266             :     MetaAction  ( META_TEXTRECT_ACTION ),
    1267             :     maRect      ( rRect ),
    1268             :     maStr       ( rStr ),
    1269        1022 :     mnStyle     ( nStyle )
    1270             : {
    1271        1022 : }
    1272             : 
    1273        1022 : void MetaTextRectAction::Execute( OutputDevice* pOut )
    1274             : {
    1275        1022 :     pOut->DrawText( maRect, maStr, mnStyle );
    1276        1022 : }
    1277             : 
    1278           0 : MetaAction* MetaTextRectAction::Clone()
    1279             : {
    1280           0 :     MetaAction* pClone = (MetaAction*) new MetaTextRectAction( *this );
    1281           0 :     pClone->ResetRefCount();
    1282           0 :     return pClone;
    1283             : }
    1284             : 
    1285           0 : void MetaTextRectAction::Move( long nHorzMove, long nVertMove )
    1286             : {
    1287           0 :     maRect.Move( nHorzMove, nVertMove );
    1288           0 : }
    1289             : 
    1290           0 : void MetaTextRectAction::Scale( double fScaleX, double fScaleY )
    1291             : {
    1292           0 :     ImplScaleRect( maRect, fScaleX, fScaleY );
    1293           0 : }
    1294             : 
    1295           0 : bool MetaTextRectAction::Compare( const MetaAction& rMetaAction ) const
    1296             : {
    1297           0 :     return ( maRect == ((MetaTextRectAction&)rMetaAction).maRect ) &&
    1298           0 :            ( maStr == ((MetaTextRectAction&)rMetaAction).maStr ) &&
    1299           0 :            ( mnStyle == ((MetaTextRectAction&)rMetaAction).mnStyle );
    1300             : }
    1301             : 
    1302           0 : void MetaTextRectAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    1303             : {
    1304           0 :     WRITE_BASE_COMPAT( rOStm, 2, pData );
    1305           0 :     WriteRectangle( rOStm, maRect );
    1306           0 :     rOStm.WriteUniOrByteString( maStr, pData->meActualCharSet );
    1307           0 :     rOStm.WriteUInt16( mnStyle );
    1308             : 
    1309           0 :     write_uInt16_lenPrefixed_uInt16s_FromOUString(rOStm, maStr); // version 2
    1310           0 : }
    1311             : 
    1312           0 : void MetaTextRectAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
    1313             : {
    1314           0 :     COMPAT( rIStm );
    1315           0 :     ReadRectangle( rIStm, maRect );
    1316           0 :     maStr = rIStm.ReadUniOrByteString(pData->meActualCharSet);
    1317           0 :     rIStm  .ReadUInt16( mnStyle );
    1318             : 
    1319           0 :     if ( aCompat.GetVersion() >= 2 )                            // Version 2
    1320           0 :         maStr = read_uInt16_lenPrefixed_uInt16s_ToOUString(rIStm);
    1321           0 : }
    1322             : 
    1323           0 : IMPL_META_ACTION( TextLine, META_TEXTLINE_ACTION )
    1324             : 
    1325           0 : MetaTextLineAction::MetaTextLineAction( const Point& rPos, long nWidth,
    1326             :                                         FontStrikeout eStrikeout,
    1327             :                                         FontUnderline eUnderline,
    1328             :                                         FontUnderline eOverline ) :
    1329             :     MetaAction  ( META_TEXTLINE_ACTION ),
    1330             :     maPos       ( rPos ),
    1331             :     mnWidth     ( nWidth ),
    1332             :     meStrikeout ( eStrikeout ),
    1333             :     meUnderline ( eUnderline ),
    1334           0 :     meOverline  ( eOverline )
    1335             : {
    1336           0 : }
    1337             : 
    1338           0 : void MetaTextLineAction::Execute( OutputDevice* pOut )
    1339             : {
    1340           0 :     pOut->DrawTextLine( maPos, mnWidth, meStrikeout, meUnderline, meOverline );
    1341           0 : }
    1342             : 
    1343           0 : MetaAction* MetaTextLineAction::Clone()
    1344             : {
    1345           0 :     MetaAction* pClone = (MetaAction*)new MetaTextLineAction( *this );
    1346           0 :     pClone->ResetRefCount();
    1347           0 :     return pClone;
    1348             : }
    1349             : 
    1350           0 : void MetaTextLineAction::Move( long nHorzMove, long nVertMove )
    1351             : {
    1352           0 :     maPos.Move( nHorzMove, nVertMove );
    1353           0 : }
    1354             : 
    1355           0 : void MetaTextLineAction::Scale( double fScaleX, double fScaleY )
    1356             : {
    1357           0 :     ImplScalePoint( maPos, fScaleX, fScaleY );
    1358           0 :     mnWidth = FRound( mnWidth * fabs(fScaleX) );
    1359           0 : }
    1360             : 
    1361           0 : bool MetaTextLineAction::Compare( const MetaAction& rMetaAction ) const
    1362             : {
    1363           0 :     return ( maPos == ((MetaTextLineAction&)rMetaAction).maPos ) &&
    1364           0 :            ( mnWidth == ((MetaTextLineAction&)rMetaAction).mnWidth ) &&
    1365           0 :            ( meStrikeout == ((MetaTextLineAction&)rMetaAction).meStrikeout ) &&
    1366           0 :            ( meUnderline == ((MetaTextLineAction&)rMetaAction).meUnderline ) &&
    1367           0 :            ( meOverline  == ((MetaTextLineAction&)rMetaAction).meOverline );
    1368             : }
    1369             : 
    1370           0 : void MetaTextLineAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    1371             : {
    1372           0 :     WRITE_BASE_COMPAT( rOStm, 2, pData );
    1373             : 
    1374             :     //#fdo39428 SvStream no longer supports operator<<(long)
    1375           0 :     WritePair( rOStm, maPos );
    1376           0 :     rOStm.WriteInt32( sal::static_int_cast<sal_Int32>(mnWidth) );
    1377           0 :     rOStm.WriteUInt32( static_cast<sal_uInt32>(meStrikeout) );
    1378           0 :     rOStm.WriteUInt32( static_cast<sal_uInt32>(meUnderline) );
    1379             :     // new in version 2
    1380           0 :     rOStm.WriteUInt32( static_cast<sal_uInt32>(meOverline) );
    1381           0 : }
    1382             : 
    1383           0 : void MetaTextLineAction::Read( SvStream& rIStm, ImplMetaReadData* )
    1384             : {
    1385           0 :     COMPAT( rIStm );
    1386             : 
    1387             :     //#fdo39428 SvStream no longer supports operator>>(long&)
    1388           0 :     sal_Int32 nTempWidth(0);
    1389           0 :     ReadPair( rIStm, maPos );
    1390           0 :     rIStm.ReadInt32( nTempWidth );
    1391           0 :     mnWidth = nTempWidth;
    1392           0 :     sal_uInt32 nTempStrikeout(0);
    1393           0 :     rIStm.ReadUInt32( nTempStrikeout );
    1394           0 :     meStrikeout = (FontStrikeout)nTempStrikeout;
    1395           0 :     sal_uInt32 nTempUnderline(0);
    1396           0 :     rIStm.ReadUInt32( nTempUnderline );
    1397           0 :     meUnderline = (FontUnderline)nTempUnderline;
    1398           0 :     if ( aCompat.GetVersion() >= 2 ) {
    1399           0 :         sal_uInt32 nTempUnderline2(0);
    1400           0 :         rIStm.ReadUInt32(nTempUnderline2);
    1401           0 :         meUnderline = (FontUnderline)nTempUnderline2;
    1402           0 :     }
    1403           0 : }
    1404             : 
    1405           0 : IMPL_META_ACTION( Bmp, META_BMP_ACTION )
    1406             : 
    1407           0 : MetaBmpAction::MetaBmpAction( const Point& rPt, const Bitmap& rBmp ) :
    1408             :     MetaAction  ( META_BMP_ACTION ),
    1409             :     maBmp       ( rBmp ),
    1410           0 :     maPt        ( rPt )
    1411             : {
    1412           0 : }
    1413             : 
    1414           0 : void MetaBmpAction::Execute( OutputDevice* pOut )
    1415             : {
    1416           0 :     pOut->DrawBitmap( maPt, maBmp );
    1417           0 : }
    1418             : 
    1419           0 : MetaAction* MetaBmpAction::Clone()
    1420             : {
    1421           0 :     MetaAction* pClone = (MetaAction*) new MetaBmpAction( *this );
    1422           0 :     pClone->ResetRefCount();
    1423           0 :     return pClone;
    1424             : }
    1425             : 
    1426           0 : void MetaBmpAction::Move( long nHorzMove, long nVertMove )
    1427             : {
    1428           0 :     maPt.Move( nHorzMove, nVertMove );
    1429           0 : }
    1430             : 
    1431           0 : void MetaBmpAction::Scale( double fScaleX, double fScaleY )
    1432             : {
    1433           0 :     ImplScalePoint( maPt, fScaleX, fScaleY );
    1434           0 : }
    1435             : 
    1436           0 : bool MetaBmpAction::Compare( const MetaAction& rMetaAction ) const
    1437             : {
    1438           0 :     return maBmp.IsEqual(((MetaBmpAction&)rMetaAction).maBmp ) &&
    1439           0 :            ( maPt == ((MetaBmpAction&)rMetaAction).maPt );
    1440             : }
    1441             : 
    1442           0 : void MetaBmpAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    1443             : {
    1444           0 :     if( !!maBmp )
    1445             :     {
    1446           0 :         WRITE_BASE_COMPAT( rOStm, 1, pData );
    1447           0 :         WriteDIB(maBmp, rOStm, false, true);
    1448           0 :         WritePair( rOStm, maPt );
    1449             :     }
    1450           0 : }
    1451             : 
    1452           0 : void MetaBmpAction::Read( SvStream& rIStm, ImplMetaReadData* )
    1453             : {
    1454           0 :     COMPAT( rIStm );
    1455           0 :     ReadDIB(maBmp, rIStm, true);
    1456           0 :     ReadPair( rIStm, maPt );
    1457           0 : }
    1458             : 
    1459        2020 : IMPL_META_ACTION( BmpScale, META_BMPSCALE_ACTION )
    1460             : 
    1461         506 : MetaBmpScaleAction::MetaBmpScaleAction( const Point& rPt, const Size& rSz,
    1462             :                                         const Bitmap& rBmp ) :
    1463             :     MetaAction  ( META_BMPSCALE_ACTION ),
    1464             :     maBmp       ( rBmp ),
    1465             :     maPt        ( rPt ),
    1466         506 :     maSz        ( rSz )
    1467             : {
    1468         506 : }
    1469             : 
    1470           6 : void MetaBmpScaleAction::Execute( OutputDevice* pOut )
    1471             : {
    1472           6 :     pOut->DrawBitmap( maPt, maSz, maBmp );
    1473           6 : }
    1474             : 
    1475           0 : MetaAction* MetaBmpScaleAction::Clone()
    1476             : {
    1477           0 :     MetaAction* pClone = (MetaAction*) new MetaBmpScaleAction( *this );
    1478           0 :     pClone->ResetRefCount();
    1479           0 :     return pClone;
    1480             : }
    1481             : 
    1482          59 : void MetaBmpScaleAction::Move( long nHorzMove, long nVertMove )
    1483             : {
    1484          59 :     maPt.Move( nHorzMove, nVertMove );
    1485          59 : }
    1486             : 
    1487           0 : void MetaBmpScaleAction::Scale( double fScaleX, double fScaleY )
    1488             : {
    1489           0 :     Rectangle aRectangle(maPt, maSz);
    1490           0 :     ImplScaleRect( aRectangle, fScaleX, fScaleY );
    1491           0 :     maPt = aRectangle.TopLeft();
    1492           0 :     maSz = aRectangle.GetSize();
    1493           0 : }
    1494             : 
    1495           0 : bool MetaBmpScaleAction::Compare( const MetaAction& rMetaAction ) const
    1496             : {
    1497           0 :     return ( maBmp.IsEqual(((MetaBmpScaleAction&)rMetaAction).maBmp )) &&
    1498           0 :            ( maPt == ((MetaBmpScaleAction&)rMetaAction).maPt ) &&
    1499           0 :            ( maSz == ((MetaBmpScaleAction&)rMetaAction).maSz );
    1500             : }
    1501             : 
    1502         344 : void MetaBmpScaleAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    1503             : {
    1504         344 :     if( !!maBmp )
    1505             :     {
    1506         344 :         WRITE_BASE_COMPAT( rOStm, 1, pData );
    1507         344 :         WriteDIB(maBmp, rOStm, false, true);
    1508         344 :         WritePair( rOStm, maPt );
    1509         344 :         WritePair( rOStm, maSz );
    1510             :     }
    1511         344 : }
    1512             : 
    1513         336 : void MetaBmpScaleAction::Read( SvStream& rIStm, ImplMetaReadData* )
    1514             : {
    1515         336 :     COMPAT( rIStm );
    1516         336 :     ReadDIB(maBmp, rIStm, true);
    1517         336 :     ReadPair( rIStm, maPt );
    1518         336 :     ReadPair( rIStm, maSz );
    1519         336 : }
    1520             : 
    1521           0 : IMPL_META_ACTION( BmpScalePart, META_BMPSCALEPART_ACTION )
    1522             : 
    1523           0 : MetaBmpScalePartAction::MetaBmpScalePartAction( const Point& rDstPt, const Size& rDstSz,
    1524             :                                                 const Point& rSrcPt, const Size& rSrcSz,
    1525             :                                                 const Bitmap& rBmp ) :
    1526             :     MetaAction  ( META_BMPSCALEPART_ACTION ),
    1527             :     maBmp       ( rBmp ),
    1528             :     maDstPt     ( rDstPt ),
    1529             :     maDstSz     ( rDstSz ),
    1530             :     maSrcPt     ( rSrcPt ),
    1531           0 :     maSrcSz     ( rSrcSz )
    1532             : {
    1533           0 : }
    1534             : 
    1535           0 : void MetaBmpScalePartAction::Execute( OutputDevice* pOut )
    1536             : {
    1537           0 :     pOut->DrawBitmap( maDstPt, maDstSz, maSrcPt, maSrcSz, maBmp );
    1538           0 : }
    1539             : 
    1540           0 : MetaAction* MetaBmpScalePartAction::Clone()
    1541             : {
    1542           0 :     MetaAction* pClone = (MetaAction*) new MetaBmpScalePartAction( *this );
    1543           0 :     pClone->ResetRefCount();
    1544           0 :     return pClone;
    1545             : }
    1546             : 
    1547           0 : void MetaBmpScalePartAction::Move( long nHorzMove, long nVertMove )
    1548             : {
    1549           0 :     maDstPt.Move( nHorzMove, nVertMove );
    1550           0 : }
    1551             : 
    1552           0 : void MetaBmpScalePartAction::Scale( double fScaleX, double fScaleY )
    1553             : {
    1554           0 :     Rectangle aRectangle(maDstPt, maDstSz);
    1555           0 :     ImplScaleRect( aRectangle, fScaleX, fScaleY );
    1556           0 :     maDstPt = aRectangle.TopLeft();
    1557           0 :     maDstSz = aRectangle.GetSize();
    1558           0 : }
    1559             : 
    1560           0 : bool MetaBmpScalePartAction::Compare( const MetaAction& rMetaAction ) const
    1561             : {
    1562           0 :     return ( maBmp.IsEqual(((MetaBmpScalePartAction&)rMetaAction).maBmp )) &&
    1563           0 :            ( maDstPt == ((MetaBmpScalePartAction&)rMetaAction).maDstPt ) &&
    1564           0 :            ( maDstSz == ((MetaBmpScalePartAction&)rMetaAction).maDstSz ) &&
    1565           0 :            ( maSrcPt == ((MetaBmpScalePartAction&)rMetaAction).maSrcPt ) &&
    1566           0 :            ( maSrcSz == ((MetaBmpScalePartAction&)rMetaAction).maSrcSz );
    1567             : }
    1568             : 
    1569           0 : void MetaBmpScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    1570             : {
    1571           0 :     if( !!maBmp )
    1572             :     {
    1573           0 :         WRITE_BASE_COMPAT( rOStm, 1, pData );
    1574           0 :         WriteDIB(maBmp, rOStm, false, true);
    1575           0 :         WritePair( rOStm, maDstPt );
    1576           0 :         WritePair( rOStm, maDstSz );
    1577           0 :         WritePair( rOStm, maSrcPt );
    1578           0 :         WritePair( rOStm, maSrcSz );
    1579             :     }
    1580           0 : }
    1581             : 
    1582           0 : void MetaBmpScalePartAction::Read( SvStream& rIStm, ImplMetaReadData* )
    1583             : {
    1584           0 :     COMPAT( rIStm );
    1585           0 :     ReadDIB(maBmp, rIStm, true);
    1586           0 :     ReadPair( rIStm, maDstPt );
    1587           0 :     ReadPair( rIStm, maDstSz );
    1588           0 :     ReadPair( rIStm, maSrcPt );
    1589           0 :     ReadPair( rIStm, maSrcSz );
    1590           0 : }
    1591             : 
    1592           4 : IMPL_META_ACTION( BmpEx, META_BMPEX_ACTION )
    1593             : 
    1594           2 : MetaBmpExAction::MetaBmpExAction( const Point& rPt, const BitmapEx& rBmpEx ) :
    1595             :     MetaAction  ( META_BMPEX_ACTION ),
    1596             :     maBmpEx     ( rBmpEx ),
    1597           2 :     maPt        ( rPt )
    1598             : {
    1599           2 : }
    1600             : 
    1601           0 : void MetaBmpExAction::Execute( OutputDevice* pOut )
    1602             : {
    1603           0 :     pOut->DrawBitmapEx( maPt, maBmpEx );
    1604           0 : }
    1605             : 
    1606           0 : MetaAction* MetaBmpExAction::Clone()
    1607             : {
    1608           0 :     MetaBmpExAction* pClone = new MetaBmpExAction( *this );
    1609           0 :     pClone->ResetRefCount();
    1610           0 :     return pClone;
    1611             : }
    1612             : 
    1613           2 : void MetaBmpExAction::Move( long nHorzMove, long nVertMove )
    1614             : {
    1615           2 :     maPt.Move( nHorzMove, nVertMove );
    1616           2 : }
    1617             : 
    1618           0 : void MetaBmpExAction::Scale( double fScaleX, double fScaleY )
    1619             : {
    1620           0 :     ImplScalePoint( maPt, fScaleX, fScaleY );
    1621           0 : }
    1622             : 
    1623           0 : bool MetaBmpExAction::Compare( const MetaAction& rMetaAction ) const
    1624             : {
    1625           0 :     return ( maBmpEx.IsEqual(((MetaBmpExAction&)rMetaAction).maBmpEx )) &&
    1626           0 :            ( maPt == ((MetaBmpExAction&)rMetaAction).maPt );
    1627             : }
    1628             : 
    1629           0 : void MetaBmpExAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    1630             : {
    1631           0 :     if( !!maBmpEx.GetBitmap() )
    1632             :     {
    1633           0 :         WRITE_BASE_COMPAT( rOStm, 1, pData );
    1634           0 :         WriteDIBBitmapEx(maBmpEx, rOStm);
    1635           0 :         WritePair( rOStm, maPt );
    1636             :     }
    1637           0 : }
    1638             : 
    1639           0 : void MetaBmpExAction::Read( SvStream& rIStm, ImplMetaReadData* )
    1640             : {
    1641           0 :     COMPAT( rIStm );
    1642           0 :     ReadDIBBitmapEx(maBmpEx, rIStm);
    1643           0 :     ReadPair( rIStm, maPt );
    1644           0 : }
    1645             : 
    1646          88 : IMPL_META_ACTION( BmpExScale, META_BMPEXSCALE_ACTION )
    1647             : 
    1648          44 : MetaBmpExScaleAction::MetaBmpExScaleAction( const Point& rPt, const Size& rSz,
    1649             :                                             const BitmapEx& rBmpEx ) :
    1650             :     MetaAction  ( META_BMPEXSCALE_ACTION ),
    1651             :     maBmpEx     ( rBmpEx ),
    1652             :     maPt        ( rPt ),
    1653          44 :     maSz        ( rSz )
    1654             : {
    1655          44 : }
    1656             : 
    1657          31 : void MetaBmpExScaleAction::Execute( OutputDevice* pOut )
    1658             : {
    1659          31 :     pOut->DrawBitmapEx( maPt, maSz, maBmpEx );
    1660          31 : }
    1661             : 
    1662           0 : MetaAction* MetaBmpExScaleAction::Clone()
    1663             : {
    1664           0 :     MetaAction* pClone = (MetaAction*) new MetaBmpExScaleAction( *this );
    1665           0 :     pClone->ResetRefCount();
    1666           0 :     return pClone;
    1667             : }
    1668             : 
    1669          21 : void MetaBmpExScaleAction::Move( long nHorzMove, long nVertMove )
    1670             : {
    1671          21 :     maPt.Move( nHorzMove, nVertMove );
    1672          21 : }
    1673             : 
    1674           0 : void MetaBmpExScaleAction::Scale( double fScaleX, double fScaleY )
    1675             : {
    1676           0 :     Rectangle aRectangle(maPt, maSz);
    1677           0 :     ImplScaleRect( aRectangle, fScaleX, fScaleY );
    1678           0 :     maPt = aRectangle.TopLeft();
    1679           0 :     maSz = aRectangle.GetSize();
    1680           0 : }
    1681             : 
    1682           0 : bool MetaBmpExScaleAction::Compare( const MetaAction& rMetaAction ) const
    1683             : {
    1684           0 :     return ( maBmpEx.IsEqual(((MetaBmpExScaleAction&)rMetaAction).maBmpEx )) &&
    1685           0 :            ( maPt == ((MetaBmpExScaleAction&)rMetaAction).maPt ) &&
    1686           0 :            ( maSz == ((MetaBmpExScaleAction&)rMetaAction).maSz );
    1687             : }
    1688             : 
    1689           4 : void MetaBmpExScaleAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    1690             : {
    1691           4 :     if( !!maBmpEx.GetBitmap() )
    1692             :     {
    1693           4 :         WRITE_BASE_COMPAT( rOStm, 1, pData );
    1694           4 :         WriteDIBBitmapEx(maBmpEx, rOStm);
    1695           4 :         WritePair( rOStm, maPt );
    1696           4 :         WritePair( rOStm, maSz );
    1697             :     }
    1698           4 : }
    1699             : 
    1700           0 : void MetaBmpExScaleAction::Read( SvStream& rIStm, ImplMetaReadData* )
    1701             : {
    1702           0 :     COMPAT( rIStm );
    1703           0 :     ReadDIBBitmapEx(maBmpEx, rIStm);
    1704           0 :     ReadPair( rIStm, maPt );
    1705           0 :     ReadPair( rIStm, maSz );
    1706           0 : }
    1707             : 
    1708         748 : IMPL_META_ACTION( BmpExScalePart, META_BMPEXSCALEPART_ACTION )
    1709             : 
    1710         374 : MetaBmpExScalePartAction::MetaBmpExScalePartAction( const Point& rDstPt, const Size& rDstSz,
    1711             :                                                     const Point& rSrcPt, const Size& rSrcSz,
    1712             :                                                     const BitmapEx& rBmpEx ) :
    1713             :     MetaAction  ( META_BMPEXSCALEPART_ACTION ),
    1714             :     maBmpEx     ( rBmpEx ),
    1715             :     maDstPt     ( rDstPt ),
    1716             :     maDstSz     ( rDstSz ),
    1717             :     maSrcPt     ( rSrcPt ),
    1718         374 :     maSrcSz     ( rSrcSz )
    1719             : {
    1720         374 : }
    1721             : 
    1722         374 : void MetaBmpExScalePartAction::Execute( OutputDevice* pOut )
    1723             : {
    1724         374 :     pOut->DrawBitmapEx( maDstPt, maDstSz, maSrcPt, maSrcSz, maBmpEx );
    1725         374 : }
    1726             : 
    1727           0 : MetaAction* MetaBmpExScalePartAction::Clone()
    1728             : {
    1729           0 :     MetaAction* pClone = (MetaAction*) new MetaBmpExScalePartAction( *this );
    1730           0 :     pClone->ResetRefCount();
    1731           0 :     return pClone;
    1732             : }
    1733             : 
    1734           0 : void MetaBmpExScalePartAction::Move( long nHorzMove, long nVertMove )
    1735             : {
    1736           0 :     maDstPt.Move( nHorzMove, nVertMove );
    1737           0 : }
    1738             : 
    1739           0 : void MetaBmpExScalePartAction::Scale( double fScaleX, double fScaleY )
    1740             : {
    1741           0 :     Rectangle aRectangle(maDstPt, maDstSz);
    1742           0 :     ImplScaleRect( aRectangle, fScaleX, fScaleY );
    1743           0 :     maDstPt = aRectangle.TopLeft();
    1744           0 :     maDstSz = aRectangle.GetSize();
    1745           0 : }
    1746             : 
    1747           0 : bool MetaBmpExScalePartAction::Compare( const MetaAction& rMetaAction ) const
    1748             : {
    1749           0 :     return ( maBmpEx.IsEqual(((MetaBmpExScalePartAction&)rMetaAction).maBmpEx )) &&
    1750           0 :            ( maDstPt == ((MetaBmpExScalePartAction&)rMetaAction).maDstPt ) &&
    1751           0 :            ( maDstSz == ((MetaBmpExScalePartAction&)rMetaAction).maDstSz ) &&
    1752           0 :            ( maSrcPt == ((MetaBmpExScalePartAction&)rMetaAction).maSrcPt ) &&
    1753           0 :            ( maSrcSz == ((MetaBmpExScalePartAction&)rMetaAction).maSrcSz );
    1754             : }
    1755             : 
    1756           0 : void MetaBmpExScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    1757             : {
    1758           0 :     if( !!maBmpEx.GetBitmap() )
    1759             :     {
    1760           0 :         WRITE_BASE_COMPAT( rOStm, 1, pData );
    1761           0 :         WriteDIBBitmapEx(maBmpEx, rOStm);
    1762           0 :         WritePair( rOStm, maDstPt );
    1763           0 :         WritePair( rOStm, maDstSz );
    1764           0 :         WritePair( rOStm, maSrcPt );
    1765           0 :         WritePair( rOStm, maSrcSz );
    1766             :     }
    1767           0 : }
    1768             : 
    1769           0 : void MetaBmpExScalePartAction::Read( SvStream& rIStm, ImplMetaReadData* )
    1770             : {
    1771           0 :     COMPAT( rIStm );
    1772           0 :     ReadDIBBitmapEx(maBmpEx, rIStm);
    1773           0 :     ReadPair( rIStm, maDstPt );
    1774           0 :     ReadPair( rIStm, maDstSz );
    1775           0 :     ReadPair( rIStm, maSrcPt );
    1776           0 :     ReadPair( rIStm, maSrcSz );
    1777           0 : }
    1778             : 
    1779           0 : IMPL_META_ACTION( Mask, META_MASK_ACTION )
    1780             : 
    1781           0 : MetaMaskAction::MetaMaskAction( const Point& rPt,
    1782             :                                 const Bitmap& rBmp,
    1783             :                                 const Color& rColor ) :
    1784             :     MetaAction  ( META_MASK_ACTION ),
    1785             :     maBmp       ( rBmp ),
    1786             :     maColor     ( rColor ),
    1787           0 :     maPt        ( rPt )
    1788             : {
    1789           0 : }
    1790             : 
    1791           0 : void MetaMaskAction::Execute( OutputDevice* pOut )
    1792             : {
    1793           0 :     pOut->DrawMask( maPt, maBmp, maColor );
    1794           0 : }
    1795             : 
    1796           0 : MetaAction* MetaMaskAction::Clone()
    1797             : {
    1798           0 :     MetaAction* pClone = (MetaAction*) new MetaMaskAction( *this );
    1799           0 :     pClone->ResetRefCount();
    1800           0 :     return pClone;
    1801             : }
    1802             : 
    1803           0 : void MetaMaskAction::Move( long nHorzMove, long nVertMove )
    1804             : {
    1805           0 :     maPt.Move( nHorzMove, nVertMove );
    1806           0 : }
    1807             : 
    1808           0 : void MetaMaskAction::Scale( double fScaleX, double fScaleY )
    1809             : {
    1810           0 :     ImplScalePoint( maPt, fScaleX, fScaleY );
    1811           0 : }
    1812             : 
    1813           0 : bool MetaMaskAction::Compare( const MetaAction& rMetaAction ) const
    1814             : {
    1815           0 :     return ( maBmp.IsEqual(((MetaMaskAction&)rMetaAction).maBmp )) &&
    1816           0 :            ( maColor == ((MetaMaskAction&)rMetaAction).maColor ) &&
    1817           0 :            ( maPt == ((MetaMaskAction&)rMetaAction).maPt );
    1818             : }
    1819             : 
    1820           0 : void MetaMaskAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    1821             : {
    1822           0 :     if( !!maBmp )
    1823             :     {
    1824           0 :         WRITE_BASE_COMPAT( rOStm, 1, pData );
    1825           0 :         WriteDIB(maBmp, rOStm, false, true);
    1826           0 :         WritePair( rOStm, maPt );
    1827             :     }
    1828           0 : }
    1829             : 
    1830           0 : void MetaMaskAction::Read( SvStream& rIStm, ImplMetaReadData* )
    1831             : {
    1832           0 :     COMPAT( rIStm );
    1833           0 :     ReadDIB(maBmp, rIStm, true);
    1834           0 :     ReadPair( rIStm, maPt );
    1835           0 : }
    1836             : 
    1837           0 : IMPL_META_ACTION( MaskScale, META_MASKSCALE_ACTION )
    1838             : 
    1839           0 : MetaMaskScaleAction::MetaMaskScaleAction( const Point& rPt, const Size& rSz,
    1840             :                                           const Bitmap& rBmp,
    1841             :                                           const Color& rColor ) :
    1842             :     MetaAction  ( META_MASKSCALE_ACTION ),
    1843             :     maBmp       ( rBmp ),
    1844             :     maColor     ( rColor ),
    1845             :     maPt        ( rPt ),
    1846           0 :     maSz        ( rSz )
    1847             : {
    1848           0 : }
    1849             : 
    1850           0 : void MetaMaskScaleAction::Execute( OutputDevice* pOut )
    1851             : {
    1852           0 :     pOut->DrawMask( maPt, maSz, maBmp, maColor );
    1853           0 : }
    1854             : 
    1855           0 : MetaAction* MetaMaskScaleAction::Clone()
    1856             : {
    1857           0 :     MetaAction* pClone = (MetaAction*) new MetaMaskScaleAction( *this );
    1858           0 :     pClone->ResetRefCount();
    1859           0 :     return pClone;
    1860             : }
    1861             : 
    1862           0 : void MetaMaskScaleAction::Move( long nHorzMove, long nVertMove )
    1863             : {
    1864           0 :     maPt.Move( nHorzMove, nVertMove );
    1865           0 : }
    1866             : 
    1867           0 : void MetaMaskScaleAction::Scale( double fScaleX, double fScaleY )
    1868             : {
    1869           0 :     Rectangle aRectangle(maPt, maSz);
    1870           0 :     ImplScaleRect( aRectangle, fScaleX, fScaleY );
    1871           0 :     maPt = aRectangle.TopLeft();
    1872           0 :     maSz = aRectangle.GetSize();
    1873           0 : }
    1874             : 
    1875           0 : bool MetaMaskScaleAction::Compare( const MetaAction& rMetaAction ) const
    1876             : {
    1877           0 :     return ( maBmp.IsEqual(((MetaMaskScaleAction&)rMetaAction).maBmp )) &&
    1878           0 :            ( maColor == ((MetaMaskScaleAction&)rMetaAction).maColor ) &&
    1879           0 :            ( maPt == ((MetaMaskScaleAction&)rMetaAction).maPt ) &&
    1880           0 :            ( maSz == ((MetaMaskScaleAction&)rMetaAction).maSz );
    1881             : }
    1882             : 
    1883           0 : void MetaMaskScaleAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    1884             : {
    1885           0 :     if( !!maBmp )
    1886             :     {
    1887           0 :         WRITE_BASE_COMPAT( rOStm, 1, pData );
    1888           0 :         WriteDIB(maBmp, rOStm, false, true);
    1889           0 :         WritePair( rOStm, maPt );
    1890           0 :         WritePair( rOStm, maSz );
    1891             :     }
    1892           0 : }
    1893             : 
    1894           0 : void MetaMaskScaleAction::Read( SvStream& rIStm, ImplMetaReadData* )
    1895             : {
    1896           0 :     COMPAT( rIStm );
    1897           0 :     ReadDIB(maBmp, rIStm, true);
    1898           0 :     ReadPair( rIStm, maPt );
    1899           0 :     ReadPair( rIStm, maSz );
    1900           0 : }
    1901             : 
    1902           0 : IMPL_META_ACTION( MaskScalePart, META_MASKSCALEPART_ACTION )
    1903             : 
    1904           0 : MetaMaskScalePartAction::MetaMaskScalePartAction( const Point& rDstPt, const Size& rDstSz,
    1905             :                                                   const Point& rSrcPt, const Size& rSrcSz,
    1906             :                                                   const Bitmap& rBmp,
    1907             :                                                   const Color& rColor ) :
    1908             :     MetaAction  ( META_MASKSCALEPART_ACTION ),
    1909             :     maBmp       ( rBmp ),
    1910             :     maColor     ( rColor ),
    1911             :     maDstPt     ( rDstPt ),
    1912             :     maDstSz     ( rDstSz ),
    1913             :     maSrcPt     ( rSrcPt ),
    1914           0 :     maSrcSz     ( rSrcSz )
    1915             : {
    1916           0 : }
    1917             : 
    1918           0 : void MetaMaskScalePartAction::Execute( OutputDevice* pOut )
    1919             : {
    1920           0 :     pOut->DrawMask( maDstPt, maDstSz, maSrcPt, maSrcSz, maBmp, maColor, META_MASKSCALE_ACTION );
    1921           0 : }
    1922             : 
    1923           0 : MetaAction* MetaMaskScalePartAction::Clone()
    1924             : {
    1925           0 :     MetaAction* pClone = (MetaAction*) new MetaMaskScalePartAction( *this );
    1926           0 :     pClone->ResetRefCount();
    1927           0 :     return pClone;
    1928             : }
    1929             : 
    1930           0 : void MetaMaskScalePartAction::Move( long nHorzMove, long nVertMove )
    1931             : {
    1932           0 :     maDstPt.Move( nHorzMove, nVertMove );
    1933           0 : }
    1934             : 
    1935           0 : void MetaMaskScalePartAction::Scale( double fScaleX, double fScaleY )
    1936             : {
    1937           0 :     Rectangle aRectangle(maDstPt, maDstSz);
    1938           0 :     ImplScaleRect( aRectangle, fScaleX, fScaleY );
    1939           0 :     maDstPt = aRectangle.TopLeft();
    1940           0 :     maDstSz = aRectangle.GetSize();
    1941           0 : }
    1942             : 
    1943           0 : bool MetaMaskScalePartAction::Compare( const MetaAction& rMetaAction ) const
    1944             : {
    1945           0 :     return ( maBmp.IsEqual(((MetaMaskScalePartAction&)rMetaAction).maBmp )) &&
    1946           0 :            ( maColor == ((MetaMaskScalePartAction&)rMetaAction).maColor ) &&
    1947           0 :            ( maDstPt == ((MetaMaskScalePartAction&)rMetaAction).maDstPt ) &&
    1948           0 :            ( maDstSz == ((MetaMaskScalePartAction&)rMetaAction).maDstSz ) &&
    1949           0 :            ( maSrcPt == ((MetaMaskScalePartAction&)rMetaAction).maSrcPt ) &&
    1950           0 :            ( maSrcSz == ((MetaMaskScalePartAction&)rMetaAction).maSrcSz );
    1951             : }
    1952             : 
    1953           0 : void MetaMaskScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    1954             : {
    1955           0 :     if( !!maBmp )
    1956             :     {
    1957           0 :         WRITE_BASE_COMPAT( rOStm, 1, pData );
    1958           0 :         WriteDIB(maBmp, rOStm, false, true);
    1959           0 :         maColor.Write( rOStm, true );
    1960           0 :         WritePair( rOStm, maDstPt );
    1961           0 :         WritePair( rOStm, maDstSz );
    1962           0 :         WritePair( rOStm, maSrcPt );
    1963           0 :         WritePair( rOStm, maSrcSz );
    1964             :     }
    1965           0 : }
    1966             : 
    1967           0 : void MetaMaskScalePartAction::Read( SvStream& rIStm, ImplMetaReadData* )
    1968             : {
    1969           0 :     COMPAT( rIStm );
    1970           0 :     ReadDIB(maBmp, rIStm, true);
    1971           0 :     maColor.Read( rIStm, true );
    1972           0 :     ReadPair( rIStm, maDstPt );
    1973           0 :     ReadPair( rIStm, maDstSz );
    1974           0 :     ReadPair( rIStm, maSrcPt );
    1975           0 :     ReadPair( rIStm, maSrcSz );
    1976           0 : }
    1977             : 
    1978          12 : IMPL_META_ACTION( Gradient, META_GRADIENT_ACTION )
    1979             : 
    1980           6 : MetaGradientAction::MetaGradientAction( const Rectangle& rRect, const Gradient& rGradient ) :
    1981             :     MetaAction  ( META_GRADIENT_ACTION ),
    1982             :     maRect      ( rRect ),
    1983           6 :     maGradient  ( rGradient )
    1984             : {
    1985           6 : }
    1986             : 
    1987           2 : void MetaGradientAction::Execute( OutputDevice* pOut )
    1988             : {
    1989           2 :     pOut->DrawGradient( maRect, maGradient );
    1990           2 : }
    1991             : 
    1992           0 : MetaAction* MetaGradientAction::Clone()
    1993             : {
    1994           0 :     MetaAction* pClone = (MetaAction*) new MetaGradientAction( *this );
    1995           0 :     pClone->ResetRefCount();
    1996           0 :     return pClone;
    1997             : }
    1998             : 
    1999           4 : void MetaGradientAction::Move( long nHorzMove, long nVertMove )
    2000             : {
    2001           4 :     maRect.Move( nHorzMove, nVertMove );
    2002           4 : }
    2003             : 
    2004           0 : void MetaGradientAction::Scale( double fScaleX, double fScaleY )
    2005             : {
    2006           0 :     ImplScaleRect( maRect, fScaleX, fScaleY );
    2007           0 : }
    2008             : 
    2009           0 : bool MetaGradientAction::Compare( const MetaAction& rMetaAction ) const
    2010             : {
    2011           0 :     return ( maRect == ((MetaGradientAction&)rMetaAction).maRect ) &&
    2012           0 :            ( maGradient == ((MetaGradientAction&)rMetaAction).maGradient );
    2013             : }
    2014             : 
    2015           0 : void MetaGradientAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2016             : {
    2017           0 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2018           0 :     WriteRectangle( rOStm, maRect );
    2019           0 :     WriteGradient( rOStm, maGradient );
    2020           0 : }
    2021             : 
    2022           0 : void MetaGradientAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2023             : {
    2024           0 :     COMPAT( rIStm );
    2025           0 :     ReadRectangle( rIStm, maRect );
    2026           0 :     ReadGradient( rIStm, maGradient );
    2027           0 : }
    2028             : 
    2029           0 : MetaGradientExAction::MetaGradientExAction() :
    2030           0 :     MetaAction  ( META_GRADIENTEX_ACTION )
    2031             : {
    2032           0 : }
    2033             : 
    2034           2 : MetaGradientExAction::MetaGradientExAction( const PolyPolygon& rPolyPoly, const Gradient& rGradient ) :
    2035             :     MetaAction  ( META_GRADIENTEX_ACTION ),
    2036             :     maPolyPoly  ( rPolyPoly ),
    2037           2 :     maGradient  ( rGradient )
    2038             : {
    2039           2 : }
    2040             : 
    2041           4 : MetaGradientExAction::~MetaGradientExAction()
    2042             : {
    2043           4 : }
    2044             : 
    2045           0 : void MetaGradientExAction::Execute( OutputDevice* pOut )
    2046             : {
    2047           0 :     if( pOut->GetConnectMetaFile() )
    2048             :     {
    2049           0 :         Duplicate();
    2050           0 :         pOut->GetConnectMetaFile()->AddAction( this );
    2051             :     }
    2052           0 : }
    2053             : 
    2054           0 : MetaAction* MetaGradientExAction::Clone()
    2055             : {
    2056           0 :     MetaAction* pClone = (MetaAction*) new MetaGradientExAction( *this );
    2057           0 :     pClone->ResetRefCount();
    2058           0 :     return pClone;
    2059             : }
    2060             : 
    2061           2 : void MetaGradientExAction::Move( long nHorzMove, long nVertMove )
    2062             : {
    2063           2 :     maPolyPoly.Move( nHorzMove, nVertMove );
    2064           2 : }
    2065             : 
    2066           0 : void MetaGradientExAction::Scale( double fScaleX, double fScaleY )
    2067             : {
    2068           0 :     for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
    2069           0 :         ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
    2070           0 : }
    2071             : 
    2072           0 : bool MetaGradientExAction::Compare( const MetaAction& rMetaAction ) const
    2073             : {
    2074           0 :     return ( maPolyPoly == ((MetaGradientExAction&)rMetaAction).maPolyPoly ) &&
    2075           0 :            ( maGradient == ((MetaGradientExAction&)rMetaAction).maGradient );
    2076             : }
    2077             : 
    2078           0 : void MetaGradientExAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2079             : {
    2080           0 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2081             : 
    2082             :     // #i105373# see comment at MetaTransparentAction::Write
    2083           0 :     PolyPolygon aNoCurvePolyPolygon;
    2084           0 :     maPolyPoly.AdaptiveSubdivide(aNoCurvePolyPolygon);
    2085             : 
    2086           0 :     WritePolyPolygon( rOStm, aNoCurvePolyPolygon );
    2087           0 :     WriteGradient( rOStm, maGradient );
    2088           0 : }
    2089             : 
    2090           0 : void MetaGradientExAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2091             : {
    2092           0 :     COMPAT( rIStm );
    2093           0 :     ReadPolyPolygon( rIStm, maPolyPoly );
    2094           0 :     ReadGradient( rIStm, maGradient );
    2095           0 : }
    2096             : 
    2097          30 : IMPL_META_ACTION( Hatch, META_HATCH_ACTION )
    2098             : 
    2099          15 : MetaHatchAction::MetaHatchAction( const PolyPolygon& rPolyPoly, const Hatch& rHatch ) :
    2100             :     MetaAction  ( META_HATCH_ACTION ),
    2101             :     maPolyPoly  ( rPolyPoly ),
    2102          15 :     maHatch     ( rHatch )
    2103             : {
    2104          15 : }
    2105             : 
    2106           0 : void MetaHatchAction::Execute( OutputDevice* pOut )
    2107             : {
    2108           0 :     pOut->DrawHatch( maPolyPoly, maHatch );
    2109           0 : }
    2110             : 
    2111           0 : MetaAction* MetaHatchAction::Clone()
    2112             : {
    2113           0 :     MetaAction* pClone = (MetaAction*) new MetaHatchAction( *this );
    2114           0 :     pClone->ResetRefCount();
    2115           0 :     return pClone;
    2116             : }
    2117             : 
    2118           0 : void MetaHatchAction::Move( long nHorzMove, long nVertMove )
    2119             : {
    2120           0 :     maPolyPoly.Move( nHorzMove, nVertMove );
    2121           0 : }
    2122             : 
    2123           0 : void MetaHatchAction::Scale( double fScaleX, double fScaleY )
    2124             : {
    2125           0 :     for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
    2126           0 :         ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
    2127           0 : }
    2128             : 
    2129           0 : bool MetaHatchAction::Compare( const MetaAction& rMetaAction ) const
    2130             : {
    2131           0 :     return ( maPolyPoly == ((MetaHatchAction&)rMetaAction).maPolyPoly ) &&
    2132           0 :            ( maHatch == ((MetaHatchAction&)rMetaAction).maHatch );
    2133             : }
    2134             : 
    2135          28 : void MetaHatchAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2136             : {
    2137          28 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2138             : 
    2139             :     // #i105373# see comment at MetaTransparentAction::Write
    2140          56 :     PolyPolygon aNoCurvePolyPolygon;
    2141          28 :     maPolyPoly.AdaptiveSubdivide(aNoCurvePolyPolygon);
    2142             : 
    2143          28 :     WritePolyPolygon( rOStm, aNoCurvePolyPolygon );
    2144          56 :     WriteHatch( rOStm, maHatch );
    2145          28 : }
    2146             : 
    2147           0 : void MetaHatchAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2148             : {
    2149           0 :     COMPAT( rIStm );
    2150           0 :     ReadPolyPolygon( rIStm, maPolyPoly );
    2151           0 :     ReadHatch( rIStm, maHatch );
    2152           0 : }
    2153             : 
    2154        4388 : IMPL_META_ACTION( Wallpaper, META_WALLPAPER_ACTION )
    2155             : 
    2156        2194 : MetaWallpaperAction::MetaWallpaperAction( const Rectangle& rRect,
    2157             :                                           const Wallpaper& rPaper ) :
    2158             :     MetaAction  ( META_WALLPAPER_ACTION ),
    2159             :     maRect      ( rRect ),
    2160        2194 :     maWallpaper ( rPaper )
    2161             : {
    2162        2194 : }
    2163             : 
    2164        2194 : void MetaWallpaperAction::Execute( OutputDevice* pOut )
    2165             : {
    2166        2194 :     pOut->DrawWallpaper( maRect, maWallpaper );
    2167        2194 : }
    2168             : 
    2169           0 : MetaAction* MetaWallpaperAction::Clone()
    2170             : {
    2171           0 :     MetaAction* pClone = (MetaAction*) new MetaWallpaperAction( *this );
    2172           0 :     pClone->ResetRefCount();
    2173           0 :     return pClone;
    2174             : }
    2175             : 
    2176           0 : void MetaWallpaperAction::Move( long nHorzMove, long nVertMove )
    2177             : {
    2178           0 :     maRect.Move( nHorzMove, nVertMove );
    2179           0 : }
    2180             : 
    2181           0 : void MetaWallpaperAction::Scale( double fScaleX, double fScaleY )
    2182             : {
    2183           0 :     ImplScaleRect( maRect, fScaleX, fScaleY );
    2184           0 : }
    2185             : 
    2186           0 : bool MetaWallpaperAction::Compare( const MetaAction& rMetaAction ) const
    2187             : {
    2188           0 :     return ( maRect == ((MetaWallpaperAction&)rMetaAction).maRect ) &&
    2189           0 :            ( maWallpaper == ((MetaWallpaperAction&)rMetaAction).maWallpaper );
    2190             : }
    2191             : 
    2192           0 : void MetaWallpaperAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2193             : {
    2194           0 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2195           0 :     WriteWallpaper( rOStm, maWallpaper );
    2196           0 : }
    2197             : 
    2198           0 : void MetaWallpaperAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2199             : {
    2200           0 :     COMPAT( rIStm );
    2201           0 :     ReadWallpaper( rIStm, maWallpaper );
    2202           0 : }
    2203             : 
    2204       15945 : IMPL_META_ACTION( ClipRegion, META_CLIPREGION_ACTION )
    2205             : 
    2206        7971 : MetaClipRegionAction::MetaClipRegionAction( const Region& rRegion, bool bClip ) :
    2207             :     MetaAction  ( META_CLIPREGION_ACTION ),
    2208             :     maRegion    ( rRegion ),
    2209        7971 :     mbClip      ( bClip )
    2210             : {
    2211        7971 : }
    2212             : 
    2213        7814 : void MetaClipRegionAction::Execute( OutputDevice* pOut )
    2214             : {
    2215        7814 :     if( mbClip )
    2216        7785 :         pOut->SetClipRegion( maRegion );
    2217             :     else
    2218          29 :         pOut->SetClipRegion();
    2219        7814 : }
    2220             : 
    2221           0 : MetaAction* MetaClipRegionAction::Clone()
    2222             : {
    2223           0 :     MetaAction* pClone = (MetaAction*) new MetaClipRegionAction( *this );
    2224           0 :     pClone->ResetRefCount();
    2225           0 :     return pClone;
    2226             : }
    2227             : 
    2228           4 : void MetaClipRegionAction::Move( long nHorzMove, long nVertMove )
    2229             : {
    2230           4 :     maRegion.Move( nHorzMove, nVertMove );
    2231           4 : }
    2232             : 
    2233           0 : void MetaClipRegionAction::Scale( double fScaleX, double fScaleY )
    2234             : {
    2235           0 :     maRegion.Scale( fScaleX, fScaleY );
    2236           0 : }
    2237             : 
    2238           0 : bool MetaClipRegionAction::Compare( const MetaAction& rMetaAction ) const
    2239             : {
    2240           0 :     return ( maRegion == ((MetaClipRegionAction&)rMetaAction).maRegion ) &&
    2241           0 :            ( mbClip == ((MetaClipRegionAction&)rMetaAction).mbClip );
    2242             : }
    2243             : 
    2244         293 : void MetaClipRegionAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2245             : {
    2246         293 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2247         293 :     WriteRegion( rOStm, maRegion );
    2248         293 :     rOStm.WriteUChar( mbClip );
    2249         293 : }
    2250             : 
    2251           1 : void MetaClipRegionAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2252             : {
    2253           1 :     COMPAT( rIStm );
    2254           1 :     ReadRegion( rIStm, maRegion );
    2255           1 :     rIStm.ReadCharAsBool( mbClip );
    2256           1 : }
    2257             : 
    2258       26729 : IMPL_META_ACTION( ISectRectClipRegion, META_ISECTRECTCLIPREGION_ACTION )
    2259             : 
    2260        5858 : MetaISectRectClipRegionAction::MetaISectRectClipRegionAction( const Rectangle& rRect ) :
    2261             :     MetaAction  ( META_ISECTRECTCLIPREGION_ACTION ),
    2262        5858 :     maRect      ( rRect )
    2263             : {
    2264        5858 : }
    2265             : 
    2266         778 : void MetaISectRectClipRegionAction::Execute( OutputDevice* pOut )
    2267             : {
    2268         778 :     pOut->IntersectClipRegion( maRect );
    2269         778 : }
    2270             : 
    2271           0 : MetaAction* MetaISectRectClipRegionAction::Clone()
    2272             : {
    2273           0 :     MetaAction* pClone = (MetaAction*) new MetaISectRectClipRegionAction( *this );
    2274           0 :     pClone->ResetRefCount();
    2275           0 :     return pClone;
    2276             : }
    2277             : 
    2278          13 : void MetaISectRectClipRegionAction::Move( long nHorzMove, long nVertMove )
    2279             : {
    2280          13 :     maRect.Move( nHorzMove, nVertMove );
    2281          13 : }
    2282             : 
    2283           0 : void MetaISectRectClipRegionAction::Scale( double fScaleX, double fScaleY )
    2284             : {
    2285           0 :     ImplScaleRect( maRect, fScaleX, fScaleY );
    2286           0 : }
    2287             : 
    2288           0 : bool MetaISectRectClipRegionAction::Compare( const MetaAction& rMetaAction ) const
    2289             : {
    2290           0 :     return maRect == ((MetaISectRectClipRegionAction&)rMetaAction).maRect;
    2291             : }
    2292             : 
    2293        5591 : void MetaISectRectClipRegionAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2294             : {
    2295        5591 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2296        5591 :     WriteRectangle( rOStm, maRect );
    2297        5591 : }
    2298             : 
    2299        5005 : void MetaISectRectClipRegionAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2300             : {
    2301        5005 :     COMPAT( rIStm );
    2302        5005 :     ReadRectangle( rIStm, maRect );
    2303        5005 : }
    2304             : 
    2305        3078 : IMPL_META_ACTION( ISectRegionClipRegion, META_ISECTREGIONCLIPREGION_ACTION )
    2306             : 
    2307         867 : MetaISectRegionClipRegionAction::MetaISectRegionClipRegionAction( const Region& rRegion ) :
    2308             :     MetaAction  ( META_ISECTREGIONCLIPREGION_ACTION ),
    2309         867 :     maRegion    ( rRegion )
    2310             : {
    2311         867 : }
    2312             : 
    2313         447 : void MetaISectRegionClipRegionAction::Execute( OutputDevice* pOut )
    2314             : {
    2315         447 :     pOut->IntersectClipRegion( maRegion );
    2316         447 : }
    2317             : 
    2318           0 : MetaAction* MetaISectRegionClipRegionAction::Clone()
    2319             : {
    2320           0 :     MetaAction* pClone = (MetaAction*) new MetaISectRegionClipRegionAction( *this );
    2321           0 :     pClone->ResetRefCount();
    2322           0 :     return pClone;
    2323             : }
    2324             : 
    2325           0 : void MetaISectRegionClipRegionAction::Move( long nHorzMove, long nVertMove )
    2326             : {
    2327           0 :     maRegion.Move( nHorzMove, nVertMove );
    2328           0 : }
    2329             : 
    2330           0 : void MetaISectRegionClipRegionAction::Scale( double fScaleX, double fScaleY )
    2331             : {
    2332           0 :     maRegion.Scale( fScaleX, fScaleY );
    2333           0 : }
    2334             : 
    2335           0 : bool MetaISectRegionClipRegionAction::Compare( const MetaAction& rMetaAction ) const
    2336             : {
    2337           0 :     return maRegion == ((MetaISectRegionClipRegionAction&)rMetaAction).maRegion;
    2338             : }
    2339             : 
    2340         456 : void MetaISectRegionClipRegionAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2341             : {
    2342         456 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2343         456 :     WriteRegion( rOStm, maRegion );
    2344         456 : }
    2345             : 
    2346         448 : void MetaISectRegionClipRegionAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2347             : {
    2348         448 :     COMPAT( rIStm );
    2349         448 :     ReadRegion( rIStm, maRegion );
    2350         448 : }
    2351             : 
    2352           0 : IMPL_META_ACTION( MoveClipRegion, META_MOVECLIPREGION_ACTION )
    2353             : 
    2354           0 : MetaMoveClipRegionAction::MetaMoveClipRegionAction( long nHorzMove, long nVertMove ) :
    2355             :     MetaAction  ( META_MOVECLIPREGION_ACTION ),
    2356             :     mnHorzMove  ( nHorzMove ),
    2357           0 :     mnVertMove  ( nVertMove )
    2358             : {
    2359           0 : }
    2360             : 
    2361           0 : void MetaMoveClipRegionAction::Execute( OutputDevice* pOut )
    2362             : {
    2363           0 :     pOut->MoveClipRegion( mnHorzMove, mnVertMove );
    2364           0 : }
    2365             : 
    2366           0 : MetaAction* MetaMoveClipRegionAction::Clone()
    2367             : {
    2368           0 :     MetaAction* pClone = (MetaAction*) new MetaMoveClipRegionAction( *this );
    2369           0 :     pClone->ResetRefCount();
    2370           0 :     return pClone;
    2371             : }
    2372             : 
    2373           0 : void MetaMoveClipRegionAction::Scale( double fScaleX, double fScaleY )
    2374             : {
    2375           0 :     mnHorzMove = FRound( mnHorzMove * fScaleX );
    2376           0 :     mnVertMove = FRound( mnVertMove * fScaleY );
    2377           0 : }
    2378             : 
    2379           0 : bool MetaMoveClipRegionAction::Compare( const MetaAction& rMetaAction ) const
    2380             : {
    2381           0 :     return ( mnHorzMove == ((MetaMoveClipRegionAction&)rMetaAction).mnHorzMove ) &&
    2382           0 :            ( mnVertMove == ((MetaMoveClipRegionAction&)rMetaAction).mnVertMove );
    2383             : }
    2384             : 
    2385           0 : void MetaMoveClipRegionAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2386             : {
    2387           0 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2388             :     //#fdo39428 SvStream no longer supports operator<<(long)
    2389           0 :     rOStm.WriteInt32( sal::static_int_cast<sal_Int32>(mnHorzMove) ).WriteInt32( sal::static_int_cast<sal_Int32>(mnVertMove) );
    2390           0 : }
    2391             : 
    2392           0 : void MetaMoveClipRegionAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2393             : {
    2394           0 :     COMPAT( rIStm );
    2395             :     //#fdo39428 SvStream no longer supports operator>>(long&)
    2396           0 :     sal_Int32 nTmpHM(0), nTmpVM(0);
    2397           0 :     rIStm.ReadInt32( nTmpHM ).ReadInt32( nTmpVM );
    2398           0 :     mnHorzMove = nTmpHM;
    2399           0 :     mnVertMove = nTmpVM;
    2400           0 : }
    2401             : 
    2402      104600 : IMPL_META_ACTION( LineColor, META_LINECOLOR_ACTION )
    2403             : 
    2404       49266 : MetaLineColorAction::MetaLineColorAction( const Color& rColor, bool bSet ) :
    2405             :     MetaAction  ( META_LINECOLOR_ACTION ),
    2406             :     maColor     ( rColor ),
    2407       49266 :     mbSet       ( bSet )
    2408             : {
    2409       49266 : }
    2410             : 
    2411       43219 : void MetaLineColorAction::Execute( OutputDevice* pOut )
    2412             : {
    2413       43219 :     if( mbSet )
    2414       35300 :         pOut->SetLineColor( maColor );
    2415             :     else
    2416        7919 :         pOut->SetLineColor();
    2417       43219 : }
    2418             : 
    2419           0 : MetaAction* MetaLineColorAction::Clone()
    2420             : {
    2421           0 :     MetaAction* pClone = (MetaAction*) new MetaLineColorAction( *this );
    2422           0 :     pClone->ResetRefCount();
    2423           0 :     return pClone;
    2424             : }
    2425             : 
    2426           0 : bool MetaLineColorAction::Compare( const MetaAction& rMetaAction ) const
    2427             : {
    2428           0 :     return ( maColor == ((MetaLineColorAction&)rMetaAction).maColor ) &&
    2429           0 :            ( mbSet == ((MetaLineColorAction&)rMetaAction).mbSet );
    2430             : }
    2431             : 
    2432        8874 : void MetaLineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2433             : {
    2434        8874 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2435        8874 :     maColor.Write( rOStm, true );
    2436        8874 :     rOStm.WriteUChar( mbSet );
    2437        8874 : }
    2438             : 
    2439        2028 : void MetaLineColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2440             : {
    2441        2028 :     COMPAT( rIStm );
    2442        2028 :     maColor.Read( rIStm, true );
    2443        2028 :     rIStm.ReadCharAsBool( mbSet );
    2444        2028 : }
    2445             : 
    2446       77264 : IMPL_META_ACTION( FillColor, META_FILLCOLOR_ACTION )
    2447             : 
    2448       35642 : MetaFillColorAction::MetaFillColorAction( const Color& rColor, bool bSet ) :
    2449             :     MetaAction  ( META_FILLCOLOR_ACTION ),
    2450             :     maColor     ( rColor ),
    2451       35642 :     mbSet       ( bSet )
    2452             : {
    2453       35642 : }
    2454             : 
    2455       31014 : void MetaFillColorAction::Execute( OutputDevice* pOut )
    2456             : {
    2457       31014 :     if( mbSet )
    2458       28737 :         pOut->SetFillColor( maColor );
    2459             :     else
    2460        2277 :         pOut->SetFillColor();
    2461       31014 : }
    2462             : 
    2463           0 : MetaAction* MetaFillColorAction::Clone()
    2464             : {
    2465           0 :     MetaAction* pClone = (MetaAction*) new MetaFillColorAction( *this );
    2466           0 :     pClone->ResetRefCount();
    2467           0 :     return pClone;
    2468             : }
    2469             : 
    2470           0 : bool MetaFillColorAction::Compare( const MetaAction& rMetaAction ) const
    2471             : {
    2472           0 :     return ( maColor == ((MetaFillColorAction&)rMetaAction).maColor ) &&
    2473           0 :            ( mbSet == ((MetaFillColorAction&)rMetaAction).mbSet );
    2474             : }
    2475             : 
    2476        6308 : void MetaFillColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2477             : {
    2478        6308 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2479        6308 :     maColor.Write( rOStm, true );
    2480        6308 :     rOStm.WriteUChar( mbSet );
    2481        6308 : }
    2482             : 
    2483        2000 : void MetaFillColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2484             : {
    2485        2000 :     COMPAT( rIStm );
    2486        2000 :     maColor.Read( rIStm, true );
    2487        2000 :     rIStm.ReadCharAsBool( mbSet );
    2488        2000 : }
    2489             : 
    2490      223839 : IMPL_META_ACTION( TextColor, META_TEXTCOLOR_ACTION )
    2491             : 
    2492       51532 : MetaTextColorAction::MetaTextColorAction( const Color& rColor ) :
    2493             :     MetaAction  ( META_TEXTCOLOR_ACTION ),
    2494       51532 :     maColor     ( rColor )
    2495             : {
    2496       51532 : }
    2497             : 
    2498       11556 : void MetaTextColorAction::Execute( OutputDevice* pOut )
    2499             : {
    2500       11556 :     pOut->SetTextColor( maColor );
    2501       11556 : }
    2502             : 
    2503           0 : MetaAction* MetaTextColorAction::Clone()
    2504             : {
    2505           0 :     MetaAction* pClone = (MetaAction*) new MetaTextColorAction( *this );
    2506           0 :     pClone->ResetRefCount();
    2507           0 :     return pClone;
    2508             : }
    2509             : 
    2510           0 : bool MetaTextColorAction::Compare( const MetaAction& rMetaAction ) const
    2511             : {
    2512           0 :     return maColor == ((MetaTextColorAction&)rMetaAction).maColor;
    2513             : }
    2514             : 
    2515       41127 : void MetaTextColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2516             : {
    2517       41127 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2518       41127 :     maColor.Write( rOStm, true );
    2519       41127 : }
    2520             : 
    2521       40259 : void MetaTextColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2522             : {
    2523       40259 :     COMPAT( rIStm );
    2524       40259 :     maColor.Read( rIStm, true );
    2525       40259 : }
    2526             : 
    2527      237250 : IMPL_META_ACTION( TextFillColor, META_TEXTFILLCOLOR_ACTION )
    2528             : 
    2529       59263 : MetaTextFillColorAction::MetaTextFillColorAction( const Color& rColor, bool bSet ) :
    2530             :     MetaAction  ( META_TEXTFILLCOLOR_ACTION ),
    2531             :     maColor     ( rColor ),
    2532       59263 :     mbSet       ( bSet )
    2533             : {
    2534       59263 : }
    2535             : 
    2536       19458 : void MetaTextFillColorAction::Execute( OutputDevice* pOut )
    2537             : {
    2538       19458 :     if( mbSet )
    2539        2032 :         pOut->SetTextFillColor( maColor );
    2540             :     else
    2541       17426 :         pOut->SetTextFillColor();
    2542       19458 : }
    2543             : 
    2544           0 : MetaAction* MetaTextFillColorAction::Clone()
    2545             : {
    2546           0 :     MetaAction* pClone = (MetaAction*) new MetaTextFillColorAction( *this );
    2547           0 :     pClone->ResetRefCount();
    2548           0 :     return pClone;
    2549             : }
    2550             : 
    2551           0 : bool MetaTextFillColorAction::Compare( const MetaAction& rMetaAction ) const
    2552             : {
    2553           0 :     return ( maColor == ((MetaTextFillColorAction&)rMetaAction).maColor ) &&
    2554           0 :            ( mbSet == ((MetaTextFillColorAction&)rMetaAction).mbSet );
    2555             : }
    2556             : 
    2557       41930 : void MetaTextFillColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2558             : {
    2559       41930 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2560       41930 :     maColor.Write( rOStm, true );
    2561       41930 :     rOStm.WriteUChar( mbSet );
    2562       41930 : }
    2563             : 
    2564       39576 : void MetaTextFillColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2565             : {
    2566       39576 :     COMPAT( rIStm );
    2567       39576 :     maColor.Read( rIStm, true );
    2568       39576 :     rIStm.ReadCharAsBool( mbSet );
    2569       39576 : }
    2570             : 
    2571       15284 : IMPL_META_ACTION( TextLineColor, META_TEXTLINECOLOR_ACTION )
    2572             : 
    2573        7639 : MetaTextLineColorAction::MetaTextLineColorAction( const Color& rColor, bool bSet ) :
    2574             :     MetaAction  ( META_TEXTLINECOLOR_ACTION ),
    2575             :     maColor     ( rColor ),
    2576        7639 :     mbSet       ( bSet )
    2577             : {
    2578        7639 : }
    2579             : 
    2580        7639 : void MetaTextLineColorAction::Execute( OutputDevice* pOut )
    2581             : {
    2582        7639 :     if( mbSet )
    2583           4 :         pOut->SetTextLineColor( maColor );
    2584             :     else
    2585        7635 :         pOut->SetTextLineColor();
    2586        7639 : }
    2587             : 
    2588           0 : MetaAction* MetaTextLineColorAction::Clone()
    2589             : {
    2590           0 :     MetaAction* pClone = (MetaAction*) new MetaTextLineColorAction( *this );
    2591           0 :     pClone->ResetRefCount();
    2592           0 :     return pClone;
    2593             : }
    2594             : 
    2595           0 : bool MetaTextLineColorAction::Compare( const MetaAction& rMetaAction ) const
    2596             : {
    2597           0 :     return ( maColor == ((MetaTextLineColorAction&)rMetaAction).maColor ) &&
    2598           0 :            ( mbSet == ((MetaTextLineColorAction&)rMetaAction).mbSet );
    2599             : }
    2600             : 
    2601           4 : void MetaTextLineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2602             : {
    2603           4 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2604           4 :     maColor.Write( rOStm, true );
    2605           4 :     rOStm.WriteUChar( mbSet );
    2606           4 : }
    2607             : 
    2608           2 : void MetaTextLineColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2609             : {
    2610           2 :     COMPAT( rIStm );
    2611           2 :     maColor.Read( rIStm, true );
    2612           2 :     rIStm.ReadCharAsBool( mbSet );
    2613           2 : }
    2614             : 
    2615       15284 : IMPL_META_ACTION( OverlineColor, META_OVERLINECOLOR_ACTION )
    2616             : 
    2617        7639 : MetaOverlineColorAction::MetaOverlineColorAction( const Color& rColor, bool bSet ) :
    2618             :     MetaAction  ( META_OVERLINECOLOR_ACTION ),
    2619             :     maColor     ( rColor ),
    2620        7639 :     mbSet       ( bSet )
    2621             : {
    2622        7639 : }
    2623             : 
    2624        7639 : void MetaOverlineColorAction::Execute( OutputDevice* pOut )
    2625             : {
    2626        7639 :     if( mbSet )
    2627           4 :         pOut->SetOverlineColor( maColor );
    2628             :     else
    2629        7635 :         pOut->SetOverlineColor();
    2630        7639 : }
    2631             : 
    2632           0 : MetaAction* MetaOverlineColorAction::Clone()
    2633             : {
    2634           0 :     MetaAction* pClone = (MetaAction*) new MetaOverlineColorAction( *this );
    2635           0 :     pClone->ResetRefCount();
    2636           0 :     return pClone;
    2637             : }
    2638             : 
    2639           0 : bool MetaOverlineColorAction::Compare( const MetaAction& rMetaAction ) const
    2640             : {
    2641           0 :     return ( maColor == ((MetaOverlineColorAction&)rMetaAction).maColor ) &&
    2642           0 :            ( mbSet == ((MetaOverlineColorAction&)rMetaAction).mbSet );
    2643             : }
    2644             : 
    2645           4 : void MetaOverlineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2646             : {
    2647           4 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2648           4 :     maColor.Write( rOStm, true );
    2649           4 :     rOStm.WriteUChar( mbSet );
    2650           4 : }
    2651             : 
    2652           2 : void MetaOverlineColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2653             : {
    2654           2 :     COMPAT( rIStm );
    2655           2 :     maColor.Read( rIStm, true );
    2656           2 :     rIStm.ReadCharAsBool( mbSet );
    2657           2 : }
    2658             : 
    2659      232827 : IMPL_META_ACTION( TextAlign, META_TEXTALIGN_ACTION )
    2660             : 
    2661       57053 : MetaTextAlignAction::MetaTextAlignAction( TextAlign aAlign ) :
    2662             :     MetaAction  ( META_TEXTALIGN_ACTION ),
    2663       57053 :     maAlign     ( aAlign )
    2664             : {
    2665       57053 : }
    2666             : 
    2667       17294 : void MetaTextAlignAction::Execute( OutputDevice* pOut )
    2668             : {
    2669       17294 :     pOut->SetTextAlign( maAlign );
    2670       17294 : }
    2671             : 
    2672           0 : MetaAction* MetaTextAlignAction::Clone()
    2673             : {
    2674           0 :     MetaAction* pClone = (MetaAction*) new MetaTextAlignAction( *this );
    2675           0 :     pClone->ResetRefCount();
    2676           0 :     return pClone;
    2677             : }
    2678             : 
    2679           0 : bool MetaTextAlignAction::Compare( const MetaAction& rMetaAction ) const
    2680             : {
    2681           0 :     return maAlign == ((MetaTextAlignAction&)rMetaAction).maAlign;
    2682             : }
    2683             : 
    2684       41707 : void MetaTextAlignAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2685             : {
    2686       41707 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2687       41707 :     rOStm.WriteUInt16( (sal_uInt16) maAlign );
    2688       41707 : }
    2689             : 
    2690       39575 : void MetaTextAlignAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2691             : {
    2692       39575 :     sal_uInt16 nTmp16(0);
    2693             : 
    2694       39575 :     COMPAT( rIStm );
    2695       39575 :     rIStm.ReadUInt16( nTmp16 ); maAlign = (TextAlign) nTmp16;
    2696       39575 : }
    2697             : 
    2698         594 : IMPL_META_ACTION( MapMode, META_MAPMODE_ACTION )
    2699             : 
    2700         297 : MetaMapModeAction::MetaMapModeAction( const MapMode& rMapMode ) :
    2701             :     MetaAction  ( META_MAPMODE_ACTION ),
    2702         297 :     maMapMode   ( rMapMode )
    2703             : {
    2704         297 : }
    2705             : 
    2706         284 : void MetaMapModeAction::Execute( OutputDevice* pOut )
    2707             : {
    2708         284 :     pOut->SetMapMode( maMapMode );
    2709         284 : }
    2710             : 
    2711           0 : MetaAction* MetaMapModeAction::Clone()
    2712             : {
    2713           0 :     MetaAction* pClone = (MetaAction*) new MetaMapModeAction( *this );
    2714           0 :     pClone->ResetRefCount();
    2715           0 :     return pClone;
    2716             : }
    2717             : 
    2718           0 : void MetaMapModeAction::Scale( double fScaleX, double fScaleY )
    2719             : {
    2720           0 :     Point aPoint( maMapMode.GetOrigin() );
    2721             : 
    2722           0 :     ImplScalePoint( aPoint, fScaleX, fScaleY );
    2723           0 :     maMapMode.SetOrigin( aPoint );
    2724           0 : }
    2725             : 
    2726           0 : bool MetaMapModeAction::Compare( const MetaAction& rMetaAction ) const
    2727             : {
    2728           0 :     return maMapMode == ((MetaMapModeAction&)rMetaAction).maMapMode;
    2729             : }
    2730             : 
    2731          10 : void MetaMapModeAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2732             : {
    2733          10 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2734          10 :     WriteMapMode( rOStm, maMapMode );
    2735          10 : }
    2736             : 
    2737           0 : void MetaMapModeAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2738             : {
    2739           0 :     COMPAT( rIStm );
    2740           0 :     ReadMapMode( rIStm, maMapMode );
    2741           0 : }
    2742             : 
    2743      217223 : IMPL_META_ACTION( Font, META_FONT_ACTION )
    2744             : 
    2745       49250 : MetaFontAction::MetaFontAction( const Font& rFont ) :
    2746             :     MetaAction  ( META_FONT_ACTION ),
    2747       49250 :     maFont      ( rFont )
    2748             : {
    2749             :     // #96876: because RTL_TEXTENCODING_SYMBOL is often set at the StarSymbol font,
    2750             :     // we change the textencoding to RTL_TEXTENCODING_UNICODE here, which seems
    2751             :     // to be the right way; changing the textencoding at other sources
    2752             :     // is too dangerous at the moment
    2753       98500 :     if ( IsStarSymbol( maFont.GetName() )
    2754       49250 :         && ( maFont.GetCharSet() != RTL_TEXTENCODING_UNICODE ) )
    2755             :     {
    2756           2 :         maFont.SetCharSet( RTL_TEXTENCODING_UNICODE );
    2757             :     }
    2758       49250 : }
    2759             : 
    2760        9546 : void MetaFontAction::Execute( OutputDevice* pOut )
    2761             : {
    2762        9546 :     pOut->SetFont( maFont );
    2763        9546 : }
    2764             : 
    2765           0 : MetaAction* MetaFontAction::Clone()
    2766             : {
    2767           0 :     MetaAction* pClone = (MetaAction*) new MetaFontAction( *this );
    2768           0 :     pClone->ResetRefCount();
    2769           0 :     return pClone;
    2770             : }
    2771             : 
    2772           0 : void MetaFontAction::Scale( double fScaleX, double fScaleY )
    2773             : {
    2774             :     const Size aSize(
    2775           0 :         FRound(maFont.GetSize().Width() * fabs(fScaleX)),
    2776           0 :         FRound(maFont.GetSize().Height() * fabs(fScaleY)));
    2777           0 :     maFont.SetSize( aSize );
    2778           0 : }
    2779             : 
    2780           0 : bool MetaFontAction::Compare( const MetaAction& rMetaAction ) const
    2781             : {
    2782           0 :     return maFont == ((MetaFontAction&)rMetaAction).maFont;
    2783             : }
    2784             : 
    2785       41591 : void MetaFontAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2786             : {
    2787       41591 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2788       41591 :     WriteFont( rOStm, maFont );
    2789       41591 :     pData->meActualCharSet = maFont.GetCharSet();
    2790       41591 :     if ( pData->meActualCharSet == RTL_TEXTENCODING_DONTKNOW )
    2791       24242 :         pData->meActualCharSet = osl_getThreadTextEncoding();
    2792       41591 : }
    2793             : 
    2794       39575 : void MetaFontAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
    2795             : {
    2796       39575 :     COMPAT( rIStm );
    2797       39575 :     ReadFont( rIStm, maFont );
    2798       39575 :     pData->meActualCharSet = maFont.GetCharSet();
    2799       39575 :     if ( pData->meActualCharSet == RTL_TEXTENCODING_DONTKNOW )
    2800       24243 :         pData->meActualCharSet = osl_getThreadTextEncoding();
    2801       39575 : }
    2802             : 
    2803      244970 : IMPL_META_ACTION( Push, META_PUSH_ACTION )
    2804             : 
    2805       55015 : MetaPushAction::MetaPushAction( sal_uInt16 nFlags ) :
    2806             :     MetaAction  ( META_PUSH_ACTION ),
    2807       55015 :     mnFlags     ( nFlags )
    2808             : {
    2809       55015 : }
    2810             : 
    2811       10434 : void MetaPushAction::Execute( OutputDevice* pOut )
    2812             : {
    2813       10434 :     pOut->Push( mnFlags );
    2814       10434 : }
    2815             : 
    2816           0 : MetaAction* MetaPushAction::Clone()
    2817             : {
    2818           0 :     MetaAction* pClone = (MetaAction*) new MetaPushAction( *this );
    2819           0 :     pClone->ResetRefCount();
    2820           0 :     return pClone;
    2821             : }
    2822             : 
    2823           0 : bool MetaPushAction::Compare( const MetaAction& rMetaAction ) const
    2824             : {
    2825           0 :     return mnFlags == ((MetaPushAction&)rMetaAction).mnFlags;
    2826             : }
    2827             : 
    2828       47125 : void MetaPushAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2829             : {
    2830       47125 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2831       47125 :     rOStm.WriteUInt16( mnFlags );
    2832       47125 : }
    2833             : 
    2834       44982 : void MetaPushAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2835             : {
    2836       44982 :     COMPAT( rIStm );
    2837       44982 :     rIStm.ReadUInt16( mnFlags );
    2838       44982 : }
    2839             : 
    2840      299985 : IMPL_META_ACTION( Pop, META_POP_ACTION )
    2841             : 
    2842       10434 : void MetaPopAction::Execute( OutputDevice* pOut )
    2843             : {
    2844       10434 :     pOut->Pop();
    2845       10434 : }
    2846             : 
    2847           0 : MetaAction* MetaPopAction::Clone()
    2848             : {
    2849           0 :     MetaAction* pClone = (MetaAction*) new MetaPopAction( *this );
    2850           0 :     pClone->ResetRefCount();
    2851           0 :     return pClone;
    2852             : }
    2853             : 
    2854       47125 : void MetaPopAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2855             : {
    2856       47125 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2857       47125 : }
    2858             : 
    2859       44982 : void MetaPopAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2860             : {
    2861       44982 :     COMPAT( rIStm );
    2862       44982 : }
    2863             : 
    2864       23715 : IMPL_META_ACTION( RasterOp, META_RASTEROP_ACTION )
    2865             : 
    2866       11852 : MetaRasterOpAction::MetaRasterOpAction( RasterOp eRasterOp ) :
    2867             :     MetaAction  ( META_RASTEROP_ACTION ),
    2868       11852 :     meRasterOp  ( eRasterOp )
    2869             : {
    2870       11852 : }
    2871             : 
    2872        8877 : void MetaRasterOpAction::Execute( OutputDevice* pOut )
    2873             : {
    2874        8877 :     pOut->SetRasterOp( meRasterOp );
    2875        8877 : }
    2876             : 
    2877           0 : MetaAction* MetaRasterOpAction::Clone()
    2878             : {
    2879           0 :     MetaAction* pClone = (MetaAction*) new MetaRasterOpAction( *this );
    2880           0 :     pClone->ResetRefCount();
    2881           0 :     return pClone;
    2882             : }
    2883             : 
    2884           0 : bool MetaRasterOpAction::Compare( const MetaAction& rMetaAction ) const
    2885             : {
    2886           0 :     return meRasterOp == ((MetaRasterOpAction&)rMetaAction).meRasterOp;
    2887             : }
    2888             : 
    2889       12148 : void MetaRasterOpAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2890             : {
    2891       12148 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2892       12148 :     rOStm.WriteUInt16( (sal_uInt16) meRasterOp );
    2893       12148 : }
    2894             : 
    2895           7 : void MetaRasterOpAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2896             : {
    2897           7 :     sal_uInt16 nTmp16(0);
    2898             : 
    2899           7 :     COMPAT( rIStm );
    2900           7 :     rIStm.ReadUInt16( nTmp16 ); meRasterOp = (RasterOp) nTmp16;
    2901           7 : }
    2902             : 
    2903          56 : IMPL_META_ACTION( Transparent, META_TRANSPARENT_ACTION )
    2904             : 
    2905          28 : MetaTransparentAction::MetaTransparentAction( const PolyPolygon& rPolyPoly, sal_uInt16 nTransPercent ) :
    2906             :     MetaAction      ( META_TRANSPARENT_ACTION ),
    2907             :     maPolyPoly      ( rPolyPoly ),
    2908          28 :     mnTransPercent  ( nTransPercent )
    2909             : {
    2910          28 : }
    2911             : 
    2912           0 : void MetaTransparentAction::Execute( OutputDevice* pOut )
    2913             : {
    2914           0 :     pOut->DrawTransparent( maPolyPoly, mnTransPercent );
    2915           0 : }
    2916             : 
    2917           0 : MetaAction* MetaTransparentAction::Clone()
    2918             : {
    2919           0 :     MetaAction* pClone = (MetaAction*) new MetaTransparentAction( *this );
    2920           0 :     pClone->ResetRefCount();
    2921           0 :     return pClone;
    2922             : }
    2923             : 
    2924          13 : void MetaTransparentAction::Move( long nHorzMove, long nVertMove )
    2925             : {
    2926          13 :     maPolyPoly.Move( nHorzMove, nVertMove );
    2927          13 : }
    2928             : 
    2929           0 : void MetaTransparentAction::Scale( double fScaleX, double fScaleY )
    2930             : {
    2931           0 :     for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
    2932           0 :         ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
    2933           0 : }
    2934             : 
    2935           0 : bool MetaTransparentAction::Compare( const MetaAction& rMetaAction ) const
    2936             : {
    2937           0 :     return ( maPolyPoly == ((MetaTransparentAction&)rMetaAction).maPolyPoly ) &&
    2938           0 :            ( mnTransPercent == ((MetaTransparentAction&)rMetaAction).mnTransPercent );
    2939             : }
    2940             : 
    2941           0 : void MetaTransparentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    2942             : {
    2943           0 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    2944             : 
    2945             :     // #i105373# The PolyPolygon in this action may be a curve; this
    2946             :     // was ignored until now what is an error. To make older office
    2947             :     // versions work with MetaFiles, i opt for applying AdaptiveSubdivide
    2948             :     // to the PolyPoylgon.
    2949             :     // The alternative would be to really write the curve information
    2950             :     // like in MetaPolyPolygonAction::Write (where someone extended it
    2951             :     // correctly, but not here :-( ).
    2952             :     // The golden solution would be to combine both, but i think it's
    2953             :     // not necessary; a good subdivision will be sufficient.
    2954           0 :     PolyPolygon aNoCurvePolyPolygon;
    2955           0 :     maPolyPoly.AdaptiveSubdivide(aNoCurvePolyPolygon);
    2956             : 
    2957           0 :     WritePolyPolygon( rOStm, aNoCurvePolyPolygon );
    2958           0 :     rOStm.WriteUInt16( mnTransPercent );
    2959           0 : }
    2960             : 
    2961           0 : void MetaTransparentAction::Read( SvStream& rIStm, ImplMetaReadData* )
    2962             : {
    2963           0 :     COMPAT( rIStm );
    2964           0 :     ReadPolyPolygon( rIStm, maPolyPoly );
    2965           0 :     rIStm.ReadUInt16( mnTransPercent );
    2966           0 : }
    2967             : 
    2968           0 : IMPL_META_ACTION( FloatTransparent, META_FLOATTRANSPARENT_ACTION )
    2969             : 
    2970           0 : MetaFloatTransparentAction::MetaFloatTransparentAction( const GDIMetaFile& rMtf, const Point& rPos,
    2971             :                                                         const Size& rSize, const Gradient& rGradient ) :
    2972             :     MetaAction      ( META_FLOATTRANSPARENT_ACTION ),
    2973             :     maMtf           ( rMtf ),
    2974             :     maPoint         ( rPos ),
    2975             :     maSize          ( rSize ),
    2976           0 :     maGradient      ( rGradient )
    2977             : {
    2978           0 : }
    2979             : 
    2980           0 : void MetaFloatTransparentAction::Execute( OutputDevice* pOut )
    2981             : {
    2982           0 :     pOut->DrawTransparent( maMtf, maPoint, maSize, maGradient );
    2983           0 : }
    2984             : 
    2985           0 : MetaAction* MetaFloatTransparentAction::Clone()
    2986             : {
    2987           0 :     MetaAction* pClone = (MetaAction*) new MetaFloatTransparentAction( *this );
    2988           0 :     pClone->ResetRefCount();
    2989           0 :     return pClone;
    2990             : }
    2991             : 
    2992           0 : void MetaFloatTransparentAction::Move( long nHorzMove, long nVertMove )
    2993             : {
    2994           0 :     maPoint.Move( nHorzMove, nVertMove );
    2995           0 : }
    2996             : 
    2997           0 : void MetaFloatTransparentAction::Scale( double fScaleX, double fScaleY )
    2998             : {
    2999           0 :     Rectangle aRectangle(maPoint, maSize);
    3000           0 :     ImplScaleRect( aRectangle, fScaleX, fScaleY );
    3001           0 :     maPoint = aRectangle.TopLeft();
    3002           0 :     maSize = aRectangle.GetSize();
    3003           0 : }
    3004             : 
    3005           0 : bool MetaFloatTransparentAction::Compare( const MetaAction& rMetaAction ) const
    3006             : {
    3007           0 :     return ( maMtf == ((MetaFloatTransparentAction&)rMetaAction).maMtf ) &&
    3008           0 :            ( maPoint == ((MetaFloatTransparentAction&)rMetaAction).maPoint ) &&
    3009           0 :            ( maSize == ((MetaFloatTransparentAction&)rMetaAction).maSize ) &&
    3010           0 :            ( maGradient == ((MetaFloatTransparentAction&)rMetaAction).maGradient );
    3011             : }
    3012             : 
    3013           0 : void MetaFloatTransparentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    3014             : {
    3015           0 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    3016             : 
    3017           0 :     maMtf.Write( rOStm );
    3018           0 :     WritePair( rOStm,  maPoint );
    3019           0 :     WritePair( rOStm, maSize );
    3020           0 :     WriteGradient( rOStm, maGradient );
    3021           0 : }
    3022             : 
    3023           0 : void MetaFloatTransparentAction::Read( SvStream& rIStm, ImplMetaReadData* )
    3024             : {
    3025           0 :     COMPAT( rIStm );
    3026           0 :     ReadGDIMetaFile( rIStm, maMtf );
    3027           0 :     ReadPair( rIStm, maPoint );
    3028           0 :     ReadPair( rIStm, maSize );
    3029           0 :     ReadGradient( rIStm, maGradient );
    3030           0 : }
    3031             : 
    3032           0 : IMPL_META_ACTION( EPS, META_EPS_ACTION )
    3033             : 
    3034           0 : MetaEPSAction::MetaEPSAction( const Point& rPoint, const Size& rSize,
    3035             :                               const GfxLink& rGfxLink, const GDIMetaFile& rSubst ) :
    3036             :     MetaAction  ( META_EPS_ACTION ),
    3037             :     maGfxLink   ( rGfxLink ),
    3038             :     maSubst     ( rSubst ),
    3039             :     maPoint     ( rPoint ),
    3040           0 :     maSize      ( rSize )
    3041             : {
    3042           0 : }
    3043             : 
    3044           0 : void MetaEPSAction::Execute( OutputDevice* pOut )
    3045             : {
    3046           0 :     pOut->DrawEPS( maPoint, maSize, maGfxLink, &maSubst );
    3047           0 : }
    3048             : 
    3049           0 : MetaAction* MetaEPSAction::Clone()
    3050             : {
    3051           0 :     MetaAction* pClone = (MetaAction*) new MetaEPSAction( *this );
    3052           0 :     pClone->ResetRefCount();
    3053           0 :     return pClone;
    3054             : }
    3055             : 
    3056           0 : void MetaEPSAction::Move( long nHorzMove, long nVertMove )
    3057             : {
    3058           0 :     maPoint.Move( nHorzMove, nVertMove );
    3059           0 : }
    3060             : 
    3061           0 : void MetaEPSAction::Scale( double fScaleX, double fScaleY )
    3062             : {
    3063           0 :     Rectangle aRectangle(maPoint, maSize);
    3064           0 :     ImplScaleRect( aRectangle, fScaleX, fScaleY );
    3065           0 :     maPoint = aRectangle.TopLeft();
    3066           0 :     maSize = aRectangle.GetSize();
    3067           0 : }
    3068             : 
    3069           0 : bool MetaEPSAction::Compare( const MetaAction& rMetaAction ) const
    3070             : {
    3071           0 :     return ( maGfxLink.IsEqual(((MetaEPSAction&)rMetaAction).maGfxLink )) &&
    3072           0 :            ( maSubst == ((MetaEPSAction&)rMetaAction).maSubst ) &&
    3073           0 :            ( maPoint == ((MetaEPSAction&)rMetaAction).maPoint ) &&
    3074           0 :            ( maSize == ((MetaEPSAction&)rMetaAction).maSize );
    3075             : }
    3076             : 
    3077           0 : void MetaEPSAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    3078             : {
    3079           0 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    3080           0 :     WriteGfxLink( rOStm, maGfxLink );
    3081           0 :     WritePair( rOStm, maPoint );
    3082           0 :     WritePair( rOStm, maSize );
    3083           0 :     maSubst.Write( rOStm );
    3084           0 : }
    3085             : 
    3086           0 : void MetaEPSAction::Read( SvStream& rIStm, ImplMetaReadData* )
    3087             : {
    3088           0 :     COMPAT( rIStm );
    3089           0 :     ReadGfxLink( rIStm, maGfxLink );
    3090           0 :     ReadPair( rIStm, maPoint );
    3091           0 :     ReadPair( rIStm, maSize );
    3092           0 :     ReadGDIMetaFile( rIStm, maSubst );
    3093           0 : }
    3094             : 
    3095       15270 : IMPL_META_ACTION( RefPoint, META_REFPOINT_ACTION )
    3096             : 
    3097        7635 : MetaRefPointAction::MetaRefPointAction( const Point& rRefPoint, bool bSet ) :
    3098             :     MetaAction  ( META_REFPOINT_ACTION ),
    3099             :     maRefPoint  ( rRefPoint ),
    3100        7635 :     mbSet       ( bSet )
    3101             : {
    3102        7635 : }
    3103             : 
    3104        7635 : void MetaRefPointAction::Execute( OutputDevice* pOut )
    3105             : {
    3106        7635 :     if( mbSet )
    3107           0 :         pOut->SetRefPoint( maRefPoint );
    3108             :     else
    3109        7635 :         pOut->SetRefPoint();
    3110        7635 : }
    3111             : 
    3112           0 : MetaAction* MetaRefPointAction::Clone()
    3113             : {
    3114           0 :     MetaAction* pClone = (MetaAction*) new MetaRefPointAction( *this );
    3115           0 :     pClone->ResetRefCount();
    3116           0 :     return pClone;
    3117             : }
    3118             : 
    3119           0 : bool MetaRefPointAction::Compare( const MetaAction& rMetaAction ) const
    3120             : {
    3121           0 :     return ( maRefPoint == ((MetaRefPointAction&)rMetaAction).maRefPoint ) &&
    3122           0 :            ( mbSet == ((MetaRefPointAction&)rMetaAction).mbSet );
    3123             : }
    3124             : 
    3125           0 : void MetaRefPointAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    3126             : {
    3127           0 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    3128           0 :     WritePair( rOStm, maRefPoint );
    3129           0 :     rOStm.WriteUChar( mbSet );
    3130           0 : }
    3131             : 
    3132           0 : void MetaRefPointAction::Read( SvStream& rIStm, ImplMetaReadData* )
    3133             : {
    3134           0 :     COMPAT( rIStm );
    3135           0 :     ReadPair( rIStm, maRefPoint ).ReadCharAsBool( mbSet );
    3136           0 : }
    3137             : 
    3138         124 : MetaCommentAction::MetaCommentAction( sal_Int32 nValue ) :
    3139             :     MetaAction  ( META_COMMENT_ACTION ),
    3140         124 :     mnValue     ( nValue )
    3141             : {
    3142         124 :     ImplInitDynamicData( NULL, 0UL );
    3143         124 : }
    3144             : 
    3145          64 : MetaCommentAction::MetaCommentAction( const MetaCommentAction& rAct ) :
    3146             :     MetaAction  ( META_COMMENT_ACTION ),
    3147             :     maComment   ( rAct.maComment ),
    3148          64 :     mnValue     ( rAct.mnValue )
    3149             : {
    3150          64 :     ImplInitDynamicData( rAct.mpData, rAct.mnDataSize );
    3151          64 : }
    3152             : 
    3153        7564 : MetaCommentAction::MetaCommentAction( const OString& rComment, sal_Int32 nValue, const sal_uInt8* pData, sal_uInt32 nDataSize ) :
    3154             :     MetaAction  ( META_COMMENT_ACTION ),
    3155             :     maComment   ( rComment ),
    3156        7564 :     mnValue     ( nValue )
    3157             : {
    3158        7564 :     ImplInitDynamicData( pData, nDataSize );
    3159        7564 : }
    3160             : 
    3161       23232 : MetaCommentAction::~MetaCommentAction()
    3162             : {
    3163        7744 :     if ( mpData )
    3164        1300 :         delete[] mpData;
    3165       15488 : }
    3166             : 
    3167        8311 : void MetaCommentAction::ImplInitDynamicData( const sal_uInt8* pData, sal_uInt32 nDataSize )
    3168             : {
    3169        8311 :     if ( nDataSize && pData )
    3170             :     {
    3171        1840 :         mnDataSize = nDataSize, mpData = new sal_uInt8[ mnDataSize ];
    3172        1840 :         memcpy( mpData, pData, mnDataSize );
    3173             :     }
    3174             :     else
    3175             :     {
    3176        6471 :         mnDataSize = 0;
    3177        6471 :         mpData = NULL;
    3178             :     }
    3179        8311 : }
    3180             : 
    3181         827 : void MetaCommentAction::Execute( OutputDevice* pOut )
    3182             : {
    3183         827 :     if ( pOut->GetConnectMetaFile() )
    3184             :     {
    3185         200 :         Duplicate();
    3186         200 :         pOut->GetConnectMetaFile()->AddAction( this );
    3187             :     }
    3188         827 : }
    3189             : 
    3190          64 : MetaAction* MetaCommentAction::Clone()
    3191             : {
    3192          64 :     MetaAction* pClone = (MetaAction*) new MetaCommentAction( *this );
    3193          64 :     pClone->ResetRefCount();
    3194          64 :     return pClone;
    3195             : }
    3196             : 
    3197        3610 : void MetaCommentAction::Move( long nXMove, long nYMove )
    3198             : {
    3199        3610 :     if ( nXMove || nYMove )
    3200             :     {
    3201        3316 :         if ( mnDataSize && mpData )
    3202             :         {
    3203         563 :             bool bPathStroke = (maComment == "XPATHSTROKE_SEQ_BEGIN");
    3204         563 :             if ( bPathStroke || maComment == "XPATHFILL_SEQ_BEGIN" )
    3205             :             {
    3206         559 :                 SvMemoryStream  aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
    3207        1118 :                 SvMemoryStream  aDest;
    3208         559 :                 if ( bPathStroke )
    3209             :                 {
    3210         557 :                     SvtGraphicStroke aStroke;
    3211         557 :                     ReadSvtGraphicStroke( aMemStm, aStroke );
    3212             : 
    3213        1114 :                     Polygon aPath;
    3214         557 :                     aStroke.getPath( aPath );
    3215         557 :                     aPath.Move( nXMove, nYMove );
    3216         557 :                     aStroke.setPath( aPath );
    3217             : 
    3218        1114 :                     PolyPolygon aStartArrow;
    3219         557 :                     aStroke.getStartArrow(aStartArrow);
    3220         557 :                     aStartArrow.Move(nXMove, nYMove);
    3221         557 :                     aStroke.setStartArrow(aStartArrow);
    3222             : 
    3223        1114 :                     PolyPolygon aEndArrow;
    3224         557 :                     aStroke.getEndArrow(aEndArrow);
    3225         557 :                     aEndArrow.Move(nXMove, nYMove);
    3226         557 :                     aStroke.setEndArrow(aEndArrow);
    3227             : 
    3228        1114 :                     WriteSvtGraphicStroke( aDest, aStroke );
    3229             :                 }
    3230             :                 else
    3231             :                 {
    3232           2 :                     SvtGraphicFill aFill;
    3233           2 :                     ReadSvtGraphicFill( aMemStm, aFill );
    3234             : 
    3235           4 :                     PolyPolygon aPath;
    3236           2 :                     aFill.getPath( aPath );
    3237           2 :                     aPath.Move( nXMove, nYMove );
    3238           2 :                     aFill.setPath( aPath );
    3239             : 
    3240           4 :                     WriteSvtGraphicFill( aDest, aFill );
    3241             :                 }
    3242         559 :                 delete[] mpData;
    3243        1118 :                 ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() );
    3244             :             }
    3245             :         }
    3246             :     }
    3247        3610 : }
    3248             : 
    3249             : // SJ: 25.07.06 #i56656# we are not able to mirrorcertain kind of
    3250             : // comments properly, especially the XPATHSTROKE and XPATHFILL lead to
    3251             : // problems, so it is better to remove these comments when mirroring
    3252             : // FIXME: fake comment to apply the next hunk in the right location
    3253           0 : void MetaCommentAction::Scale( double fXScale, double fYScale )
    3254             : {
    3255           0 :     if ( ( fXScale != 1.0 ) || ( fYScale != 1.0 ) )
    3256             :     {
    3257           0 :         if ( mnDataSize && mpData )
    3258             :         {
    3259           0 :             bool bPathStroke = (maComment == "XPATHSTROKE_SEQ_BEGIN");
    3260           0 :             if ( bPathStroke || maComment == "XPATHFILL_SEQ_BEGIN" )
    3261             :             {
    3262           0 :                 SvMemoryStream  aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
    3263           0 :                 SvMemoryStream  aDest;
    3264           0 :                 if ( bPathStroke )
    3265             :                 {
    3266           0 :                     SvtGraphicStroke aStroke;
    3267           0 :                     ReadSvtGraphicStroke( aMemStm, aStroke );
    3268           0 :                     aStroke.scale( fXScale, fYScale );
    3269           0 :                     WriteSvtGraphicStroke( aDest, aStroke );
    3270             :                 }
    3271             :                 else
    3272             :                 {
    3273           0 :                     SvtGraphicFill aFill;
    3274           0 :                     ReadSvtGraphicFill( aMemStm, aFill );
    3275           0 :                     PolyPolygon aPath;
    3276           0 :                     aFill.getPath( aPath );
    3277           0 :                     aPath.Scale( fXScale, fYScale );
    3278           0 :                     aFill.setPath( aPath );
    3279           0 :                     WriteSvtGraphicFill( aDest, aFill );
    3280             :                 }
    3281           0 :                 delete[] mpData;
    3282           0 :                 ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() );
    3283           0 :             } else if( maComment == "EMF_PLUS_HEADER_INFO" ){
    3284           0 :                 SvMemoryStream  aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
    3285           0 :                 SvMemoryStream  aDest;
    3286             : 
    3287           0 :                 sal_Int32 nLeft(0), nRight(0), nTop(0), nBottom(0);
    3288           0 :                 sal_Int32 nPixX(0), nPixY(0), nMillX(0), nMillY(0);
    3289           0 :                 float m11(0), m12(0), m21(0), m22(0), mdx(0), mdy(0);
    3290             : 
    3291             :                 // read data
    3292           0 :                 aMemStm.ReadInt32( nLeft ).ReadInt32( nTop ).ReadInt32( nRight ).ReadInt32( nBottom );
    3293           0 :                 aMemStm.ReadInt32( nPixX ).ReadInt32( nPixY ).ReadInt32( nMillX ).ReadInt32( nMillY );
    3294           0 :                 aMemStm.ReadFloat( m11 ).ReadFloat( m12 ).ReadFloat( m21 ).ReadFloat( m22 ).ReadFloat( mdx ).ReadFloat( mdy );
    3295             : 
    3296             :                 // add scale to the transformation
    3297           0 :                 m11 *= fXScale;
    3298           0 :                 m12 *= fXScale;
    3299           0 :                 m22 *= fYScale;
    3300           0 :                 m21 *= fYScale;
    3301             : 
    3302             :                 // prepare new data
    3303           0 :                 aDest.WriteInt32( nLeft ).WriteInt32( nTop ).WriteInt32( nRight ).WriteInt32( nBottom );
    3304           0 :                 aDest.WriteInt32( nPixX ).WriteInt32( nPixY ).WriteInt32( nMillX ).WriteInt32( nMillY );
    3305           0 :                 aDest.WriteFloat( m11 ).WriteFloat( m12 ).WriteFloat( m21 ).WriteFloat( m22 ).WriteFloat( mdx ).WriteFloat( mdy );
    3306             : 
    3307             :                 // save them
    3308           0 :                 ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() );
    3309             :             }
    3310             :         }
    3311             :     }
    3312           0 : }
    3313             : 
    3314           0 : bool MetaCommentAction::Compare( const MetaAction& rMetaAction ) const
    3315             : {
    3316           0 :     return ( maComment == ((MetaCommentAction&)rMetaAction).maComment ) &&
    3317           0 :            ( mnValue == ((MetaCommentAction&)rMetaAction).mnValue ) &&
    3318           0 :            ( mnDataSize == ((MetaCommentAction&)rMetaAction).mnDataSize ) &&
    3319           0 :            ( memcmp( mpData, ((MetaCommentAction&)rMetaAction).mpData, mnDataSize ) == 0 );
    3320             : }
    3321             : 
    3322         788 : void MetaCommentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    3323             : {
    3324         788 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    3325         788 :     write_uInt16_lenPrefixed_uInt8s_FromOString(rOStm, maComment);
    3326         788 :     rOStm.WriteInt32( mnValue ).WriteUInt32( mnDataSize );
    3327             : 
    3328         788 :     if ( mnDataSize )
    3329         572 :         rOStm.Write( mpData, mnDataSize );
    3330         788 : }
    3331             : 
    3332         124 : void MetaCommentAction::Read( SvStream& rIStm, ImplMetaReadData* )
    3333             : {
    3334         124 :     COMPAT( rIStm );
    3335         124 :     maComment = read_uInt16_lenPrefixed_uInt8s_ToOString(rIStm);
    3336         124 :     rIStm.ReadInt32( mnValue ).ReadUInt32( mnDataSize );
    3337             : 
    3338             :     SAL_INFO("vcl.gdi", "MetaCommentAction::Read " << maComment);
    3339             : 
    3340         124 :     delete[] mpData;
    3341             : 
    3342         124 :     if( mnDataSize )
    3343             :     {
    3344          25 :         mpData = new sal_uInt8[ mnDataSize ];
    3345          25 :         rIStm.Read( mpData, mnDataSize );
    3346             :     }
    3347             :     else
    3348          99 :         mpData = NULL;
    3349         124 : }
    3350             : 
    3351       64112 : IMPL_META_ACTION( LayoutMode, META_LAYOUTMODE_ACTION )
    3352             : 
    3353       17686 : MetaLayoutModeAction::MetaLayoutModeAction( sal_uInt32 nLayoutMode ) :
    3354             :     MetaAction  ( META_LAYOUTMODE_ACTION ),
    3355       17686 :     mnLayoutMode( nLayoutMode )
    3356             : {
    3357       17686 : }
    3358             : 
    3359        8164 : void MetaLayoutModeAction::Execute( OutputDevice* pOut )
    3360             : {
    3361        8164 :     pOut->SetLayoutMode( mnLayoutMode );
    3362        8164 : }
    3363             : 
    3364           0 : MetaAction* MetaLayoutModeAction::Clone()
    3365             : {
    3366           0 :     MetaAction* pClone = (MetaAction*) new MetaLayoutModeAction( *this );
    3367           0 :     pClone->ResetRefCount();
    3368           0 :     return pClone;
    3369             : }
    3370             : 
    3371           0 : bool MetaLayoutModeAction::Compare( const MetaAction& rMetaAction ) const
    3372             : {
    3373           0 :     return mnLayoutMode == ((MetaLayoutModeAction&)rMetaAction).mnLayoutMode;
    3374             : }
    3375             : 
    3376        9602 : void MetaLayoutModeAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    3377             : {
    3378        9602 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    3379        9602 :     rOStm.WriteUInt32( mnLayoutMode );
    3380        9602 : }
    3381             : 
    3382        9580 : void MetaLayoutModeAction::Read( SvStream& rIStm, ImplMetaReadData* )
    3383             : {
    3384        9580 :     COMPAT( rIStm );
    3385        9580 :     rIStm.ReadUInt32( mnLayoutMode );
    3386        9580 : }
    3387             : 
    3388       89402 : IMPL_META_ACTION( TextLanguage, META_TEXTLANGUAGE_ACTION )
    3389             : 
    3390       22809 : MetaTextLanguageAction::MetaTextLanguageAction( LanguageType eTextLanguage ) :
    3391             :     MetaAction  ( META_TEXTLANGUAGE_ACTION ),
    3392       22809 :     meTextLanguage( eTextLanguage )
    3393             : {
    3394       22809 : }
    3395             : 
    3396        8230 : void MetaTextLanguageAction::Execute( OutputDevice* pOut )
    3397             : {
    3398        8230 :     pOut->SetDigitLanguage( meTextLanguage );
    3399        8230 : }
    3400             : 
    3401           0 : MetaAction* MetaTextLanguageAction::Clone()
    3402             : {
    3403           0 :     MetaAction* pClone = (MetaAction*) new MetaTextLanguageAction( *this );
    3404           0 :     pClone->ResetRefCount();
    3405           0 :     return pClone;
    3406             : }
    3407             : 
    3408           0 : bool MetaTextLanguageAction::Compare( const MetaAction& rMetaAction ) const
    3409             : {
    3410           0 :     return meTextLanguage == ((MetaTextLanguageAction&)rMetaAction).meTextLanguage;
    3411             : }
    3412             : 
    3413       14647 : void MetaTextLanguageAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
    3414             : {
    3415       14647 :     WRITE_BASE_COMPAT( rOStm, 1, pData );
    3416       14647 :     rOStm.WriteUInt16( meTextLanguage );
    3417       14647 : }
    3418             : 
    3419       14596 : void MetaTextLanguageAction::Read( SvStream& rIStm, ImplMetaReadData* )
    3420             : {
    3421       14596 :     COMPAT( rIStm );
    3422       14596 :     rIStm.ReadUInt16( meTextLanguage );
    3423       14596 : }
    3424             : 
    3425             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10