xref: /trunk/main/vcl/source/gdi/metaact.cxx (revision ddde725d65c83fe3ba1186d46f6e3e08f12ba47e)
19f62ea84SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
39f62ea84SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
49f62ea84SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
59f62ea84SAndrew Rist  * distributed with this work for additional information
69f62ea84SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
79f62ea84SAndrew Rist  * to you under the Apache License, Version 2.0 (the
89f62ea84SAndrew Rist  * "License"); you may not use this file except in compliance
99f62ea84SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
119f62ea84SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
139f62ea84SAndrew Rist  * Unless required by applicable law or agreed to in writing,
149f62ea84SAndrew Rist  * software distributed under the License is distributed on an
159f62ea84SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
169f62ea84SAndrew Rist  * KIND, either express or implied.  See the License for the
179f62ea84SAndrew Rist  * specific language governing permissions and limitations
189f62ea84SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
209f62ea84SAndrew Rist  *************************************************************/
219f62ea84SAndrew Rist 
229f62ea84SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_vcl.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #define ENABLE_BYTESTRING_STREAM_OPERATORS
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include <algorithm>
30cdf0e10cSrcweir #include <string.h>
31cdf0e10cSrcweir #include <tools/stream.hxx>
32cdf0e10cSrcweir #include <tools/vcompat.hxx>
33cdf0e10cSrcweir #include <vcl/outdev.hxx>
34cdf0e10cSrcweir #include <vcl/salbtype.hxx>
35cdf0e10cSrcweir #include <vcl/metaact.hxx>
36cdf0e10cSrcweir #include <vcl/graphictools.hxx>
37*ddde725dSArmin Le Grand //#include <svgio/svgreader/svgreader.hxx>
38*ddde725dSArmin Le Grand #include <basegfx/matrix/b2dhommatrixtools.hxx>
39cdf0e10cSrcweir 
40cdf0e10cSrcweir // ========================================================================
41cdf0e10cSrcweir 
42cdf0e10cSrcweir inline void ImplScalePoint( Point& rPt, double fScaleX, double fScaleY )
43cdf0e10cSrcweir {
44cdf0e10cSrcweir     rPt.X() = FRound( fScaleX * rPt.X() );
45cdf0e10cSrcweir     rPt.Y() = FRound( fScaleY * rPt.Y() );
46cdf0e10cSrcweir }
47cdf0e10cSrcweir 
48cdf0e10cSrcweir // ------------------------------------------------------------------------
49cdf0e10cSrcweir 
50cdf0e10cSrcweir inline void ImplScaleRect( Rectangle& rRect, double fScaleX, double fScaleY )
51cdf0e10cSrcweir {
52cdf0e10cSrcweir     Point aTL( rRect.TopLeft() );
53cdf0e10cSrcweir     Point aBR( rRect.BottomRight() );
54cdf0e10cSrcweir 
55cdf0e10cSrcweir     ImplScalePoint( aTL, fScaleX, fScaleY );
56cdf0e10cSrcweir     ImplScalePoint( aBR, fScaleX, fScaleY );
57cdf0e10cSrcweir 
58cdf0e10cSrcweir     rRect = Rectangle( aTL, aBR );
59cdf0e10cSrcweir     rRect.Justify();
60cdf0e10cSrcweir }
61cdf0e10cSrcweir 
62cdf0e10cSrcweir // ------------------------------------------------------------------------
63cdf0e10cSrcweir 
64cdf0e10cSrcweir inline void ImplScalePoly( Polygon& rPoly, double fScaleX, double fScaleY )
65cdf0e10cSrcweir {
66cdf0e10cSrcweir     for( sal_uInt16 i = 0, nCount = rPoly.GetSize(); i < nCount; i++ )
67cdf0e10cSrcweir         ImplScalePoint( rPoly[ i ], fScaleX, fScaleY );
68cdf0e10cSrcweir }
69cdf0e10cSrcweir 
70cdf0e10cSrcweir // ------------------------------------------------------------------------
71cdf0e10cSrcweir 
72cdf0e10cSrcweir inline void ImplScaleLineInfo( LineInfo& rLineInfo, double fScaleX, double fScaleY )
73cdf0e10cSrcweir {
74cdf0e10cSrcweir     if( !rLineInfo.IsDefault() )
75cdf0e10cSrcweir     {
76cdf0e10cSrcweir         const double fScale = ( fabs(fScaleX) + fabs(fScaleY) ) * 0.5;
77cdf0e10cSrcweir 
78cdf0e10cSrcweir         rLineInfo.SetWidth( FRound( fScale * rLineInfo.GetWidth() ) );
79cdf0e10cSrcweir         rLineInfo.SetDashLen( FRound( fScale * rLineInfo.GetDashLen() ) );
80cdf0e10cSrcweir         rLineInfo.SetDotLen( FRound( fScale * rLineInfo.GetDotLen() ) );
81cdf0e10cSrcweir         rLineInfo.SetDistance( FRound( fScale * rLineInfo.GetDistance() ) );
82cdf0e10cSrcweir     }
83cdf0e10cSrcweir }
84cdf0e10cSrcweir 
85cdf0e10cSrcweir // ========================================================================
86cdf0e10cSrcweir 
87cdf0e10cSrcweir #define COMPAT( _def_rIStm ) VersionCompat aCompat( ( _def_rIStm ), STREAM_READ );
88cdf0e10cSrcweir #define COMPAT_VERSION() aCompat.GetVersion()
89cdf0e10cSrcweir #define WRITE_BASE_COMPAT( _def_rOStm, _def_nVer, _pWriteData )         \
90cdf0e10cSrcweir     MetaAction::Write( ( _def_rOStm ), _pWriteData );                   \
91cdf0e10cSrcweir     VersionCompat aCompat( ( _def_rOStm ), STREAM_WRITE, ( _def_nVer ) );
92cdf0e10cSrcweir 
93cdf0e10cSrcweir // ========================================================================
94cdf0e10cSrcweir 
95cdf0e10cSrcweir MetaAction::MetaAction() :
96cdf0e10cSrcweir     mnRefCount( 1 ),
97cdf0e10cSrcweir     mnType( META_NULL_ACTION )
98cdf0e10cSrcweir {
99cdf0e10cSrcweir }
100cdf0e10cSrcweir 
101cdf0e10cSrcweir // ------------------------------------------------------------------------
102cdf0e10cSrcweir 
103cdf0e10cSrcweir MetaAction::MetaAction( sal_uInt16 nType ) :
104cdf0e10cSrcweir     mnRefCount( 1 ),
105cdf0e10cSrcweir     mnType( nType )
106cdf0e10cSrcweir {
107cdf0e10cSrcweir }
108cdf0e10cSrcweir 
109cdf0e10cSrcweir // ------------------------------------------------------------------------
110cdf0e10cSrcweir 
111cdf0e10cSrcweir MetaAction::~MetaAction()
112cdf0e10cSrcweir {
113cdf0e10cSrcweir }
114cdf0e10cSrcweir 
115cdf0e10cSrcweir // ------------------------------------------------------------------------
116cdf0e10cSrcweir 
117cdf0e10cSrcweir void MetaAction::Execute( OutputDevice* )
118cdf0e10cSrcweir {
119cdf0e10cSrcweir }
120cdf0e10cSrcweir 
121cdf0e10cSrcweir // ------------------------------------------------------------------------
122cdf0e10cSrcweir 
123cdf0e10cSrcweir MetaAction* MetaAction::Clone()
124cdf0e10cSrcweir {
125cdf0e10cSrcweir     return new MetaAction;
126cdf0e10cSrcweir }
127cdf0e10cSrcweir 
128cdf0e10cSrcweir // ------------------------------------------------------------------------
129cdf0e10cSrcweir 
130cdf0e10cSrcweir void MetaAction::Move( long, long )
131cdf0e10cSrcweir {
132cdf0e10cSrcweir }
133cdf0e10cSrcweir 
134cdf0e10cSrcweir // ------------------------------------------------------------------------
135cdf0e10cSrcweir 
136cdf0e10cSrcweir void MetaAction::Scale( double, double )
137cdf0e10cSrcweir {
138cdf0e10cSrcweir }
139cdf0e10cSrcweir 
140cdf0e10cSrcweir // ------------------------------------------------------------------------
141cdf0e10cSrcweir 
142cdf0e10cSrcweir sal_Bool MetaAction::Compare( const MetaAction& ) const
143cdf0e10cSrcweir {
144cdf0e10cSrcweir     return sal_True;
145cdf0e10cSrcweir }
146cdf0e10cSrcweir 
147cdf0e10cSrcweir // ------------------------------------------------------------------------
148cdf0e10cSrcweir 
149cdf0e10cSrcweir sal_Bool MetaAction::IsEqual( const MetaAction& rMetaAction ) const
150cdf0e10cSrcweir {
151cdf0e10cSrcweir     if ( mnType != rMetaAction.mnType )
152cdf0e10cSrcweir         return sal_False;
153cdf0e10cSrcweir     else
154cdf0e10cSrcweir         return Compare( rMetaAction );
155cdf0e10cSrcweir }
156cdf0e10cSrcweir 
157cdf0e10cSrcweir // ------------------------------------------------------------------------
158cdf0e10cSrcweir 
159cdf0e10cSrcweir void MetaAction::Write( SvStream& rOStm, ImplMetaWriteData* )
160cdf0e10cSrcweir {
161cdf0e10cSrcweir     rOStm << mnType;
162cdf0e10cSrcweir }
163cdf0e10cSrcweir 
164cdf0e10cSrcweir // ------------------------------------------------------------------------
165cdf0e10cSrcweir 
166cdf0e10cSrcweir void MetaAction::Read( SvStream& rIStm, ImplMetaReadData* )
167cdf0e10cSrcweir {
168cdf0e10cSrcweir     rIStm >> mnType;
169cdf0e10cSrcweir }
170cdf0e10cSrcweir 
171cdf0e10cSrcweir // ------------------------------------------------------------------------
172cdf0e10cSrcweir 
173cdf0e10cSrcweir MetaAction* MetaAction::ReadMetaAction( SvStream& rIStm, ImplMetaReadData* pData )
174cdf0e10cSrcweir {
175cdf0e10cSrcweir     MetaAction* pAction = NULL;
176cdf0e10cSrcweir     sal_uInt16      nType;
177cdf0e10cSrcweir 
178cdf0e10cSrcweir     rIStm >> nType;
179cdf0e10cSrcweir 
180cdf0e10cSrcweir     switch( nType )
181cdf0e10cSrcweir     {
182cdf0e10cSrcweir         case( META_NULL_ACTION ): pAction = new MetaAction; break;
183cdf0e10cSrcweir         case( META_PIXEL_ACTION ): pAction = new MetaPixelAction; break;
184cdf0e10cSrcweir         case( META_POINT_ACTION ): pAction = new MetaPointAction; break;
185cdf0e10cSrcweir         case( META_LINE_ACTION ): pAction = new MetaLineAction; break;
186cdf0e10cSrcweir         case( META_RECT_ACTION ): pAction = new MetaRectAction; break;
187cdf0e10cSrcweir         case( META_ROUNDRECT_ACTION ): pAction = new MetaRoundRectAction; break;
188cdf0e10cSrcweir         case( META_ELLIPSE_ACTION ): pAction = new MetaEllipseAction; break;
189cdf0e10cSrcweir         case( META_ARC_ACTION ): pAction = new MetaArcAction; break;
190cdf0e10cSrcweir         case( META_PIE_ACTION ): pAction = new MetaPieAction; break;
191cdf0e10cSrcweir         case( META_CHORD_ACTION ): pAction = new MetaChordAction; break;
192cdf0e10cSrcweir         case( META_POLYLINE_ACTION ): pAction = new MetaPolyLineAction; break;
193cdf0e10cSrcweir         case( META_POLYGON_ACTION ): pAction = new MetaPolygonAction; break;
194cdf0e10cSrcweir         case( META_POLYPOLYGON_ACTION ): pAction = new MetaPolyPolygonAction; break;
195cdf0e10cSrcweir         case( META_TEXT_ACTION ): pAction = new MetaTextAction; break;
196cdf0e10cSrcweir         case( META_TEXTARRAY_ACTION ): pAction = new MetaTextArrayAction; break;
197cdf0e10cSrcweir         case( META_STRETCHTEXT_ACTION ): pAction = new MetaStretchTextAction; break;
198cdf0e10cSrcweir         case( META_TEXTRECT_ACTION ): pAction = new MetaTextRectAction; break;
199cdf0e10cSrcweir         case( META_TEXTLINE_ACTION ): pAction = new MetaTextLineAction; break;
200cdf0e10cSrcweir         case( META_BMP_ACTION ): pAction = new MetaBmpAction; break;
201cdf0e10cSrcweir         case( META_BMPSCALE_ACTION ): pAction = new MetaBmpScaleAction; break;
202cdf0e10cSrcweir         case( META_BMPSCALEPART_ACTION ): pAction = new MetaBmpScalePartAction; break;
203cdf0e10cSrcweir         case( META_BMPEX_ACTION ): pAction = new MetaBmpExAction; break;
204cdf0e10cSrcweir         case( META_BMPEXSCALE_ACTION ): pAction = new MetaBmpExScaleAction; break;
205cdf0e10cSrcweir         case( META_BMPEXSCALEPART_ACTION ): pAction = new MetaBmpExScalePartAction; break;
206cdf0e10cSrcweir         case( META_MASK_ACTION ): pAction = new MetaMaskAction; break;
207cdf0e10cSrcweir         case( META_MASKSCALE_ACTION ): pAction = new MetaMaskScaleAction; break;
208cdf0e10cSrcweir         case( META_MASKSCALEPART_ACTION ): pAction = new MetaMaskScalePartAction; break;
209cdf0e10cSrcweir         case( META_GRADIENT_ACTION ): pAction = new MetaGradientAction; break;
210cdf0e10cSrcweir         case( META_GRADIENTEX_ACTION ): pAction = new MetaGradientExAction; break;
211cdf0e10cSrcweir         case( META_HATCH_ACTION ): pAction = new MetaHatchAction; break;
212cdf0e10cSrcweir         case( META_WALLPAPER_ACTION ): pAction = new MetaWallpaperAction; break;
213cdf0e10cSrcweir         case( META_CLIPREGION_ACTION ): pAction = new MetaClipRegionAction; break;
214cdf0e10cSrcweir         case( META_ISECTRECTCLIPREGION_ACTION ): pAction = new MetaISectRectClipRegionAction; break;
215cdf0e10cSrcweir         case( META_ISECTREGIONCLIPREGION_ACTION ): pAction = new MetaISectRegionClipRegionAction; break;
216cdf0e10cSrcweir         case( META_MOVECLIPREGION_ACTION ): pAction = new MetaMoveClipRegionAction; break;
217cdf0e10cSrcweir         case( META_LINECOLOR_ACTION ): pAction = new MetaLineColorAction; break;
218cdf0e10cSrcweir         case( META_FILLCOLOR_ACTION ): pAction = new MetaFillColorAction; break;
219cdf0e10cSrcweir         case( META_TEXTCOLOR_ACTION ): pAction = new MetaTextColorAction; break;
220cdf0e10cSrcweir         case( META_TEXTFILLCOLOR_ACTION ): pAction = new MetaTextFillColorAction; break;
221cdf0e10cSrcweir         case( META_TEXTLINECOLOR_ACTION ): pAction = new MetaTextLineColorAction; break;
222cdf0e10cSrcweir         case( META_OVERLINECOLOR_ACTION ): pAction = new MetaOverlineColorAction; break;
223cdf0e10cSrcweir         case( META_TEXTALIGN_ACTION ): pAction = new MetaTextAlignAction; break;
224cdf0e10cSrcweir         case( META_MAPMODE_ACTION ): pAction = new MetaMapModeAction; break;
225cdf0e10cSrcweir         case( META_FONT_ACTION ): pAction = new MetaFontAction; break;
226cdf0e10cSrcweir         case( META_PUSH_ACTION ): pAction = new MetaPushAction; break;
227cdf0e10cSrcweir         case( META_POP_ACTION ): pAction = new MetaPopAction; break;
228cdf0e10cSrcweir         case( META_RASTEROP_ACTION ): pAction = new MetaRasterOpAction; break;
229cdf0e10cSrcweir         case( META_TRANSPARENT_ACTION ): pAction = new MetaTransparentAction; break;
230cdf0e10cSrcweir         case( META_FLOATTRANSPARENT_ACTION ): pAction = new MetaFloatTransparentAction; break;
231cdf0e10cSrcweir         case( META_EPS_ACTION ): pAction = new MetaEPSAction; break;
232cdf0e10cSrcweir         case( META_REFPOINT_ACTION ): pAction = new MetaRefPointAction; break;
233cdf0e10cSrcweir         case( META_COMMENT_ACTION ): pAction = new MetaCommentAction; break;
234cdf0e10cSrcweir         case( META_LAYOUTMODE_ACTION ): pAction = new MetaLayoutModeAction; break;
235cdf0e10cSrcweir         case( META_TEXTLANGUAGE_ACTION ): pAction = new MetaTextLanguageAction; break;
236cdf0e10cSrcweir 
237cdf0e10cSrcweir         default:
238cdf0e10cSrcweir         {
239cdf0e10cSrcweir             // Action ueberlesen durch Kombination Ctor/Dtor,
240cdf0e10cSrcweir             // new/delete, weil Compiler sonst vielleicht wegoptimieren
241cdf0e10cSrcweir             delete ( new VersionCompat( rIStm, STREAM_READ ) );
242cdf0e10cSrcweir         }
243cdf0e10cSrcweir         break;
244cdf0e10cSrcweir     }
245cdf0e10cSrcweir 
246cdf0e10cSrcweir     if( pAction )
247cdf0e10cSrcweir         pAction->Read( rIStm, pData );
248cdf0e10cSrcweir 
249cdf0e10cSrcweir     return pAction;
250cdf0e10cSrcweir }
251cdf0e10cSrcweir 
252cdf0e10cSrcweir // ========================================================================
253cdf0e10cSrcweir 
254cdf0e10cSrcweir IMPL_META_ACTION( Pixel, META_PIXEL_ACTION )
255cdf0e10cSrcweir 
256cdf0e10cSrcweir // ------------------------------------------------------------------------
257cdf0e10cSrcweir 
258cdf0e10cSrcweir MetaPixelAction::MetaPixelAction( const Point& rPt, const Color& rColor ) :
259cdf0e10cSrcweir     MetaAction  ( META_PIXEL_ACTION ),
260cdf0e10cSrcweir     maPt        ( rPt ),
261cdf0e10cSrcweir     maColor     ( rColor )
262cdf0e10cSrcweir {
263cdf0e10cSrcweir }
264cdf0e10cSrcweir 
265cdf0e10cSrcweir // ------------------------------------------------------------------------
266cdf0e10cSrcweir 
267cdf0e10cSrcweir void MetaPixelAction::Execute( OutputDevice* pOut )
268cdf0e10cSrcweir {
269cdf0e10cSrcweir     pOut->DrawPixel( maPt, maColor );
270cdf0e10cSrcweir }
271cdf0e10cSrcweir 
272cdf0e10cSrcweir // ------------------------------------------------------------------------
273cdf0e10cSrcweir 
274cdf0e10cSrcweir MetaAction* MetaPixelAction::Clone()
275cdf0e10cSrcweir {
276cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaPixelAction( *this );
277cdf0e10cSrcweir     pClone->ResetRefCount();
278cdf0e10cSrcweir     return pClone;
279cdf0e10cSrcweir }
280cdf0e10cSrcweir 
281cdf0e10cSrcweir // ------------------------------------------------------------------------
282cdf0e10cSrcweir 
283cdf0e10cSrcweir void MetaPixelAction::Move( long nHorzMove, long nVertMove )
284cdf0e10cSrcweir {
285cdf0e10cSrcweir     maPt.Move( nHorzMove, nVertMove );
286cdf0e10cSrcweir }
287cdf0e10cSrcweir 
288cdf0e10cSrcweir // ------------------------------------------------------------------------
289cdf0e10cSrcweir 
290cdf0e10cSrcweir void MetaPixelAction::Scale( double fScaleX, double fScaleY )
291cdf0e10cSrcweir {
292cdf0e10cSrcweir     ImplScalePoint( maPt, fScaleX, fScaleY );
293cdf0e10cSrcweir }
294cdf0e10cSrcweir 
295cdf0e10cSrcweir // ------------------------------------------------------------------------
296cdf0e10cSrcweir 
297cdf0e10cSrcweir sal_Bool MetaPixelAction::Compare( const MetaAction& rMetaAction ) const
298cdf0e10cSrcweir {
299cdf0e10cSrcweir     return ( maPt == ((MetaPixelAction&)rMetaAction).maPt ) &&
300cdf0e10cSrcweir            ( maColor == ((MetaPixelAction&)rMetaAction).maColor );
301cdf0e10cSrcweir }
302cdf0e10cSrcweir 
303cdf0e10cSrcweir // ------------------------------------------------------------------------
304cdf0e10cSrcweir 
305cdf0e10cSrcweir void MetaPixelAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
306cdf0e10cSrcweir {
307cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
308cdf0e10cSrcweir     rOStm << maPt;
309cdf0e10cSrcweir     maColor.Write( rOStm, sal_True );
310cdf0e10cSrcweir }
311cdf0e10cSrcweir 
312cdf0e10cSrcweir // ------------------------------------------------------------------------
313cdf0e10cSrcweir 
314cdf0e10cSrcweir void MetaPixelAction::Read( SvStream& rIStm, ImplMetaReadData* )
315cdf0e10cSrcweir {
316cdf0e10cSrcweir     COMPAT( rIStm );
317cdf0e10cSrcweir     rIStm >> maPt;
318cdf0e10cSrcweir     maColor.Read( rIStm, sal_True );
319cdf0e10cSrcweir }
320cdf0e10cSrcweir 
321cdf0e10cSrcweir // ========================================================================
322cdf0e10cSrcweir 
323cdf0e10cSrcweir IMPL_META_ACTION( Point, META_POINT_ACTION )
324cdf0e10cSrcweir 
325cdf0e10cSrcweir // ------------------------------------------------------------------------
326cdf0e10cSrcweir 
327cdf0e10cSrcweir MetaPointAction::MetaPointAction( const Point& rPt ) :
328cdf0e10cSrcweir     MetaAction  ( META_POINT_ACTION ),
329cdf0e10cSrcweir     maPt        ( rPt )
330cdf0e10cSrcweir {
331cdf0e10cSrcweir }
332cdf0e10cSrcweir 
333cdf0e10cSrcweir // ------------------------------------------------------------------------
334cdf0e10cSrcweir 
335cdf0e10cSrcweir void MetaPointAction::Execute( OutputDevice* pOut )
336cdf0e10cSrcweir {
337cdf0e10cSrcweir     pOut->DrawPixel( maPt );
338cdf0e10cSrcweir }
339cdf0e10cSrcweir 
340cdf0e10cSrcweir // ------------------------------------------------------------------------
341cdf0e10cSrcweir 
342cdf0e10cSrcweir MetaAction* MetaPointAction::Clone()
343cdf0e10cSrcweir {
344cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaPointAction( *this );
345cdf0e10cSrcweir     pClone->ResetRefCount();
346cdf0e10cSrcweir     return pClone;
347cdf0e10cSrcweir }
348cdf0e10cSrcweir 
349cdf0e10cSrcweir // ------------------------------------------------------------------------
350cdf0e10cSrcweir 
351cdf0e10cSrcweir void MetaPointAction::Move( long nHorzMove, long nVertMove )
352cdf0e10cSrcweir {
353cdf0e10cSrcweir     maPt.Move( nHorzMove, nVertMove );
354cdf0e10cSrcweir }
355cdf0e10cSrcweir 
356cdf0e10cSrcweir // ------------------------------------------------------------------------
357cdf0e10cSrcweir 
358cdf0e10cSrcweir void MetaPointAction::Scale( double fScaleX, double fScaleY )
359cdf0e10cSrcweir {
360cdf0e10cSrcweir     ImplScalePoint( maPt, fScaleX, fScaleY );
361cdf0e10cSrcweir }
362cdf0e10cSrcweir 
363cdf0e10cSrcweir // ------------------------------------------------------------------------
364cdf0e10cSrcweir 
365cdf0e10cSrcweir sal_Bool MetaPointAction::Compare( const MetaAction& rMetaAction ) const
366cdf0e10cSrcweir {
367cdf0e10cSrcweir     return maPt == ((MetaPointAction&)rMetaAction).maPt;
368cdf0e10cSrcweir }
369cdf0e10cSrcweir 
370cdf0e10cSrcweir // ------------------------------------------------------------------------
371cdf0e10cSrcweir 
372cdf0e10cSrcweir void MetaPointAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
373cdf0e10cSrcweir {
374cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
375cdf0e10cSrcweir     rOStm << maPt;
376cdf0e10cSrcweir }
377cdf0e10cSrcweir 
378cdf0e10cSrcweir // ------------------------------------------------------------------------
379cdf0e10cSrcweir 
380cdf0e10cSrcweir void MetaPointAction::Read( SvStream& rIStm, ImplMetaReadData* )
381cdf0e10cSrcweir {
382cdf0e10cSrcweir     COMPAT( rIStm );
383cdf0e10cSrcweir     rIStm >> maPt;
384cdf0e10cSrcweir }
385cdf0e10cSrcweir 
386cdf0e10cSrcweir // ========================================================================
387cdf0e10cSrcweir 
388cdf0e10cSrcweir IMPL_META_ACTION( Line, META_LINE_ACTION )
389cdf0e10cSrcweir 
390cdf0e10cSrcweir // ------------------------------------------------------------------------
391cdf0e10cSrcweir 
392cdf0e10cSrcweir MetaLineAction::MetaLineAction( const Point& rStart, const Point& rEnd ) :
393cdf0e10cSrcweir     MetaAction  ( META_LINE_ACTION ),
394cdf0e10cSrcweir     maStartPt   ( rStart ),
395cdf0e10cSrcweir     maEndPt     ( rEnd )
396cdf0e10cSrcweir {
397cdf0e10cSrcweir }
398cdf0e10cSrcweir 
399cdf0e10cSrcweir // ------------------------------------------------------------------------
400cdf0e10cSrcweir 
401cdf0e10cSrcweir MetaLineAction::MetaLineAction( const Point& rStart, const Point& rEnd,
402cdf0e10cSrcweir                                 const LineInfo& rLineInfo ) :
403cdf0e10cSrcweir     MetaAction  ( META_LINE_ACTION ),
404cdf0e10cSrcweir     maLineInfo  ( rLineInfo ),
405cdf0e10cSrcweir     maStartPt   ( rStart ),
406cdf0e10cSrcweir     maEndPt     ( rEnd )
407cdf0e10cSrcweir {
408cdf0e10cSrcweir }
409cdf0e10cSrcweir 
410cdf0e10cSrcweir // ------------------------------------------------------------------------
411cdf0e10cSrcweir 
412cdf0e10cSrcweir void MetaLineAction::Execute( OutputDevice* pOut )
413cdf0e10cSrcweir {
414cdf0e10cSrcweir     if( maLineInfo.IsDefault() )
415cdf0e10cSrcweir         pOut->DrawLine( maStartPt, maEndPt );
416cdf0e10cSrcweir     else
417cdf0e10cSrcweir         pOut->DrawLine( maStartPt, maEndPt, maLineInfo );
418cdf0e10cSrcweir }
419cdf0e10cSrcweir 
420cdf0e10cSrcweir // ------------------------------------------------------------------------
421cdf0e10cSrcweir 
422cdf0e10cSrcweir MetaAction* MetaLineAction::Clone()
423cdf0e10cSrcweir {
424cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaLineAction( *this );
425cdf0e10cSrcweir     pClone->ResetRefCount();
426cdf0e10cSrcweir     return pClone;
427cdf0e10cSrcweir }
428cdf0e10cSrcweir 
429cdf0e10cSrcweir // ------------------------------------------------------------------------
430cdf0e10cSrcweir 
431cdf0e10cSrcweir void MetaLineAction::Move( long nHorzMove, long nVertMove )
432cdf0e10cSrcweir {
433cdf0e10cSrcweir     maStartPt.Move( nHorzMove, nVertMove );
434cdf0e10cSrcweir     maEndPt.Move( nHorzMove, nVertMove );
435cdf0e10cSrcweir }
436cdf0e10cSrcweir 
437cdf0e10cSrcweir // ------------------------------------------------------------------------
438cdf0e10cSrcweir 
439cdf0e10cSrcweir void MetaLineAction::Scale( double fScaleX, double fScaleY )
440cdf0e10cSrcweir {
441cdf0e10cSrcweir     ImplScalePoint( maStartPt, fScaleX, fScaleY );
442cdf0e10cSrcweir     ImplScalePoint( maEndPt, fScaleX, fScaleY );
443cdf0e10cSrcweir     ImplScaleLineInfo( maLineInfo, fScaleX, fScaleY );
444cdf0e10cSrcweir }
445cdf0e10cSrcweir 
446cdf0e10cSrcweir // ------------------------------------------------------------------------
447cdf0e10cSrcweir 
448cdf0e10cSrcweir sal_Bool MetaLineAction::Compare( const MetaAction& rMetaAction ) const
449cdf0e10cSrcweir {
450cdf0e10cSrcweir     return ( maLineInfo == ((MetaLineAction&)rMetaAction).maLineInfo ) &&
451cdf0e10cSrcweir            ( maStartPt == ((MetaLineAction&)rMetaAction).maStartPt ) &&
452cdf0e10cSrcweir            ( maEndPt == ((MetaLineAction&)rMetaAction).maEndPt );
453cdf0e10cSrcweir }
454cdf0e10cSrcweir 
455cdf0e10cSrcweir // ------------------------------------------------------------------------
456cdf0e10cSrcweir 
457cdf0e10cSrcweir void MetaLineAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
458cdf0e10cSrcweir {
459cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 2, pData );
460cdf0e10cSrcweir 
461cdf0e10cSrcweir     rOStm << maStartPt << maEndPt;  // Version 1
462cdf0e10cSrcweir     rOStm << maLineInfo;            // Version 2
463cdf0e10cSrcweir }
464cdf0e10cSrcweir 
465cdf0e10cSrcweir // ------------------------------------------------------------------------
466cdf0e10cSrcweir 
467cdf0e10cSrcweir void MetaLineAction::Read( SvStream& rIStm, ImplMetaReadData* )
468cdf0e10cSrcweir {
469cdf0e10cSrcweir     COMPAT( rIStm );
470cdf0e10cSrcweir 
471cdf0e10cSrcweir     // Version 1
472cdf0e10cSrcweir     rIStm >> maStartPt >> maEndPt;
473cdf0e10cSrcweir 
474cdf0e10cSrcweir     // Version 2
475cdf0e10cSrcweir     if( aCompat.GetVersion() >= 2 )
476cdf0e10cSrcweir     {
477cdf0e10cSrcweir         rIStm >> maLineInfo;
478cdf0e10cSrcweir     }
479cdf0e10cSrcweir }
480cdf0e10cSrcweir 
481cdf0e10cSrcweir // ========================================================================
482cdf0e10cSrcweir 
483cdf0e10cSrcweir IMPL_META_ACTION( Rect, META_RECT_ACTION )
484cdf0e10cSrcweir 
485cdf0e10cSrcweir // ------------------------------------------------------------------------
486cdf0e10cSrcweir 
487cdf0e10cSrcweir MetaRectAction::MetaRectAction( const Rectangle& rRect ) :
488cdf0e10cSrcweir     MetaAction  ( META_RECT_ACTION ),
489cdf0e10cSrcweir     maRect      ( rRect )
490cdf0e10cSrcweir {
491cdf0e10cSrcweir }
492cdf0e10cSrcweir 
493cdf0e10cSrcweir // ------------------------------------------------------------------------
494cdf0e10cSrcweir 
495cdf0e10cSrcweir void MetaRectAction::Execute( OutputDevice* pOut )
496cdf0e10cSrcweir {
497cdf0e10cSrcweir     pOut->DrawRect( maRect );
498cdf0e10cSrcweir }
499cdf0e10cSrcweir 
500cdf0e10cSrcweir // ------------------------------------------------------------------------
501cdf0e10cSrcweir 
502cdf0e10cSrcweir MetaAction* MetaRectAction::Clone()
503cdf0e10cSrcweir {
504cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaRectAction( *this );
505cdf0e10cSrcweir     pClone->ResetRefCount();
506cdf0e10cSrcweir     return pClone;
507cdf0e10cSrcweir }
508cdf0e10cSrcweir 
509cdf0e10cSrcweir // ------------------------------------------------------------------------
510cdf0e10cSrcweir 
511cdf0e10cSrcweir void MetaRectAction::Move( long nHorzMove, long nVertMove )
512cdf0e10cSrcweir {
513cdf0e10cSrcweir     maRect.Move( nHorzMove, nVertMove );
514cdf0e10cSrcweir }
515cdf0e10cSrcweir 
516cdf0e10cSrcweir // ------------------------------------------------------------------------
517cdf0e10cSrcweir 
518cdf0e10cSrcweir void MetaRectAction::Scale( double fScaleX, double fScaleY )
519cdf0e10cSrcweir {
520cdf0e10cSrcweir     ImplScaleRect( maRect, fScaleX, fScaleY );
521cdf0e10cSrcweir }
522cdf0e10cSrcweir 
523cdf0e10cSrcweir // ------------------------------------------------------------------------
524cdf0e10cSrcweir 
525cdf0e10cSrcweir sal_Bool MetaRectAction::Compare( const MetaAction& rMetaAction ) const
526cdf0e10cSrcweir {
527cdf0e10cSrcweir     return maRect == ((MetaRectAction&)rMetaAction).maRect;
528cdf0e10cSrcweir }
529cdf0e10cSrcweir 
530cdf0e10cSrcweir // ------------------------------------------------------------------------
531cdf0e10cSrcweir 
532cdf0e10cSrcweir void MetaRectAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
533cdf0e10cSrcweir {
534cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
535cdf0e10cSrcweir     rOStm << maRect;
536cdf0e10cSrcweir }
537cdf0e10cSrcweir 
538cdf0e10cSrcweir // ------------------------------------------------------------------------
539cdf0e10cSrcweir 
540cdf0e10cSrcweir void MetaRectAction::Read( SvStream& rIStm, ImplMetaReadData* )
541cdf0e10cSrcweir {
542cdf0e10cSrcweir     COMPAT( rIStm );
543cdf0e10cSrcweir     rIStm >> maRect;
544cdf0e10cSrcweir }
545cdf0e10cSrcweir 
546cdf0e10cSrcweir // ========================================================================
547cdf0e10cSrcweir 
548cdf0e10cSrcweir IMPL_META_ACTION( RoundRect, META_ROUNDRECT_ACTION )
549cdf0e10cSrcweir 
550cdf0e10cSrcweir // ------------------------------------------------------------------------
551cdf0e10cSrcweir 
552cdf0e10cSrcweir MetaRoundRectAction::MetaRoundRectAction( const Rectangle& rRect,
553cdf0e10cSrcweir                                           sal_uInt32 nHorzRound, sal_uInt32 nVertRound ) :
554cdf0e10cSrcweir     MetaAction  ( META_ROUNDRECT_ACTION ),
555cdf0e10cSrcweir     maRect      ( rRect ),
556cdf0e10cSrcweir     mnHorzRound ( nHorzRound ),
557cdf0e10cSrcweir     mnVertRound ( nVertRound )
558cdf0e10cSrcweir {
559cdf0e10cSrcweir }
560cdf0e10cSrcweir 
561cdf0e10cSrcweir // ------------------------------------------------------------------------
562cdf0e10cSrcweir 
563cdf0e10cSrcweir void MetaRoundRectAction::Execute( OutputDevice* pOut )
564cdf0e10cSrcweir {
565cdf0e10cSrcweir     pOut->DrawRect( maRect, mnHorzRound, mnVertRound );
566cdf0e10cSrcweir }
567cdf0e10cSrcweir 
568cdf0e10cSrcweir // ------------------------------------------------------------------------
569cdf0e10cSrcweir 
570cdf0e10cSrcweir MetaAction* MetaRoundRectAction::Clone()
571cdf0e10cSrcweir {
572cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaRoundRectAction( *this );
573cdf0e10cSrcweir     pClone->ResetRefCount();
574cdf0e10cSrcweir     return pClone;
575cdf0e10cSrcweir }
576cdf0e10cSrcweir 
577cdf0e10cSrcweir // ------------------------------------------------------------------------
578cdf0e10cSrcweir 
579cdf0e10cSrcweir void MetaRoundRectAction::Move( long nHorzMove, long nVertMove )
580cdf0e10cSrcweir {
581cdf0e10cSrcweir     maRect.Move( nHorzMove, nVertMove );
582cdf0e10cSrcweir }
583cdf0e10cSrcweir 
584cdf0e10cSrcweir // ------------------------------------------------------------------------
585cdf0e10cSrcweir 
586cdf0e10cSrcweir void MetaRoundRectAction::Scale( double fScaleX, double fScaleY )
587cdf0e10cSrcweir {
588cdf0e10cSrcweir     ImplScaleRect( maRect, fScaleX, fScaleY );
589cdf0e10cSrcweir     mnHorzRound = FRound( mnHorzRound * fabs(fScaleX) );
590cdf0e10cSrcweir     mnVertRound = FRound( mnVertRound * fabs(fScaleY) );
591cdf0e10cSrcweir }
592cdf0e10cSrcweir 
593cdf0e10cSrcweir // ------------------------------------------------------------------------
594cdf0e10cSrcweir 
595cdf0e10cSrcweir sal_Bool MetaRoundRectAction::Compare( const MetaAction& rMetaAction ) const
596cdf0e10cSrcweir {
597cdf0e10cSrcweir     return ( maRect == ((MetaRoundRectAction&)rMetaAction).maRect ) &&
598cdf0e10cSrcweir            ( mnHorzRound == ((MetaRoundRectAction&)rMetaAction).mnHorzRound ) &&
599cdf0e10cSrcweir            ( mnVertRound == ((MetaRoundRectAction&)rMetaAction).mnVertRound );
600cdf0e10cSrcweir }
601cdf0e10cSrcweir 
602cdf0e10cSrcweir // ------------------------------------------------------------------------
603cdf0e10cSrcweir 
604cdf0e10cSrcweir void MetaRoundRectAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
605cdf0e10cSrcweir {
606cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
607cdf0e10cSrcweir     rOStm << maRect << mnHorzRound << mnVertRound;
608cdf0e10cSrcweir }
609cdf0e10cSrcweir 
610cdf0e10cSrcweir // ------------------------------------------------------------------------
611cdf0e10cSrcweir 
612cdf0e10cSrcweir void MetaRoundRectAction::Read( SvStream& rIStm, ImplMetaReadData* )
613cdf0e10cSrcweir {
614cdf0e10cSrcweir     COMPAT( rIStm );
615cdf0e10cSrcweir     rIStm >> maRect >> mnHorzRound >> mnVertRound;
616cdf0e10cSrcweir }
617cdf0e10cSrcweir 
618cdf0e10cSrcweir // ========================================================================
619cdf0e10cSrcweir 
620cdf0e10cSrcweir IMPL_META_ACTION( Ellipse, META_ELLIPSE_ACTION )
621cdf0e10cSrcweir 
622cdf0e10cSrcweir // ------------------------------------------------------------------------
623cdf0e10cSrcweir 
624cdf0e10cSrcweir MetaEllipseAction::MetaEllipseAction( const Rectangle& rRect ) :
625cdf0e10cSrcweir     MetaAction  ( META_ELLIPSE_ACTION ),
626cdf0e10cSrcweir     maRect      ( rRect )
627cdf0e10cSrcweir {
628cdf0e10cSrcweir }
629cdf0e10cSrcweir 
630cdf0e10cSrcweir // ------------------------------------------------------------------------
631cdf0e10cSrcweir 
632cdf0e10cSrcweir void MetaEllipseAction::Execute( OutputDevice* pOut )
633cdf0e10cSrcweir {
634cdf0e10cSrcweir     pOut->DrawEllipse( maRect );
635cdf0e10cSrcweir }
636cdf0e10cSrcweir 
637cdf0e10cSrcweir // ------------------------------------------------------------------------
638cdf0e10cSrcweir 
639cdf0e10cSrcweir MetaAction* MetaEllipseAction::Clone()
640cdf0e10cSrcweir {
641cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaEllipseAction( *this );
642cdf0e10cSrcweir     pClone->ResetRefCount();
643cdf0e10cSrcweir     return pClone;
644cdf0e10cSrcweir }
645cdf0e10cSrcweir 
646cdf0e10cSrcweir // ------------------------------------------------------------------------
647cdf0e10cSrcweir 
648cdf0e10cSrcweir void MetaEllipseAction::Move( long nHorzMove, long nVertMove )
649cdf0e10cSrcweir {
650cdf0e10cSrcweir     maRect.Move( nHorzMove, nVertMove );
651cdf0e10cSrcweir }
652cdf0e10cSrcweir 
653cdf0e10cSrcweir // ------------------------------------------------------------------------
654cdf0e10cSrcweir 
655cdf0e10cSrcweir void MetaEllipseAction::Scale( double fScaleX, double fScaleY )
656cdf0e10cSrcweir {
657cdf0e10cSrcweir     ImplScaleRect( maRect, fScaleX, fScaleY );
658cdf0e10cSrcweir }
659cdf0e10cSrcweir 
660cdf0e10cSrcweir // ------------------------------------------------------------------------
661cdf0e10cSrcweir 
662cdf0e10cSrcweir sal_Bool MetaEllipseAction::Compare( const MetaAction& rMetaAction ) const
663cdf0e10cSrcweir {
664cdf0e10cSrcweir     return maRect == ((MetaEllipseAction&)rMetaAction).maRect;
665cdf0e10cSrcweir }
666cdf0e10cSrcweir 
667cdf0e10cSrcweir // ------------------------------------------------------------------------
668cdf0e10cSrcweir 
669cdf0e10cSrcweir void MetaEllipseAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
670cdf0e10cSrcweir {
671cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
672cdf0e10cSrcweir     rOStm << maRect;
673cdf0e10cSrcweir }
674cdf0e10cSrcweir 
675cdf0e10cSrcweir // ------------------------------------------------------------------------
676cdf0e10cSrcweir 
677cdf0e10cSrcweir void MetaEllipseAction::Read( SvStream& rIStm, ImplMetaReadData* )
678cdf0e10cSrcweir {
679cdf0e10cSrcweir     COMPAT( rIStm );
680cdf0e10cSrcweir     rIStm >> maRect;
681cdf0e10cSrcweir }
682cdf0e10cSrcweir 
683cdf0e10cSrcweir // ========================================================================
684cdf0e10cSrcweir 
685cdf0e10cSrcweir IMPL_META_ACTION( Arc, META_ARC_ACTION )
686cdf0e10cSrcweir 
687cdf0e10cSrcweir // ------------------------------------------------------------------------
688cdf0e10cSrcweir 
689cdf0e10cSrcweir MetaArcAction::MetaArcAction( const Rectangle& rRect,
690cdf0e10cSrcweir                               const Point& rStart, const Point& rEnd ) :
691cdf0e10cSrcweir     MetaAction  ( META_ARC_ACTION ),
692cdf0e10cSrcweir     maRect      ( rRect ),
693cdf0e10cSrcweir     maStartPt   ( rStart ),
694cdf0e10cSrcweir     maEndPt     ( rEnd )
695cdf0e10cSrcweir {
696cdf0e10cSrcweir }
697cdf0e10cSrcweir 
698cdf0e10cSrcweir // ------------------------------------------------------------------------
699cdf0e10cSrcweir 
700cdf0e10cSrcweir void MetaArcAction::Execute( OutputDevice* pOut )
701cdf0e10cSrcweir {
702cdf0e10cSrcweir     pOut->DrawArc( maRect, maStartPt, maEndPt );
703cdf0e10cSrcweir }
704cdf0e10cSrcweir 
705cdf0e10cSrcweir // ------------------------------------------------------------------------
706cdf0e10cSrcweir 
707cdf0e10cSrcweir MetaAction* MetaArcAction::Clone()
708cdf0e10cSrcweir {
709cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaArcAction( *this );
710cdf0e10cSrcweir     pClone->ResetRefCount();
711cdf0e10cSrcweir     return pClone;
712cdf0e10cSrcweir }
713cdf0e10cSrcweir 
714cdf0e10cSrcweir // ------------------------------------------------------------------------
715cdf0e10cSrcweir 
716cdf0e10cSrcweir void MetaArcAction::Move( long nHorzMove, long nVertMove )
717cdf0e10cSrcweir {
718cdf0e10cSrcweir     maRect.Move(  nHorzMove, nVertMove );
719cdf0e10cSrcweir     maStartPt.Move(  nHorzMove, nVertMove );
720cdf0e10cSrcweir     maEndPt.Move(  nHorzMove, nVertMove );
721cdf0e10cSrcweir }
722cdf0e10cSrcweir 
723cdf0e10cSrcweir // ------------------------------------------------------------------------
724cdf0e10cSrcweir 
725cdf0e10cSrcweir void MetaArcAction::Scale( double fScaleX, double fScaleY )
726cdf0e10cSrcweir {
727cdf0e10cSrcweir     ImplScaleRect( maRect, fScaleX, fScaleY );
728cdf0e10cSrcweir     ImplScalePoint( maStartPt, fScaleX, fScaleY );
729cdf0e10cSrcweir     ImplScalePoint( maEndPt, fScaleX, fScaleY );
730cdf0e10cSrcweir }
731cdf0e10cSrcweir 
732cdf0e10cSrcweir // ------------------------------------------------------------------------
733cdf0e10cSrcweir 
734cdf0e10cSrcweir sal_Bool MetaArcAction::Compare( const MetaAction& rMetaAction ) const
735cdf0e10cSrcweir {
736cdf0e10cSrcweir     return ( maRect == ((MetaArcAction&)rMetaAction).maRect ) &&
737cdf0e10cSrcweir            ( maStartPt == ((MetaArcAction&)rMetaAction).maStartPt ) &&
738cdf0e10cSrcweir            ( maEndPt == ((MetaArcAction&)rMetaAction).maEndPt );
739cdf0e10cSrcweir }
740cdf0e10cSrcweir 
741cdf0e10cSrcweir // ------------------------------------------------------------------------
742cdf0e10cSrcweir 
743cdf0e10cSrcweir void MetaArcAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
744cdf0e10cSrcweir {
745cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
746cdf0e10cSrcweir     rOStm << maRect << maStartPt << maEndPt;
747cdf0e10cSrcweir }
748cdf0e10cSrcweir 
749cdf0e10cSrcweir // ------------------------------------------------------------------------
750cdf0e10cSrcweir 
751cdf0e10cSrcweir void MetaArcAction::Read( SvStream& rIStm, ImplMetaReadData* )
752cdf0e10cSrcweir {
753cdf0e10cSrcweir     COMPAT( rIStm );
754cdf0e10cSrcweir     rIStm >> maRect >> maStartPt >> maEndPt;
755cdf0e10cSrcweir }
756cdf0e10cSrcweir 
757cdf0e10cSrcweir // ========================================================================
758cdf0e10cSrcweir 
759cdf0e10cSrcweir IMPL_META_ACTION( Pie, META_PIE_ACTION )
760cdf0e10cSrcweir 
761cdf0e10cSrcweir // ------------------------------------------------------------------------
762cdf0e10cSrcweir 
763cdf0e10cSrcweir MetaPieAction::MetaPieAction( const Rectangle& rRect,
764cdf0e10cSrcweir                               const Point& rStart, const Point& rEnd ) :
765cdf0e10cSrcweir     MetaAction  ( META_PIE_ACTION ),
766cdf0e10cSrcweir     maRect      ( rRect ),
767cdf0e10cSrcweir     maStartPt   ( rStart ),
768cdf0e10cSrcweir     maEndPt     ( rEnd )
769cdf0e10cSrcweir {
770cdf0e10cSrcweir }
771cdf0e10cSrcweir 
772cdf0e10cSrcweir // ------------------------------------------------------------------------
773cdf0e10cSrcweir 
774cdf0e10cSrcweir void MetaPieAction::Execute( OutputDevice* pOut )
775cdf0e10cSrcweir {
776cdf0e10cSrcweir     pOut->DrawPie( maRect, maStartPt, maEndPt );
777cdf0e10cSrcweir }
778cdf0e10cSrcweir 
779cdf0e10cSrcweir // ------------------------------------------------------------------------
780cdf0e10cSrcweir 
781cdf0e10cSrcweir MetaAction* MetaPieAction::Clone()
782cdf0e10cSrcweir {
783cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaPieAction( *this );
784cdf0e10cSrcweir     pClone->ResetRefCount();
785cdf0e10cSrcweir     return pClone;
786cdf0e10cSrcweir }
787cdf0e10cSrcweir 
788cdf0e10cSrcweir // ------------------------------------------------------------------------
789cdf0e10cSrcweir 
790cdf0e10cSrcweir void MetaPieAction::Move( long nHorzMove, long nVertMove )
791cdf0e10cSrcweir {
792cdf0e10cSrcweir     maRect.Move(  nHorzMove, nVertMove );
793cdf0e10cSrcweir     maStartPt.Move(  nHorzMove, nVertMove );
794cdf0e10cSrcweir     maEndPt.Move(  nHorzMove, nVertMove );
795cdf0e10cSrcweir }
796cdf0e10cSrcweir 
797cdf0e10cSrcweir // ------------------------------------------------------------------------
798cdf0e10cSrcweir 
799cdf0e10cSrcweir void MetaPieAction::Scale( double fScaleX, double fScaleY )
800cdf0e10cSrcweir {
801cdf0e10cSrcweir     ImplScaleRect( maRect, fScaleX, fScaleY );
802cdf0e10cSrcweir     ImplScalePoint( maStartPt, fScaleX, fScaleY );
803cdf0e10cSrcweir     ImplScalePoint( maEndPt, fScaleX, fScaleY );
804cdf0e10cSrcweir }
805cdf0e10cSrcweir 
806cdf0e10cSrcweir // ------------------------------------------------------------------------
807cdf0e10cSrcweir 
808cdf0e10cSrcweir sal_Bool MetaPieAction::Compare( const MetaAction& rMetaAction ) const
809cdf0e10cSrcweir {
810cdf0e10cSrcweir     return ( maRect == ((MetaPieAction&)rMetaAction).maRect ) &&
811cdf0e10cSrcweir            ( maStartPt == ((MetaPieAction&)rMetaAction).maStartPt ) &&
812cdf0e10cSrcweir            ( maEndPt == ((MetaPieAction&)rMetaAction).maEndPt );
813cdf0e10cSrcweir }
814cdf0e10cSrcweir 
815cdf0e10cSrcweir // ------------------------------------------------------------------------
816cdf0e10cSrcweir 
817cdf0e10cSrcweir void MetaPieAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
818cdf0e10cSrcweir {
819cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
820cdf0e10cSrcweir     rOStm << maRect << maStartPt << maEndPt;
821cdf0e10cSrcweir }
822cdf0e10cSrcweir 
823cdf0e10cSrcweir // ------------------------------------------------------------------------
824cdf0e10cSrcweir 
825cdf0e10cSrcweir void MetaPieAction::Read( SvStream& rIStm, ImplMetaReadData* )
826cdf0e10cSrcweir {
827cdf0e10cSrcweir     COMPAT( rIStm );
828cdf0e10cSrcweir     rIStm >> maRect >> maStartPt >> maEndPt;
829cdf0e10cSrcweir }
830cdf0e10cSrcweir 
831cdf0e10cSrcweir // ========================================================================
832cdf0e10cSrcweir 
833cdf0e10cSrcweir IMPL_META_ACTION( Chord, META_CHORD_ACTION )
834cdf0e10cSrcweir 
835cdf0e10cSrcweir // ------------------------------------------------------------------------
836cdf0e10cSrcweir 
837cdf0e10cSrcweir MetaChordAction::MetaChordAction( const Rectangle& rRect,
838cdf0e10cSrcweir                                   const Point& rStart, const Point& rEnd ) :
839cdf0e10cSrcweir     MetaAction  ( META_CHORD_ACTION ),
840cdf0e10cSrcweir     maRect      ( rRect ),
841cdf0e10cSrcweir     maStartPt   ( rStart ),
842cdf0e10cSrcweir     maEndPt     ( rEnd )
843cdf0e10cSrcweir {
844cdf0e10cSrcweir }
845cdf0e10cSrcweir 
846cdf0e10cSrcweir // ------------------------------------------------------------------------
847cdf0e10cSrcweir 
848cdf0e10cSrcweir void MetaChordAction::Execute( OutputDevice* pOut )
849cdf0e10cSrcweir {
850cdf0e10cSrcweir     pOut->DrawChord( maRect, maStartPt, maEndPt );
851cdf0e10cSrcweir }
852cdf0e10cSrcweir 
853cdf0e10cSrcweir // ------------------------------------------------------------------------
854cdf0e10cSrcweir 
855cdf0e10cSrcweir MetaAction* MetaChordAction::Clone()
856cdf0e10cSrcweir {
857cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaChordAction( *this );
858cdf0e10cSrcweir     pClone->ResetRefCount();
859cdf0e10cSrcweir     return pClone;
860cdf0e10cSrcweir }
861cdf0e10cSrcweir 
862cdf0e10cSrcweir // ------------------------------------------------------------------------
863cdf0e10cSrcweir 
864cdf0e10cSrcweir void MetaChordAction::Move( long nHorzMove, long nVertMove )
865cdf0e10cSrcweir {
866cdf0e10cSrcweir     maRect.Move(  nHorzMove, nVertMove );
867cdf0e10cSrcweir     maStartPt.Move(  nHorzMove, nVertMove );
868cdf0e10cSrcweir     maEndPt.Move(  nHorzMove, nVertMove );
869cdf0e10cSrcweir }
870cdf0e10cSrcweir 
871cdf0e10cSrcweir // ------------------------------------------------------------------------
872cdf0e10cSrcweir 
873cdf0e10cSrcweir void MetaChordAction::Scale( double fScaleX, double fScaleY )
874cdf0e10cSrcweir {
875cdf0e10cSrcweir     ImplScaleRect( maRect, fScaleX, fScaleY );
876cdf0e10cSrcweir     ImplScalePoint( maStartPt, fScaleX, fScaleY );
877cdf0e10cSrcweir     ImplScalePoint( maEndPt, fScaleX, fScaleY );
878cdf0e10cSrcweir }
879cdf0e10cSrcweir 
880cdf0e10cSrcweir // ------------------------------------------------------------------------
881cdf0e10cSrcweir 
882cdf0e10cSrcweir sal_Bool MetaChordAction::Compare( const MetaAction& rMetaAction ) const
883cdf0e10cSrcweir {
884cdf0e10cSrcweir     return ( maRect == ((MetaChordAction&)rMetaAction).maRect ) &&
885cdf0e10cSrcweir            ( maStartPt == ((MetaChordAction&)rMetaAction).maStartPt ) &&
886cdf0e10cSrcweir            ( maEndPt == ((MetaChordAction&)rMetaAction).maEndPt );
887cdf0e10cSrcweir }
888cdf0e10cSrcweir 
889cdf0e10cSrcweir // ------------------------------------------------------------------------
890cdf0e10cSrcweir 
891cdf0e10cSrcweir void MetaChordAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
892cdf0e10cSrcweir {
893cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
894cdf0e10cSrcweir     rOStm << maRect << maStartPt << maEndPt;
895cdf0e10cSrcweir }
896cdf0e10cSrcweir 
897cdf0e10cSrcweir // ------------------------------------------------------------------------
898cdf0e10cSrcweir 
899cdf0e10cSrcweir void MetaChordAction::Read( SvStream& rIStm, ImplMetaReadData* )
900cdf0e10cSrcweir {
901cdf0e10cSrcweir     COMPAT( rIStm );
902cdf0e10cSrcweir     rIStm >> maRect >> maStartPt >> maEndPt;
903cdf0e10cSrcweir }
904cdf0e10cSrcweir 
905cdf0e10cSrcweir // ========================================================================
906cdf0e10cSrcweir 
907cdf0e10cSrcweir IMPL_META_ACTION( PolyLine, META_POLYLINE_ACTION )
908cdf0e10cSrcweir 
909cdf0e10cSrcweir // ------------------------------------------------------------------------
910cdf0e10cSrcweir 
911cdf0e10cSrcweir MetaPolyLineAction::MetaPolyLineAction( const Polygon& rPoly ) :
912cdf0e10cSrcweir     MetaAction  ( META_POLYLINE_ACTION ),
913cdf0e10cSrcweir     maPoly      ( rPoly )
914cdf0e10cSrcweir {
915cdf0e10cSrcweir }
916cdf0e10cSrcweir 
917cdf0e10cSrcweir // ------------------------------------------------------------------------
918cdf0e10cSrcweir 
919cdf0e10cSrcweir MetaPolyLineAction::MetaPolyLineAction( const Polygon& rPoly, const LineInfo& rLineInfo ) :
920cdf0e10cSrcweir     MetaAction  ( META_POLYLINE_ACTION ),
921cdf0e10cSrcweir     maLineInfo  ( rLineInfo ),
922cdf0e10cSrcweir     maPoly      ( rPoly )
923cdf0e10cSrcweir {
924cdf0e10cSrcweir }
925cdf0e10cSrcweir 
926cdf0e10cSrcweir // ------------------------------------------------------------------------
927cdf0e10cSrcweir 
928cdf0e10cSrcweir void MetaPolyLineAction::Execute( OutputDevice* pOut )
929cdf0e10cSrcweir {
930cdf0e10cSrcweir     if( maLineInfo.IsDefault() )
931cdf0e10cSrcweir         pOut->DrawPolyLine( maPoly );
932cdf0e10cSrcweir     else
933cdf0e10cSrcweir         pOut->DrawPolyLine( maPoly, maLineInfo );
934cdf0e10cSrcweir }
935cdf0e10cSrcweir 
936cdf0e10cSrcweir // ------------------------------------------------------------------------
937cdf0e10cSrcweir 
938cdf0e10cSrcweir MetaAction* MetaPolyLineAction::Clone()
939cdf0e10cSrcweir {
940cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaPolyLineAction( *this );
941cdf0e10cSrcweir     pClone->ResetRefCount();
942cdf0e10cSrcweir     return pClone;
943cdf0e10cSrcweir }
944cdf0e10cSrcweir 
945cdf0e10cSrcweir // ------------------------------------------------------------------------
946cdf0e10cSrcweir 
947cdf0e10cSrcweir void MetaPolyLineAction::Move( long nHorzMove, long nVertMove )
948cdf0e10cSrcweir {
949cdf0e10cSrcweir     maPoly.Move( nHorzMove, nVertMove );
950cdf0e10cSrcweir }
951cdf0e10cSrcweir 
952cdf0e10cSrcweir // ------------------------------------------------------------------------
953cdf0e10cSrcweir 
954cdf0e10cSrcweir void MetaPolyLineAction::Scale( double fScaleX, double fScaleY )
955cdf0e10cSrcweir {
956cdf0e10cSrcweir     ImplScalePoly( maPoly, fScaleX, fScaleY );
957cdf0e10cSrcweir     ImplScaleLineInfo( maLineInfo, fScaleX, fScaleY );
958cdf0e10cSrcweir }
959cdf0e10cSrcweir 
960cdf0e10cSrcweir // ------------------------------------------------------------------------
961cdf0e10cSrcweir 
962cdf0e10cSrcweir sal_Bool MetaPolyLineAction::Compare( const MetaAction& rMetaAction ) const
963cdf0e10cSrcweir {
964cdf0e10cSrcweir     sal_Bool bIsEqual = sal_True;;
965cdf0e10cSrcweir     if ( maLineInfo != ((MetaPolyLineAction&)rMetaAction).maLineInfo )
966cdf0e10cSrcweir         bIsEqual = sal_False;
967cdf0e10cSrcweir     else
968cdf0e10cSrcweir         bIsEqual = maPoly.IsEqual(((MetaPolyLineAction&)rMetaAction).maPoly );
969cdf0e10cSrcweir     return bIsEqual;
970cdf0e10cSrcweir 
971cdf0e10cSrcweir }
972cdf0e10cSrcweir 
973cdf0e10cSrcweir // ------------------------------------------------------------------------
974cdf0e10cSrcweir 
975cdf0e10cSrcweir void MetaPolyLineAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
976cdf0e10cSrcweir {
977cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 3, pData );
978cdf0e10cSrcweir 
979cdf0e10cSrcweir     Polygon aSimplePoly;
980cdf0e10cSrcweir     maPoly.AdaptiveSubdivide( aSimplePoly );
981cdf0e10cSrcweir 
982cdf0e10cSrcweir     rOStm << aSimplePoly;                               // Version 1
983cdf0e10cSrcweir     rOStm << maLineInfo;                                // Version 2
984cdf0e10cSrcweir 
985cdf0e10cSrcweir     sal_uInt8 bHasPolyFlags = maPoly.HasFlags();        // Version 3
986cdf0e10cSrcweir     rOStm << bHasPolyFlags;
987cdf0e10cSrcweir     if ( bHasPolyFlags )
988cdf0e10cSrcweir         maPoly.Write( rOStm );
989cdf0e10cSrcweir }
990cdf0e10cSrcweir 
991cdf0e10cSrcweir // ------------------------------------------------------------------------
992cdf0e10cSrcweir 
993cdf0e10cSrcweir void MetaPolyLineAction::Read( SvStream& rIStm, ImplMetaReadData* )
994cdf0e10cSrcweir {
995cdf0e10cSrcweir     COMPAT( rIStm );
996cdf0e10cSrcweir 
997cdf0e10cSrcweir     // Version 1
998cdf0e10cSrcweir     rIStm >> maPoly;
999cdf0e10cSrcweir 
1000cdf0e10cSrcweir     // Version 2
1001cdf0e10cSrcweir     if( aCompat.GetVersion() >= 2 )
1002cdf0e10cSrcweir         rIStm >> maLineInfo;
1003cdf0e10cSrcweir     if ( aCompat.GetVersion() >= 3 )
1004cdf0e10cSrcweir     {
1005cdf0e10cSrcweir         sal_uInt8 bHasPolyFlags;
1006cdf0e10cSrcweir         rIStm >> bHasPolyFlags;
1007cdf0e10cSrcweir         if ( bHasPolyFlags )
1008cdf0e10cSrcweir             maPoly.Read( rIStm );
1009cdf0e10cSrcweir     }
1010cdf0e10cSrcweir }
1011cdf0e10cSrcweir 
1012cdf0e10cSrcweir // ========================================================================
1013cdf0e10cSrcweir 
1014cdf0e10cSrcweir IMPL_META_ACTION( Polygon, META_POLYGON_ACTION )
1015cdf0e10cSrcweir 
1016cdf0e10cSrcweir // ------------------------------------------------------------------------
1017cdf0e10cSrcweir 
1018cdf0e10cSrcweir MetaPolygonAction::MetaPolygonAction( const Polygon& rPoly ) :
1019cdf0e10cSrcweir     MetaAction  ( META_POLYGON_ACTION ),
1020cdf0e10cSrcweir     maPoly      ( rPoly )
1021cdf0e10cSrcweir {
1022cdf0e10cSrcweir }
1023cdf0e10cSrcweir 
1024cdf0e10cSrcweir // ------------------------------------------------------------------------
1025cdf0e10cSrcweir 
1026cdf0e10cSrcweir void MetaPolygonAction::Execute( OutputDevice* pOut )
1027cdf0e10cSrcweir {
1028cdf0e10cSrcweir     pOut->DrawPolygon( maPoly );
1029cdf0e10cSrcweir }
1030cdf0e10cSrcweir 
1031cdf0e10cSrcweir // ------------------------------------------------------------------------
1032cdf0e10cSrcweir 
1033cdf0e10cSrcweir MetaAction* MetaPolygonAction::Clone()
1034cdf0e10cSrcweir {
1035cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaPolygonAction( *this );
1036cdf0e10cSrcweir     pClone->ResetRefCount();
1037cdf0e10cSrcweir     return pClone;
1038cdf0e10cSrcweir }
1039cdf0e10cSrcweir 
1040cdf0e10cSrcweir // ------------------------------------------------------------------------
1041cdf0e10cSrcweir 
1042cdf0e10cSrcweir void MetaPolygonAction::Move( long nHorzMove, long nVertMove )
1043cdf0e10cSrcweir {
1044cdf0e10cSrcweir     maPoly.Move( nHorzMove, nVertMove );
1045cdf0e10cSrcweir }
1046cdf0e10cSrcweir 
1047cdf0e10cSrcweir // ------------------------------------------------------------------------
1048cdf0e10cSrcweir 
1049cdf0e10cSrcweir void MetaPolygonAction::Scale( double fScaleX, double fScaleY )
1050cdf0e10cSrcweir {
1051cdf0e10cSrcweir     ImplScalePoly( maPoly, fScaleX, fScaleY );
1052cdf0e10cSrcweir }
1053cdf0e10cSrcweir 
1054cdf0e10cSrcweir // ------------------------------------------------------------------------
1055cdf0e10cSrcweir 
1056cdf0e10cSrcweir sal_Bool MetaPolygonAction::Compare( const MetaAction& rMetaAction ) const
1057cdf0e10cSrcweir {
1058cdf0e10cSrcweir     return maPoly.IsEqual(((MetaPolygonAction&)rMetaAction).maPoly );
1059cdf0e10cSrcweir }
1060cdf0e10cSrcweir 
1061cdf0e10cSrcweir // ------------------------------------------------------------------------
1062cdf0e10cSrcweir 
1063cdf0e10cSrcweir void MetaPolygonAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
1064cdf0e10cSrcweir {
1065cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 2, pData );
1066cdf0e10cSrcweir 
1067cdf0e10cSrcweir     Polygon aSimplePoly;                            // Version 1
1068cdf0e10cSrcweir     maPoly.AdaptiveSubdivide( aSimplePoly );
1069cdf0e10cSrcweir     rOStm << aSimplePoly;
1070cdf0e10cSrcweir 
1071cdf0e10cSrcweir     sal_uInt8 bHasPolyFlags = maPoly.HasFlags();    // Version 2
1072cdf0e10cSrcweir     rOStm << bHasPolyFlags;
1073cdf0e10cSrcweir     if ( bHasPolyFlags )
1074cdf0e10cSrcweir         maPoly.Write( rOStm );
1075cdf0e10cSrcweir }
1076cdf0e10cSrcweir 
1077cdf0e10cSrcweir // ------------------------------------------------------------------------
1078cdf0e10cSrcweir 
1079cdf0e10cSrcweir void MetaPolygonAction::Read( SvStream& rIStm, ImplMetaReadData* )
1080cdf0e10cSrcweir {
1081cdf0e10cSrcweir     COMPAT( rIStm );
1082cdf0e10cSrcweir 
1083cdf0e10cSrcweir     rIStm >> maPoly;                    // Version 1
1084cdf0e10cSrcweir 
1085cdf0e10cSrcweir     if( aCompat.GetVersion() >= 2 )     // Version 2
1086cdf0e10cSrcweir     {
1087cdf0e10cSrcweir         sal_uInt8 bHasPolyFlags;
1088cdf0e10cSrcweir         rIStm >> bHasPolyFlags;
1089cdf0e10cSrcweir         if ( bHasPolyFlags )
1090cdf0e10cSrcweir             maPoly.Read( rIStm );
1091cdf0e10cSrcweir     }
1092cdf0e10cSrcweir }
1093cdf0e10cSrcweir 
1094cdf0e10cSrcweir // ========================================================================
1095cdf0e10cSrcweir 
1096cdf0e10cSrcweir IMPL_META_ACTION( PolyPolygon, META_POLYPOLYGON_ACTION )
1097cdf0e10cSrcweir 
1098cdf0e10cSrcweir // ------------------------------------------------------------------------
1099cdf0e10cSrcweir 
1100cdf0e10cSrcweir MetaPolyPolygonAction::MetaPolyPolygonAction( const PolyPolygon& rPolyPoly ) :
1101cdf0e10cSrcweir     MetaAction  ( META_POLYPOLYGON_ACTION ),
1102cdf0e10cSrcweir     maPolyPoly  ( rPolyPoly )
1103cdf0e10cSrcweir {
1104cdf0e10cSrcweir }
1105cdf0e10cSrcweir 
1106cdf0e10cSrcweir // ------------------------------------------------------------------------
1107cdf0e10cSrcweir 
1108cdf0e10cSrcweir void MetaPolyPolygonAction::Execute( OutputDevice* pOut )
1109cdf0e10cSrcweir {
1110cdf0e10cSrcweir     pOut->DrawPolyPolygon( maPolyPoly );
1111cdf0e10cSrcweir }
1112cdf0e10cSrcweir 
1113cdf0e10cSrcweir // ------------------------------------------------------------------------
1114cdf0e10cSrcweir 
1115cdf0e10cSrcweir MetaAction* MetaPolyPolygonAction::Clone()
1116cdf0e10cSrcweir {
1117cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaPolyPolygonAction( *this );
1118cdf0e10cSrcweir     pClone->ResetRefCount();
1119cdf0e10cSrcweir     return pClone;
1120cdf0e10cSrcweir }
1121cdf0e10cSrcweir 
1122cdf0e10cSrcweir // ------------------------------------------------------------------------
1123cdf0e10cSrcweir 
1124cdf0e10cSrcweir void MetaPolyPolygonAction::Move( long nHorzMove, long nVertMove )
1125cdf0e10cSrcweir {
1126cdf0e10cSrcweir     maPolyPoly.Move( nHorzMove, nVertMove );
1127cdf0e10cSrcweir }
1128cdf0e10cSrcweir 
1129cdf0e10cSrcweir // ------------------------------------------------------------------------
1130cdf0e10cSrcweir 
1131cdf0e10cSrcweir void MetaPolyPolygonAction::Scale( double fScaleX, double fScaleY )
1132cdf0e10cSrcweir {
1133cdf0e10cSrcweir     for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
1134cdf0e10cSrcweir         ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
1135cdf0e10cSrcweir }
1136cdf0e10cSrcweir 
1137cdf0e10cSrcweir // ------------------------------------------------------------------------
1138cdf0e10cSrcweir 
1139cdf0e10cSrcweir sal_Bool MetaPolyPolygonAction::Compare( const MetaAction& rMetaAction ) const
1140cdf0e10cSrcweir {
1141cdf0e10cSrcweir     return maPolyPoly.IsEqual(((MetaPolyPolygonAction&)rMetaAction).maPolyPoly );
1142cdf0e10cSrcweir }
1143cdf0e10cSrcweir 
1144cdf0e10cSrcweir // ------------------------------------------------------------------------
1145cdf0e10cSrcweir 
1146cdf0e10cSrcweir void MetaPolyPolygonAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
1147cdf0e10cSrcweir {
1148cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 2, pData );
1149cdf0e10cSrcweir 
1150cdf0e10cSrcweir     sal_uInt16 nNumberOfComplexPolygons = 0;
1151cdf0e10cSrcweir     sal_uInt16 i, nPolyCount = maPolyPoly.Count();
1152cdf0e10cSrcweir 
1153cdf0e10cSrcweir     Polygon aSimplePoly;                                // Version 1
1154cdf0e10cSrcweir     rOStm << nPolyCount;
1155cdf0e10cSrcweir     for ( i = 0; i < nPolyCount; i++ )
1156cdf0e10cSrcweir     {
1157cdf0e10cSrcweir         const Polygon& rPoly = maPolyPoly.GetObject( i );
1158cdf0e10cSrcweir         if ( rPoly.HasFlags() )
1159cdf0e10cSrcweir             nNumberOfComplexPolygons++;
1160cdf0e10cSrcweir         rPoly.AdaptiveSubdivide( aSimplePoly );
1161cdf0e10cSrcweir         rOStm << aSimplePoly;
1162cdf0e10cSrcweir     }
1163cdf0e10cSrcweir 
1164cdf0e10cSrcweir     rOStm << nNumberOfComplexPolygons;                  // Version 2
1165cdf0e10cSrcweir     for ( i = 0; nNumberOfComplexPolygons && ( i < nPolyCount ); i++ )
1166cdf0e10cSrcweir     {
1167cdf0e10cSrcweir         const Polygon& rPoly = maPolyPoly.GetObject( i );
1168cdf0e10cSrcweir         if ( rPoly.HasFlags() )
1169cdf0e10cSrcweir         {
1170cdf0e10cSrcweir             rOStm << i;
1171cdf0e10cSrcweir             rPoly.Write( rOStm );
1172cdf0e10cSrcweir 
1173cdf0e10cSrcweir             nNumberOfComplexPolygons--;
1174cdf0e10cSrcweir         }
1175cdf0e10cSrcweir     }
1176cdf0e10cSrcweir }
1177cdf0e10cSrcweir 
1178cdf0e10cSrcweir // ------------------------------------------------------------------------
1179cdf0e10cSrcweir 
1180cdf0e10cSrcweir void MetaPolyPolygonAction::Read( SvStream& rIStm, ImplMetaReadData* )
1181cdf0e10cSrcweir {
1182cdf0e10cSrcweir     COMPAT( rIStm );
1183cdf0e10cSrcweir     rIStm >> maPolyPoly;                // Version 1
1184cdf0e10cSrcweir 
1185cdf0e10cSrcweir     if ( aCompat.GetVersion() >= 2 )    // Version 2
1186cdf0e10cSrcweir     {
1187cdf0e10cSrcweir         sal_uInt16 i, nIndex, nNumberOfComplexPolygons;
1188cdf0e10cSrcweir         rIStm >> nNumberOfComplexPolygons;
1189cdf0e10cSrcweir         for ( i = 0; i < nNumberOfComplexPolygons; i++ )
1190cdf0e10cSrcweir         {
1191cdf0e10cSrcweir             rIStm >> nIndex;
1192cdf0e10cSrcweir             Polygon aPoly;
1193cdf0e10cSrcweir             aPoly.Read( rIStm );
1194cdf0e10cSrcweir             maPolyPoly.Replace( aPoly, nIndex );
1195cdf0e10cSrcweir         }
1196cdf0e10cSrcweir     }
1197cdf0e10cSrcweir }
1198cdf0e10cSrcweir 
1199cdf0e10cSrcweir // ========================================================================
1200cdf0e10cSrcweir 
1201cdf0e10cSrcweir IMPL_META_ACTION( Text, META_TEXT_ACTION )
1202cdf0e10cSrcweir 
1203cdf0e10cSrcweir // ------------------------------------------------------------------------
1204cdf0e10cSrcweir 
1205cdf0e10cSrcweir MetaTextAction::MetaTextAction( const Point& rPt, const XubString& rStr,
1206cdf0e10cSrcweir                                 sal_uInt16 nIndex, sal_uInt16 nLen ) :
1207cdf0e10cSrcweir     MetaAction  ( META_TEXT_ACTION ),
1208cdf0e10cSrcweir     maPt        ( rPt ),
1209cdf0e10cSrcweir     maStr       ( rStr ),
1210cdf0e10cSrcweir     mnIndex     ( nIndex ),
1211cdf0e10cSrcweir     mnLen       ( nLen )
1212cdf0e10cSrcweir {
1213cdf0e10cSrcweir }
1214cdf0e10cSrcweir 
1215cdf0e10cSrcweir // ------------------------------------------------------------------------
1216cdf0e10cSrcweir 
1217cdf0e10cSrcweir void MetaTextAction::Execute( OutputDevice* pOut )
1218cdf0e10cSrcweir {
1219cdf0e10cSrcweir     pOut->DrawText( maPt, maStr, mnIndex, mnLen );
1220cdf0e10cSrcweir }
1221cdf0e10cSrcweir 
1222cdf0e10cSrcweir // ------------------------------------------------------------------------
1223cdf0e10cSrcweir 
1224cdf0e10cSrcweir MetaAction* MetaTextAction::Clone()
1225cdf0e10cSrcweir {
1226cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaTextAction( *this );
1227cdf0e10cSrcweir     pClone->ResetRefCount();
1228cdf0e10cSrcweir     return pClone;
1229cdf0e10cSrcweir }
1230cdf0e10cSrcweir 
1231cdf0e10cSrcweir // ------------------------------------------------------------------------
1232cdf0e10cSrcweir 
1233cdf0e10cSrcweir void MetaTextAction::Move( long nHorzMove, long nVertMove )
1234cdf0e10cSrcweir {
1235cdf0e10cSrcweir     maPt.Move( nHorzMove, nVertMove );
1236cdf0e10cSrcweir }
1237cdf0e10cSrcweir 
1238cdf0e10cSrcweir // ------------------------------------------------------------------------
1239cdf0e10cSrcweir 
1240cdf0e10cSrcweir void MetaTextAction::Scale( double fScaleX, double fScaleY )
1241cdf0e10cSrcweir {
1242cdf0e10cSrcweir     ImplScalePoint( maPt, fScaleX, fScaleY );
1243cdf0e10cSrcweir }
1244cdf0e10cSrcweir 
1245cdf0e10cSrcweir // ------------------------------------------------------------------------
1246cdf0e10cSrcweir 
1247cdf0e10cSrcweir sal_Bool MetaTextAction::Compare( const MetaAction& rMetaAction ) const
1248cdf0e10cSrcweir {
1249cdf0e10cSrcweir     return ( maPt == ((MetaTextAction&)rMetaAction).maPt ) &&
1250cdf0e10cSrcweir            ( maStr == ((MetaTextAction&)rMetaAction).maStr ) &&
1251cdf0e10cSrcweir            ( mnIndex == ((MetaTextAction&)rMetaAction).mnIndex ) &&
1252cdf0e10cSrcweir            ( mnLen == ((MetaTextAction&)rMetaAction).mnLen );
1253cdf0e10cSrcweir }
1254cdf0e10cSrcweir 
1255cdf0e10cSrcweir // ------------------------------------------------------------------------
1256cdf0e10cSrcweir 
1257cdf0e10cSrcweir void MetaTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
1258cdf0e10cSrcweir {
1259cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 2, pData );
1260cdf0e10cSrcweir     rOStm   << maPt;
1261cdf0e10cSrcweir     rOStm.WriteByteString( maStr, pData->meActualCharSet );
1262cdf0e10cSrcweir     rOStm   << mnIndex;
1263cdf0e10cSrcweir     rOStm   << mnLen;
1264cdf0e10cSrcweir 
1265cdf0e10cSrcweir     sal_uInt16 i, nLen = maStr.Len();                           // version 2
1266cdf0e10cSrcweir     rOStm << nLen;
1267cdf0e10cSrcweir     for ( i = 0; i < nLen; i++ )
1268cdf0e10cSrcweir     {
1269cdf0e10cSrcweir         sal_Unicode nUni = maStr.GetChar( i );
1270cdf0e10cSrcweir         rOStm << nUni;
1271cdf0e10cSrcweir     }
1272cdf0e10cSrcweir }
1273cdf0e10cSrcweir 
1274cdf0e10cSrcweir // ------------------------------------------------------------------------
1275cdf0e10cSrcweir 
1276cdf0e10cSrcweir void MetaTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
1277cdf0e10cSrcweir {
1278cdf0e10cSrcweir     COMPAT( rIStm );
1279cdf0e10cSrcweir     rIStm   >> maPt;
1280cdf0e10cSrcweir     rIStm.ReadByteString( maStr, pData->meActualCharSet );
1281cdf0e10cSrcweir     rIStm   >> mnIndex;
1282cdf0e10cSrcweir     rIStm   >> mnLen;
1283cdf0e10cSrcweir 
1284cdf0e10cSrcweir     if ( aCompat.GetVersion() >= 2 )                            // Version 2
1285cdf0e10cSrcweir     {
1286cdf0e10cSrcweir         sal_uInt16 nLen;
1287cdf0e10cSrcweir         rIStm >> nLen;
1288cdf0e10cSrcweir         sal_Unicode* pBuffer = maStr.AllocBuffer( nLen );
1289cdf0e10cSrcweir         while ( nLen-- )
1290cdf0e10cSrcweir             rIStm >> *pBuffer++;
1291cdf0e10cSrcweir     }
1292cdf0e10cSrcweir }
1293cdf0e10cSrcweir 
1294cdf0e10cSrcweir // ========================================================================
1295cdf0e10cSrcweir 
1296cdf0e10cSrcweir MetaTextArrayAction::MetaTextArrayAction() :
1297cdf0e10cSrcweir     MetaAction  ( META_TEXTARRAY_ACTION ),
1298cdf0e10cSrcweir     mpDXAry     ( NULL ),
1299cdf0e10cSrcweir     mnIndex     ( 0 ),
1300cdf0e10cSrcweir     mnLen       ( 0 )
1301cdf0e10cSrcweir {
1302cdf0e10cSrcweir }
1303cdf0e10cSrcweir 
1304cdf0e10cSrcweir // ------------------------------------------------------------------------
1305cdf0e10cSrcweir 
1306cdf0e10cSrcweir MetaTextArrayAction::MetaTextArrayAction( const MetaTextArrayAction& rAction ) :
1307cdf0e10cSrcweir     MetaAction  ( META_TEXTARRAY_ACTION ),
1308cdf0e10cSrcweir     maStartPt   ( rAction.maStartPt ),
1309cdf0e10cSrcweir     maStr       ( rAction.maStr ),
1310cdf0e10cSrcweir     mnIndex     ( rAction.mnIndex ),
1311cdf0e10cSrcweir     mnLen       ( rAction.mnLen )
1312cdf0e10cSrcweir {
1313cdf0e10cSrcweir     if( rAction.mpDXAry )
1314cdf0e10cSrcweir     {
1315cdf0e10cSrcweir         const sal_uLong nAryLen = mnLen;
1316cdf0e10cSrcweir 
1317cdf0e10cSrcweir         mpDXAry = new sal_Int32[ nAryLen ];
1318cdf0e10cSrcweir         memcpy( mpDXAry, rAction.mpDXAry, nAryLen * sizeof( sal_Int32 ) );
1319cdf0e10cSrcweir     }
1320cdf0e10cSrcweir     else
1321cdf0e10cSrcweir         mpDXAry = NULL;
1322cdf0e10cSrcweir }
1323cdf0e10cSrcweir 
1324cdf0e10cSrcweir // ------------------------------------------------------------------------
1325cdf0e10cSrcweir 
1326cdf0e10cSrcweir MetaTextArrayAction::MetaTextArrayAction( const Point& rStartPt,
1327cdf0e10cSrcweir                                           const XubString& rStr,
1328cdf0e10cSrcweir                                           const sal_Int32* pDXAry,
1329cdf0e10cSrcweir                                           sal_uInt16 nIndex,
1330cdf0e10cSrcweir                                           sal_uInt16 nLen ) :
1331cdf0e10cSrcweir     MetaAction  ( META_TEXTARRAY_ACTION ),
1332cdf0e10cSrcweir     maStartPt   ( rStartPt ),
1333cdf0e10cSrcweir     maStr       ( rStr ),
1334cdf0e10cSrcweir     mnIndex     ( nIndex ),
1335cdf0e10cSrcweir     mnLen       ( ( nLen == STRING_LEN ) ? rStr.Len() : nLen )
1336cdf0e10cSrcweir {
1337cdf0e10cSrcweir     const sal_uLong nAryLen = pDXAry ? mnLen : 0;
1338cdf0e10cSrcweir 
1339cdf0e10cSrcweir     if( nAryLen )
1340cdf0e10cSrcweir     {
1341cdf0e10cSrcweir         mpDXAry = new sal_Int32[ nAryLen ];
1342cdf0e10cSrcweir         memcpy( mpDXAry, pDXAry, nAryLen * sizeof( sal_Int32 ) );
1343cdf0e10cSrcweir     }
1344cdf0e10cSrcweir     else
1345cdf0e10cSrcweir         mpDXAry = NULL;
1346cdf0e10cSrcweir }
1347cdf0e10cSrcweir 
1348cdf0e10cSrcweir // ------------------------------------------------------------------------
1349cdf0e10cSrcweir 
1350cdf0e10cSrcweir MetaTextArrayAction::~MetaTextArrayAction()
1351cdf0e10cSrcweir {
1352cdf0e10cSrcweir     delete[] mpDXAry;
1353cdf0e10cSrcweir }
1354cdf0e10cSrcweir 
1355cdf0e10cSrcweir // ------------------------------------------------------------------------
1356cdf0e10cSrcweir 
1357cdf0e10cSrcweir void MetaTextArrayAction::Execute( OutputDevice* pOut )
1358cdf0e10cSrcweir {
1359cdf0e10cSrcweir     pOut->DrawTextArray( maStartPt, maStr, mpDXAry, mnIndex, mnLen );
1360cdf0e10cSrcweir }
1361cdf0e10cSrcweir 
1362cdf0e10cSrcweir // ------------------------------------------------------------------------
1363cdf0e10cSrcweir 
1364cdf0e10cSrcweir MetaAction* MetaTextArrayAction::Clone()
1365cdf0e10cSrcweir {
1366cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaTextArrayAction( *this );
1367cdf0e10cSrcweir     pClone->ResetRefCount();
1368cdf0e10cSrcweir     return pClone;
1369cdf0e10cSrcweir }
1370cdf0e10cSrcweir 
1371cdf0e10cSrcweir // ------------------------------------------------------------------------
1372cdf0e10cSrcweir 
1373cdf0e10cSrcweir void MetaTextArrayAction::Move( long nHorzMove, long nVertMove )
1374cdf0e10cSrcweir {
1375cdf0e10cSrcweir     maStartPt.Move( nHorzMove, nVertMove );
1376cdf0e10cSrcweir }
1377cdf0e10cSrcweir 
1378cdf0e10cSrcweir // ------------------------------------------------------------------------
1379cdf0e10cSrcweir 
1380cdf0e10cSrcweir void MetaTextArrayAction::Scale( double fScaleX, double fScaleY )
1381cdf0e10cSrcweir {
1382cdf0e10cSrcweir     ImplScalePoint( maStartPt, fScaleX, fScaleY );
1383cdf0e10cSrcweir 
1384cdf0e10cSrcweir     if ( mpDXAry && mnLen )
1385cdf0e10cSrcweir     {
1386cdf0e10cSrcweir         for ( sal_uInt16 i = 0, nCount = mnLen; i < nCount; i++ )
1387cdf0e10cSrcweir             mpDXAry[ i ] = FRound( mpDXAry[ i ] * fabs(fScaleX) );
1388cdf0e10cSrcweir     }
1389cdf0e10cSrcweir }
1390cdf0e10cSrcweir 
1391cdf0e10cSrcweir // ------------------------------------------------------------------------
1392cdf0e10cSrcweir 
1393cdf0e10cSrcweir sal_Bool MetaTextArrayAction::Compare( const MetaAction& rMetaAction ) const
1394cdf0e10cSrcweir {
1395cdf0e10cSrcweir     return ( maStartPt == ((MetaTextArrayAction&)rMetaAction).maStartPt ) &&
1396cdf0e10cSrcweir            ( maStr == ((MetaTextArrayAction&)rMetaAction).maStr ) &&
1397cdf0e10cSrcweir            ( mnIndex == ((MetaTextArrayAction&)rMetaAction).mnIndex ) &&
1398cdf0e10cSrcweir            ( mnLen == ((MetaTextArrayAction&)rMetaAction).mnLen ) &&
1399cdf0e10cSrcweir            ( memcmp( mpDXAry, ((MetaTextArrayAction&)rMetaAction).mpDXAry, mnLen ) == 0 );
1400cdf0e10cSrcweir }
1401cdf0e10cSrcweir 
1402cdf0e10cSrcweir // ------------------------------------------------------------------------
1403cdf0e10cSrcweir 
1404cdf0e10cSrcweir void MetaTextArrayAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
1405cdf0e10cSrcweir {
1406cdf0e10cSrcweir     const sal_uInt32 nAryLen = mpDXAry ? mnLen : 0;
1407cdf0e10cSrcweir 
1408cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 2, pData );
1409cdf0e10cSrcweir     rOStm   << maStartPt;
1410cdf0e10cSrcweir     rOStm.WriteByteString( maStr, pData->meActualCharSet );
1411cdf0e10cSrcweir     rOStm   << mnIndex;
1412cdf0e10cSrcweir     rOStm   << mnLen;
1413cdf0e10cSrcweir     rOStm   << nAryLen;
1414cdf0e10cSrcweir 
1415cdf0e10cSrcweir     for( sal_uLong i = 0UL; i < nAryLen; i++ )
1416cdf0e10cSrcweir         rOStm << mpDXAry[ i ];
1417cdf0e10cSrcweir 
1418cdf0e10cSrcweir     sal_uInt16 j, nLen = maStr.Len();                           // version 2
1419cdf0e10cSrcweir     rOStm << nLen;
1420cdf0e10cSrcweir     for ( j = 0; j < nLen; j++ )
1421cdf0e10cSrcweir     {
1422cdf0e10cSrcweir         sal_Unicode nUni = maStr.GetChar( j );
1423cdf0e10cSrcweir         rOStm << nUni;
1424cdf0e10cSrcweir     }
1425cdf0e10cSrcweir }
1426cdf0e10cSrcweir 
1427cdf0e10cSrcweir // ------------------------------------------------------------------------
1428cdf0e10cSrcweir 
1429cdf0e10cSrcweir void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
1430cdf0e10cSrcweir {
1431cdf0e10cSrcweir     sal_uInt32 nAryLen;
1432cdf0e10cSrcweir 
1433cdf0e10cSrcweir     delete[] mpDXAry;
1434cdf0e10cSrcweir 
1435cdf0e10cSrcweir     COMPAT( rIStm );
1436cdf0e10cSrcweir     rIStm   >> maStartPt;
1437cdf0e10cSrcweir     rIStm.ReadByteString( maStr, pData->meActualCharSet );
1438cdf0e10cSrcweir     rIStm   >> mnIndex;
1439cdf0e10cSrcweir     rIStm   >> mnLen;
1440cdf0e10cSrcweir     rIStm   >> nAryLen;
1441cdf0e10cSrcweir 
1442cdf0e10cSrcweir     if ( mnIndex + mnLen > maStr.Len() )
1443cdf0e10cSrcweir     {
1444cdf0e10cSrcweir         mnIndex = 0;
1445cdf0e10cSrcweir         mpDXAry = 0;
1446cdf0e10cSrcweir         return;
1447cdf0e10cSrcweir     }
1448cdf0e10cSrcweir 
1449cdf0e10cSrcweir     if( nAryLen )
1450cdf0e10cSrcweir     {
1451cdf0e10cSrcweir         // #i9762#, #106172# Ensure that DX array is at least mnLen entries long
1452cdf0e10cSrcweir         if ( mnLen >= nAryLen )
1453cdf0e10cSrcweir         {
1454cdf0e10cSrcweir             mpDXAry = new (std::nothrow)sal_Int32[ mnLen ];
1455cdf0e10cSrcweir             if ( mpDXAry )
1456cdf0e10cSrcweir             {
1457cdf0e10cSrcweir                 sal_uLong i;
1458cdf0e10cSrcweir                 for( i = 0UL; i < nAryLen; i++ )
1459cdf0e10cSrcweir                     rIStm >> mpDXAry[ i ];
1460cdf0e10cSrcweir 
1461cdf0e10cSrcweir                 // #106172# setup remainder
1462cdf0e10cSrcweir                 for( ; i < mnLen; i++ )
1463cdf0e10cSrcweir                     mpDXAry[ i ] = 0;
1464cdf0e10cSrcweir             }
1465cdf0e10cSrcweir         }
1466cdf0e10cSrcweir         else
1467cdf0e10cSrcweir         {
1468cdf0e10cSrcweir             mpDXAry = NULL;
1469cdf0e10cSrcweir             return;
1470cdf0e10cSrcweir         }
1471cdf0e10cSrcweir     }
1472cdf0e10cSrcweir     else
1473cdf0e10cSrcweir         mpDXAry = NULL;
1474cdf0e10cSrcweir 
1475cdf0e10cSrcweir     if ( aCompat.GetVersion() >= 2 )                            // Version 2
1476cdf0e10cSrcweir     {
1477cdf0e10cSrcweir         sal_uInt16 nLen;
1478cdf0e10cSrcweir         rIStm >> nLen;
1479cdf0e10cSrcweir         sal_Unicode* pBuffer = maStr.AllocBuffer( nLen );
1480cdf0e10cSrcweir         while ( nLen-- )
1481cdf0e10cSrcweir             rIStm >> *pBuffer++;
1482cdf0e10cSrcweir 
1483cdf0e10cSrcweir         if ( mnIndex + mnLen > maStr.Len() )
1484cdf0e10cSrcweir         {
1485cdf0e10cSrcweir             mnIndex = 0;
1486cdf0e10cSrcweir             delete[] mpDXAry, mpDXAry = NULL;
1487cdf0e10cSrcweir         }
1488cdf0e10cSrcweir     }
1489cdf0e10cSrcweir }
1490cdf0e10cSrcweir 
1491cdf0e10cSrcweir // ========================================================================
1492cdf0e10cSrcweir 
1493cdf0e10cSrcweir IMPL_META_ACTION( StretchText, META_STRETCHTEXT_ACTION )
1494cdf0e10cSrcweir 
1495cdf0e10cSrcweir // ------------------------------------------------------------------------
1496cdf0e10cSrcweir 
1497cdf0e10cSrcweir MetaStretchTextAction::MetaStretchTextAction( const Point& rPt, sal_uInt32 nWidth,
1498cdf0e10cSrcweir                                               const XubString& rStr,
1499cdf0e10cSrcweir                                               sal_uInt16 nIndex, sal_uInt16 nLen ) :
1500cdf0e10cSrcweir     MetaAction  ( META_STRETCHTEXT_ACTION ),
1501cdf0e10cSrcweir     maPt        ( rPt ),
1502cdf0e10cSrcweir     maStr       ( rStr ),
1503cdf0e10cSrcweir     mnWidth     ( nWidth ),
1504cdf0e10cSrcweir     mnIndex     ( nIndex ),
1505cdf0e10cSrcweir     mnLen       ( nLen )
1506cdf0e10cSrcweir {
1507cdf0e10cSrcweir }
1508cdf0e10cSrcweir 
1509cdf0e10cSrcweir // ------------------------------------------------------------------------
1510cdf0e10cSrcweir 
1511cdf0e10cSrcweir void MetaStretchTextAction::Execute( OutputDevice* pOut )
1512cdf0e10cSrcweir {
1513cdf0e10cSrcweir     pOut->DrawStretchText( maPt, mnWidth, maStr, mnIndex, mnLen );
1514cdf0e10cSrcweir }
1515cdf0e10cSrcweir 
1516cdf0e10cSrcweir // ------------------------------------------------------------------------
1517cdf0e10cSrcweir 
1518cdf0e10cSrcweir MetaAction* MetaStretchTextAction::Clone()
1519cdf0e10cSrcweir {
1520cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaStretchTextAction( *this );
1521cdf0e10cSrcweir     pClone->ResetRefCount();
1522cdf0e10cSrcweir     return pClone;
1523cdf0e10cSrcweir }
1524cdf0e10cSrcweir 
1525cdf0e10cSrcweir // ------------------------------------------------------------------------
1526cdf0e10cSrcweir 
1527cdf0e10cSrcweir void MetaStretchTextAction::Move( long nHorzMove, long nVertMove )
1528cdf0e10cSrcweir {
1529cdf0e10cSrcweir     maPt.Move( nHorzMove, nVertMove );
1530cdf0e10cSrcweir }
1531cdf0e10cSrcweir 
1532cdf0e10cSrcweir // ------------------------------------------------------------------------
1533cdf0e10cSrcweir 
1534cdf0e10cSrcweir void MetaStretchTextAction::Scale( double fScaleX, double fScaleY )
1535cdf0e10cSrcweir {
1536cdf0e10cSrcweir     ImplScalePoint( maPt, fScaleX, fScaleY );
1537cdf0e10cSrcweir     mnWidth = (sal_uLong)FRound( mnWidth * fabs(fScaleX) );
1538cdf0e10cSrcweir }
1539cdf0e10cSrcweir 
1540cdf0e10cSrcweir // ------------------------------------------------------------------------
1541cdf0e10cSrcweir 
1542cdf0e10cSrcweir sal_Bool MetaStretchTextAction::Compare( const MetaAction& rMetaAction ) const
1543cdf0e10cSrcweir {
1544cdf0e10cSrcweir     return ( maPt == ((MetaStretchTextAction&)rMetaAction).maPt ) &&
1545cdf0e10cSrcweir            ( maStr == ((MetaStretchTextAction&)rMetaAction).maStr ) &&
1546cdf0e10cSrcweir            ( mnWidth == ((MetaStretchTextAction&)rMetaAction).mnWidth ) &&
1547cdf0e10cSrcweir            ( mnIndex == ((MetaStretchTextAction&)rMetaAction).mnIndex ) &&
1548cdf0e10cSrcweir            ( mnLen == ((MetaStretchTextAction&)rMetaAction).mnLen );
1549cdf0e10cSrcweir }
1550cdf0e10cSrcweir 
1551cdf0e10cSrcweir // ------------------------------------------------------------------------
1552cdf0e10cSrcweir 
1553cdf0e10cSrcweir void MetaStretchTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
1554cdf0e10cSrcweir {
1555cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 2, pData );
1556cdf0e10cSrcweir     rOStm   << maPt;
1557cdf0e10cSrcweir     rOStm.WriteByteString( maStr, pData->meActualCharSet );
1558cdf0e10cSrcweir     rOStm   << mnWidth;
1559cdf0e10cSrcweir     rOStm   << mnIndex;
1560cdf0e10cSrcweir     rOStm   << mnLen;
1561cdf0e10cSrcweir 
1562cdf0e10cSrcweir     sal_uInt16 i, nLen = maStr.Len();                           // version 2
1563cdf0e10cSrcweir     rOStm << nLen;
1564cdf0e10cSrcweir     for ( i = 0; i < nLen; i++ )
1565cdf0e10cSrcweir     {
1566cdf0e10cSrcweir         sal_Unicode nUni = maStr.GetChar( i );
1567cdf0e10cSrcweir         rOStm << nUni;
1568cdf0e10cSrcweir     }
1569cdf0e10cSrcweir }
1570cdf0e10cSrcweir 
1571cdf0e10cSrcweir // ------------------------------------------------------------------------
1572cdf0e10cSrcweir 
1573cdf0e10cSrcweir void MetaStretchTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
1574cdf0e10cSrcweir {
1575cdf0e10cSrcweir     COMPAT( rIStm );
1576cdf0e10cSrcweir     rIStm   >> maPt;
1577cdf0e10cSrcweir     rIStm.ReadByteString( maStr, pData->meActualCharSet );
1578cdf0e10cSrcweir     rIStm   >> mnWidth;
1579cdf0e10cSrcweir     rIStm   >> mnIndex;
1580cdf0e10cSrcweir     rIStm   >> mnLen;
1581cdf0e10cSrcweir 
1582cdf0e10cSrcweir     if ( aCompat.GetVersion() >= 2 )                            // Version 2
1583cdf0e10cSrcweir     {
1584cdf0e10cSrcweir         sal_uInt16 nLen;
1585cdf0e10cSrcweir         rIStm >> nLen;
1586cdf0e10cSrcweir         sal_Unicode* pBuffer = maStr.AllocBuffer( nLen );
1587cdf0e10cSrcweir         while ( nLen-- )
1588cdf0e10cSrcweir             rIStm >> *pBuffer++;
1589cdf0e10cSrcweir     }
1590cdf0e10cSrcweir }
1591cdf0e10cSrcweir 
1592cdf0e10cSrcweir // ========================================================================
1593cdf0e10cSrcweir 
1594cdf0e10cSrcweir IMPL_META_ACTION( TextRect, META_TEXTRECT_ACTION )
1595cdf0e10cSrcweir 
1596cdf0e10cSrcweir // ------------------------------------------------------------------------
1597cdf0e10cSrcweir 
1598cdf0e10cSrcweir MetaTextRectAction::MetaTextRectAction( const Rectangle& rRect,
1599cdf0e10cSrcweir                                         const XubString& rStr, sal_uInt16 nStyle ) :
1600cdf0e10cSrcweir     MetaAction  ( META_TEXTRECT_ACTION ),
1601cdf0e10cSrcweir     maRect      ( rRect ),
1602cdf0e10cSrcweir     maStr       ( rStr ),
1603cdf0e10cSrcweir     mnStyle     ( nStyle )
1604cdf0e10cSrcweir {
1605cdf0e10cSrcweir }
1606cdf0e10cSrcweir 
1607cdf0e10cSrcweir // ------------------------------------------------------------------------
1608cdf0e10cSrcweir 
1609cdf0e10cSrcweir void MetaTextRectAction::Execute( OutputDevice* pOut )
1610cdf0e10cSrcweir {
1611cdf0e10cSrcweir     pOut->DrawText( maRect, maStr, mnStyle );
1612cdf0e10cSrcweir }
1613cdf0e10cSrcweir 
1614cdf0e10cSrcweir // ------------------------------------------------------------------------
1615cdf0e10cSrcweir 
1616cdf0e10cSrcweir MetaAction* MetaTextRectAction::Clone()
1617cdf0e10cSrcweir {
1618cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaTextRectAction( *this );
1619cdf0e10cSrcweir     pClone->ResetRefCount();
1620cdf0e10cSrcweir     return pClone;
1621cdf0e10cSrcweir }
1622cdf0e10cSrcweir 
1623cdf0e10cSrcweir // ------------------------------------------------------------------------
1624cdf0e10cSrcweir 
1625cdf0e10cSrcweir void MetaTextRectAction::Move( long nHorzMove, long nVertMove )
1626cdf0e10cSrcweir {
1627cdf0e10cSrcweir     maRect.Move( nHorzMove, nVertMove );
1628cdf0e10cSrcweir }
1629cdf0e10cSrcweir 
1630cdf0e10cSrcweir // ------------------------------------------------------------------------
1631cdf0e10cSrcweir 
1632cdf0e10cSrcweir void MetaTextRectAction::Scale( double fScaleX, double fScaleY )
1633cdf0e10cSrcweir {
1634cdf0e10cSrcweir     ImplScaleRect( maRect, fScaleX, fScaleY );
1635cdf0e10cSrcweir }
1636cdf0e10cSrcweir 
1637cdf0e10cSrcweir // ------------------------------------------------------------------------
1638cdf0e10cSrcweir 
1639cdf0e10cSrcweir sal_Bool MetaTextRectAction::Compare( const MetaAction& rMetaAction ) const
1640cdf0e10cSrcweir {
1641cdf0e10cSrcweir     return ( maRect == ((MetaTextRectAction&)rMetaAction).maRect ) &&
1642cdf0e10cSrcweir            ( maStr == ((MetaTextRectAction&)rMetaAction).maStr ) &&
1643cdf0e10cSrcweir            ( mnStyle == ((MetaTextRectAction&)rMetaAction).mnStyle );
1644cdf0e10cSrcweir }
1645cdf0e10cSrcweir 
1646cdf0e10cSrcweir // ------------------------------------------------------------------------
1647cdf0e10cSrcweir 
1648cdf0e10cSrcweir void MetaTextRectAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
1649cdf0e10cSrcweir {
1650cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 2, pData );
1651cdf0e10cSrcweir     rOStm   << maRect;
1652cdf0e10cSrcweir     rOStm.WriteByteString( maStr, pData->meActualCharSet );
1653cdf0e10cSrcweir     rOStm   << mnStyle;
1654cdf0e10cSrcweir 
1655cdf0e10cSrcweir     sal_uInt16 i, nLen = maStr.Len();                           // version 2
1656cdf0e10cSrcweir     rOStm << nLen;
1657cdf0e10cSrcweir     for ( i = 0; i < nLen; i++ )
1658cdf0e10cSrcweir     {
1659cdf0e10cSrcweir         sal_Unicode nUni = maStr.GetChar( i );
1660cdf0e10cSrcweir         rOStm << nUni;
1661cdf0e10cSrcweir     }
1662cdf0e10cSrcweir }
1663cdf0e10cSrcweir 
1664cdf0e10cSrcweir // ------------------------------------------------------------------------
1665cdf0e10cSrcweir 
1666cdf0e10cSrcweir void MetaTextRectAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
1667cdf0e10cSrcweir {
1668cdf0e10cSrcweir     COMPAT( rIStm );
1669cdf0e10cSrcweir     rIStm   >> maRect;
1670cdf0e10cSrcweir     rIStm.ReadByteString( maStr, pData->meActualCharSet );
1671cdf0e10cSrcweir     rIStm   >> mnStyle;
1672cdf0e10cSrcweir 
1673cdf0e10cSrcweir     if ( aCompat.GetVersion() >= 2 )                            // Version 2
1674cdf0e10cSrcweir     {
1675cdf0e10cSrcweir         sal_uInt16 nLen;
1676cdf0e10cSrcweir         rIStm >> nLen;
1677cdf0e10cSrcweir         sal_Unicode* pBuffer = maStr.AllocBuffer( nLen );
1678cdf0e10cSrcweir         while ( nLen-- )
1679cdf0e10cSrcweir             rIStm >> *pBuffer++;
1680cdf0e10cSrcweir     }
1681cdf0e10cSrcweir }
1682cdf0e10cSrcweir 
1683cdf0e10cSrcweir // ========================================================================
1684cdf0e10cSrcweir 
1685cdf0e10cSrcweir IMPL_META_ACTION( TextLine, META_TEXTLINE_ACTION )
1686cdf0e10cSrcweir 
1687cdf0e10cSrcweir // ------------------------------------------------------------------------
1688cdf0e10cSrcweir 
1689cdf0e10cSrcweir MetaTextLineAction::MetaTextLineAction( const Point& rPos, long nWidth,
1690cdf0e10cSrcweir                                         FontStrikeout eStrikeout,
1691cdf0e10cSrcweir                                         FontUnderline eUnderline,
1692cdf0e10cSrcweir                                         FontUnderline eOverline ) :
1693cdf0e10cSrcweir     MetaAction  ( META_TEXTLINE_ACTION ),
1694cdf0e10cSrcweir     maPos       ( rPos ),
1695cdf0e10cSrcweir     mnWidth     ( nWidth ),
1696cdf0e10cSrcweir     meStrikeout ( eStrikeout ),
1697cdf0e10cSrcweir     meUnderline ( eUnderline ),
1698cdf0e10cSrcweir     meOverline  ( eOverline )
1699cdf0e10cSrcweir {
1700cdf0e10cSrcweir }
1701cdf0e10cSrcweir 
1702cdf0e10cSrcweir // ------------------------------------------------------------------------
1703cdf0e10cSrcweir 
1704cdf0e10cSrcweir void MetaTextLineAction::Execute( OutputDevice* pOut )
1705cdf0e10cSrcweir {
1706cdf0e10cSrcweir     pOut->DrawTextLine( maPos, mnWidth, meStrikeout, meUnderline, meOverline );
1707cdf0e10cSrcweir }
1708cdf0e10cSrcweir 
1709cdf0e10cSrcweir // ------------------------------------------------------------------------
1710cdf0e10cSrcweir 
1711cdf0e10cSrcweir MetaAction* MetaTextLineAction::Clone()
1712cdf0e10cSrcweir {
1713cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*)new MetaTextLineAction( *this );
1714cdf0e10cSrcweir     pClone->ResetRefCount();
1715cdf0e10cSrcweir     return pClone;
1716cdf0e10cSrcweir }
1717cdf0e10cSrcweir 
1718cdf0e10cSrcweir // ------------------------------------------------------------------------
1719cdf0e10cSrcweir 
1720cdf0e10cSrcweir void MetaTextLineAction::Move( long nHorzMove, long nVertMove )
1721cdf0e10cSrcweir {
1722cdf0e10cSrcweir     maPos.Move( nHorzMove, nVertMove );
1723cdf0e10cSrcweir }
1724cdf0e10cSrcweir 
1725cdf0e10cSrcweir // ------------------------------------------------------------------------
1726cdf0e10cSrcweir 
1727cdf0e10cSrcweir void MetaTextLineAction::Scale( double fScaleX, double fScaleY )
1728cdf0e10cSrcweir {
1729cdf0e10cSrcweir     ImplScalePoint( maPos, fScaleX, fScaleY );
1730cdf0e10cSrcweir     mnWidth = FRound( mnWidth * fabs(fScaleX) );
1731cdf0e10cSrcweir }
1732cdf0e10cSrcweir 
1733cdf0e10cSrcweir // ------------------------------------------------------------------------
1734cdf0e10cSrcweir 
1735cdf0e10cSrcweir sal_Bool MetaTextLineAction::Compare( const MetaAction& rMetaAction ) const
1736cdf0e10cSrcweir {
1737cdf0e10cSrcweir     return ( maPos == ((MetaTextLineAction&)rMetaAction).maPos ) &&
1738cdf0e10cSrcweir            ( mnWidth == ((MetaTextLineAction&)rMetaAction).mnWidth ) &&
1739cdf0e10cSrcweir            ( meStrikeout == ((MetaTextLineAction&)rMetaAction).meStrikeout ) &&
1740cdf0e10cSrcweir            ( meUnderline == ((MetaTextLineAction&)rMetaAction).meUnderline ) &&
1741cdf0e10cSrcweir            ( meOverline  == ((MetaTextLineAction&)rMetaAction).meOverline );
1742cdf0e10cSrcweir }
1743cdf0e10cSrcweir 
1744cdf0e10cSrcweir // ------------------------------------------------------------------------
1745cdf0e10cSrcweir 
1746cdf0e10cSrcweir void MetaTextLineAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
1747cdf0e10cSrcweir {
1748cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 2, pData );
1749cdf0e10cSrcweir 
1750cdf0e10cSrcweir     rOStm << maPos;
1751cdf0e10cSrcweir     rOStm << mnWidth;
1752cdf0e10cSrcweir     rOStm << static_cast<sal_uInt32>(meStrikeout);
1753cdf0e10cSrcweir     rOStm << static_cast<sal_uInt32>(meUnderline);
1754cdf0e10cSrcweir     // new in version 2
1755cdf0e10cSrcweir     rOStm << static_cast<sal_uInt32>(meOverline);
1756cdf0e10cSrcweir }
1757cdf0e10cSrcweir 
1758cdf0e10cSrcweir // ------------------------------------------------------------------------
1759cdf0e10cSrcweir 
1760cdf0e10cSrcweir void MetaTextLineAction::Read( SvStream& rIStm, ImplMetaReadData* )
1761cdf0e10cSrcweir {
1762cdf0e10cSrcweir     COMPAT( rIStm );
1763cdf0e10cSrcweir 
1764cdf0e10cSrcweir     sal_uInt32 nTemp;
1765cdf0e10cSrcweir     rIStm >> maPos;
1766cdf0e10cSrcweir     rIStm >> mnWidth;
1767cdf0e10cSrcweir     rIStm >> nTemp;
1768cdf0e10cSrcweir     meStrikeout = (FontStrikeout)nTemp;
1769cdf0e10cSrcweir     rIStm >> nTemp;
1770cdf0e10cSrcweir     meUnderline = (FontUnderline)nTemp;
1771cdf0e10cSrcweir     if ( aCompat.GetVersion() >= 2 ) {
1772cdf0e10cSrcweir         rIStm >> nTemp;
1773cdf0e10cSrcweir         meUnderline = (FontUnderline)nTemp;
1774cdf0e10cSrcweir     }
1775cdf0e10cSrcweir }
1776cdf0e10cSrcweir 
1777cdf0e10cSrcweir // ========================================================================
1778cdf0e10cSrcweir 
1779cdf0e10cSrcweir IMPL_META_ACTION( Bmp, META_BMP_ACTION )
1780cdf0e10cSrcweir 
1781cdf0e10cSrcweir // ------------------------------------------------------------------------
1782cdf0e10cSrcweir 
1783cdf0e10cSrcweir MetaBmpAction::MetaBmpAction( const Point& rPt, const Bitmap& rBmp ) :
1784cdf0e10cSrcweir     MetaAction  ( META_BMP_ACTION ),
1785cdf0e10cSrcweir     maBmp       ( rBmp ),
1786cdf0e10cSrcweir     maPt        ( rPt )
1787cdf0e10cSrcweir {
1788cdf0e10cSrcweir }
1789cdf0e10cSrcweir 
1790cdf0e10cSrcweir // ------------------------------------------------------------------------
1791cdf0e10cSrcweir 
1792cdf0e10cSrcweir void MetaBmpAction::Execute( OutputDevice* pOut )
1793cdf0e10cSrcweir {
1794cdf0e10cSrcweir     pOut->DrawBitmap( maPt, maBmp );
1795cdf0e10cSrcweir }
1796cdf0e10cSrcweir 
1797cdf0e10cSrcweir // ------------------------------------------------------------------------
1798cdf0e10cSrcweir 
1799cdf0e10cSrcweir MetaAction* MetaBmpAction::Clone()
1800cdf0e10cSrcweir {
1801cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaBmpAction( *this );
1802cdf0e10cSrcweir     pClone->ResetRefCount();
1803cdf0e10cSrcweir     return pClone;
1804cdf0e10cSrcweir }
1805cdf0e10cSrcweir 
1806cdf0e10cSrcweir // ------------------------------------------------------------------------
1807cdf0e10cSrcweir 
1808cdf0e10cSrcweir void MetaBmpAction::Move( long nHorzMove, long nVertMove )
1809cdf0e10cSrcweir {
1810cdf0e10cSrcweir     maPt.Move( nHorzMove, nVertMove );
1811cdf0e10cSrcweir }
1812cdf0e10cSrcweir 
1813cdf0e10cSrcweir // ------------------------------------------------------------------------
1814cdf0e10cSrcweir 
1815cdf0e10cSrcweir void MetaBmpAction::Scale( double fScaleX, double fScaleY )
1816cdf0e10cSrcweir {
1817cdf0e10cSrcweir     ImplScalePoint( maPt, fScaleX, fScaleY );
1818cdf0e10cSrcweir }
1819cdf0e10cSrcweir 
1820cdf0e10cSrcweir // ------------------------------------------------------------------------
1821cdf0e10cSrcweir 
1822cdf0e10cSrcweir sal_Bool MetaBmpAction::Compare( const MetaAction& rMetaAction ) const
1823cdf0e10cSrcweir {
1824cdf0e10cSrcweir     return maBmp.IsEqual(((MetaBmpAction&)rMetaAction).maBmp ) &&
1825cdf0e10cSrcweir            ( maPt == ((MetaBmpAction&)rMetaAction).maPt );
1826cdf0e10cSrcweir }
1827cdf0e10cSrcweir 
1828cdf0e10cSrcweir // ------------------------------------------------------------------------
1829cdf0e10cSrcweir 
1830cdf0e10cSrcweir void MetaBmpAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
1831cdf0e10cSrcweir {
1832cdf0e10cSrcweir     if( !!maBmp )
1833cdf0e10cSrcweir     {
1834cdf0e10cSrcweir         WRITE_BASE_COMPAT( rOStm, 1, pData );
1835cdf0e10cSrcweir         rOStm << maBmp << maPt;
1836cdf0e10cSrcweir     }
1837cdf0e10cSrcweir }
1838cdf0e10cSrcweir 
1839cdf0e10cSrcweir // ------------------------------------------------------------------------
1840cdf0e10cSrcweir 
1841cdf0e10cSrcweir void MetaBmpAction::Read( SvStream& rIStm, ImplMetaReadData* )
1842cdf0e10cSrcweir {
1843cdf0e10cSrcweir     COMPAT( rIStm );
1844cdf0e10cSrcweir     rIStm >> maBmp >> maPt;
1845cdf0e10cSrcweir }
1846cdf0e10cSrcweir 
1847cdf0e10cSrcweir // ========================================================================
1848cdf0e10cSrcweir 
1849cdf0e10cSrcweir IMPL_META_ACTION( BmpScale, META_BMPSCALE_ACTION )
1850cdf0e10cSrcweir 
1851cdf0e10cSrcweir // ------------------------------------------------------------------------
1852cdf0e10cSrcweir 
1853cdf0e10cSrcweir MetaBmpScaleAction::MetaBmpScaleAction( const Point& rPt, const Size& rSz,
1854cdf0e10cSrcweir                                         const Bitmap& rBmp ) :
1855cdf0e10cSrcweir     MetaAction  ( META_BMPSCALE_ACTION ),
1856cdf0e10cSrcweir     maBmp       ( rBmp ),
1857cdf0e10cSrcweir     maPt        ( rPt ),
1858cdf0e10cSrcweir     maSz        ( rSz )
1859cdf0e10cSrcweir {
1860cdf0e10cSrcweir }
1861cdf0e10cSrcweir 
1862cdf0e10cSrcweir // ------------------------------------------------------------------------
1863cdf0e10cSrcweir 
1864cdf0e10cSrcweir void MetaBmpScaleAction::Execute( OutputDevice* pOut )
1865cdf0e10cSrcweir {
1866cdf0e10cSrcweir     pOut->DrawBitmap( maPt, maSz, maBmp );
1867cdf0e10cSrcweir }
1868cdf0e10cSrcweir 
1869cdf0e10cSrcweir // ------------------------------------------------------------------------
1870cdf0e10cSrcweir 
1871cdf0e10cSrcweir MetaAction* MetaBmpScaleAction::Clone()
1872cdf0e10cSrcweir {
1873cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaBmpScaleAction( *this );
1874cdf0e10cSrcweir     pClone->ResetRefCount();
1875cdf0e10cSrcweir     return pClone;
1876cdf0e10cSrcweir }
1877cdf0e10cSrcweir 
1878cdf0e10cSrcweir // ------------------------------------------------------------------------
1879cdf0e10cSrcweir 
1880cdf0e10cSrcweir void MetaBmpScaleAction::Move( long nHorzMove, long nVertMove )
1881cdf0e10cSrcweir {
1882cdf0e10cSrcweir     maPt.Move( nHorzMove, nVertMove );
1883cdf0e10cSrcweir }
1884cdf0e10cSrcweir 
1885cdf0e10cSrcweir // ------------------------------------------------------------------------
1886cdf0e10cSrcweir 
1887cdf0e10cSrcweir void MetaBmpScaleAction::Scale( double fScaleX, double fScaleY )
1888cdf0e10cSrcweir {
1889cdf0e10cSrcweir     Rectangle aRectangle(maPt, maSz);
1890cdf0e10cSrcweir     ImplScaleRect( aRectangle, fScaleX, fScaleY );
1891cdf0e10cSrcweir     maPt = aRectangle.TopLeft();
1892cdf0e10cSrcweir     maSz = aRectangle.GetSize();
1893cdf0e10cSrcweir }
1894cdf0e10cSrcweir 
1895cdf0e10cSrcweir // ------------------------------------------------------------------------
1896cdf0e10cSrcweir 
1897cdf0e10cSrcweir sal_Bool MetaBmpScaleAction::Compare( const MetaAction& rMetaAction ) const
1898cdf0e10cSrcweir {
1899cdf0e10cSrcweir     return ( maBmp.IsEqual(((MetaBmpScaleAction&)rMetaAction).maBmp )) &&
1900cdf0e10cSrcweir            ( maPt == ((MetaBmpScaleAction&)rMetaAction).maPt ) &&
1901cdf0e10cSrcweir            ( maSz == ((MetaBmpScaleAction&)rMetaAction).maSz );
1902cdf0e10cSrcweir }
1903cdf0e10cSrcweir 
1904cdf0e10cSrcweir // ------------------------------------------------------------------------
1905cdf0e10cSrcweir 
1906cdf0e10cSrcweir void MetaBmpScaleAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
1907cdf0e10cSrcweir {
1908cdf0e10cSrcweir     if( !!maBmp )
1909cdf0e10cSrcweir     {
1910cdf0e10cSrcweir         WRITE_BASE_COMPAT( rOStm, 1, pData );
1911cdf0e10cSrcweir         rOStm << maBmp << maPt << maSz;
1912cdf0e10cSrcweir     }
1913cdf0e10cSrcweir }
1914cdf0e10cSrcweir 
1915cdf0e10cSrcweir // ------------------------------------------------------------------------
1916cdf0e10cSrcweir 
1917cdf0e10cSrcweir void MetaBmpScaleAction::Read( SvStream& rIStm, ImplMetaReadData* )
1918cdf0e10cSrcweir {
1919cdf0e10cSrcweir     COMPAT( rIStm );
1920cdf0e10cSrcweir     rIStm >> maBmp >> maPt >> maSz;
1921cdf0e10cSrcweir }
1922cdf0e10cSrcweir 
1923cdf0e10cSrcweir // ========================================================================
1924cdf0e10cSrcweir 
1925cdf0e10cSrcweir IMPL_META_ACTION( BmpScalePart, META_BMPSCALEPART_ACTION )
1926cdf0e10cSrcweir 
1927cdf0e10cSrcweir // ------------------------------------------------------------------------
1928cdf0e10cSrcweir 
1929cdf0e10cSrcweir MetaBmpScalePartAction::MetaBmpScalePartAction( const Point& rDstPt, const Size& rDstSz,
1930cdf0e10cSrcweir                                                 const Point& rSrcPt, const Size& rSrcSz,
1931cdf0e10cSrcweir                                                 const Bitmap& rBmp ) :
1932cdf0e10cSrcweir     MetaAction  ( META_BMPSCALEPART_ACTION ),
1933cdf0e10cSrcweir     maBmp       ( rBmp ),
1934cdf0e10cSrcweir     maDstPt     ( rDstPt ),
1935cdf0e10cSrcweir     maDstSz     ( rDstSz ),
1936cdf0e10cSrcweir     maSrcPt     ( rSrcPt ),
1937cdf0e10cSrcweir     maSrcSz     ( rSrcSz )
1938cdf0e10cSrcweir {
1939cdf0e10cSrcweir }
1940cdf0e10cSrcweir 
1941cdf0e10cSrcweir // ------------------------------------------------------------------------
1942cdf0e10cSrcweir 
1943cdf0e10cSrcweir void MetaBmpScalePartAction::Execute( OutputDevice* pOut )
1944cdf0e10cSrcweir {
1945cdf0e10cSrcweir     pOut->DrawBitmap( maDstPt, maDstSz, maSrcPt, maSrcSz, maBmp );
1946cdf0e10cSrcweir }
1947cdf0e10cSrcweir 
1948cdf0e10cSrcweir // ------------------------------------------------------------------------
1949cdf0e10cSrcweir 
1950cdf0e10cSrcweir MetaAction* MetaBmpScalePartAction::Clone()
1951cdf0e10cSrcweir {
1952cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaBmpScalePartAction( *this );
1953cdf0e10cSrcweir     pClone->ResetRefCount();
1954cdf0e10cSrcweir     return pClone;
1955cdf0e10cSrcweir }
1956cdf0e10cSrcweir 
1957cdf0e10cSrcweir // ------------------------------------------------------------------------
1958cdf0e10cSrcweir 
1959cdf0e10cSrcweir void MetaBmpScalePartAction::Move( long nHorzMove, long nVertMove )
1960cdf0e10cSrcweir {
1961cdf0e10cSrcweir     maDstPt.Move( nHorzMove, nVertMove );
1962cdf0e10cSrcweir }
1963cdf0e10cSrcweir 
1964cdf0e10cSrcweir // ------------------------------------------------------------------------
1965cdf0e10cSrcweir 
1966cdf0e10cSrcweir void MetaBmpScalePartAction::Scale( double fScaleX, double fScaleY )
1967cdf0e10cSrcweir {
1968cdf0e10cSrcweir     Rectangle aRectangle(maDstPt, maDstSz);
1969cdf0e10cSrcweir     ImplScaleRect( aRectangle, fScaleX, fScaleY );
1970cdf0e10cSrcweir     maDstPt = aRectangle.TopLeft();
1971cdf0e10cSrcweir     maDstSz = aRectangle.GetSize();
1972cdf0e10cSrcweir }
1973cdf0e10cSrcweir 
1974cdf0e10cSrcweir // ------------------------------------------------------------------------
1975cdf0e10cSrcweir 
1976cdf0e10cSrcweir sal_Bool MetaBmpScalePartAction::Compare( const MetaAction& rMetaAction ) const
1977cdf0e10cSrcweir {
1978cdf0e10cSrcweir     return ( maBmp.IsEqual(((MetaBmpScalePartAction&)rMetaAction).maBmp )) &&
1979cdf0e10cSrcweir            ( maDstPt == ((MetaBmpScalePartAction&)rMetaAction).maDstPt ) &&
1980cdf0e10cSrcweir            ( maDstSz == ((MetaBmpScalePartAction&)rMetaAction).maDstSz ) &&
1981cdf0e10cSrcweir            ( maSrcPt == ((MetaBmpScalePartAction&)rMetaAction).maSrcPt ) &&
1982cdf0e10cSrcweir            ( maSrcSz == ((MetaBmpScalePartAction&)rMetaAction).maSrcSz );
1983cdf0e10cSrcweir }
1984cdf0e10cSrcweir 
1985cdf0e10cSrcweir // ------------------------------------------------------------------------
1986cdf0e10cSrcweir 
1987cdf0e10cSrcweir void MetaBmpScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
1988cdf0e10cSrcweir {
1989cdf0e10cSrcweir     if( !!maBmp )
1990cdf0e10cSrcweir     {
1991cdf0e10cSrcweir         WRITE_BASE_COMPAT( rOStm, 1, pData );
1992cdf0e10cSrcweir         rOStm << maBmp << maDstPt << maDstSz << maSrcPt << maSrcSz;
1993cdf0e10cSrcweir     }
1994cdf0e10cSrcweir }
1995cdf0e10cSrcweir 
1996cdf0e10cSrcweir // ------------------------------------------------------------------------
1997cdf0e10cSrcweir 
1998cdf0e10cSrcweir void MetaBmpScalePartAction::Read( SvStream& rIStm, ImplMetaReadData* )
1999cdf0e10cSrcweir {
2000cdf0e10cSrcweir     COMPAT( rIStm );
2001cdf0e10cSrcweir     rIStm >> maBmp >> maDstPt >> maDstSz >> maSrcPt >> maSrcSz;
2002cdf0e10cSrcweir }
2003cdf0e10cSrcweir 
2004cdf0e10cSrcweir // ========================================================================
2005cdf0e10cSrcweir 
2006cdf0e10cSrcweir IMPL_META_ACTION( BmpEx, META_BMPEX_ACTION )
2007cdf0e10cSrcweir 
2008cdf0e10cSrcweir // ------------------------------------------------------------------------
2009cdf0e10cSrcweir 
2010cdf0e10cSrcweir MetaBmpExAction::MetaBmpExAction( const Point& rPt, const BitmapEx& rBmpEx ) :
2011cdf0e10cSrcweir     MetaAction  ( META_BMPEX_ACTION ),
2012cdf0e10cSrcweir     maBmpEx     ( rBmpEx ),
2013cdf0e10cSrcweir     maPt        ( rPt )
2014cdf0e10cSrcweir {
2015cdf0e10cSrcweir }
2016cdf0e10cSrcweir 
2017cdf0e10cSrcweir // ------------------------------------------------------------------------
2018cdf0e10cSrcweir 
2019cdf0e10cSrcweir void MetaBmpExAction::Execute( OutputDevice* pOut )
2020cdf0e10cSrcweir {
2021cdf0e10cSrcweir     pOut->DrawBitmapEx( maPt, maBmpEx );
2022cdf0e10cSrcweir }
2023cdf0e10cSrcweir 
2024cdf0e10cSrcweir // ------------------------------------------------------------------------
2025cdf0e10cSrcweir 
2026cdf0e10cSrcweir MetaAction* MetaBmpExAction::Clone()
2027cdf0e10cSrcweir {
2028*ddde725dSArmin Le Grand     MetaBmpExAction* pClone = new MetaBmpExAction( *this );
2029cdf0e10cSrcweir     pClone->ResetRefCount();
2030cdf0e10cSrcweir     return pClone;
2031cdf0e10cSrcweir }
2032cdf0e10cSrcweir 
2033cdf0e10cSrcweir // ------------------------------------------------------------------------
2034cdf0e10cSrcweir 
2035cdf0e10cSrcweir void MetaBmpExAction::Move( long nHorzMove, long nVertMove )
2036cdf0e10cSrcweir {
2037cdf0e10cSrcweir     maPt.Move( nHorzMove, nVertMove );
2038cdf0e10cSrcweir }
2039cdf0e10cSrcweir 
2040cdf0e10cSrcweir // ------------------------------------------------------------------------
2041cdf0e10cSrcweir 
2042cdf0e10cSrcweir void MetaBmpExAction::Scale( double fScaleX, double fScaleY )
2043cdf0e10cSrcweir {
2044cdf0e10cSrcweir     ImplScalePoint( maPt, fScaleX, fScaleY );
2045cdf0e10cSrcweir }
2046cdf0e10cSrcweir 
2047cdf0e10cSrcweir // ------------------------------------------------------------------------
2048cdf0e10cSrcweir 
2049cdf0e10cSrcweir sal_Bool MetaBmpExAction::Compare( const MetaAction& rMetaAction ) const
2050cdf0e10cSrcweir {
2051cdf0e10cSrcweir     return ( maBmpEx.IsEqual(((MetaBmpExAction&)rMetaAction).maBmpEx )) &&
2052cdf0e10cSrcweir            ( maPt == ((MetaBmpExAction&)rMetaAction).maPt );
2053cdf0e10cSrcweir }
2054cdf0e10cSrcweir 
2055cdf0e10cSrcweir // ------------------------------------------------------------------------
2056cdf0e10cSrcweir 
2057cdf0e10cSrcweir void MetaBmpExAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
2058cdf0e10cSrcweir {
2059cdf0e10cSrcweir     if( !!maBmpEx.GetBitmap() )
2060cdf0e10cSrcweir     {
2061cdf0e10cSrcweir         WRITE_BASE_COMPAT( rOStm, 1, pData );
2062cdf0e10cSrcweir         rOStm << maBmpEx << maPt;
2063cdf0e10cSrcweir     }
2064cdf0e10cSrcweir }
2065cdf0e10cSrcweir 
2066cdf0e10cSrcweir // ------------------------------------------------------------------------
2067cdf0e10cSrcweir 
2068cdf0e10cSrcweir void MetaBmpExAction::Read( SvStream& rIStm, ImplMetaReadData* )
2069cdf0e10cSrcweir {
2070cdf0e10cSrcweir     COMPAT( rIStm );
2071cdf0e10cSrcweir     rIStm >> maBmpEx >> maPt;
2072cdf0e10cSrcweir }
2073cdf0e10cSrcweir 
2074cdf0e10cSrcweir // ========================================================================
2075cdf0e10cSrcweir 
2076cdf0e10cSrcweir IMPL_META_ACTION( BmpExScale, META_BMPEXSCALE_ACTION )
2077cdf0e10cSrcweir 
2078cdf0e10cSrcweir // ------------------------------------------------------------------------
2079cdf0e10cSrcweir 
2080cdf0e10cSrcweir MetaBmpExScaleAction::MetaBmpExScaleAction( const Point& rPt, const Size& rSz,
2081cdf0e10cSrcweir                                             const BitmapEx& rBmpEx ) :
2082cdf0e10cSrcweir     MetaAction  ( META_BMPEXSCALE_ACTION ),
2083cdf0e10cSrcweir     maBmpEx     ( rBmpEx ),
2084cdf0e10cSrcweir     maPt        ( rPt ),
2085cdf0e10cSrcweir     maSz        ( rSz )
2086cdf0e10cSrcweir {
2087cdf0e10cSrcweir }
2088cdf0e10cSrcweir 
2089cdf0e10cSrcweir // ------------------------------------------------------------------------
2090cdf0e10cSrcweir 
2091cdf0e10cSrcweir void MetaBmpExScaleAction::Execute( OutputDevice* pOut )
2092cdf0e10cSrcweir {
2093cdf0e10cSrcweir     pOut->DrawBitmapEx( maPt, maSz, maBmpEx );
2094cdf0e10cSrcweir }
2095cdf0e10cSrcweir 
2096cdf0e10cSrcweir // ------------------------------------------------------------------------
2097cdf0e10cSrcweir 
2098cdf0e10cSrcweir MetaAction* MetaBmpExScaleAction::Clone()
2099cdf0e10cSrcweir {
2100cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaBmpExScaleAction( *this );
2101cdf0e10cSrcweir     pClone->ResetRefCount();
2102cdf0e10cSrcweir     return pClone;
2103cdf0e10cSrcweir }
2104cdf0e10cSrcweir 
2105cdf0e10cSrcweir // ------------------------------------------------------------------------
2106cdf0e10cSrcweir 
2107cdf0e10cSrcweir void MetaBmpExScaleAction::Move( long nHorzMove, long nVertMove )
2108cdf0e10cSrcweir {
2109cdf0e10cSrcweir     maPt.Move( nHorzMove, nVertMove );
2110cdf0e10cSrcweir }
2111cdf0e10cSrcweir 
2112cdf0e10cSrcweir // ------------------------------------------------------------------------
2113cdf0e10cSrcweir 
2114cdf0e10cSrcweir void MetaBmpExScaleAction::Scale( double fScaleX, double fScaleY )
2115cdf0e10cSrcweir {
2116cdf0e10cSrcweir     Rectangle aRectangle(maPt, maSz);
2117cdf0e10cSrcweir     ImplScaleRect( aRectangle, fScaleX, fScaleY );
2118cdf0e10cSrcweir     maPt = aRectangle.TopLeft();
2119cdf0e10cSrcweir     maSz = aRectangle.GetSize();
2120cdf0e10cSrcweir }
2121cdf0e10cSrcweir 
2122cdf0e10cSrcweir // ------------------------------------------------------------------------
2123cdf0e10cSrcweir 
2124cdf0e10cSrcweir sal_Bool MetaBmpExScaleAction::Compare( const MetaAction& rMetaAction ) const
2125cdf0e10cSrcweir {
2126cdf0e10cSrcweir     return ( maBmpEx.IsEqual(((MetaBmpExScaleAction&)rMetaAction).maBmpEx )) &&
2127cdf0e10cSrcweir            ( maPt == ((MetaBmpExScaleAction&)rMetaAction).maPt ) &&
2128cdf0e10cSrcweir            ( maSz == ((MetaBmpExScaleAction&)rMetaAction).maSz );
2129cdf0e10cSrcweir }
2130cdf0e10cSrcweir 
2131cdf0e10cSrcweir // ------------------------------------------------------------------------
2132cdf0e10cSrcweir 
2133cdf0e10cSrcweir void MetaBmpExScaleAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
2134cdf0e10cSrcweir {
2135cdf0e10cSrcweir     if( !!maBmpEx.GetBitmap() )
2136cdf0e10cSrcweir     {
2137cdf0e10cSrcweir         WRITE_BASE_COMPAT( rOStm, 1, pData );
2138cdf0e10cSrcweir         rOStm << maBmpEx << maPt << maSz;
2139cdf0e10cSrcweir     }
2140cdf0e10cSrcweir }
2141cdf0e10cSrcweir 
2142cdf0e10cSrcweir // ------------------------------------------------------------------------
2143cdf0e10cSrcweir 
2144cdf0e10cSrcweir void MetaBmpExScaleAction::Read( SvStream& rIStm, ImplMetaReadData* )
2145cdf0e10cSrcweir {
2146cdf0e10cSrcweir     COMPAT( rIStm );
2147cdf0e10cSrcweir     rIStm >> maBmpEx >> maPt >> maSz;
2148cdf0e10cSrcweir }
2149cdf0e10cSrcweir 
2150cdf0e10cSrcweir // ========================================================================
2151cdf0e10cSrcweir 
2152cdf0e10cSrcweir IMPL_META_ACTION( BmpExScalePart, META_BMPEXSCALEPART_ACTION )
2153cdf0e10cSrcweir 
2154cdf0e10cSrcweir // ------------------------------------------------------------------------
2155cdf0e10cSrcweir 
2156cdf0e10cSrcweir MetaBmpExScalePartAction::MetaBmpExScalePartAction( const Point& rDstPt, const Size& rDstSz,
2157cdf0e10cSrcweir                                                     const Point& rSrcPt, const Size& rSrcSz,
2158cdf0e10cSrcweir                                                     const BitmapEx& rBmpEx ) :
2159cdf0e10cSrcweir     MetaAction  ( META_BMPEXSCALEPART_ACTION ),
2160cdf0e10cSrcweir     maBmpEx     ( rBmpEx ),
2161cdf0e10cSrcweir     maDstPt     ( rDstPt ),
2162cdf0e10cSrcweir     maDstSz     ( rDstSz ),
2163cdf0e10cSrcweir     maSrcPt     ( rSrcPt ),
2164cdf0e10cSrcweir     maSrcSz     ( rSrcSz )
2165cdf0e10cSrcweir {
2166cdf0e10cSrcweir }
2167cdf0e10cSrcweir 
2168cdf0e10cSrcweir // ------------------------------------------------------------------------
2169cdf0e10cSrcweir 
2170cdf0e10cSrcweir void MetaBmpExScalePartAction::Execute( OutputDevice* pOut )
2171cdf0e10cSrcweir {
2172cdf0e10cSrcweir     pOut->DrawBitmapEx( maDstPt, maDstSz, maSrcPt, maSrcSz, maBmpEx );
2173cdf0e10cSrcweir }
2174cdf0e10cSrcweir 
2175cdf0e10cSrcweir // ------------------------------------------------------------------------
2176cdf0e10cSrcweir 
2177cdf0e10cSrcweir MetaAction* MetaBmpExScalePartAction::Clone()
2178cdf0e10cSrcweir {
2179cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaBmpExScalePartAction( *this );
2180cdf0e10cSrcweir     pClone->ResetRefCount();
2181cdf0e10cSrcweir     return pClone;
2182cdf0e10cSrcweir }
2183cdf0e10cSrcweir 
2184cdf0e10cSrcweir // ------------------------------------------------------------------------
2185cdf0e10cSrcweir 
2186cdf0e10cSrcweir void MetaBmpExScalePartAction::Move( long nHorzMove, long nVertMove )
2187cdf0e10cSrcweir {
2188cdf0e10cSrcweir     maDstPt.Move( nHorzMove, nVertMove );
2189cdf0e10cSrcweir }
2190cdf0e10cSrcweir 
2191cdf0e10cSrcweir // ------------------------------------------------------------------------
2192cdf0e10cSrcweir 
2193cdf0e10cSrcweir void MetaBmpExScalePartAction::Scale( double fScaleX, double fScaleY )
2194cdf0e10cSrcweir {
2195cdf0e10cSrcweir     Rectangle aRectangle(maDstPt, maDstSz);
2196cdf0e10cSrcweir     ImplScaleRect( aRectangle, fScaleX, fScaleY );
2197cdf0e10cSrcweir     maDstPt = aRectangle.TopLeft();
2198cdf0e10cSrcweir     maDstSz = aRectangle.GetSize();
2199cdf0e10cSrcweir }
2200cdf0e10cSrcweir 
2201cdf0e10cSrcweir // ------------------------------------------------------------------------
2202cdf0e10cSrcweir 
2203cdf0e10cSrcweir sal_Bool MetaBmpExScalePartAction::Compare( const MetaAction& rMetaAction ) const
2204cdf0e10cSrcweir {
2205cdf0e10cSrcweir     return ( maBmpEx.IsEqual(((MetaBmpExScalePartAction&)rMetaAction).maBmpEx )) &&
2206cdf0e10cSrcweir            ( maDstPt == ((MetaBmpExScalePartAction&)rMetaAction).maDstPt ) &&
2207cdf0e10cSrcweir            ( maDstSz == ((MetaBmpExScalePartAction&)rMetaAction).maDstSz ) &&
2208cdf0e10cSrcweir            ( maSrcPt == ((MetaBmpExScalePartAction&)rMetaAction).maSrcPt ) &&
2209cdf0e10cSrcweir            ( maSrcSz == ((MetaBmpExScalePartAction&)rMetaAction).maSrcSz );
2210cdf0e10cSrcweir }
2211cdf0e10cSrcweir 
2212cdf0e10cSrcweir // ------------------------------------------------------------------------
2213cdf0e10cSrcweir 
2214cdf0e10cSrcweir void MetaBmpExScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
2215cdf0e10cSrcweir {
2216cdf0e10cSrcweir     if( !!maBmpEx.GetBitmap() )
2217cdf0e10cSrcweir     {
2218cdf0e10cSrcweir         WRITE_BASE_COMPAT( rOStm, 1, pData );
2219cdf0e10cSrcweir         rOStm << maBmpEx << maDstPt << maDstSz << maSrcPt << maSrcSz;
2220cdf0e10cSrcweir     }
2221cdf0e10cSrcweir }
2222cdf0e10cSrcweir 
2223cdf0e10cSrcweir // ------------------------------------------------------------------------
2224cdf0e10cSrcweir 
2225cdf0e10cSrcweir void MetaBmpExScalePartAction::Read( SvStream& rIStm, ImplMetaReadData* )
2226cdf0e10cSrcweir {
2227cdf0e10cSrcweir     COMPAT( rIStm );
2228cdf0e10cSrcweir     rIStm >> maBmpEx >> maDstPt >> maDstSz >> maSrcPt >> maSrcSz;
2229cdf0e10cSrcweir }
2230cdf0e10cSrcweir 
2231cdf0e10cSrcweir // ========================================================================
2232cdf0e10cSrcweir 
2233cdf0e10cSrcweir IMPL_META_ACTION( Mask, META_MASK_ACTION )
2234cdf0e10cSrcweir 
2235cdf0e10cSrcweir // ------------------------------------------------------------------------
2236cdf0e10cSrcweir 
2237cdf0e10cSrcweir MetaMaskAction::MetaMaskAction( const Point& rPt,
2238cdf0e10cSrcweir                                 const Bitmap& rBmp,
2239cdf0e10cSrcweir                                 const Color& rColor ) :
2240cdf0e10cSrcweir     MetaAction  ( META_MASK_ACTION ),
2241cdf0e10cSrcweir     maBmp       ( rBmp ),
2242cdf0e10cSrcweir     maColor     ( rColor ),
2243cdf0e10cSrcweir     maPt        ( rPt )
2244cdf0e10cSrcweir {
2245cdf0e10cSrcweir }
2246cdf0e10cSrcweir 
2247cdf0e10cSrcweir // ------------------------------------------------------------------------
2248cdf0e10cSrcweir 
2249cdf0e10cSrcweir void MetaMaskAction::Execute( OutputDevice* pOut )
2250cdf0e10cSrcweir {
2251cdf0e10cSrcweir     pOut->DrawMask( maPt, maBmp, maColor );
2252cdf0e10cSrcweir }
2253cdf0e10cSrcweir 
2254cdf0e10cSrcweir // ------------------------------------------------------------------------
2255cdf0e10cSrcweir 
2256cdf0e10cSrcweir MetaAction* MetaMaskAction::Clone()
2257cdf0e10cSrcweir {
2258cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaMaskAction( *this );
2259cdf0e10cSrcweir     pClone->ResetRefCount();
2260cdf0e10cSrcweir     return pClone;
2261cdf0e10cSrcweir }
2262cdf0e10cSrcweir 
2263cdf0e10cSrcweir // ------------------------------------------------------------------------
2264cdf0e10cSrcweir 
2265cdf0e10cSrcweir void MetaMaskAction::Move( long nHorzMove, long nVertMove )
2266cdf0e10cSrcweir {
2267cdf0e10cSrcweir     maPt.Move( nHorzMove, nVertMove );
2268cdf0e10cSrcweir }
2269cdf0e10cSrcweir 
2270cdf0e10cSrcweir // ------------------------------------------------------------------------
2271cdf0e10cSrcweir 
2272cdf0e10cSrcweir void MetaMaskAction::Scale( double fScaleX, double fScaleY )
2273cdf0e10cSrcweir {
2274cdf0e10cSrcweir     ImplScalePoint( maPt, fScaleX, fScaleY );
2275cdf0e10cSrcweir }
2276cdf0e10cSrcweir 
2277cdf0e10cSrcweir // ------------------------------------------------------------------------
2278cdf0e10cSrcweir 
2279cdf0e10cSrcweir sal_Bool MetaMaskAction::Compare( const MetaAction& rMetaAction ) const
2280cdf0e10cSrcweir {
2281cdf0e10cSrcweir     return ( maBmp.IsEqual(((MetaMaskAction&)rMetaAction).maBmp )) &&
2282cdf0e10cSrcweir            ( maColor == ((MetaMaskAction&)rMetaAction).maColor ) &&
2283cdf0e10cSrcweir            ( maPt == ((MetaMaskAction&)rMetaAction).maPt );
2284cdf0e10cSrcweir }
2285cdf0e10cSrcweir 
2286cdf0e10cSrcweir // ------------------------------------------------------------------------
2287cdf0e10cSrcweir 
2288cdf0e10cSrcweir void MetaMaskAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
2289cdf0e10cSrcweir {
2290cdf0e10cSrcweir     if( !!maBmp )
2291cdf0e10cSrcweir     {
2292cdf0e10cSrcweir         WRITE_BASE_COMPAT( rOStm, 1, pData );
2293cdf0e10cSrcweir         rOStm << maBmp << maPt;
2294cdf0e10cSrcweir     }
2295cdf0e10cSrcweir }
2296cdf0e10cSrcweir 
2297cdf0e10cSrcweir // ------------------------------------------------------------------------
2298cdf0e10cSrcweir 
2299cdf0e10cSrcweir void MetaMaskAction::Read( SvStream& rIStm, ImplMetaReadData* )
2300cdf0e10cSrcweir {
2301cdf0e10cSrcweir     COMPAT( rIStm );
2302cdf0e10cSrcweir     rIStm >> maBmp >> maPt;
2303cdf0e10cSrcweir }
2304cdf0e10cSrcweir 
2305cdf0e10cSrcweir // ========================================================================
2306cdf0e10cSrcweir 
2307cdf0e10cSrcweir IMPL_META_ACTION( MaskScale, META_MASKSCALE_ACTION )
2308cdf0e10cSrcweir 
2309cdf0e10cSrcweir // ------------------------------------------------------------------------
2310cdf0e10cSrcweir 
2311cdf0e10cSrcweir MetaMaskScaleAction::MetaMaskScaleAction( const Point& rPt, const Size& rSz,
2312cdf0e10cSrcweir                                           const Bitmap& rBmp,
2313cdf0e10cSrcweir                                           const Color& rColor ) :
2314cdf0e10cSrcweir     MetaAction  ( META_MASKSCALE_ACTION ),
2315cdf0e10cSrcweir     maBmp       ( rBmp ),
2316cdf0e10cSrcweir     maColor     ( rColor ),
2317cdf0e10cSrcweir     maPt        ( rPt ),
2318cdf0e10cSrcweir     maSz        ( rSz )
2319cdf0e10cSrcweir {
2320cdf0e10cSrcweir }
2321cdf0e10cSrcweir 
2322cdf0e10cSrcweir // ------------------------------------------------------------------------
2323cdf0e10cSrcweir 
2324cdf0e10cSrcweir void MetaMaskScaleAction::Execute( OutputDevice* pOut )
2325cdf0e10cSrcweir {
2326cdf0e10cSrcweir     pOut->DrawMask( maPt, maSz, maBmp, maColor );
2327cdf0e10cSrcweir }
2328cdf0e10cSrcweir 
2329cdf0e10cSrcweir // ------------------------------------------------------------------------
2330cdf0e10cSrcweir 
2331cdf0e10cSrcweir MetaAction* MetaMaskScaleAction::Clone()
2332cdf0e10cSrcweir {
2333cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaMaskScaleAction( *this );
2334cdf0e10cSrcweir     pClone->ResetRefCount();
2335cdf0e10cSrcweir     return pClone;
2336cdf0e10cSrcweir }
2337cdf0e10cSrcweir 
2338cdf0e10cSrcweir // ------------------------------------------------------------------------
2339cdf0e10cSrcweir 
2340cdf0e10cSrcweir void MetaMaskScaleAction::Move( long nHorzMove, long nVertMove )
2341cdf0e10cSrcweir {
2342cdf0e10cSrcweir     maPt.Move( nHorzMove, nVertMove );
2343cdf0e10cSrcweir }
2344cdf0e10cSrcweir 
2345cdf0e10cSrcweir // ------------------------------------------------------------------------
2346cdf0e10cSrcweir 
2347cdf0e10cSrcweir void MetaMaskScaleAction::Scale( double fScaleX, double fScaleY )
2348cdf0e10cSrcweir {
2349cdf0e10cSrcweir     Rectangle aRectangle(maPt, maSz);
2350cdf0e10cSrcweir     ImplScaleRect( aRectangle, fScaleX, fScaleY );
2351cdf0e10cSrcweir     maPt = aRectangle.TopLeft();
2352cdf0e10cSrcweir     maSz = aRectangle.GetSize();
2353cdf0e10cSrcweir }
2354cdf0e10cSrcweir 
2355cdf0e10cSrcweir // ------------------------------------------------------------------------
2356cdf0e10cSrcweir 
2357cdf0e10cSrcweir sal_Bool MetaMaskScaleAction::Compare( const MetaAction& rMetaAction ) const
2358cdf0e10cSrcweir {
2359cdf0e10cSrcweir     return ( maBmp.IsEqual(((MetaMaskScaleAction&)rMetaAction).maBmp )) &&
2360cdf0e10cSrcweir            ( maColor == ((MetaMaskScaleAction&)rMetaAction).maColor ) &&
2361cdf0e10cSrcweir            ( maPt == ((MetaMaskScaleAction&)rMetaAction).maPt ) &&
2362cdf0e10cSrcweir            ( maSz == ((MetaMaskScaleAction&)rMetaAction).maSz );
2363cdf0e10cSrcweir }
2364cdf0e10cSrcweir 
2365cdf0e10cSrcweir // ------------------------------------------------------------------------
2366cdf0e10cSrcweir 
2367cdf0e10cSrcweir void MetaMaskScaleAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
2368cdf0e10cSrcweir {
2369cdf0e10cSrcweir     if( !!maBmp )
2370cdf0e10cSrcweir     {
2371cdf0e10cSrcweir         WRITE_BASE_COMPAT( rOStm, 1, pData );
2372cdf0e10cSrcweir         rOStm << maBmp << maPt << maSz;
2373cdf0e10cSrcweir     }
2374cdf0e10cSrcweir }
2375cdf0e10cSrcweir 
2376cdf0e10cSrcweir // ------------------------------------------------------------------------
2377cdf0e10cSrcweir 
2378cdf0e10cSrcweir void MetaMaskScaleAction::Read( SvStream& rIStm, ImplMetaReadData* )
2379cdf0e10cSrcweir {
2380cdf0e10cSrcweir     COMPAT( rIStm );
2381cdf0e10cSrcweir     rIStm >> maBmp >> maPt >> maSz;
2382cdf0e10cSrcweir }
2383cdf0e10cSrcweir 
2384cdf0e10cSrcweir // ========================================================================
2385cdf0e10cSrcweir 
2386cdf0e10cSrcweir IMPL_META_ACTION( MaskScalePart, META_MASKSCALEPART_ACTION )
2387cdf0e10cSrcweir 
2388cdf0e10cSrcweir // ------------------------------------------------------------------------
2389cdf0e10cSrcweir 
2390cdf0e10cSrcweir MetaMaskScalePartAction::MetaMaskScalePartAction( const Point& rDstPt, const Size& rDstSz,
2391cdf0e10cSrcweir                                                   const Point& rSrcPt, const Size& rSrcSz,
2392cdf0e10cSrcweir                                                   const Bitmap& rBmp,
2393cdf0e10cSrcweir                                                   const Color& rColor ) :
2394cdf0e10cSrcweir     MetaAction  ( META_MASKSCALEPART_ACTION ),
2395cdf0e10cSrcweir     maBmp       ( rBmp ),
2396cdf0e10cSrcweir     maColor     ( rColor ),
2397cdf0e10cSrcweir     maDstPt     ( rDstPt ),
2398cdf0e10cSrcweir     maDstSz     ( rDstSz ),
2399cdf0e10cSrcweir     maSrcPt     ( rSrcPt ),
2400cdf0e10cSrcweir     maSrcSz     ( rSrcSz )
2401cdf0e10cSrcweir {
2402cdf0e10cSrcweir }
2403cdf0e10cSrcweir 
2404cdf0e10cSrcweir // ------------------------------------------------------------------------
2405cdf0e10cSrcweir 
2406cdf0e10cSrcweir void MetaMaskScalePartAction::Execute( OutputDevice* pOut )
2407cdf0e10cSrcweir {
2408cdf0e10cSrcweir     pOut->DrawMask( maDstPt, maDstSz, maSrcPt, maSrcSz, maBmp, maColor );
2409cdf0e10cSrcweir }
2410cdf0e10cSrcweir 
2411cdf0e10cSrcweir // ------------------------------------------------------------------------
2412cdf0e10cSrcweir 
2413cdf0e10cSrcweir MetaAction* MetaMaskScalePartAction::Clone()
2414cdf0e10cSrcweir {
2415cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaMaskScalePartAction( *this );
2416cdf0e10cSrcweir     pClone->ResetRefCount();
2417cdf0e10cSrcweir     return pClone;
2418cdf0e10cSrcweir }
2419cdf0e10cSrcweir 
2420cdf0e10cSrcweir // ------------------------------------------------------------------------
2421cdf0e10cSrcweir 
2422cdf0e10cSrcweir void MetaMaskScalePartAction::Move( long nHorzMove, long nVertMove )
2423cdf0e10cSrcweir {
2424cdf0e10cSrcweir     maDstPt.Move( nHorzMove, nVertMove );
2425cdf0e10cSrcweir }
2426cdf0e10cSrcweir 
2427cdf0e10cSrcweir // ------------------------------------------------------------------------
2428cdf0e10cSrcweir 
2429cdf0e10cSrcweir void MetaMaskScalePartAction::Scale( double fScaleX, double fScaleY )
2430cdf0e10cSrcweir {
2431cdf0e10cSrcweir     Rectangle aRectangle(maDstPt, maDstSz);
2432cdf0e10cSrcweir     ImplScaleRect( aRectangle, fScaleX, fScaleY );
2433cdf0e10cSrcweir     maDstPt = aRectangle.TopLeft();
2434cdf0e10cSrcweir     maDstSz = aRectangle.GetSize();
2435cdf0e10cSrcweir }
2436cdf0e10cSrcweir 
2437cdf0e10cSrcweir // ------------------------------------------------------------------------
2438cdf0e10cSrcweir 
2439cdf0e10cSrcweir sal_Bool MetaMaskScalePartAction::Compare( const MetaAction& rMetaAction ) const
2440cdf0e10cSrcweir {
2441cdf0e10cSrcweir     return ( maBmp.IsEqual(((MetaMaskScalePartAction&)rMetaAction).maBmp )) &&
2442cdf0e10cSrcweir            ( maColor == ((MetaMaskScalePartAction&)rMetaAction).maColor ) &&
2443cdf0e10cSrcweir            ( maDstPt == ((MetaMaskScalePartAction&)rMetaAction).maDstPt ) &&
2444cdf0e10cSrcweir            ( maDstSz == ((MetaMaskScalePartAction&)rMetaAction).maDstSz ) &&
2445cdf0e10cSrcweir            ( maSrcPt == ((MetaMaskScalePartAction&)rMetaAction).maSrcPt ) &&
2446cdf0e10cSrcweir            ( maSrcSz == ((MetaMaskScalePartAction&)rMetaAction).maSrcSz );
2447cdf0e10cSrcweir }
2448cdf0e10cSrcweir 
2449cdf0e10cSrcweir // ------------------------------------------------------------------------
2450cdf0e10cSrcweir 
2451cdf0e10cSrcweir void MetaMaskScalePartAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
2452cdf0e10cSrcweir {
2453cdf0e10cSrcweir     if( !!maBmp )
2454cdf0e10cSrcweir     {
2455cdf0e10cSrcweir         WRITE_BASE_COMPAT( rOStm, 1, pData );
2456cdf0e10cSrcweir         rOStm << maBmp;
2457cdf0e10cSrcweir         maColor.Write( rOStm, sal_True );
2458cdf0e10cSrcweir         rOStm << maDstPt << maDstSz << maSrcPt << maSrcSz;
2459cdf0e10cSrcweir     }
2460cdf0e10cSrcweir }
2461cdf0e10cSrcweir 
2462cdf0e10cSrcweir // ------------------------------------------------------------------------
2463cdf0e10cSrcweir 
2464cdf0e10cSrcweir void MetaMaskScalePartAction::Read( SvStream& rIStm, ImplMetaReadData* )
2465cdf0e10cSrcweir {
2466cdf0e10cSrcweir     COMPAT( rIStm );
2467cdf0e10cSrcweir     rIStm >> maBmp;
2468cdf0e10cSrcweir     maColor.Read( rIStm, sal_True );
2469cdf0e10cSrcweir     rIStm >> maDstPt >> maDstSz >> maSrcPt >> maSrcSz;
2470cdf0e10cSrcweir }
2471cdf0e10cSrcweir 
2472cdf0e10cSrcweir // ========================================================================
2473cdf0e10cSrcweir 
2474cdf0e10cSrcweir IMPL_META_ACTION( Gradient, META_GRADIENT_ACTION )
2475cdf0e10cSrcweir 
2476cdf0e10cSrcweir // ------------------------------------------------------------------------
2477cdf0e10cSrcweir 
2478cdf0e10cSrcweir MetaGradientAction::MetaGradientAction( const Rectangle& rRect, const Gradient& rGradient ) :
2479cdf0e10cSrcweir     MetaAction  ( META_GRADIENT_ACTION ),
2480cdf0e10cSrcweir     maRect      ( rRect ),
2481cdf0e10cSrcweir     maGradient  ( rGradient )
2482cdf0e10cSrcweir {
2483cdf0e10cSrcweir }
2484cdf0e10cSrcweir 
2485cdf0e10cSrcweir // ------------------------------------------------------------------------
2486cdf0e10cSrcweir 
2487cdf0e10cSrcweir void MetaGradientAction::Execute( OutputDevice* pOut )
2488cdf0e10cSrcweir {
2489cdf0e10cSrcweir     pOut->DrawGradient( maRect, maGradient );
2490cdf0e10cSrcweir }
2491cdf0e10cSrcweir 
2492cdf0e10cSrcweir // ------------------------------------------------------------------------
2493cdf0e10cSrcweir 
2494cdf0e10cSrcweir MetaAction* MetaGradientAction::Clone()
2495cdf0e10cSrcweir {
2496cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaGradientAction( *this );
2497cdf0e10cSrcweir     pClone->ResetRefCount();
2498cdf0e10cSrcweir     return pClone;
2499cdf0e10cSrcweir }
2500cdf0e10cSrcweir 
2501cdf0e10cSrcweir // ------------------------------------------------------------------------
2502cdf0e10cSrcweir 
2503cdf0e10cSrcweir void MetaGradientAction::Move( long nHorzMove, long nVertMove )
2504cdf0e10cSrcweir {
2505cdf0e10cSrcweir     maRect.Move( nHorzMove, nVertMove );
2506cdf0e10cSrcweir }
2507cdf0e10cSrcweir 
2508cdf0e10cSrcweir // ------------------------------------------------------------------------
2509cdf0e10cSrcweir 
2510cdf0e10cSrcweir void MetaGradientAction::Scale( double fScaleX, double fScaleY )
2511cdf0e10cSrcweir {
2512cdf0e10cSrcweir     ImplScaleRect( maRect, fScaleX, fScaleY );
2513cdf0e10cSrcweir }
2514cdf0e10cSrcweir 
2515cdf0e10cSrcweir // ------------------------------------------------------------------------
2516cdf0e10cSrcweir 
2517cdf0e10cSrcweir sal_Bool MetaGradientAction::Compare( const MetaAction& rMetaAction ) const
2518cdf0e10cSrcweir {
2519cdf0e10cSrcweir     return ( maRect == ((MetaGradientAction&)rMetaAction).maRect ) &&
2520cdf0e10cSrcweir            ( maGradient == ((MetaGradientAction&)rMetaAction).maGradient );
2521cdf0e10cSrcweir }
2522cdf0e10cSrcweir 
2523cdf0e10cSrcweir // ------------------------------------------------------------------------
2524cdf0e10cSrcweir 
2525cdf0e10cSrcweir void MetaGradientAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
2526cdf0e10cSrcweir {
2527cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
2528cdf0e10cSrcweir     rOStm << maRect << maGradient;
2529cdf0e10cSrcweir }
2530cdf0e10cSrcweir 
2531cdf0e10cSrcweir // ------------------------------------------------------------------------
2532cdf0e10cSrcweir 
2533cdf0e10cSrcweir void MetaGradientAction::Read( SvStream& rIStm, ImplMetaReadData* )
2534cdf0e10cSrcweir {
2535cdf0e10cSrcweir     COMPAT( rIStm );
2536cdf0e10cSrcweir     rIStm >> maRect >> maGradient;
2537cdf0e10cSrcweir }
2538cdf0e10cSrcweir 
2539cdf0e10cSrcweir // ========================================================================
2540cdf0e10cSrcweir 
2541cdf0e10cSrcweir MetaGradientExAction::MetaGradientExAction() :
2542cdf0e10cSrcweir     MetaAction  ( META_GRADIENTEX_ACTION )
2543cdf0e10cSrcweir {
2544cdf0e10cSrcweir }
2545cdf0e10cSrcweir 
2546cdf0e10cSrcweir // ------------------------------------------------------------------------
2547cdf0e10cSrcweir 
2548cdf0e10cSrcweir MetaGradientExAction::MetaGradientExAction( const PolyPolygon& rPolyPoly, const Gradient& rGradient ) :
2549cdf0e10cSrcweir     MetaAction  ( META_GRADIENTEX_ACTION ),
2550cdf0e10cSrcweir     maPolyPoly  ( rPolyPoly ),
2551cdf0e10cSrcweir     maGradient  ( rGradient )
2552cdf0e10cSrcweir {
2553cdf0e10cSrcweir }
2554cdf0e10cSrcweir 
2555cdf0e10cSrcweir // ------------------------------------------------------------------------
2556cdf0e10cSrcweir 
2557cdf0e10cSrcweir MetaGradientExAction::~MetaGradientExAction()
2558cdf0e10cSrcweir {
2559cdf0e10cSrcweir }
2560cdf0e10cSrcweir 
2561cdf0e10cSrcweir // ------------------------------------------------------------------------
2562cdf0e10cSrcweir 
2563cdf0e10cSrcweir void MetaGradientExAction::Execute( OutputDevice* pOut )
2564cdf0e10cSrcweir {
2565cdf0e10cSrcweir     if( pOut->GetConnectMetaFile() )
2566cdf0e10cSrcweir     {
2567cdf0e10cSrcweir         Duplicate();
2568cdf0e10cSrcweir         pOut->GetConnectMetaFile()->AddAction( this );
2569cdf0e10cSrcweir     }
2570cdf0e10cSrcweir }
2571cdf0e10cSrcweir 
2572cdf0e10cSrcweir // ------------------------------------------------------------------------
2573cdf0e10cSrcweir 
2574cdf0e10cSrcweir MetaAction* MetaGradientExAction::Clone()
2575cdf0e10cSrcweir {
2576cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaGradientExAction( *this );
2577cdf0e10cSrcweir     pClone->ResetRefCount();
2578cdf0e10cSrcweir     return pClone;
2579cdf0e10cSrcweir }
2580cdf0e10cSrcweir 
2581cdf0e10cSrcweir // ------------------------------------------------------------------------
2582cdf0e10cSrcweir 
2583cdf0e10cSrcweir void MetaGradientExAction::Move( long nHorzMove, long nVertMove )
2584cdf0e10cSrcweir {
2585cdf0e10cSrcweir     maPolyPoly.Move( nHorzMove, nVertMove );
2586cdf0e10cSrcweir }
2587cdf0e10cSrcweir 
2588cdf0e10cSrcweir // ------------------------------------------------------------------------
2589cdf0e10cSrcweir 
2590cdf0e10cSrcweir void MetaGradientExAction::Scale( double fScaleX, double fScaleY )
2591cdf0e10cSrcweir {
2592cdf0e10cSrcweir     for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
2593cdf0e10cSrcweir         ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
2594cdf0e10cSrcweir }
2595cdf0e10cSrcweir 
2596cdf0e10cSrcweir // ------------------------------------------------------------------------
2597cdf0e10cSrcweir 
2598cdf0e10cSrcweir sal_Bool MetaGradientExAction::Compare( const MetaAction& rMetaAction ) const
2599cdf0e10cSrcweir {
2600cdf0e10cSrcweir     return ( maPolyPoly == ((MetaGradientExAction&)rMetaAction).maPolyPoly ) &&
2601cdf0e10cSrcweir            ( maGradient == ((MetaGradientExAction&)rMetaAction).maGradient );
2602cdf0e10cSrcweir }
2603cdf0e10cSrcweir 
2604cdf0e10cSrcweir // ------------------------------------------------------------------------
2605cdf0e10cSrcweir 
2606cdf0e10cSrcweir void MetaGradientExAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
2607cdf0e10cSrcweir {
2608cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
2609cdf0e10cSrcweir 
2610cdf0e10cSrcweir     // #i105373# see comment at MetaTransparentAction::Write
2611cdf0e10cSrcweir     PolyPolygon aNoCurvePolyPolygon;
2612cdf0e10cSrcweir     maPolyPoly.AdaptiveSubdivide(aNoCurvePolyPolygon);
2613cdf0e10cSrcweir 
2614cdf0e10cSrcweir     rOStm << aNoCurvePolyPolygon;
2615cdf0e10cSrcweir     rOStm << maGradient;
2616cdf0e10cSrcweir }
2617cdf0e10cSrcweir 
2618cdf0e10cSrcweir // ------------------------------------------------------------------------
2619cdf0e10cSrcweir 
2620cdf0e10cSrcweir void MetaGradientExAction::Read( SvStream& rIStm, ImplMetaReadData* )
2621cdf0e10cSrcweir {
2622cdf0e10cSrcweir     COMPAT( rIStm );
2623cdf0e10cSrcweir     rIStm >> maPolyPoly >> maGradient;
2624cdf0e10cSrcweir }
2625cdf0e10cSrcweir 
2626cdf0e10cSrcweir // ========================================================================
2627cdf0e10cSrcweir 
2628cdf0e10cSrcweir IMPL_META_ACTION( Hatch, META_HATCH_ACTION )
2629cdf0e10cSrcweir 
2630cdf0e10cSrcweir // ------------------------------------------------------------------------
2631cdf0e10cSrcweir 
2632cdf0e10cSrcweir MetaHatchAction::MetaHatchAction( const PolyPolygon& rPolyPoly, const Hatch& rHatch ) :
2633cdf0e10cSrcweir     MetaAction  ( META_HATCH_ACTION ),
2634cdf0e10cSrcweir     maPolyPoly  ( rPolyPoly ),
2635cdf0e10cSrcweir     maHatch     ( rHatch )
2636cdf0e10cSrcweir {
2637cdf0e10cSrcweir }
2638cdf0e10cSrcweir 
2639cdf0e10cSrcweir // ------------------------------------------------------------------------
2640cdf0e10cSrcweir 
2641cdf0e10cSrcweir void MetaHatchAction::Execute( OutputDevice* pOut )
2642cdf0e10cSrcweir {
2643cdf0e10cSrcweir     pOut->DrawHatch( maPolyPoly, maHatch );
2644cdf0e10cSrcweir }
2645cdf0e10cSrcweir 
2646cdf0e10cSrcweir // ------------------------------------------------------------------------
2647cdf0e10cSrcweir 
2648cdf0e10cSrcweir MetaAction* MetaHatchAction::Clone()
2649cdf0e10cSrcweir {
2650cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaHatchAction( *this );
2651cdf0e10cSrcweir     pClone->ResetRefCount();
2652cdf0e10cSrcweir     return pClone;
2653cdf0e10cSrcweir }
2654cdf0e10cSrcweir 
2655cdf0e10cSrcweir // ------------------------------------------------------------------------
2656cdf0e10cSrcweir 
2657cdf0e10cSrcweir void MetaHatchAction::Move( long nHorzMove, long nVertMove )
2658cdf0e10cSrcweir {
2659cdf0e10cSrcweir     maPolyPoly.Move( nHorzMove, nVertMove );
2660cdf0e10cSrcweir }
2661cdf0e10cSrcweir 
2662cdf0e10cSrcweir // ------------------------------------------------------------------------
2663cdf0e10cSrcweir 
2664cdf0e10cSrcweir void MetaHatchAction::Scale( double fScaleX, double fScaleY )
2665cdf0e10cSrcweir {
2666cdf0e10cSrcweir     for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
2667cdf0e10cSrcweir         ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
2668cdf0e10cSrcweir }
2669cdf0e10cSrcweir 
2670cdf0e10cSrcweir // ------------------------------------------------------------------------
2671cdf0e10cSrcweir 
2672cdf0e10cSrcweir sal_Bool MetaHatchAction::Compare( const MetaAction& rMetaAction ) const
2673cdf0e10cSrcweir {
2674cdf0e10cSrcweir     return ( maPolyPoly == ((MetaHatchAction&)rMetaAction).maPolyPoly ) &&
2675cdf0e10cSrcweir            ( maHatch == ((MetaHatchAction&)rMetaAction).maHatch );
2676cdf0e10cSrcweir }
2677cdf0e10cSrcweir 
2678cdf0e10cSrcweir // ------------------------------------------------------------------------
2679cdf0e10cSrcweir 
2680cdf0e10cSrcweir void MetaHatchAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
2681cdf0e10cSrcweir {
2682cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
2683cdf0e10cSrcweir 
2684cdf0e10cSrcweir     // #i105373# see comment at MetaTransparentAction::Write
2685cdf0e10cSrcweir     PolyPolygon aNoCurvePolyPolygon;
2686cdf0e10cSrcweir     maPolyPoly.AdaptiveSubdivide(aNoCurvePolyPolygon);
2687cdf0e10cSrcweir 
2688cdf0e10cSrcweir     rOStm << aNoCurvePolyPolygon;
2689cdf0e10cSrcweir     rOStm << maHatch;
2690cdf0e10cSrcweir }
2691cdf0e10cSrcweir 
2692cdf0e10cSrcweir // ------------------------------------------------------------------------
2693cdf0e10cSrcweir 
2694cdf0e10cSrcweir void MetaHatchAction::Read( SvStream& rIStm, ImplMetaReadData* )
2695cdf0e10cSrcweir {
2696cdf0e10cSrcweir     COMPAT( rIStm );
2697cdf0e10cSrcweir     rIStm >> maPolyPoly >> maHatch;
2698cdf0e10cSrcweir }
2699cdf0e10cSrcweir 
2700cdf0e10cSrcweir // ========================================================================
2701cdf0e10cSrcweir 
2702cdf0e10cSrcweir IMPL_META_ACTION( Wallpaper, META_WALLPAPER_ACTION )
2703cdf0e10cSrcweir 
2704cdf0e10cSrcweir // ------------------------------------------------------------------------
2705cdf0e10cSrcweir 
2706cdf0e10cSrcweir MetaWallpaperAction::MetaWallpaperAction( const Rectangle& rRect,
2707cdf0e10cSrcweir                                           const Wallpaper& rPaper ) :
2708cdf0e10cSrcweir     MetaAction  ( META_WALLPAPER_ACTION ),
2709cdf0e10cSrcweir     maRect      ( rRect ),
2710cdf0e10cSrcweir     maWallpaper ( rPaper )
2711cdf0e10cSrcweir {
2712cdf0e10cSrcweir }
2713cdf0e10cSrcweir 
2714cdf0e10cSrcweir // ------------------------------------------------------------------------
2715cdf0e10cSrcweir 
2716cdf0e10cSrcweir void MetaWallpaperAction::Execute( OutputDevice* pOut )
2717cdf0e10cSrcweir {
2718cdf0e10cSrcweir     pOut->DrawWallpaper( maRect, maWallpaper );
2719cdf0e10cSrcweir }
2720cdf0e10cSrcweir 
2721cdf0e10cSrcweir // ------------------------------------------------------------------------
2722cdf0e10cSrcweir 
2723cdf0e10cSrcweir MetaAction* MetaWallpaperAction::Clone()
2724cdf0e10cSrcweir {
2725cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaWallpaperAction( *this );
2726cdf0e10cSrcweir     pClone->ResetRefCount();
2727cdf0e10cSrcweir     return pClone;
2728cdf0e10cSrcweir }
2729cdf0e10cSrcweir 
2730cdf0e10cSrcweir // ------------------------------------------------------------------------
2731cdf0e10cSrcweir 
2732cdf0e10cSrcweir void MetaWallpaperAction::Move( long nHorzMove, long nVertMove )
2733cdf0e10cSrcweir {
2734cdf0e10cSrcweir     maRect.Move( nHorzMove, nVertMove );
2735cdf0e10cSrcweir }
2736cdf0e10cSrcweir 
2737cdf0e10cSrcweir // ------------------------------------------------------------------------
2738cdf0e10cSrcweir 
2739cdf0e10cSrcweir void MetaWallpaperAction::Scale( double fScaleX, double fScaleY )
2740cdf0e10cSrcweir {
2741cdf0e10cSrcweir     ImplScaleRect( maRect, fScaleX, fScaleY );
2742cdf0e10cSrcweir }
2743cdf0e10cSrcweir 
2744cdf0e10cSrcweir // ------------------------------------------------------------------------
2745cdf0e10cSrcweir 
2746cdf0e10cSrcweir sal_Bool MetaWallpaperAction::Compare( const MetaAction& rMetaAction ) const
2747cdf0e10cSrcweir {
2748cdf0e10cSrcweir     return ( maRect == ((MetaWallpaperAction&)rMetaAction).maRect ) &&
2749cdf0e10cSrcweir            ( maWallpaper == ((MetaWallpaperAction&)rMetaAction).maWallpaper );
2750cdf0e10cSrcweir }
2751cdf0e10cSrcweir 
2752cdf0e10cSrcweir // ------------------------------------------------------------------------
2753cdf0e10cSrcweir 
2754cdf0e10cSrcweir void MetaWallpaperAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
2755cdf0e10cSrcweir {
2756cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
2757cdf0e10cSrcweir     rOStm << maWallpaper;
2758cdf0e10cSrcweir }
2759cdf0e10cSrcweir 
2760cdf0e10cSrcweir // ------------------------------------------------------------------------
2761cdf0e10cSrcweir 
2762cdf0e10cSrcweir void MetaWallpaperAction::Read( SvStream& rIStm, ImplMetaReadData* )
2763cdf0e10cSrcweir {
2764cdf0e10cSrcweir     COMPAT( rIStm );
2765cdf0e10cSrcweir     rIStm >> maWallpaper;
2766cdf0e10cSrcweir }
2767cdf0e10cSrcweir 
2768cdf0e10cSrcweir // ========================================================================
2769cdf0e10cSrcweir 
2770cdf0e10cSrcweir IMPL_META_ACTION( ClipRegion, META_CLIPREGION_ACTION )
2771cdf0e10cSrcweir 
2772cdf0e10cSrcweir // ------------------------------------------------------------------------
2773cdf0e10cSrcweir 
2774cdf0e10cSrcweir MetaClipRegionAction::MetaClipRegionAction( const Region& rRegion, sal_Bool bClip ) :
2775cdf0e10cSrcweir     MetaAction  ( META_CLIPREGION_ACTION ),
2776cdf0e10cSrcweir     maRegion    ( rRegion ),
2777cdf0e10cSrcweir     mbClip      ( bClip )
2778cdf0e10cSrcweir {
2779cdf0e10cSrcweir }
2780cdf0e10cSrcweir 
2781cdf0e10cSrcweir // ------------------------------------------------------------------------
2782cdf0e10cSrcweir 
2783cdf0e10cSrcweir void MetaClipRegionAction::Execute( OutputDevice* pOut )
2784cdf0e10cSrcweir {
2785cdf0e10cSrcweir     if( mbClip )
2786cdf0e10cSrcweir         pOut->SetClipRegion( maRegion );
2787cdf0e10cSrcweir     else
2788cdf0e10cSrcweir         pOut->SetClipRegion();
2789cdf0e10cSrcweir }
2790cdf0e10cSrcweir 
2791cdf0e10cSrcweir // ------------------------------------------------------------------------
2792cdf0e10cSrcweir 
2793cdf0e10cSrcweir MetaAction* MetaClipRegionAction::Clone()
2794cdf0e10cSrcweir {
2795cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaClipRegionAction( *this );
2796cdf0e10cSrcweir     pClone->ResetRefCount();
2797cdf0e10cSrcweir     return pClone;
2798cdf0e10cSrcweir }
2799cdf0e10cSrcweir 
2800cdf0e10cSrcweir // ------------------------------------------------------------------------
2801cdf0e10cSrcweir 
2802cdf0e10cSrcweir void MetaClipRegionAction::Move( long nHorzMove, long nVertMove )
2803cdf0e10cSrcweir {
2804cdf0e10cSrcweir     maRegion.Move( nHorzMove, nVertMove );
2805cdf0e10cSrcweir }
2806cdf0e10cSrcweir 
2807cdf0e10cSrcweir // ------------------------------------------------------------------------
2808cdf0e10cSrcweir 
2809cdf0e10cSrcweir void MetaClipRegionAction::Scale( double fScaleX, double fScaleY )
2810cdf0e10cSrcweir {
2811cdf0e10cSrcweir     maRegion.Scale( fScaleX, fScaleY );
2812cdf0e10cSrcweir }
2813cdf0e10cSrcweir 
2814cdf0e10cSrcweir // ------------------------------------------------------------------------
2815cdf0e10cSrcweir 
2816cdf0e10cSrcweir sal_Bool MetaClipRegionAction::Compare( const MetaAction& rMetaAction ) const
2817cdf0e10cSrcweir {
2818cdf0e10cSrcweir     return ( maRegion == ((MetaClipRegionAction&)rMetaAction).maRegion ) &&
2819cdf0e10cSrcweir            ( mbClip == ((MetaClipRegionAction&)rMetaAction).mbClip );
2820cdf0e10cSrcweir }
2821cdf0e10cSrcweir 
2822cdf0e10cSrcweir // ------------------------------------------------------------------------
2823cdf0e10cSrcweir 
2824cdf0e10cSrcweir void MetaClipRegionAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
2825cdf0e10cSrcweir {
2826cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
2827cdf0e10cSrcweir     rOStm << maRegion << mbClip;
2828cdf0e10cSrcweir }
2829cdf0e10cSrcweir 
2830cdf0e10cSrcweir // ------------------------------------------------------------------------
2831cdf0e10cSrcweir 
2832cdf0e10cSrcweir void MetaClipRegionAction::Read( SvStream& rIStm, ImplMetaReadData* )
2833cdf0e10cSrcweir {
2834cdf0e10cSrcweir     COMPAT( rIStm );
2835cdf0e10cSrcweir     rIStm >> maRegion >> mbClip;
2836cdf0e10cSrcweir }
2837cdf0e10cSrcweir 
2838cdf0e10cSrcweir // ========================================================================
2839cdf0e10cSrcweir 
2840cdf0e10cSrcweir IMPL_META_ACTION( ISectRectClipRegion, META_ISECTRECTCLIPREGION_ACTION )
2841cdf0e10cSrcweir 
2842cdf0e10cSrcweir // ------------------------------------------------------------------------
2843cdf0e10cSrcweir 
2844cdf0e10cSrcweir MetaISectRectClipRegionAction::MetaISectRectClipRegionAction( const Rectangle& rRect ) :
2845cdf0e10cSrcweir     MetaAction  ( META_ISECTRECTCLIPREGION_ACTION ),
2846cdf0e10cSrcweir     maRect      ( rRect )
2847cdf0e10cSrcweir {
2848cdf0e10cSrcweir }
2849cdf0e10cSrcweir 
2850cdf0e10cSrcweir // ------------------------------------------------------------------------
2851cdf0e10cSrcweir 
2852cdf0e10cSrcweir void MetaISectRectClipRegionAction::Execute( OutputDevice* pOut )
2853cdf0e10cSrcweir {
2854cdf0e10cSrcweir     pOut->IntersectClipRegion( maRect );
2855cdf0e10cSrcweir }
2856cdf0e10cSrcweir 
2857cdf0e10cSrcweir // ------------------------------------------------------------------------
2858cdf0e10cSrcweir 
2859cdf0e10cSrcweir MetaAction* MetaISectRectClipRegionAction::Clone()
2860cdf0e10cSrcweir {
2861cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaISectRectClipRegionAction( *this );
2862cdf0e10cSrcweir     pClone->ResetRefCount();
2863cdf0e10cSrcweir     return pClone;
2864cdf0e10cSrcweir }
2865cdf0e10cSrcweir 
2866cdf0e10cSrcweir // ------------------------------------------------------------------------
2867cdf0e10cSrcweir 
2868cdf0e10cSrcweir void MetaISectRectClipRegionAction::Move( long nHorzMove, long nVertMove )
2869cdf0e10cSrcweir {
2870cdf0e10cSrcweir     maRect.Move( nHorzMove, nVertMove );
2871cdf0e10cSrcweir }
2872cdf0e10cSrcweir 
2873cdf0e10cSrcweir // ------------------------------------------------------------------------
2874cdf0e10cSrcweir 
2875cdf0e10cSrcweir void MetaISectRectClipRegionAction::Scale( double fScaleX, double fScaleY )
2876cdf0e10cSrcweir {
2877cdf0e10cSrcweir     ImplScaleRect( maRect, fScaleX, fScaleY );
2878cdf0e10cSrcweir }
2879cdf0e10cSrcweir 
2880cdf0e10cSrcweir // ------------------------------------------------------------------------
2881cdf0e10cSrcweir 
2882cdf0e10cSrcweir sal_Bool MetaISectRectClipRegionAction::Compare( const MetaAction& rMetaAction ) const
2883cdf0e10cSrcweir {
2884cdf0e10cSrcweir     return maRect == ((MetaISectRectClipRegionAction&)rMetaAction).maRect;
2885cdf0e10cSrcweir }
2886cdf0e10cSrcweir 
2887cdf0e10cSrcweir // ------------------------------------------------------------------------
2888cdf0e10cSrcweir 
2889cdf0e10cSrcweir void MetaISectRectClipRegionAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
2890cdf0e10cSrcweir {
2891cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
2892cdf0e10cSrcweir     rOStm << maRect;
2893cdf0e10cSrcweir }
2894cdf0e10cSrcweir 
2895cdf0e10cSrcweir // ------------------------------------------------------------------------
2896cdf0e10cSrcweir 
2897cdf0e10cSrcweir void MetaISectRectClipRegionAction::Read( SvStream& rIStm, ImplMetaReadData* )
2898cdf0e10cSrcweir {
2899cdf0e10cSrcweir     COMPAT( rIStm );
2900cdf0e10cSrcweir     rIStm >> maRect;
2901cdf0e10cSrcweir }
2902cdf0e10cSrcweir 
2903cdf0e10cSrcweir // ========================================================================
2904cdf0e10cSrcweir 
2905cdf0e10cSrcweir IMPL_META_ACTION( ISectRegionClipRegion, META_ISECTREGIONCLIPREGION_ACTION )
2906cdf0e10cSrcweir 
2907cdf0e10cSrcweir // ------------------------------------------------------------------------
2908cdf0e10cSrcweir 
2909cdf0e10cSrcweir MetaISectRegionClipRegionAction::MetaISectRegionClipRegionAction( const Region& rRegion ) :
2910cdf0e10cSrcweir     MetaAction  ( META_ISECTREGIONCLIPREGION_ACTION ),
2911cdf0e10cSrcweir     maRegion    ( rRegion )
2912cdf0e10cSrcweir {
2913cdf0e10cSrcweir }
2914cdf0e10cSrcweir 
2915cdf0e10cSrcweir // ------------------------------------------------------------------------
2916cdf0e10cSrcweir 
2917cdf0e10cSrcweir void MetaISectRegionClipRegionAction::Execute( OutputDevice* pOut )
2918cdf0e10cSrcweir {
2919cdf0e10cSrcweir     pOut->IntersectClipRegion( maRegion );
2920cdf0e10cSrcweir }
2921cdf0e10cSrcweir 
2922cdf0e10cSrcweir // ------------------------------------------------------------------------
2923cdf0e10cSrcweir 
2924cdf0e10cSrcweir MetaAction* MetaISectRegionClipRegionAction::Clone()
2925cdf0e10cSrcweir {
2926cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaISectRegionClipRegionAction( *this );
2927cdf0e10cSrcweir     pClone->ResetRefCount();
2928cdf0e10cSrcweir     return pClone;
2929cdf0e10cSrcweir }
2930cdf0e10cSrcweir 
2931cdf0e10cSrcweir // ------------------------------------------------------------------------
2932cdf0e10cSrcweir 
2933cdf0e10cSrcweir void MetaISectRegionClipRegionAction::Move( long nHorzMove, long nVertMove )
2934cdf0e10cSrcweir {
2935cdf0e10cSrcweir     maRegion.Move( nHorzMove, nVertMove );
2936cdf0e10cSrcweir }
2937cdf0e10cSrcweir 
2938cdf0e10cSrcweir // ------------------------------------------------------------------------
2939cdf0e10cSrcweir 
2940cdf0e10cSrcweir void MetaISectRegionClipRegionAction::Scale( double fScaleX, double fScaleY )
2941cdf0e10cSrcweir {
2942cdf0e10cSrcweir     maRegion.Scale( fScaleX, fScaleY );
2943cdf0e10cSrcweir }
2944cdf0e10cSrcweir 
2945cdf0e10cSrcweir // ------------------------------------------------------------------------
2946cdf0e10cSrcweir 
2947cdf0e10cSrcweir sal_Bool MetaISectRegionClipRegionAction::Compare( const MetaAction& rMetaAction ) const
2948cdf0e10cSrcweir {
2949cdf0e10cSrcweir     return maRegion == ((MetaISectRegionClipRegionAction&)rMetaAction).maRegion;
2950cdf0e10cSrcweir }
2951cdf0e10cSrcweir 
2952cdf0e10cSrcweir // ------------------------------------------------------------------------
2953cdf0e10cSrcweir 
2954cdf0e10cSrcweir void MetaISectRegionClipRegionAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
2955cdf0e10cSrcweir {
2956cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
2957cdf0e10cSrcweir     rOStm << maRegion;
2958cdf0e10cSrcweir }
2959cdf0e10cSrcweir 
2960cdf0e10cSrcweir // ------------------------------------------------------------------------
2961cdf0e10cSrcweir 
2962cdf0e10cSrcweir void MetaISectRegionClipRegionAction::Read( SvStream& rIStm, ImplMetaReadData* )
2963cdf0e10cSrcweir {
2964cdf0e10cSrcweir     COMPAT( rIStm );
2965cdf0e10cSrcweir     rIStm >> maRegion;
2966cdf0e10cSrcweir }
2967cdf0e10cSrcweir 
2968cdf0e10cSrcweir // ========================================================================
2969cdf0e10cSrcweir 
2970cdf0e10cSrcweir IMPL_META_ACTION( MoveClipRegion, META_MOVECLIPREGION_ACTION )
2971cdf0e10cSrcweir 
2972cdf0e10cSrcweir // ------------------------------------------------------------------------
2973cdf0e10cSrcweir 
2974cdf0e10cSrcweir MetaMoveClipRegionAction::MetaMoveClipRegionAction( long nHorzMove, long nVertMove ) :
2975cdf0e10cSrcweir     MetaAction  ( META_MOVECLIPREGION_ACTION ),
2976cdf0e10cSrcweir     mnHorzMove  ( nHorzMove ),
2977cdf0e10cSrcweir     mnVertMove  ( nVertMove )
2978cdf0e10cSrcweir {
2979cdf0e10cSrcweir }
2980cdf0e10cSrcweir 
2981cdf0e10cSrcweir // ------------------------------------------------------------------------
2982cdf0e10cSrcweir 
2983cdf0e10cSrcweir void MetaMoveClipRegionAction::Execute( OutputDevice* pOut )
2984cdf0e10cSrcweir {
2985cdf0e10cSrcweir     pOut->MoveClipRegion( mnHorzMove, mnVertMove );
2986cdf0e10cSrcweir }
2987cdf0e10cSrcweir 
2988cdf0e10cSrcweir // ------------------------------------------------------------------------
2989cdf0e10cSrcweir 
2990cdf0e10cSrcweir MetaAction* MetaMoveClipRegionAction::Clone()
2991cdf0e10cSrcweir {
2992cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaMoveClipRegionAction( *this );
2993cdf0e10cSrcweir     pClone->ResetRefCount();
2994cdf0e10cSrcweir     return pClone;
2995cdf0e10cSrcweir }
2996cdf0e10cSrcweir 
2997cdf0e10cSrcweir // ------------------------------------------------------------------------
2998cdf0e10cSrcweir 
2999cdf0e10cSrcweir void MetaMoveClipRegionAction::Scale( double fScaleX, double fScaleY )
3000cdf0e10cSrcweir {
3001cdf0e10cSrcweir     mnHorzMove = FRound( mnHorzMove * fScaleX );
3002cdf0e10cSrcweir     mnVertMove = FRound( mnVertMove * fScaleY );
3003cdf0e10cSrcweir }
3004cdf0e10cSrcweir 
3005cdf0e10cSrcweir // ------------------------------------------------------------------------
3006cdf0e10cSrcweir 
3007cdf0e10cSrcweir sal_Bool MetaMoveClipRegionAction::Compare( const MetaAction& rMetaAction ) const
3008cdf0e10cSrcweir {
3009cdf0e10cSrcweir     return ( mnHorzMove == ((MetaMoveClipRegionAction&)rMetaAction).mnHorzMove ) &&
3010cdf0e10cSrcweir            ( mnVertMove == ((MetaMoveClipRegionAction&)rMetaAction).mnVertMove );
3011cdf0e10cSrcweir }
3012cdf0e10cSrcweir 
3013cdf0e10cSrcweir // ------------------------------------------------------------------------
3014cdf0e10cSrcweir 
3015cdf0e10cSrcweir void MetaMoveClipRegionAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
3016cdf0e10cSrcweir {
3017cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
3018cdf0e10cSrcweir     rOStm << mnHorzMove << mnVertMove;
3019cdf0e10cSrcweir }
3020cdf0e10cSrcweir 
3021cdf0e10cSrcweir // ------------------------------------------------------------------------
3022cdf0e10cSrcweir 
3023cdf0e10cSrcweir void MetaMoveClipRegionAction::Read( SvStream& rIStm, ImplMetaReadData* )
3024cdf0e10cSrcweir {
3025cdf0e10cSrcweir     COMPAT( rIStm );
3026cdf0e10cSrcweir     rIStm >> mnHorzMove >> mnVertMove;
3027cdf0e10cSrcweir }
3028cdf0e10cSrcweir 
3029cdf0e10cSrcweir // ========================================================================
3030cdf0e10cSrcweir 
3031cdf0e10cSrcweir IMPL_META_ACTION( LineColor, META_LINECOLOR_ACTION )
3032cdf0e10cSrcweir 
3033cdf0e10cSrcweir // ------------------------------------------------------------------------
3034cdf0e10cSrcweir 
3035cdf0e10cSrcweir MetaLineColorAction::MetaLineColorAction( const Color& rColor, sal_Bool bSet ) :
3036cdf0e10cSrcweir     MetaAction  ( META_LINECOLOR_ACTION ),
3037cdf0e10cSrcweir     maColor     ( rColor ),
3038cdf0e10cSrcweir     mbSet       ( bSet )
3039cdf0e10cSrcweir {
3040cdf0e10cSrcweir }
3041cdf0e10cSrcweir 
3042cdf0e10cSrcweir // ------------------------------------------------------------------------
3043cdf0e10cSrcweir 
3044cdf0e10cSrcweir void MetaLineColorAction::Execute( OutputDevice* pOut )
3045cdf0e10cSrcweir {
3046cdf0e10cSrcweir     if( mbSet )
3047cdf0e10cSrcweir         pOut->SetLineColor( maColor );
3048cdf0e10cSrcweir     else
3049cdf0e10cSrcweir         pOut->SetLineColor();
3050cdf0e10cSrcweir }
3051cdf0e10cSrcweir 
3052cdf0e10cSrcweir // ------------------------------------------------------------------------
3053cdf0e10cSrcweir 
3054cdf0e10cSrcweir MetaAction* MetaLineColorAction::Clone()
3055cdf0e10cSrcweir {
3056cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaLineColorAction( *this );
3057cdf0e10cSrcweir     pClone->ResetRefCount();
3058cdf0e10cSrcweir     return pClone;
3059cdf0e10cSrcweir }
3060cdf0e10cSrcweir 
3061cdf0e10cSrcweir // ------------------------------------------------------------------------
3062cdf0e10cSrcweir 
3063cdf0e10cSrcweir sal_Bool MetaLineColorAction::Compare( const MetaAction& rMetaAction ) const
3064cdf0e10cSrcweir {
3065cdf0e10cSrcweir     return ( maColor == ((MetaLineColorAction&)rMetaAction).maColor ) &&
3066cdf0e10cSrcweir            ( mbSet == ((MetaLineColorAction&)rMetaAction).mbSet );
3067cdf0e10cSrcweir }
3068cdf0e10cSrcweir 
3069cdf0e10cSrcweir // ------------------------------------------------------------------------
3070cdf0e10cSrcweir 
3071cdf0e10cSrcweir void MetaLineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
3072cdf0e10cSrcweir {
3073cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
3074cdf0e10cSrcweir     maColor.Write( rOStm, sal_True );
3075cdf0e10cSrcweir     rOStm << mbSet;
3076cdf0e10cSrcweir }
3077cdf0e10cSrcweir 
3078cdf0e10cSrcweir // ------------------------------------------------------------------------
3079cdf0e10cSrcweir 
3080cdf0e10cSrcweir void MetaLineColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
3081cdf0e10cSrcweir {
3082cdf0e10cSrcweir     COMPAT( rIStm );
3083cdf0e10cSrcweir     maColor.Read( rIStm, sal_True );
3084cdf0e10cSrcweir     rIStm >> mbSet;
3085cdf0e10cSrcweir }
3086cdf0e10cSrcweir 
3087cdf0e10cSrcweir // ========================================================================
3088cdf0e10cSrcweir 
3089cdf0e10cSrcweir IMPL_META_ACTION( FillColor, META_FILLCOLOR_ACTION )
3090cdf0e10cSrcweir 
3091cdf0e10cSrcweir // ------------------------------------------------------------------------
3092cdf0e10cSrcweir 
3093cdf0e10cSrcweir MetaFillColorAction::MetaFillColorAction( const Color& rColor, sal_Bool bSet ) :
3094cdf0e10cSrcweir     MetaAction  ( META_FILLCOLOR_ACTION ),
3095cdf0e10cSrcweir     maColor     ( rColor ),
3096cdf0e10cSrcweir     mbSet       ( bSet )
3097cdf0e10cSrcweir {
3098cdf0e10cSrcweir }
3099cdf0e10cSrcweir 
3100cdf0e10cSrcweir // ------------------------------------------------------------------------
3101cdf0e10cSrcweir 
3102cdf0e10cSrcweir void MetaFillColorAction::Execute( OutputDevice* pOut )
3103cdf0e10cSrcweir {
3104cdf0e10cSrcweir     if( mbSet )
3105cdf0e10cSrcweir         pOut->SetFillColor( maColor );
3106cdf0e10cSrcweir     else
3107cdf0e10cSrcweir         pOut->SetFillColor();
3108cdf0e10cSrcweir }
3109cdf0e10cSrcweir 
3110cdf0e10cSrcweir // ------------------------------------------------------------------------
3111cdf0e10cSrcweir 
3112cdf0e10cSrcweir MetaAction* MetaFillColorAction::Clone()
3113cdf0e10cSrcweir {
3114cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaFillColorAction( *this );
3115cdf0e10cSrcweir     pClone->ResetRefCount();
3116cdf0e10cSrcweir     return pClone;
3117cdf0e10cSrcweir }
3118cdf0e10cSrcweir 
3119cdf0e10cSrcweir // ------------------------------------------------------------------------
3120cdf0e10cSrcweir 
3121cdf0e10cSrcweir sal_Bool MetaFillColorAction::Compare( const MetaAction& rMetaAction ) const
3122cdf0e10cSrcweir {
3123cdf0e10cSrcweir     return ( maColor == ((MetaFillColorAction&)rMetaAction).maColor ) &&
3124cdf0e10cSrcweir            ( mbSet == ((MetaFillColorAction&)rMetaAction).mbSet );
3125cdf0e10cSrcweir }
3126cdf0e10cSrcweir 
3127cdf0e10cSrcweir // ------------------------------------------------------------------------
3128cdf0e10cSrcweir 
3129cdf0e10cSrcweir void MetaFillColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
3130cdf0e10cSrcweir {
3131cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
3132cdf0e10cSrcweir     maColor.Write( rOStm, sal_True );
3133cdf0e10cSrcweir     rOStm << mbSet;
3134cdf0e10cSrcweir }
3135cdf0e10cSrcweir 
3136cdf0e10cSrcweir // ------------------------------------------------------------------------
3137cdf0e10cSrcweir 
3138cdf0e10cSrcweir void MetaFillColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
3139cdf0e10cSrcweir {
3140cdf0e10cSrcweir     COMPAT( rIStm );
3141cdf0e10cSrcweir     maColor.Read( rIStm, sal_True );
3142cdf0e10cSrcweir     rIStm >> mbSet;
3143cdf0e10cSrcweir }
3144cdf0e10cSrcweir 
3145cdf0e10cSrcweir // ========================================================================
3146cdf0e10cSrcweir 
3147cdf0e10cSrcweir IMPL_META_ACTION( TextColor, META_TEXTCOLOR_ACTION )
3148cdf0e10cSrcweir 
3149cdf0e10cSrcweir // ------------------------------------------------------------------------
3150cdf0e10cSrcweir 
3151cdf0e10cSrcweir MetaTextColorAction::MetaTextColorAction( const Color& rColor ) :
3152cdf0e10cSrcweir     MetaAction  ( META_TEXTCOLOR_ACTION ),
3153cdf0e10cSrcweir     maColor     ( rColor )
3154cdf0e10cSrcweir {
3155cdf0e10cSrcweir }
3156cdf0e10cSrcweir 
3157cdf0e10cSrcweir // ------------------------------------------------------------------------
3158cdf0e10cSrcweir 
3159cdf0e10cSrcweir void MetaTextColorAction::Execute( OutputDevice* pOut )
3160cdf0e10cSrcweir {
3161cdf0e10cSrcweir     pOut->SetTextColor( maColor );
3162cdf0e10cSrcweir }
3163cdf0e10cSrcweir 
3164cdf0e10cSrcweir // ------------------------------------------------------------------------
3165cdf0e10cSrcweir 
3166cdf0e10cSrcweir MetaAction* MetaTextColorAction::Clone()
3167cdf0e10cSrcweir {
3168cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaTextColorAction( *this );
3169cdf0e10cSrcweir     pClone->ResetRefCount();
3170cdf0e10cSrcweir     return pClone;
3171cdf0e10cSrcweir }
3172cdf0e10cSrcweir 
3173cdf0e10cSrcweir // ------------------------------------------------------------------------
3174cdf0e10cSrcweir 
3175cdf0e10cSrcweir sal_Bool MetaTextColorAction::Compare( const MetaAction& rMetaAction ) const
3176cdf0e10cSrcweir {
3177cdf0e10cSrcweir     return maColor == ((MetaTextColorAction&)rMetaAction).maColor;
3178cdf0e10cSrcweir }
3179cdf0e10cSrcweir 
3180cdf0e10cSrcweir // ------------------------------------------------------------------------
3181cdf0e10cSrcweir 
3182cdf0e10cSrcweir void MetaTextColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
3183cdf0e10cSrcweir {
3184cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
3185cdf0e10cSrcweir     maColor.Write( rOStm, sal_True );
3186cdf0e10cSrcweir }
3187cdf0e10cSrcweir 
3188cdf0e10cSrcweir // ------------------------------------------------------------------------
3189cdf0e10cSrcweir 
3190cdf0e10cSrcweir void MetaTextColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
3191cdf0e10cSrcweir {
3192cdf0e10cSrcweir     COMPAT( rIStm );
3193cdf0e10cSrcweir     maColor.Read( rIStm, sal_True );
3194cdf0e10cSrcweir }
3195cdf0e10cSrcweir 
3196cdf0e10cSrcweir // ========================================================================
3197cdf0e10cSrcweir 
3198cdf0e10cSrcweir IMPL_META_ACTION( TextFillColor, META_TEXTFILLCOLOR_ACTION )
3199cdf0e10cSrcweir 
3200cdf0e10cSrcweir // ------------------------------------------------------------------------
3201cdf0e10cSrcweir 
3202cdf0e10cSrcweir MetaTextFillColorAction::MetaTextFillColorAction( const Color& rColor, sal_Bool bSet ) :
3203cdf0e10cSrcweir     MetaAction  ( META_TEXTFILLCOLOR_ACTION ),
3204cdf0e10cSrcweir     maColor     ( rColor ),
3205cdf0e10cSrcweir     mbSet       ( bSet )
3206cdf0e10cSrcweir {
3207cdf0e10cSrcweir }
3208cdf0e10cSrcweir 
3209cdf0e10cSrcweir // ------------------------------------------------------------------------
3210cdf0e10cSrcweir 
3211cdf0e10cSrcweir void MetaTextFillColorAction::Execute( OutputDevice* pOut )
3212cdf0e10cSrcweir {
3213cdf0e10cSrcweir     if( mbSet )
3214cdf0e10cSrcweir         pOut->SetTextFillColor( maColor );
3215cdf0e10cSrcweir     else
3216cdf0e10cSrcweir         pOut->SetTextFillColor();
3217cdf0e10cSrcweir }
3218cdf0e10cSrcweir 
3219cdf0e10cSrcweir // ------------------------------------------------------------------------
3220cdf0e10cSrcweir 
3221cdf0e10cSrcweir MetaAction* MetaTextFillColorAction::Clone()
3222cdf0e10cSrcweir {
3223cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaTextFillColorAction( *this );
3224cdf0e10cSrcweir     pClone->ResetRefCount();
3225cdf0e10cSrcweir     return pClone;
3226cdf0e10cSrcweir }
3227cdf0e10cSrcweir 
3228cdf0e10cSrcweir // ------------------------------------------------------------------------
3229cdf0e10cSrcweir 
3230cdf0e10cSrcweir sal_Bool MetaTextFillColorAction::Compare( const MetaAction& rMetaAction ) const
3231cdf0e10cSrcweir {
3232cdf0e10cSrcweir     return ( maColor == ((MetaTextFillColorAction&)rMetaAction).maColor ) &&
3233cdf0e10cSrcweir            ( mbSet == ((MetaTextFillColorAction&)rMetaAction).mbSet );
3234cdf0e10cSrcweir }
3235cdf0e10cSrcweir 
3236cdf0e10cSrcweir // ------------------------------------------------------------------------
3237cdf0e10cSrcweir 
3238cdf0e10cSrcweir void MetaTextFillColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
3239cdf0e10cSrcweir {
3240cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
3241cdf0e10cSrcweir     maColor.Write( rOStm, sal_True );
3242cdf0e10cSrcweir     rOStm << mbSet;
3243cdf0e10cSrcweir }
3244cdf0e10cSrcweir 
3245cdf0e10cSrcweir // ------------------------------------------------------------------------
3246cdf0e10cSrcweir 
3247cdf0e10cSrcweir void MetaTextFillColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
3248cdf0e10cSrcweir {
3249cdf0e10cSrcweir     COMPAT( rIStm );
3250cdf0e10cSrcweir     maColor.Read( rIStm, sal_True );
3251cdf0e10cSrcweir     rIStm >> mbSet;
3252cdf0e10cSrcweir }
3253cdf0e10cSrcweir 
3254cdf0e10cSrcweir // ========================================================================
3255cdf0e10cSrcweir 
3256cdf0e10cSrcweir IMPL_META_ACTION( TextLineColor, META_TEXTLINECOLOR_ACTION )
3257cdf0e10cSrcweir 
3258cdf0e10cSrcweir // ------------------------------------------------------------------------
3259cdf0e10cSrcweir 
3260cdf0e10cSrcweir MetaTextLineColorAction::MetaTextLineColorAction( const Color& rColor, sal_Bool bSet ) :
3261cdf0e10cSrcweir     MetaAction  ( META_TEXTLINECOLOR_ACTION ),
3262cdf0e10cSrcweir     maColor     ( rColor ),
3263cdf0e10cSrcweir     mbSet       ( bSet )
3264cdf0e10cSrcweir {
3265cdf0e10cSrcweir }
3266cdf0e10cSrcweir 
3267cdf0e10cSrcweir // ------------------------------------------------------------------------
3268cdf0e10cSrcweir 
3269cdf0e10cSrcweir void MetaTextLineColorAction::Execute( OutputDevice* pOut )
3270cdf0e10cSrcweir {
3271cdf0e10cSrcweir     if( mbSet )
3272cdf0e10cSrcweir         pOut->SetTextLineColor( maColor );
3273cdf0e10cSrcweir     else
3274cdf0e10cSrcweir         pOut->SetTextLineColor();
3275cdf0e10cSrcweir }
3276cdf0e10cSrcweir 
3277cdf0e10cSrcweir // ------------------------------------------------------------------------
3278cdf0e10cSrcweir 
3279cdf0e10cSrcweir MetaAction* MetaTextLineColorAction::Clone()
3280cdf0e10cSrcweir {
3281cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaTextLineColorAction( *this );
3282cdf0e10cSrcweir     pClone->ResetRefCount();
3283cdf0e10cSrcweir     return pClone;
3284cdf0e10cSrcweir }
3285cdf0e10cSrcweir 
3286cdf0e10cSrcweir // ------------------------------------------------------------------------
3287cdf0e10cSrcweir 
3288cdf0e10cSrcweir sal_Bool MetaTextLineColorAction::Compare( const MetaAction& rMetaAction ) const
3289cdf0e10cSrcweir {
3290cdf0e10cSrcweir     return ( maColor == ((MetaTextLineColorAction&)rMetaAction).maColor ) &&
3291cdf0e10cSrcweir            ( mbSet == ((MetaTextLineColorAction&)rMetaAction).mbSet );
3292cdf0e10cSrcweir }
3293cdf0e10cSrcweir 
3294cdf0e10cSrcweir // ------------------------------------------------------------------------
3295cdf0e10cSrcweir 
3296cdf0e10cSrcweir void MetaTextLineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
3297cdf0e10cSrcweir {
3298cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
3299cdf0e10cSrcweir     maColor.Write( rOStm, sal_True );
3300cdf0e10cSrcweir     rOStm << mbSet;
3301cdf0e10cSrcweir }
3302cdf0e10cSrcweir 
3303cdf0e10cSrcweir // ------------------------------------------------------------------------
3304cdf0e10cSrcweir 
3305cdf0e10cSrcweir void MetaTextLineColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
3306cdf0e10cSrcweir {
3307cdf0e10cSrcweir     COMPAT( rIStm );
3308cdf0e10cSrcweir     maColor.Read( rIStm, sal_True );
3309cdf0e10cSrcweir     rIStm >> mbSet;
3310cdf0e10cSrcweir }
3311cdf0e10cSrcweir 
3312cdf0e10cSrcweir // ========================================================================
3313cdf0e10cSrcweir 
3314cdf0e10cSrcweir IMPL_META_ACTION( OverlineColor, META_OVERLINECOLOR_ACTION )
3315cdf0e10cSrcweir 
3316cdf0e10cSrcweir // ------------------------------------------------------------------------
3317cdf0e10cSrcweir 
3318cdf0e10cSrcweir MetaOverlineColorAction::MetaOverlineColorAction( const Color& rColor, sal_Bool bSet ) :
3319cdf0e10cSrcweir     MetaAction  ( META_OVERLINECOLOR_ACTION ),
3320cdf0e10cSrcweir     maColor     ( rColor ),
3321cdf0e10cSrcweir     mbSet       ( bSet )
3322cdf0e10cSrcweir {
3323cdf0e10cSrcweir }
3324cdf0e10cSrcweir 
3325cdf0e10cSrcweir // ------------------------------------------------------------------------
3326cdf0e10cSrcweir 
3327cdf0e10cSrcweir void MetaOverlineColorAction::Execute( OutputDevice* pOut )
3328cdf0e10cSrcweir {
3329cdf0e10cSrcweir     if( mbSet )
3330cdf0e10cSrcweir         pOut->SetOverlineColor( maColor );
3331cdf0e10cSrcweir     else
3332cdf0e10cSrcweir         pOut->SetOverlineColor();
3333cdf0e10cSrcweir }
3334cdf0e10cSrcweir 
3335cdf0e10cSrcweir // ------------------------------------------------------------------------
3336cdf0e10cSrcweir 
3337cdf0e10cSrcweir MetaAction* MetaOverlineColorAction::Clone()
3338cdf0e10cSrcweir {
3339cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaOverlineColorAction( *this );
3340cdf0e10cSrcweir     pClone->ResetRefCount();
3341cdf0e10cSrcweir     return pClone;
3342cdf0e10cSrcweir }
3343cdf0e10cSrcweir 
3344cdf0e10cSrcweir // ------------------------------------------------------------------------
3345cdf0e10cSrcweir 
3346cdf0e10cSrcweir sal_Bool MetaOverlineColorAction::Compare( const MetaAction& rMetaAction ) const
3347cdf0e10cSrcweir {
3348cdf0e10cSrcweir     return ( maColor == ((MetaOverlineColorAction&)rMetaAction).maColor ) &&
3349cdf0e10cSrcweir            ( mbSet == ((MetaOverlineColorAction&)rMetaAction).mbSet );
3350cdf0e10cSrcweir }
3351cdf0e10cSrcweir 
3352cdf0e10cSrcweir // ------------------------------------------------------------------------
3353cdf0e10cSrcweir 
3354cdf0e10cSrcweir void MetaOverlineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
3355cdf0e10cSrcweir {
3356cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
3357cdf0e10cSrcweir     maColor.Write( rOStm, sal_True );
3358cdf0e10cSrcweir     rOStm << mbSet;
3359cdf0e10cSrcweir }
3360cdf0e10cSrcweir 
3361cdf0e10cSrcweir // ------------------------------------------------------------------------
3362cdf0e10cSrcweir 
3363cdf0e10cSrcweir void MetaOverlineColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
3364cdf0e10cSrcweir {
3365cdf0e10cSrcweir     COMPAT( rIStm );
3366cdf0e10cSrcweir     maColor.Read( rIStm, sal_True );
3367cdf0e10cSrcweir     rIStm >> mbSet;
3368cdf0e10cSrcweir }
3369cdf0e10cSrcweir 
3370cdf0e10cSrcweir // ========================================================================
3371cdf0e10cSrcweir 
3372cdf0e10cSrcweir IMPL_META_ACTION( TextAlign, META_TEXTALIGN_ACTION )
3373cdf0e10cSrcweir 
3374cdf0e10cSrcweir // ------------------------------------------------------------------------
3375cdf0e10cSrcweir 
3376cdf0e10cSrcweir MetaTextAlignAction::MetaTextAlignAction( TextAlign aAlign ) :
3377cdf0e10cSrcweir     MetaAction  ( META_TEXTALIGN_ACTION ),
3378cdf0e10cSrcweir     maAlign     ( aAlign )
3379cdf0e10cSrcweir {
3380cdf0e10cSrcweir }
3381cdf0e10cSrcweir 
3382cdf0e10cSrcweir // ------------------------------------------------------------------------
3383cdf0e10cSrcweir 
3384cdf0e10cSrcweir void MetaTextAlignAction::Execute( OutputDevice* pOut )
3385cdf0e10cSrcweir {
3386cdf0e10cSrcweir     pOut->SetTextAlign( maAlign );
3387cdf0e10cSrcweir }
3388cdf0e10cSrcweir 
3389cdf0e10cSrcweir // ------------------------------------------------------------------------
3390cdf0e10cSrcweir 
3391cdf0e10cSrcweir MetaAction* MetaTextAlignAction::Clone()
3392cdf0e10cSrcweir {
3393cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaTextAlignAction( *this );
3394cdf0e10cSrcweir     pClone->ResetRefCount();
3395cdf0e10cSrcweir     return pClone;
3396cdf0e10cSrcweir }
3397cdf0e10cSrcweir 
3398cdf0e10cSrcweir // ------------------------------------------------------------------------
3399cdf0e10cSrcweir 
3400cdf0e10cSrcweir sal_Bool MetaTextAlignAction::Compare( const MetaAction& rMetaAction ) const
3401cdf0e10cSrcweir {
3402cdf0e10cSrcweir     return maAlign == ((MetaTextAlignAction&)rMetaAction).maAlign;
3403cdf0e10cSrcweir }
3404cdf0e10cSrcweir 
3405cdf0e10cSrcweir // ------------------------------------------------------------------------
3406cdf0e10cSrcweir 
3407cdf0e10cSrcweir void MetaTextAlignAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
3408cdf0e10cSrcweir {
3409cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
3410cdf0e10cSrcweir     rOStm << (sal_uInt16) maAlign;
3411cdf0e10cSrcweir }
3412cdf0e10cSrcweir 
3413cdf0e10cSrcweir // ------------------------------------------------------------------------
3414cdf0e10cSrcweir 
3415cdf0e10cSrcweir void MetaTextAlignAction::Read( SvStream& rIStm, ImplMetaReadData* )
3416cdf0e10cSrcweir {
3417cdf0e10cSrcweir     sal_uInt16 nTmp16;
3418cdf0e10cSrcweir 
3419cdf0e10cSrcweir     COMPAT( rIStm );
3420cdf0e10cSrcweir     rIStm >> nTmp16; maAlign = (TextAlign) nTmp16;
3421cdf0e10cSrcweir }
3422cdf0e10cSrcweir 
3423cdf0e10cSrcweir // ========================================================================
3424cdf0e10cSrcweir 
3425cdf0e10cSrcweir IMPL_META_ACTION( MapMode, META_MAPMODE_ACTION )
3426cdf0e10cSrcweir 
3427cdf0e10cSrcweir // ------------------------------------------------------------------------
3428cdf0e10cSrcweir 
3429cdf0e10cSrcweir MetaMapModeAction::MetaMapModeAction( const MapMode& rMapMode ) :
3430cdf0e10cSrcweir     MetaAction  ( META_MAPMODE_ACTION ),
3431cdf0e10cSrcweir     maMapMode   ( rMapMode )
3432cdf0e10cSrcweir {
3433cdf0e10cSrcweir }
3434cdf0e10cSrcweir 
3435cdf0e10cSrcweir // ------------------------------------------------------------------------
3436cdf0e10cSrcweir 
3437cdf0e10cSrcweir void MetaMapModeAction::Execute( OutputDevice* pOut )
3438cdf0e10cSrcweir {
3439cdf0e10cSrcweir     pOut->SetMapMode( maMapMode );
3440cdf0e10cSrcweir }
3441cdf0e10cSrcweir 
3442cdf0e10cSrcweir // ------------------------------------------------------------------------
3443cdf0e10cSrcweir 
3444cdf0e10cSrcweir MetaAction* MetaMapModeAction::Clone()
3445cdf0e10cSrcweir {
3446cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaMapModeAction( *this );
3447cdf0e10cSrcweir     pClone->ResetRefCount();
3448cdf0e10cSrcweir     return pClone;
3449cdf0e10cSrcweir }
3450cdf0e10cSrcweir 
3451cdf0e10cSrcweir // ------------------------------------------------------------------------
3452cdf0e10cSrcweir 
3453cdf0e10cSrcweir void MetaMapModeAction::Scale( double fScaleX, double fScaleY )
3454cdf0e10cSrcweir {
3455cdf0e10cSrcweir     Point aPoint( maMapMode.GetOrigin() );
3456cdf0e10cSrcweir 
3457cdf0e10cSrcweir     ImplScalePoint( aPoint, fScaleX, fScaleY );
3458cdf0e10cSrcweir     maMapMode.SetOrigin( aPoint );
3459cdf0e10cSrcweir }
3460cdf0e10cSrcweir 
3461cdf0e10cSrcweir // ------------------------------------------------------------------------
3462cdf0e10cSrcweir 
3463cdf0e10cSrcweir sal_Bool MetaMapModeAction::Compare( const MetaAction& rMetaAction ) const
3464cdf0e10cSrcweir {
3465cdf0e10cSrcweir     return maMapMode == ((MetaMapModeAction&)rMetaAction).maMapMode;
3466cdf0e10cSrcweir }
3467cdf0e10cSrcweir 
3468cdf0e10cSrcweir // ------------------------------------------------------------------------
3469cdf0e10cSrcweir 
3470cdf0e10cSrcweir void MetaMapModeAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
3471cdf0e10cSrcweir {
3472cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
3473cdf0e10cSrcweir     rOStm << maMapMode;
3474cdf0e10cSrcweir }
3475cdf0e10cSrcweir 
3476cdf0e10cSrcweir // ------------------------------------------------------------------------
3477cdf0e10cSrcweir 
3478cdf0e10cSrcweir void MetaMapModeAction::Read( SvStream& rIStm, ImplMetaReadData* )
3479cdf0e10cSrcweir {
3480cdf0e10cSrcweir     COMPAT( rIStm );
3481cdf0e10cSrcweir     rIStm >> maMapMode;
3482cdf0e10cSrcweir }
3483cdf0e10cSrcweir 
3484cdf0e10cSrcweir // ========================================================================
3485cdf0e10cSrcweir 
3486cdf0e10cSrcweir IMPL_META_ACTION( Font, META_FONT_ACTION )
3487cdf0e10cSrcweir 
3488cdf0e10cSrcweir // ------------------------------------------------------------------------
3489cdf0e10cSrcweir 
3490cdf0e10cSrcweir MetaFontAction::MetaFontAction( const Font& rFont ) :
3491cdf0e10cSrcweir     MetaAction  ( META_FONT_ACTION ),
3492cdf0e10cSrcweir     maFont      ( rFont )
3493cdf0e10cSrcweir {
3494cdf0e10cSrcweir     // #96876: because RTL_TEXTENCODING_SYMBOL is often set at the StarSymbol font,
3495cdf0e10cSrcweir     // we change the textencoding to RTL_TEXTENCODING_UNICODE here, which seems
3496cdf0e10cSrcweir     // to be the right way; changing the textencoding at other sources
3497cdf0e10cSrcweir     // is too dangerous at the moment
3498cdf0e10cSrcweir     if( ( ( maFont.GetName().SearchAscii( "StarSymbol" ) != STRING_NOTFOUND )
3499cdf0e10cSrcweir        || ( maFont.GetName().SearchAscii( "OpenSymbol" ) != STRING_NOTFOUND ) )
3500cdf0e10cSrcweir      && ( maFont.GetCharSet() != RTL_TEXTENCODING_UNICODE ) )
3501cdf0e10cSrcweir     {
3502cdf0e10cSrcweir         maFont.SetCharSet( RTL_TEXTENCODING_UNICODE );
3503cdf0e10cSrcweir     }
3504cdf0e10cSrcweir }
3505cdf0e10cSrcweir 
3506cdf0e10cSrcweir // ------------------------------------------------------------------------
3507cdf0e10cSrcweir 
3508cdf0e10cSrcweir void MetaFontAction::Execute( OutputDevice* pOut )
3509cdf0e10cSrcweir {
3510cdf0e10cSrcweir     pOut->SetFont( maFont );
3511cdf0e10cSrcweir }
3512cdf0e10cSrcweir 
3513cdf0e10cSrcweir // ------------------------------------------------------------------------
3514cdf0e10cSrcweir 
3515cdf0e10cSrcweir MetaAction* MetaFontAction::Clone()
3516cdf0e10cSrcweir {
3517cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaFontAction( *this );
3518cdf0e10cSrcweir     pClone->ResetRefCount();
3519cdf0e10cSrcweir     return pClone;
3520cdf0e10cSrcweir }
3521cdf0e10cSrcweir 
3522cdf0e10cSrcweir // ------------------------------------------------------------------------
3523cdf0e10cSrcweir 
3524cdf0e10cSrcweir void MetaFontAction::Scale( double fScaleX, double fScaleY )
3525cdf0e10cSrcweir {
3526cdf0e10cSrcweir     const Size aSize(
3527cdf0e10cSrcweir         FRound(maFont.GetSize().Width() * fabs(fScaleX)),
3528cdf0e10cSrcweir         FRound(maFont.GetSize().Height() * fabs(fScaleY)));
3529cdf0e10cSrcweir     maFont.SetSize( aSize );
3530cdf0e10cSrcweir }
3531cdf0e10cSrcweir 
3532cdf0e10cSrcweir // ------------------------------------------------------------------------
3533cdf0e10cSrcweir 
3534cdf0e10cSrcweir sal_Bool MetaFontAction::Compare( const MetaAction& rMetaAction ) const
3535cdf0e10cSrcweir {
3536cdf0e10cSrcweir     return maFont == ((MetaFontAction&)rMetaAction).maFont;
3537cdf0e10cSrcweir }
3538cdf0e10cSrcweir 
3539cdf0e10cSrcweir // ------------------------------------------------------------------------
3540cdf0e10cSrcweir 
3541cdf0e10cSrcweir void MetaFontAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
3542cdf0e10cSrcweir {
3543cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
3544cdf0e10cSrcweir     rOStm << maFont;
3545cdf0e10cSrcweir     pData->meActualCharSet = maFont.GetCharSet();
3546cdf0e10cSrcweir     if ( pData->meActualCharSet == RTL_TEXTENCODING_DONTKNOW )
3547cdf0e10cSrcweir         pData->meActualCharSet = gsl_getSystemTextEncoding();
3548cdf0e10cSrcweir }
3549cdf0e10cSrcweir 
3550cdf0e10cSrcweir // ------------------------------------------------------------------------
3551cdf0e10cSrcweir 
3552cdf0e10cSrcweir void MetaFontAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
3553cdf0e10cSrcweir {
3554cdf0e10cSrcweir     COMPAT( rIStm );
3555cdf0e10cSrcweir     rIStm >> maFont;
3556cdf0e10cSrcweir     pData->meActualCharSet = maFont.GetCharSet();
3557cdf0e10cSrcweir     if ( pData->meActualCharSet == RTL_TEXTENCODING_DONTKNOW )
3558cdf0e10cSrcweir         pData->meActualCharSet = gsl_getSystemTextEncoding();
3559cdf0e10cSrcweir }
3560cdf0e10cSrcweir 
3561cdf0e10cSrcweir // ========================================================================
3562cdf0e10cSrcweir 
3563cdf0e10cSrcweir IMPL_META_ACTION( Push, META_PUSH_ACTION )
3564cdf0e10cSrcweir 
3565cdf0e10cSrcweir // ------------------------------------------------------------------------
3566cdf0e10cSrcweir 
3567cdf0e10cSrcweir MetaPushAction::MetaPushAction( sal_uInt16 nFlags ) :
3568cdf0e10cSrcweir     MetaAction  ( META_PUSH_ACTION ),
3569cdf0e10cSrcweir     mnFlags     ( nFlags )
3570cdf0e10cSrcweir {
3571cdf0e10cSrcweir }
3572cdf0e10cSrcweir 
3573cdf0e10cSrcweir // ------------------------------------------------------------------------
3574cdf0e10cSrcweir 
3575cdf0e10cSrcweir void MetaPushAction::Execute( OutputDevice* pOut )
3576cdf0e10cSrcweir {
3577cdf0e10cSrcweir     pOut->Push( mnFlags );
3578cdf0e10cSrcweir }
3579cdf0e10cSrcweir 
3580cdf0e10cSrcweir // ------------------------------------------------------------------------
3581cdf0e10cSrcweir 
3582cdf0e10cSrcweir MetaAction* MetaPushAction::Clone()
3583cdf0e10cSrcweir {
3584cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaPushAction( *this );
3585cdf0e10cSrcweir     pClone->ResetRefCount();
3586cdf0e10cSrcweir     return pClone;
3587cdf0e10cSrcweir }
3588cdf0e10cSrcweir 
3589cdf0e10cSrcweir // ------------------------------------------------------------------------
3590cdf0e10cSrcweir 
3591cdf0e10cSrcweir sal_Bool MetaPushAction::Compare( const MetaAction& rMetaAction ) const
3592cdf0e10cSrcweir {
3593cdf0e10cSrcweir     return mnFlags == ((MetaPushAction&)rMetaAction).mnFlags;
3594cdf0e10cSrcweir }
3595cdf0e10cSrcweir 
3596cdf0e10cSrcweir // ------------------------------------------------------------------------
3597cdf0e10cSrcweir 
3598cdf0e10cSrcweir void MetaPushAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
3599cdf0e10cSrcweir {
3600cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
3601cdf0e10cSrcweir     rOStm << mnFlags;
3602cdf0e10cSrcweir }
3603cdf0e10cSrcweir 
3604cdf0e10cSrcweir // ------------------------------------------------------------------------
3605cdf0e10cSrcweir 
3606cdf0e10cSrcweir void MetaPushAction::Read( SvStream& rIStm, ImplMetaReadData* )
3607cdf0e10cSrcweir {
3608cdf0e10cSrcweir     COMPAT( rIStm );
3609cdf0e10cSrcweir     rIStm >> mnFlags;
3610cdf0e10cSrcweir }
3611cdf0e10cSrcweir 
3612cdf0e10cSrcweir // ========================================================================
3613cdf0e10cSrcweir 
3614cdf0e10cSrcweir IMPL_META_ACTION( Pop, META_POP_ACTION )
3615cdf0e10cSrcweir 
3616cdf0e10cSrcweir // ------------------------------------------------------------------------
3617cdf0e10cSrcweir 
3618cdf0e10cSrcweir void MetaPopAction::Execute( OutputDevice* pOut )
3619cdf0e10cSrcweir {
3620cdf0e10cSrcweir     pOut->Pop();
3621cdf0e10cSrcweir }
3622cdf0e10cSrcweir 
3623cdf0e10cSrcweir // ------------------------------------------------------------------------
3624cdf0e10cSrcweir 
3625cdf0e10cSrcweir MetaAction* MetaPopAction::Clone()
3626cdf0e10cSrcweir {
3627cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaPopAction( *this );
3628cdf0e10cSrcweir     pClone->ResetRefCount();
3629cdf0e10cSrcweir     return pClone;
3630cdf0e10cSrcweir }
3631cdf0e10cSrcweir 
3632cdf0e10cSrcweir // ------------------------------------------------------------------------
3633cdf0e10cSrcweir 
3634cdf0e10cSrcweir void MetaPopAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
3635cdf0e10cSrcweir {
3636cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
3637cdf0e10cSrcweir }
3638cdf0e10cSrcweir 
3639cdf0e10cSrcweir // ------------------------------------------------------------------------
3640cdf0e10cSrcweir 
3641cdf0e10cSrcweir void MetaPopAction::Read( SvStream& rIStm, ImplMetaReadData* )
3642cdf0e10cSrcweir {
3643cdf0e10cSrcweir     COMPAT( rIStm );
3644cdf0e10cSrcweir }
3645cdf0e10cSrcweir 
3646cdf0e10cSrcweir // ========================================================================
3647cdf0e10cSrcweir 
3648cdf0e10cSrcweir IMPL_META_ACTION( RasterOp, META_RASTEROP_ACTION )
3649cdf0e10cSrcweir 
3650cdf0e10cSrcweir // ------------------------------------------------------------------------
3651cdf0e10cSrcweir 
3652cdf0e10cSrcweir MetaRasterOpAction::MetaRasterOpAction( RasterOp eRasterOp ) :
3653cdf0e10cSrcweir     MetaAction  ( META_RASTEROP_ACTION ),
3654cdf0e10cSrcweir     meRasterOp  ( eRasterOp )
3655cdf0e10cSrcweir {
3656cdf0e10cSrcweir }
3657cdf0e10cSrcweir 
3658cdf0e10cSrcweir // ------------------------------------------------------------------------
3659cdf0e10cSrcweir 
3660cdf0e10cSrcweir void MetaRasterOpAction::Execute( OutputDevice* pOut )
3661cdf0e10cSrcweir {
3662cdf0e10cSrcweir     pOut->SetRasterOp( meRasterOp );
3663cdf0e10cSrcweir }
3664cdf0e10cSrcweir 
3665cdf0e10cSrcweir // ------------------------------------------------------------------------
3666cdf0e10cSrcweir 
3667cdf0e10cSrcweir MetaAction* MetaRasterOpAction::Clone()
3668cdf0e10cSrcweir {
3669cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaRasterOpAction( *this );
3670cdf0e10cSrcweir     pClone->ResetRefCount();
3671cdf0e10cSrcweir     return pClone;
3672cdf0e10cSrcweir }
3673cdf0e10cSrcweir 
3674cdf0e10cSrcweir // ------------------------------------------------------------------------
3675cdf0e10cSrcweir 
3676cdf0e10cSrcweir sal_Bool MetaRasterOpAction::Compare( const MetaAction& rMetaAction ) const
3677cdf0e10cSrcweir {
3678cdf0e10cSrcweir     return meRasterOp == ((MetaRasterOpAction&)rMetaAction).meRasterOp;
3679cdf0e10cSrcweir }
3680cdf0e10cSrcweir 
3681cdf0e10cSrcweir // ------------------------------------------------------------------------
3682cdf0e10cSrcweir 
3683cdf0e10cSrcweir void MetaRasterOpAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
3684cdf0e10cSrcweir {
3685cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
3686cdf0e10cSrcweir     rOStm << (sal_uInt16) meRasterOp;
3687cdf0e10cSrcweir }
3688cdf0e10cSrcweir 
3689cdf0e10cSrcweir // ------------------------------------------------------------------------
3690cdf0e10cSrcweir 
3691cdf0e10cSrcweir void MetaRasterOpAction::Read( SvStream& rIStm, ImplMetaReadData* )
3692cdf0e10cSrcweir {
3693cdf0e10cSrcweir     sal_uInt16 nTmp16;
3694cdf0e10cSrcweir 
3695cdf0e10cSrcweir     COMPAT( rIStm );
3696cdf0e10cSrcweir     rIStm >> nTmp16; meRasterOp = (RasterOp) nTmp16;
3697cdf0e10cSrcweir }
3698cdf0e10cSrcweir 
3699cdf0e10cSrcweir // ========================================================================
3700cdf0e10cSrcweir 
3701cdf0e10cSrcweir IMPL_META_ACTION( Transparent, META_TRANSPARENT_ACTION )
3702cdf0e10cSrcweir 
3703cdf0e10cSrcweir // ------------------------------------------------------------------------
3704cdf0e10cSrcweir 
3705cdf0e10cSrcweir MetaTransparentAction::MetaTransparentAction( const PolyPolygon& rPolyPoly, sal_uInt16 nTransPercent ) :
3706cdf0e10cSrcweir     MetaAction      ( META_TRANSPARENT_ACTION ),
3707cdf0e10cSrcweir     maPolyPoly      ( rPolyPoly ),
3708cdf0e10cSrcweir     mnTransPercent  ( nTransPercent )
3709cdf0e10cSrcweir {
3710cdf0e10cSrcweir }
3711cdf0e10cSrcweir 
3712cdf0e10cSrcweir // ------------------------------------------------------------------------
3713cdf0e10cSrcweir 
3714cdf0e10cSrcweir void MetaTransparentAction::Execute( OutputDevice* pOut )
3715cdf0e10cSrcweir {
3716cdf0e10cSrcweir     pOut->DrawTransparent( maPolyPoly, mnTransPercent );
3717cdf0e10cSrcweir }
3718cdf0e10cSrcweir 
3719cdf0e10cSrcweir // ------------------------------------------------------------------------
3720cdf0e10cSrcweir 
3721cdf0e10cSrcweir MetaAction* MetaTransparentAction::Clone()
3722cdf0e10cSrcweir {
3723cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaTransparentAction( *this );
3724cdf0e10cSrcweir     pClone->ResetRefCount();
3725cdf0e10cSrcweir     return pClone;
3726cdf0e10cSrcweir }
3727cdf0e10cSrcweir 
3728cdf0e10cSrcweir // ------------------------------------------------------------------------
3729cdf0e10cSrcweir 
3730cdf0e10cSrcweir void MetaTransparentAction::Move( long nHorzMove, long nVertMove )
3731cdf0e10cSrcweir {
3732cdf0e10cSrcweir     maPolyPoly.Move( nHorzMove, nVertMove );
3733cdf0e10cSrcweir }
3734cdf0e10cSrcweir 
3735cdf0e10cSrcweir // ------------------------------------------------------------------------
3736cdf0e10cSrcweir 
3737cdf0e10cSrcweir void MetaTransparentAction::Scale( double fScaleX, double fScaleY )
3738cdf0e10cSrcweir {
3739cdf0e10cSrcweir     for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
3740cdf0e10cSrcweir         ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
3741cdf0e10cSrcweir }
3742cdf0e10cSrcweir 
3743cdf0e10cSrcweir // ------------------------------------------------------------------------
3744cdf0e10cSrcweir 
3745cdf0e10cSrcweir sal_Bool MetaTransparentAction::Compare( const MetaAction& rMetaAction ) const
3746cdf0e10cSrcweir {
3747cdf0e10cSrcweir     return ( maPolyPoly == ((MetaTransparentAction&)rMetaAction).maPolyPoly ) &&
3748cdf0e10cSrcweir            ( mnTransPercent == ((MetaTransparentAction&)rMetaAction).mnTransPercent );
3749cdf0e10cSrcweir }
3750cdf0e10cSrcweir 
3751cdf0e10cSrcweir // ------------------------------------------------------------------------
3752cdf0e10cSrcweir 
3753cdf0e10cSrcweir void MetaTransparentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
3754cdf0e10cSrcweir {
3755cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
3756cdf0e10cSrcweir 
3757cdf0e10cSrcweir     // #i105373# The PolyPolygon in this action may be a curve; this
3758cdf0e10cSrcweir     // was ignored until now what is an error. To make older office
3759cdf0e10cSrcweir     // versions work with MetaFiles, i opt for applying AdaptiveSubdivide
3760cdf0e10cSrcweir     // to the PolyPoylgon.
3761cdf0e10cSrcweir     // The alternative would be to really write the curve information
3762cdf0e10cSrcweir     // like in MetaPolyPolygonAction::Write (where someone extended it
3763cdf0e10cSrcweir     // correctly, but not here :-( ).
3764cdf0e10cSrcweir     // The golden solution would be to combine both, but i think it's
3765cdf0e10cSrcweir     // not necessary; a good subdivision will be sufficient.
3766cdf0e10cSrcweir     PolyPolygon aNoCurvePolyPolygon;
3767cdf0e10cSrcweir     maPolyPoly.AdaptiveSubdivide(aNoCurvePolyPolygon);
3768cdf0e10cSrcweir 
3769cdf0e10cSrcweir     rOStm << aNoCurvePolyPolygon;
3770cdf0e10cSrcweir     rOStm << mnTransPercent;
3771cdf0e10cSrcweir }
3772cdf0e10cSrcweir 
3773cdf0e10cSrcweir // ------------------------------------------------------------------------
3774cdf0e10cSrcweir 
3775cdf0e10cSrcweir void MetaTransparentAction::Read( SvStream& rIStm, ImplMetaReadData* )
3776cdf0e10cSrcweir {
3777cdf0e10cSrcweir     COMPAT( rIStm );
3778cdf0e10cSrcweir     rIStm >> maPolyPoly;
3779cdf0e10cSrcweir     rIStm >> mnTransPercent;
3780cdf0e10cSrcweir }
3781cdf0e10cSrcweir 
3782cdf0e10cSrcweir // ========================================================================
3783cdf0e10cSrcweir 
3784cdf0e10cSrcweir IMPL_META_ACTION( FloatTransparent, META_FLOATTRANSPARENT_ACTION )
3785cdf0e10cSrcweir 
3786cdf0e10cSrcweir // ------------------------------------------------------------------------
3787cdf0e10cSrcweir 
3788cdf0e10cSrcweir MetaFloatTransparentAction::MetaFloatTransparentAction( const GDIMetaFile& rMtf, const Point& rPos,
3789cdf0e10cSrcweir                                                         const Size& rSize, const Gradient& rGradient ) :
3790cdf0e10cSrcweir     MetaAction      ( META_FLOATTRANSPARENT_ACTION ),
3791cdf0e10cSrcweir     maMtf           ( rMtf ),
3792cdf0e10cSrcweir     maPoint         ( rPos ),
3793cdf0e10cSrcweir     maSize          ( rSize ),
3794cdf0e10cSrcweir     maGradient      ( rGradient )
3795cdf0e10cSrcweir {
3796cdf0e10cSrcweir }
3797cdf0e10cSrcweir 
3798cdf0e10cSrcweir // ------------------------------------------------------------------------
3799cdf0e10cSrcweir 
3800cdf0e10cSrcweir void MetaFloatTransparentAction::Execute( OutputDevice* pOut )
3801cdf0e10cSrcweir {
3802cdf0e10cSrcweir     pOut->DrawTransparent( maMtf, maPoint, maSize, maGradient );
3803cdf0e10cSrcweir }
3804cdf0e10cSrcweir 
3805cdf0e10cSrcweir // ------------------------------------------------------------------------
3806cdf0e10cSrcweir 
3807cdf0e10cSrcweir MetaAction* MetaFloatTransparentAction::Clone()
3808cdf0e10cSrcweir {
3809cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaFloatTransparentAction( *this );
3810cdf0e10cSrcweir     pClone->ResetRefCount();
3811cdf0e10cSrcweir     return pClone;
3812cdf0e10cSrcweir }
3813cdf0e10cSrcweir 
3814cdf0e10cSrcweir // ------------------------------------------------------------------------
3815cdf0e10cSrcweir 
3816cdf0e10cSrcweir void MetaFloatTransparentAction::Move( long nHorzMove, long nVertMove )
3817cdf0e10cSrcweir {
3818cdf0e10cSrcweir     maPoint.Move( nHorzMove, nVertMove );
3819cdf0e10cSrcweir }
3820cdf0e10cSrcweir 
3821cdf0e10cSrcweir // ------------------------------------------------------------------------
3822cdf0e10cSrcweir 
3823cdf0e10cSrcweir void MetaFloatTransparentAction::Scale( double fScaleX, double fScaleY )
3824cdf0e10cSrcweir {
3825cdf0e10cSrcweir     Rectangle aRectangle(maPoint, maSize);
3826cdf0e10cSrcweir     ImplScaleRect( aRectangle, fScaleX, fScaleY );
3827cdf0e10cSrcweir     maPoint = aRectangle.TopLeft();
3828cdf0e10cSrcweir     maSize = aRectangle.GetSize();
3829cdf0e10cSrcweir }
3830cdf0e10cSrcweir 
3831cdf0e10cSrcweir // ------------------------------------------------------------------------
3832cdf0e10cSrcweir 
3833cdf0e10cSrcweir sal_Bool MetaFloatTransparentAction::Compare( const MetaAction& rMetaAction ) const
3834cdf0e10cSrcweir {
3835cdf0e10cSrcweir     return ( maMtf == ((MetaFloatTransparentAction&)rMetaAction).maMtf ) &&
3836cdf0e10cSrcweir            ( maPoint == ((MetaFloatTransparentAction&)rMetaAction).maPoint ) &&
3837cdf0e10cSrcweir            ( maSize == ((MetaFloatTransparentAction&)rMetaAction).maSize ) &&
3838cdf0e10cSrcweir            ( maGradient == ((MetaFloatTransparentAction&)rMetaAction).maGradient );
3839cdf0e10cSrcweir }
3840cdf0e10cSrcweir 
3841cdf0e10cSrcweir // ------------------------------------------------------------------------
3842cdf0e10cSrcweir 
3843cdf0e10cSrcweir void MetaFloatTransparentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
3844cdf0e10cSrcweir {
3845cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
3846cdf0e10cSrcweir 
3847cdf0e10cSrcweir     maMtf.Write( rOStm );
3848cdf0e10cSrcweir     rOStm << maPoint << maSize << maGradient;
3849cdf0e10cSrcweir }
3850cdf0e10cSrcweir 
3851cdf0e10cSrcweir // ------------------------------------------------------------------------
3852cdf0e10cSrcweir 
3853cdf0e10cSrcweir void MetaFloatTransparentAction::Read( SvStream& rIStm, ImplMetaReadData* )
3854cdf0e10cSrcweir {
3855cdf0e10cSrcweir     COMPAT( rIStm );
3856cdf0e10cSrcweir     rIStm >> maMtf >> maPoint >> maSize >> maGradient;
3857cdf0e10cSrcweir }
3858cdf0e10cSrcweir 
3859cdf0e10cSrcweir // ========================================================================
3860cdf0e10cSrcweir 
3861cdf0e10cSrcweir IMPL_META_ACTION( EPS, META_EPS_ACTION )
3862cdf0e10cSrcweir 
3863cdf0e10cSrcweir // ------------------------------------------------------------------------
3864cdf0e10cSrcweir 
3865cdf0e10cSrcweir MetaEPSAction::MetaEPSAction( const Point& rPoint, const Size& rSize,
3866cdf0e10cSrcweir                               const GfxLink& rGfxLink, const GDIMetaFile& rSubst ) :
3867cdf0e10cSrcweir     MetaAction  ( META_EPS_ACTION ),
3868cdf0e10cSrcweir     maGfxLink   ( rGfxLink ),
3869cdf0e10cSrcweir     maSubst     ( rSubst ),
3870cdf0e10cSrcweir     maPoint     ( rPoint ),
3871cdf0e10cSrcweir     maSize      ( rSize )
3872cdf0e10cSrcweir {
3873cdf0e10cSrcweir }
3874cdf0e10cSrcweir 
3875cdf0e10cSrcweir // ------------------------------------------------------------------------
3876cdf0e10cSrcweir 
3877cdf0e10cSrcweir void MetaEPSAction::Execute( OutputDevice* pOut )
3878cdf0e10cSrcweir {
3879cdf0e10cSrcweir     pOut->DrawEPS( maPoint, maSize, maGfxLink, &maSubst );
3880cdf0e10cSrcweir }
3881cdf0e10cSrcweir 
3882cdf0e10cSrcweir // ------------------------------------------------------------------------
3883cdf0e10cSrcweir 
3884cdf0e10cSrcweir MetaAction* MetaEPSAction::Clone()
3885cdf0e10cSrcweir {
3886cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaEPSAction( *this );
3887cdf0e10cSrcweir     pClone->ResetRefCount();
3888cdf0e10cSrcweir     return pClone;
3889cdf0e10cSrcweir }
3890cdf0e10cSrcweir 
3891cdf0e10cSrcweir // ------------------------------------------------------------------------
3892cdf0e10cSrcweir 
3893cdf0e10cSrcweir void MetaEPSAction::Move( long nHorzMove, long nVertMove )
3894cdf0e10cSrcweir {
3895cdf0e10cSrcweir     maPoint.Move( nHorzMove, nVertMove );
3896cdf0e10cSrcweir }
3897cdf0e10cSrcweir 
3898cdf0e10cSrcweir // ------------------------------------------------------------------------
3899cdf0e10cSrcweir 
3900cdf0e10cSrcweir void MetaEPSAction::Scale( double fScaleX, double fScaleY )
3901cdf0e10cSrcweir {
3902cdf0e10cSrcweir     Rectangle aRectangle(maPoint, maSize);
3903cdf0e10cSrcweir     ImplScaleRect( aRectangle, fScaleX, fScaleY );
3904cdf0e10cSrcweir     maPoint = aRectangle.TopLeft();
3905cdf0e10cSrcweir     maSize = aRectangle.GetSize();
3906cdf0e10cSrcweir }
3907cdf0e10cSrcweir 
3908cdf0e10cSrcweir // ------------------------------------------------------------------------
3909cdf0e10cSrcweir 
3910cdf0e10cSrcweir sal_Bool MetaEPSAction::Compare( const MetaAction& rMetaAction ) const
3911cdf0e10cSrcweir {
3912cdf0e10cSrcweir     return ( maGfxLink.IsEqual(((MetaEPSAction&)rMetaAction).maGfxLink )) &&
3913cdf0e10cSrcweir            ( maSubst == ((MetaEPSAction&)rMetaAction).maSubst ) &&
3914cdf0e10cSrcweir            ( maPoint == ((MetaEPSAction&)rMetaAction).maPoint ) &&
3915cdf0e10cSrcweir            ( maSize == ((MetaEPSAction&)rMetaAction).maSize );
3916cdf0e10cSrcweir }
3917cdf0e10cSrcweir 
3918cdf0e10cSrcweir // ------------------------------------------------------------------------
3919cdf0e10cSrcweir 
3920cdf0e10cSrcweir void MetaEPSAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
3921cdf0e10cSrcweir {
3922cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
3923cdf0e10cSrcweir     rOStm << maGfxLink;
3924cdf0e10cSrcweir     rOStm << maPoint;
3925cdf0e10cSrcweir     rOStm << maSize;
3926cdf0e10cSrcweir     maSubst.Write( rOStm );
3927cdf0e10cSrcweir }
3928cdf0e10cSrcweir 
3929cdf0e10cSrcweir // ------------------------------------------------------------------------
3930cdf0e10cSrcweir 
3931cdf0e10cSrcweir void MetaEPSAction::Read( SvStream& rIStm, ImplMetaReadData* )
3932cdf0e10cSrcweir {
3933cdf0e10cSrcweir     COMPAT( rIStm );
3934cdf0e10cSrcweir     rIStm >> maGfxLink;
3935cdf0e10cSrcweir     rIStm >> maPoint;
3936cdf0e10cSrcweir     rIStm >> maSize;
3937cdf0e10cSrcweir     rIStm >> maSubst;
3938cdf0e10cSrcweir }
3939cdf0e10cSrcweir 
3940cdf0e10cSrcweir // ========================================================================
3941cdf0e10cSrcweir 
3942cdf0e10cSrcweir IMPL_META_ACTION( RefPoint, META_REFPOINT_ACTION )
3943cdf0e10cSrcweir 
3944cdf0e10cSrcweir // ------------------------------------------------------------------------
3945cdf0e10cSrcweir 
3946cdf0e10cSrcweir MetaRefPointAction::MetaRefPointAction( const Point& rRefPoint, sal_Bool bSet ) :
3947cdf0e10cSrcweir     MetaAction  ( META_REFPOINT_ACTION ),
3948cdf0e10cSrcweir     maRefPoint  ( rRefPoint ),
3949cdf0e10cSrcweir     mbSet       ( bSet )
3950cdf0e10cSrcweir {
3951cdf0e10cSrcweir }
3952cdf0e10cSrcweir 
3953cdf0e10cSrcweir // ------------------------------------------------------------------------
3954cdf0e10cSrcweir 
3955cdf0e10cSrcweir void MetaRefPointAction::Execute( OutputDevice* pOut )
3956cdf0e10cSrcweir {
3957cdf0e10cSrcweir     if( mbSet )
3958cdf0e10cSrcweir         pOut->SetRefPoint( maRefPoint );
3959cdf0e10cSrcweir     else
3960cdf0e10cSrcweir         pOut->SetRefPoint();
3961cdf0e10cSrcweir }
3962cdf0e10cSrcweir 
3963cdf0e10cSrcweir // ------------------------------------------------------------------------
3964cdf0e10cSrcweir 
3965cdf0e10cSrcweir MetaAction* MetaRefPointAction::Clone()
3966cdf0e10cSrcweir {
3967cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaRefPointAction( *this );
3968cdf0e10cSrcweir     pClone->ResetRefCount();
3969cdf0e10cSrcweir     return pClone;
3970cdf0e10cSrcweir }
3971cdf0e10cSrcweir 
3972cdf0e10cSrcweir // ------------------------------------------------------------------------
3973cdf0e10cSrcweir 
3974cdf0e10cSrcweir sal_Bool MetaRefPointAction::Compare( const MetaAction& rMetaAction ) const
3975cdf0e10cSrcweir {
3976cdf0e10cSrcweir     return ( maRefPoint == ((MetaRefPointAction&)rMetaAction).maRefPoint ) &&
3977cdf0e10cSrcweir            ( mbSet == ((MetaRefPointAction&)rMetaAction).mbSet );
3978cdf0e10cSrcweir }
3979cdf0e10cSrcweir 
3980cdf0e10cSrcweir // ------------------------------------------------------------------------
3981cdf0e10cSrcweir 
3982cdf0e10cSrcweir void MetaRefPointAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
3983cdf0e10cSrcweir {
3984cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
3985cdf0e10cSrcweir     rOStm << maRefPoint << mbSet;
3986cdf0e10cSrcweir }
3987cdf0e10cSrcweir 
3988cdf0e10cSrcweir // ------------------------------------------------------------------------
3989cdf0e10cSrcweir 
3990cdf0e10cSrcweir void MetaRefPointAction::Read( SvStream& rIStm, ImplMetaReadData* )
3991cdf0e10cSrcweir {
3992cdf0e10cSrcweir     COMPAT( rIStm );
3993cdf0e10cSrcweir     rIStm >> maRefPoint >> mbSet;
3994cdf0e10cSrcweir }
3995cdf0e10cSrcweir 
3996cdf0e10cSrcweir // ========================================================================
3997cdf0e10cSrcweir 
3998cdf0e10cSrcweir MetaCommentAction::MetaCommentAction( sal_Int32 nValue ) :
3999cdf0e10cSrcweir     MetaAction  ( META_COMMENT_ACTION ),
4000cdf0e10cSrcweir     mnValue     ( nValue )
4001cdf0e10cSrcweir {
4002cdf0e10cSrcweir     ImplInitDynamicData( NULL, 0UL );
4003cdf0e10cSrcweir }
4004cdf0e10cSrcweir 
4005cdf0e10cSrcweir // ------------------------------------------------------------------------
4006cdf0e10cSrcweir 
4007cdf0e10cSrcweir MetaCommentAction::MetaCommentAction( const MetaCommentAction& rAct ) :
4008cdf0e10cSrcweir     MetaAction  ( META_COMMENT_ACTION ),
4009cdf0e10cSrcweir     maComment   ( rAct.maComment ),
4010cdf0e10cSrcweir     mnValue     ( rAct.mnValue )
4011cdf0e10cSrcweir {
4012cdf0e10cSrcweir     ImplInitDynamicData( rAct.mpData, rAct.mnDataSize );
4013cdf0e10cSrcweir }
4014cdf0e10cSrcweir 
4015cdf0e10cSrcweir // ------------------------------------------------------------------------
4016cdf0e10cSrcweir 
4017cdf0e10cSrcweir MetaCommentAction::MetaCommentAction( const ByteString& rComment, sal_Int32 nValue, const sal_uInt8* pData, sal_uInt32 nDataSize ) :
4018cdf0e10cSrcweir     MetaAction  ( META_COMMENT_ACTION ),
4019cdf0e10cSrcweir     maComment   ( rComment ),
4020cdf0e10cSrcweir     mnValue     ( nValue )
4021cdf0e10cSrcweir {
4022cdf0e10cSrcweir     ImplInitDynamicData( pData, nDataSize );
4023cdf0e10cSrcweir }
4024cdf0e10cSrcweir 
4025cdf0e10cSrcweir // ------------------------------------------------------------------------
4026cdf0e10cSrcweir 
4027cdf0e10cSrcweir MetaCommentAction::MetaCommentAction( const sal_uInt8* pData, sal_uInt32 nDataSize ) :
4028cdf0e10cSrcweir     MetaAction  ( META_COMMENT_ACTION ),
4029cdf0e10cSrcweir     mnValue     ( 0L )
4030cdf0e10cSrcweir {
4031cdf0e10cSrcweir     ImplInitDynamicData( pData, nDataSize );
4032cdf0e10cSrcweir }
4033cdf0e10cSrcweir 
4034cdf0e10cSrcweir // ------------------------------------------------------------------------
4035cdf0e10cSrcweir 
4036cdf0e10cSrcweir MetaCommentAction::~MetaCommentAction()
4037cdf0e10cSrcweir {
4038cdf0e10cSrcweir     if ( mpData )
4039cdf0e10cSrcweir         delete[] mpData;
4040cdf0e10cSrcweir }
4041cdf0e10cSrcweir 
4042cdf0e10cSrcweir // ------------------------------------------------------------------------
4043cdf0e10cSrcweir 
4044cdf0e10cSrcweir void MetaCommentAction::ImplInitDynamicData( const sal_uInt8* pData, sal_uInt32 nDataSize )
4045cdf0e10cSrcweir {
4046cdf0e10cSrcweir     if ( nDataSize && pData )
4047cdf0e10cSrcweir     {
4048cdf0e10cSrcweir         mnDataSize = nDataSize, mpData = new sal_uInt8[ mnDataSize ];
4049cdf0e10cSrcweir         memcpy( mpData, pData, mnDataSize );
4050cdf0e10cSrcweir     }
4051cdf0e10cSrcweir     else
4052cdf0e10cSrcweir     {
4053cdf0e10cSrcweir         mnDataSize = 0;
4054cdf0e10cSrcweir         mpData = NULL;
4055cdf0e10cSrcweir     }
4056cdf0e10cSrcweir }
4057cdf0e10cSrcweir 
4058cdf0e10cSrcweir // ------------------------------------------------------------------------
4059cdf0e10cSrcweir 
4060cdf0e10cSrcweir void MetaCommentAction::Execute( OutputDevice* pOut )
4061cdf0e10cSrcweir {
4062cdf0e10cSrcweir     if ( pOut->GetConnectMetaFile() )
4063cdf0e10cSrcweir     {
4064cdf0e10cSrcweir         Duplicate();
4065cdf0e10cSrcweir         pOut->GetConnectMetaFile()->AddAction( this );
4066cdf0e10cSrcweir     }
4067cdf0e10cSrcweir }
4068cdf0e10cSrcweir 
4069cdf0e10cSrcweir // ------------------------------------------------------------------------
4070cdf0e10cSrcweir 
4071cdf0e10cSrcweir MetaAction* MetaCommentAction::Clone()
4072cdf0e10cSrcweir {
4073cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaCommentAction( *this );
4074cdf0e10cSrcweir     pClone->ResetRefCount();
4075cdf0e10cSrcweir     return pClone;
4076cdf0e10cSrcweir }
4077cdf0e10cSrcweir 
4078cdf0e10cSrcweir void MetaCommentAction::Move( long nXMove, long nYMove )
4079cdf0e10cSrcweir {
4080cdf0e10cSrcweir     if ( nXMove || nYMove )
4081cdf0e10cSrcweir     {
4082cdf0e10cSrcweir         if ( mnDataSize && mpData )
4083cdf0e10cSrcweir         {
4084cdf0e10cSrcweir             sal_Bool bPathStroke = maComment.Equals( "XPATHSTROKE_SEQ_BEGIN" );
4085cdf0e10cSrcweir             if ( bPathStroke || maComment.Equals( "XPATHFILL_SEQ_BEGIN" ) )
4086cdf0e10cSrcweir             {
4087cdf0e10cSrcweir                 SvMemoryStream  aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
4088cdf0e10cSrcweir                 SvMemoryStream  aDest;
4089cdf0e10cSrcweir                 if ( bPathStroke )
4090cdf0e10cSrcweir                 {
4091cdf0e10cSrcweir                     SvtGraphicStroke aStroke;
4092cdf0e10cSrcweir                     aMemStm >> aStroke;
4093cdf0e10cSrcweir                     Polygon aPath;
4094cdf0e10cSrcweir                     aStroke.getPath( aPath );
4095cdf0e10cSrcweir                     aPath.Move( nXMove, nYMove );
4096cdf0e10cSrcweir                     aStroke.setPath( aPath );
4097cdf0e10cSrcweir                     aDest << aStroke;
4098cdf0e10cSrcweir                 }
4099cdf0e10cSrcweir                 else
4100cdf0e10cSrcweir                 {
4101cdf0e10cSrcweir                     SvtGraphicFill aFill;
4102cdf0e10cSrcweir                     aMemStm >> aFill;
4103cdf0e10cSrcweir                     PolyPolygon aPath;
4104cdf0e10cSrcweir                     aFill.getPath( aPath );
4105cdf0e10cSrcweir                     aPath.Move( nXMove, nYMove );
4106cdf0e10cSrcweir                     aFill.setPath( aPath );
4107cdf0e10cSrcweir                     aDest << aFill;
4108cdf0e10cSrcweir                 }
4109cdf0e10cSrcweir                 delete[] mpData;
4110cdf0e10cSrcweir                 ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() );
4111cdf0e10cSrcweir             }
4112cdf0e10cSrcweir         }
4113cdf0e10cSrcweir     }
4114cdf0e10cSrcweir }
4115cdf0e10cSrcweir 
4116cdf0e10cSrcweir // ------------------------------------------------------------------------
4117cdf0e10cSrcweir // SJ: 25.07.06 #i56656# we are not able to mirrorcertain kind of
4118cdf0e10cSrcweir // comments properly, especially the XPATHSTROKE and XPATHFILL lead to
4119cdf0e10cSrcweir // problems, so it is better to remove these comments when mirroring
4120cdf0e10cSrcweir void MetaCommentAction::Scale( double fXScale, double fYScale )
4121cdf0e10cSrcweir {
4122cdf0e10cSrcweir     if ( ( fXScale != 1.0 ) || ( fYScale != 1.0 ) )
4123cdf0e10cSrcweir     {
4124cdf0e10cSrcweir         if ( mnDataSize && mpData )
4125cdf0e10cSrcweir         {
4126cdf0e10cSrcweir             sal_Bool bPathStroke = maComment.Equals( "XPATHSTROKE_SEQ_BEGIN" );
4127cdf0e10cSrcweir             if ( bPathStroke || maComment.Equals( "XPATHFILL_SEQ_BEGIN" ) )
4128cdf0e10cSrcweir             {
4129cdf0e10cSrcweir                 SvMemoryStream  aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
4130cdf0e10cSrcweir                 SvMemoryStream  aDest;
4131cdf0e10cSrcweir                 if ( bPathStroke )
4132cdf0e10cSrcweir                 {
4133cdf0e10cSrcweir                     SvtGraphicStroke aStroke;
4134cdf0e10cSrcweir                     aMemStm >> aStroke;
4135cdf0e10cSrcweir                     Polygon aPath;
4136cdf0e10cSrcweir                     aStroke.getPath( aPath );
4137cdf0e10cSrcweir                     aPath.Scale( fXScale, fYScale );
4138cdf0e10cSrcweir                     aStroke.setPath( aPath );
4139cdf0e10cSrcweir                     aDest << aStroke;
4140cdf0e10cSrcweir                 }
4141cdf0e10cSrcweir                 else
4142cdf0e10cSrcweir                 {
4143cdf0e10cSrcweir                     SvtGraphicFill aFill;
4144cdf0e10cSrcweir                     aMemStm >> aFill;
4145cdf0e10cSrcweir                     PolyPolygon aPath;
4146cdf0e10cSrcweir                     aFill.getPath( aPath );
4147cdf0e10cSrcweir                     aPath.Scale( fXScale, fYScale );
4148cdf0e10cSrcweir                     aFill.setPath( aPath );
4149cdf0e10cSrcweir                     aDest << aFill;
4150cdf0e10cSrcweir                 }
4151cdf0e10cSrcweir                 delete[] mpData;
4152cdf0e10cSrcweir                 ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() );
4153cdf0e10cSrcweir             }
4154cdf0e10cSrcweir         }
4155cdf0e10cSrcweir     }
4156cdf0e10cSrcweir }
4157cdf0e10cSrcweir 
4158cdf0e10cSrcweir // ------------------------------------------------------------------------
4159cdf0e10cSrcweir 
4160cdf0e10cSrcweir sal_Bool MetaCommentAction::Compare( const MetaAction& rMetaAction ) const
4161cdf0e10cSrcweir {
4162cdf0e10cSrcweir     return ( maComment == ((MetaCommentAction&)rMetaAction).maComment ) &&
4163cdf0e10cSrcweir            ( mnValue == ((MetaCommentAction&)rMetaAction).mnValue ) &&
4164cdf0e10cSrcweir            ( mnDataSize == ((MetaCommentAction&)rMetaAction).mnDataSize ) &&
4165cdf0e10cSrcweir            ( memcmp( mpData, ((MetaCommentAction&)rMetaAction).mpData, mnDataSize ) == 0 );
4166cdf0e10cSrcweir }
4167cdf0e10cSrcweir 
4168cdf0e10cSrcweir // ------------------------------------------------------------------------
4169cdf0e10cSrcweir 
4170cdf0e10cSrcweir void MetaCommentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
4171cdf0e10cSrcweir {
4172cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
4173cdf0e10cSrcweir     rOStm << maComment << mnValue << mnDataSize;
4174cdf0e10cSrcweir 
4175cdf0e10cSrcweir     if ( mnDataSize )
4176cdf0e10cSrcweir         rOStm.Write( mpData, mnDataSize );
4177cdf0e10cSrcweir }
4178cdf0e10cSrcweir 
4179cdf0e10cSrcweir // ------------------------------------------------------------------------
4180cdf0e10cSrcweir 
4181cdf0e10cSrcweir void MetaCommentAction::Read( SvStream& rIStm, ImplMetaReadData* )
4182cdf0e10cSrcweir {
4183cdf0e10cSrcweir     COMPAT( rIStm );
4184cdf0e10cSrcweir     rIStm >> maComment >> mnValue >> mnDataSize;
4185cdf0e10cSrcweir 
4186cdf0e10cSrcweir     if( mpData )
4187cdf0e10cSrcweir         delete[] mpData;
4188cdf0e10cSrcweir 
4189cdf0e10cSrcweir     if( mnDataSize )
4190cdf0e10cSrcweir     {
4191cdf0e10cSrcweir         mpData = new sal_uInt8[ mnDataSize ];
4192cdf0e10cSrcweir         rIStm.Read( mpData, mnDataSize );
4193cdf0e10cSrcweir     }
4194cdf0e10cSrcweir     else
4195cdf0e10cSrcweir         mpData = NULL;
4196cdf0e10cSrcweir }
4197cdf0e10cSrcweir 
4198cdf0e10cSrcweir // ========================================================================
4199cdf0e10cSrcweir 
4200cdf0e10cSrcweir IMPL_META_ACTION( LayoutMode, META_LAYOUTMODE_ACTION )
4201cdf0e10cSrcweir 
4202cdf0e10cSrcweir // ------------------------------------------------------------------------
4203cdf0e10cSrcweir 
4204cdf0e10cSrcweir MetaLayoutModeAction::MetaLayoutModeAction( sal_uInt32 nLayoutMode ) :
4205cdf0e10cSrcweir     MetaAction  ( META_LAYOUTMODE_ACTION ),
4206cdf0e10cSrcweir     mnLayoutMode( nLayoutMode )
4207cdf0e10cSrcweir {
4208cdf0e10cSrcweir }
4209cdf0e10cSrcweir 
4210cdf0e10cSrcweir // ------------------------------------------------------------------------
4211cdf0e10cSrcweir 
4212cdf0e10cSrcweir void MetaLayoutModeAction::Execute( OutputDevice* pOut )
4213cdf0e10cSrcweir {
4214cdf0e10cSrcweir     pOut->SetLayoutMode( mnLayoutMode );
4215cdf0e10cSrcweir }
4216cdf0e10cSrcweir 
4217cdf0e10cSrcweir // ------------------------------------------------------------------------
4218cdf0e10cSrcweir 
4219cdf0e10cSrcweir MetaAction* MetaLayoutModeAction::Clone()
4220cdf0e10cSrcweir {
4221cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaLayoutModeAction( *this );
4222cdf0e10cSrcweir     pClone->ResetRefCount();
4223cdf0e10cSrcweir     return pClone;
4224cdf0e10cSrcweir }
4225cdf0e10cSrcweir 
4226cdf0e10cSrcweir // ------------------------------------------------------------------------
4227cdf0e10cSrcweir 
4228cdf0e10cSrcweir sal_Bool MetaLayoutModeAction::Compare( const MetaAction& rMetaAction ) const
4229cdf0e10cSrcweir {
4230cdf0e10cSrcweir     return mnLayoutMode == ((MetaLayoutModeAction&)rMetaAction).mnLayoutMode;
4231cdf0e10cSrcweir }
4232cdf0e10cSrcweir 
4233cdf0e10cSrcweir // ------------------------------------------------------------------------
4234cdf0e10cSrcweir 
4235cdf0e10cSrcweir void MetaLayoutModeAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
4236cdf0e10cSrcweir {
4237cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
4238cdf0e10cSrcweir     rOStm << mnLayoutMode;
4239cdf0e10cSrcweir }
4240cdf0e10cSrcweir 
4241cdf0e10cSrcweir // ------------------------------------------------------------------------
4242cdf0e10cSrcweir 
4243cdf0e10cSrcweir void MetaLayoutModeAction::Read( SvStream& rIStm, ImplMetaReadData* )
4244cdf0e10cSrcweir {
4245cdf0e10cSrcweir     COMPAT( rIStm );
4246cdf0e10cSrcweir     rIStm >> mnLayoutMode;
4247cdf0e10cSrcweir }
4248cdf0e10cSrcweir 
4249cdf0e10cSrcweir // ========================================================================
4250cdf0e10cSrcweir 
4251cdf0e10cSrcweir IMPL_META_ACTION( TextLanguage, META_TEXTLANGUAGE_ACTION )
4252cdf0e10cSrcweir 
4253cdf0e10cSrcweir // ------------------------------------------------------------------------
4254cdf0e10cSrcweir 
4255cdf0e10cSrcweir MetaTextLanguageAction::MetaTextLanguageAction( LanguageType eTextLanguage ) :
4256cdf0e10cSrcweir     MetaAction  ( META_TEXTLANGUAGE_ACTION ),
4257cdf0e10cSrcweir     meTextLanguage( eTextLanguage )
4258cdf0e10cSrcweir {
4259cdf0e10cSrcweir }
4260cdf0e10cSrcweir 
4261cdf0e10cSrcweir // ------------------------------------------------------------------------
4262cdf0e10cSrcweir 
4263cdf0e10cSrcweir void MetaTextLanguageAction::Execute( OutputDevice* pOut )
4264cdf0e10cSrcweir {
4265cdf0e10cSrcweir     pOut->SetDigitLanguage( meTextLanguage );
4266cdf0e10cSrcweir }
4267cdf0e10cSrcweir 
4268cdf0e10cSrcweir // ------------------------------------------------------------------------
4269cdf0e10cSrcweir 
4270cdf0e10cSrcweir MetaAction* MetaTextLanguageAction::Clone()
4271cdf0e10cSrcweir {
4272cdf0e10cSrcweir     MetaAction* pClone = (MetaAction*) new MetaTextLanguageAction( *this );
4273cdf0e10cSrcweir     pClone->ResetRefCount();
4274cdf0e10cSrcweir     return pClone;
4275cdf0e10cSrcweir }
4276cdf0e10cSrcweir 
4277cdf0e10cSrcweir // ------------------------------------------------------------------------
4278cdf0e10cSrcweir 
4279cdf0e10cSrcweir sal_Bool MetaTextLanguageAction::Compare( const MetaAction& rMetaAction ) const
4280cdf0e10cSrcweir {
4281cdf0e10cSrcweir     return meTextLanguage == ((MetaTextLanguageAction&)rMetaAction).meTextLanguage;
4282cdf0e10cSrcweir }
4283cdf0e10cSrcweir 
4284cdf0e10cSrcweir // ------------------------------------------------------------------------
4285cdf0e10cSrcweir 
4286cdf0e10cSrcweir void MetaTextLanguageAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
4287cdf0e10cSrcweir {
4288cdf0e10cSrcweir     WRITE_BASE_COMPAT( rOStm, 1, pData );
4289cdf0e10cSrcweir     rOStm << meTextLanguage;
4290cdf0e10cSrcweir }
4291cdf0e10cSrcweir 
4292cdf0e10cSrcweir // ------------------------------------------------------------------------
4293cdf0e10cSrcweir 
4294cdf0e10cSrcweir void MetaTextLanguageAction::Read( SvStream& rIStm, ImplMetaReadData* )
4295cdf0e10cSrcweir {
4296cdf0e10cSrcweir     COMPAT( rIStm );
4297cdf0e10cSrcweir     rIStm >> meTextLanguage;
4298cdf0e10cSrcweir }
4299cdf0e10cSrcweir 
4300*ddde725dSArmin Le Grand // eof
4301