1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 #include <osl/thread.h>
24 #include <tools/stream.hxx>
25 #include <tools/vcompat.hxx>
26 #include <tools/helpers.hxx>
27 #include <vcl/dibtools.hxx>
28 #include <vcl/outdev.hxx>
29 #include <vcl/metaact.hxx>
30 #include <vcl/graphictools.hxx>
31 #include <basegfx/matrix/b2dhommatrixtools.hxx>
32 #include <unotools/fontdefs.hxx>
38 meta_action_name(MetaActionType nMetaAction
)
46 case MetaActionType::NONE
: return "NULL";
47 case MetaActionType::PIXEL
: return "PIXEL";
48 case MetaActionType::POINT
: return "POINT";
49 case MetaActionType::LINE
: return "LINE";
50 case MetaActionType::RECT
: return "RECT";
51 case MetaActionType::ROUNDRECT
: return "ROUNDRECT";
52 case MetaActionType::ELLIPSE
: return "ELLIPSE";
53 case MetaActionType::ARC
: return "ARC";
54 case MetaActionType::PIE
: return "PIE";
55 case MetaActionType::CHORD
: return "CHORD";
56 case MetaActionType::POLYLINE
: return "POLYLINE";
57 case MetaActionType::POLYGON
: return "POLYGON";
58 case MetaActionType::POLYPOLYGON
: return "POLYPOLYGON";
59 case MetaActionType::TEXT
: return "TEXT";
60 case MetaActionType::TEXTARRAY
: return "TEXTARRAY";
61 case MetaActionType::STRETCHTEXT
: return "STRETCHTEXT";
62 case MetaActionType::TEXTRECT
: return "TEXTRECT";
63 case MetaActionType::BMP
: return "BMP";
64 case MetaActionType::BMPSCALE
: return "BMPSCALE";
65 case MetaActionType::BMPSCALEPART
: return "BMPSCALEPART";
66 case MetaActionType::BMPEX
: return "BMPEX";
67 case MetaActionType::BMPEXSCALE
: return "BMPEXSCALE";
68 case MetaActionType::BMPEXSCALEPART
: return "BMPEXSCALEPART";
69 case MetaActionType::MASK
: return "MASK";
70 case MetaActionType::MASKSCALE
: return "MASKSCALE";
71 case MetaActionType::MASKSCALEPART
: return "MASKSCALEPART";
72 case MetaActionType::GRADIENT
: return "GRADIENT";
73 case MetaActionType::HATCH
: return "HATCH";
74 case MetaActionType::WALLPAPER
: return "WALLPAPER";
75 case MetaActionType::CLIPREGION
: return "CLIPREGION";
76 case MetaActionType::ISECTRECTCLIPREGION
: return "ISECTRECTCLIPREGION";
77 case MetaActionType::ISECTREGIONCLIPREGION
: return "ISECTREGIONCLIPREGION";
78 case MetaActionType::MOVECLIPREGION
: return "MOVECLIPREGION";
79 case MetaActionType::LINECOLOR
: return "LINECOLOR";
80 case MetaActionType::FILLCOLOR
: return "FILLCOLOR";
81 case MetaActionType::TEXTCOLOR
: return "TEXTCOLOR";
82 case MetaActionType::TEXTFILLCOLOR
: return "TEXTFILLCOLOR";
83 case MetaActionType::TEXTALIGN
: return "TEXTALIGN";
84 case MetaActionType::MAPMODE
: return "MAPMODE";
85 case MetaActionType::FONT
: return "FONT";
86 case MetaActionType::PUSH
: return "PUSH";
87 case MetaActionType::POP
: return "POP";
88 case MetaActionType::RASTEROP
: return "RASTEROP";
89 case MetaActionType::Transparent
: return "TRANSPARENT";
90 case MetaActionType::EPS
: return "EPS";
91 case MetaActionType::REFPOINT
: return "REFPOINT";
92 case MetaActionType::TEXTLINECOLOR
: return "TEXTLINECOLOR";
93 case MetaActionType::TEXTLINE
: return "TEXTLINE";
94 case MetaActionType::FLOATTRANSPARENT
: return "FLOATTRANSPARENT";
95 case MetaActionType::GRADIENTEX
: return "GRADIENTEX";
96 case MetaActionType::LAYOUTMODE
: return "LAYOUTMODE";
97 case MetaActionType::TEXTLANGUAGE
: return "TEXTLANGUAGE";
98 case MetaActionType::OVERLINECOLOR
: return "OVERLINECOLOR";
99 case MetaActionType::COMMENT
: return "COMMENT";
101 // Yes, return a pointer to a static buffer. This is a very
102 // local debugging output function, so no big deal.
103 static char buffer
[6];
104 sprintf(buffer
, "%u", static_cast<unsigned int>(nMetaAction
));
110 inline void ImplScalePoint( Point
& rPt
, double fScaleX
, double fScaleY
)
112 rPt
.X() = FRound( fScaleX
* rPt
.X() );
113 rPt
.Y() = FRound( fScaleY
* rPt
.Y() );
116 inline void ImplScaleRect( Rectangle
& rRect
, double fScaleX
, double fScaleY
)
118 Point
aTL( rRect
.TopLeft() );
119 Point
aBR( rRect
.BottomRight() );
121 ImplScalePoint( aTL
, fScaleX
, fScaleY
);
122 ImplScalePoint( aBR
, fScaleX
, fScaleY
);
124 rRect
= Rectangle( aTL
, aBR
);
128 inline void ImplScalePoly( tools::Polygon
& rPoly
, double fScaleX
, double fScaleY
)
130 for( sal_uInt16 i
= 0, nCount
= rPoly
.GetSize(); i
< nCount
; i
++ )
131 ImplScalePoint( rPoly
[ i
], fScaleX
, fScaleY
);
134 inline void ImplScaleLineInfo( LineInfo
& rLineInfo
, double fScaleX
, double fScaleY
)
136 if( !rLineInfo
.IsDefault() )
138 const double fScale
= ( fabs(fScaleX
) + fabs(fScaleY
) ) * 0.5;
140 rLineInfo
.SetWidth( FRound( fScale
* rLineInfo
.GetWidth() ) );
141 rLineInfo
.SetDashLen( FRound( fScale
* rLineInfo
.GetDashLen() ) );
142 rLineInfo
.SetDotLen( FRound( fScale
* rLineInfo
.GetDotLen() ) );
143 rLineInfo
.SetDistance( FRound( fScale
* rLineInfo
.GetDistance() ) );
147 } //anonymous namespace
149 MetaAction::MetaAction() :
151 mnType( MetaActionType::NONE
)
155 MetaAction::MetaAction( MetaActionType nType
) :
161 MetaAction::~MetaAction()
165 void MetaAction::Execute( OutputDevice
* )
169 MetaAction
* MetaAction::Clone()
171 return new MetaAction
;
174 void MetaAction::Move( long, long )
178 void MetaAction::Scale( double, double )
182 void MetaAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* )
184 rOStm
.WriteUInt16( static_cast<sal_uInt16
>(mnType
) );
187 void MetaAction::Read( SvStream
&, ImplMetaReadData
* )
189 // DO NOT read mnType - ReadMetaAction already did that!
192 MetaAction
* MetaAction::ReadMetaAction( SvStream
& rIStm
, ImplMetaReadData
* pData
)
194 MetaAction
* pAction
= nullptr;
196 rIStm
.ReadUInt16( nTmp
);
197 MetaActionType nType
= static_cast<MetaActionType
>(nTmp
);
199 SAL_INFO("vcl.gdi", "ReadMetaAction " << meta_action_name( nType
));
203 case MetaActionType::NONE
: pAction
= new MetaAction
; break;
204 case MetaActionType::PIXEL
: pAction
= new MetaPixelAction
; break;
205 case MetaActionType::POINT
: pAction
= new MetaPointAction
; break;
206 case MetaActionType::LINE
: pAction
= new MetaLineAction
; break;
207 case MetaActionType::RECT
: pAction
= new MetaRectAction
; break;
208 case MetaActionType::ROUNDRECT
: pAction
= new MetaRoundRectAction
; break;
209 case MetaActionType::ELLIPSE
: pAction
= new MetaEllipseAction
; break;
210 case MetaActionType::ARC
: pAction
= new MetaArcAction
; break;
211 case MetaActionType::PIE
: pAction
= new MetaPieAction
; break;
212 case MetaActionType::CHORD
: pAction
= new MetaChordAction
; break;
213 case MetaActionType::POLYLINE
: pAction
= new MetaPolyLineAction
; break;
214 case MetaActionType::POLYGON
: pAction
= new MetaPolygonAction
; break;
215 case MetaActionType::POLYPOLYGON
: pAction
= new MetaPolyPolygonAction
; break;
216 case MetaActionType::TEXT
: pAction
= new MetaTextAction
; break;
217 case MetaActionType::TEXTARRAY
: pAction
= new MetaTextArrayAction
; break;
218 case MetaActionType::STRETCHTEXT
: pAction
= new MetaStretchTextAction
; break;
219 case MetaActionType::TEXTRECT
: pAction
= new MetaTextRectAction
; break;
220 case MetaActionType::TEXTLINE
: pAction
= new MetaTextLineAction
; break;
221 case MetaActionType::BMP
: pAction
= new MetaBmpAction
; break;
222 case MetaActionType::BMPSCALE
: pAction
= new MetaBmpScaleAction
; break;
223 case MetaActionType::BMPSCALEPART
: pAction
= new MetaBmpScalePartAction
; break;
224 case MetaActionType::BMPEX
: pAction
= new MetaBmpExAction
; break;
225 case MetaActionType::BMPEXSCALE
: pAction
= new MetaBmpExScaleAction
; break;
226 case MetaActionType::BMPEXSCALEPART
: pAction
= new MetaBmpExScalePartAction
; break;
227 case MetaActionType::MASK
: pAction
= new MetaMaskAction
; break;
228 case MetaActionType::MASKSCALE
: pAction
= new MetaMaskScaleAction
; break;
229 case MetaActionType::MASKSCALEPART
: pAction
= new MetaMaskScalePartAction
; break;
230 case MetaActionType::GRADIENT
: pAction
= new MetaGradientAction
; break;
231 case MetaActionType::GRADIENTEX
: pAction
= new MetaGradientExAction
; break;
232 case MetaActionType::HATCH
: pAction
= new MetaHatchAction
; break;
233 case MetaActionType::WALLPAPER
: pAction
= new MetaWallpaperAction
; break;
234 case MetaActionType::CLIPREGION
: pAction
= new MetaClipRegionAction
; break;
235 case MetaActionType::ISECTRECTCLIPREGION
: pAction
= new MetaISectRectClipRegionAction
; break;
236 case MetaActionType::ISECTREGIONCLIPREGION
: pAction
= new MetaISectRegionClipRegionAction
; break;
237 case MetaActionType::MOVECLIPREGION
: pAction
= new MetaMoveClipRegionAction
; break;
238 case MetaActionType::LINECOLOR
: pAction
= new MetaLineColorAction
; break;
239 case MetaActionType::FILLCOLOR
: pAction
= new MetaFillColorAction
; break;
240 case MetaActionType::TEXTCOLOR
: pAction
= new MetaTextColorAction
; break;
241 case MetaActionType::TEXTFILLCOLOR
: pAction
= new MetaTextFillColorAction
; break;
242 case MetaActionType::TEXTLINECOLOR
: pAction
= new MetaTextLineColorAction
; break;
243 case MetaActionType::OVERLINECOLOR
: pAction
= new MetaOverlineColorAction
; break;
244 case MetaActionType::TEXTALIGN
: pAction
= new MetaTextAlignAction
; break;
245 case MetaActionType::MAPMODE
: pAction
= new MetaMapModeAction
; break;
246 case MetaActionType::FONT
: pAction
= new MetaFontAction
; break;
247 case MetaActionType::PUSH
: pAction
= new MetaPushAction
; break;
248 case MetaActionType::POP
: pAction
= new MetaPopAction
; break;
249 case MetaActionType::RASTEROP
: pAction
= new MetaRasterOpAction
; break;
250 case MetaActionType::Transparent
: pAction
= new MetaTransparentAction
; break;
251 case MetaActionType::FLOATTRANSPARENT
: pAction
= new MetaFloatTransparentAction
; break;
252 case MetaActionType::EPS
: pAction
= new MetaEPSAction
; break;
253 case MetaActionType::REFPOINT
: pAction
= new MetaRefPointAction
; break;
254 case MetaActionType::COMMENT
: pAction
= new MetaCommentAction
; break;
255 case MetaActionType::LAYOUTMODE
: pAction
= new MetaLayoutModeAction
; break;
256 case MetaActionType::TEXTLANGUAGE
: pAction
= new MetaTextLanguageAction
; break;
260 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
266 pAction
->Read( rIStm
, pData
);
271 MetaPixelAction::MetaPixelAction() :
272 MetaAction(MetaActionType::PIXEL
)
275 MetaPixelAction::~MetaPixelAction()
278 MetaPixelAction::MetaPixelAction( const Point
& rPt
, const Color
& rColor
) :
279 MetaAction ( MetaActionType::PIXEL
),
284 void MetaPixelAction::Execute( OutputDevice
* pOut
)
286 pOut
->DrawPixel( maPt
, maColor
);
289 MetaAction
* MetaPixelAction::Clone()
291 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaPixelAction( *this ));
292 pClone
->ResetRefCount();
296 void MetaPixelAction::Move( long nHorzMove
, long nVertMove
)
298 maPt
.Move( nHorzMove
, nVertMove
);
301 void MetaPixelAction::Scale( double fScaleX
, double fScaleY
)
303 ImplScalePoint( maPt
, fScaleX
, fScaleY
);
306 void MetaPixelAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
308 MetaAction::Write(rOStm
, pData
);
309 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
310 WritePair( rOStm
, maPt
);
311 maColor
.Write( rOStm
);
314 void MetaPixelAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
316 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
317 ReadPair( rIStm
, maPt
);
318 maColor
.Read( rIStm
);
321 MetaPointAction::MetaPointAction() :
322 MetaAction(MetaActionType::POINT
)
325 MetaPointAction::~MetaPointAction()
328 MetaPointAction::MetaPointAction( const Point
& rPt
) :
329 MetaAction ( MetaActionType::POINT
),
333 void MetaPointAction::Execute( OutputDevice
* pOut
)
335 pOut
->DrawPixel( maPt
);
338 MetaAction
* MetaPointAction::Clone()
340 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaPointAction( *this ));
341 pClone
->ResetRefCount();
345 void MetaPointAction::Move( long nHorzMove
, long nVertMove
)
347 maPt
.Move( nHorzMove
, nVertMove
);
350 void MetaPointAction::Scale( double fScaleX
, double fScaleY
)
352 ImplScalePoint( maPt
, fScaleX
, fScaleY
);
355 void MetaPointAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
357 MetaAction::Write(rOStm
, pData
);
358 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
359 WritePair( rOStm
, maPt
);
362 void MetaPointAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
364 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
365 ReadPair( rIStm
, maPt
);
368 MetaLineAction::MetaLineAction() :
369 MetaAction(MetaActionType::LINE
)
372 MetaLineAction::~MetaLineAction()
375 MetaLineAction::MetaLineAction( const Point
& rStart
, const Point
& rEnd
) :
376 MetaAction ( MetaActionType::LINE
),
377 maStartPt ( rStart
),
381 MetaLineAction::MetaLineAction( const Point
& rStart
, const Point
& rEnd
,
382 const LineInfo
& rLineInfo
) :
383 MetaAction ( MetaActionType::LINE
),
384 maLineInfo ( rLineInfo
),
385 maStartPt ( rStart
),
389 void MetaLineAction::Execute( OutputDevice
* pOut
)
391 if( maLineInfo
.IsDefault() )
392 pOut
->DrawLine( maStartPt
, maEndPt
);
394 pOut
->DrawLine( maStartPt
, maEndPt
, maLineInfo
);
397 MetaAction
* MetaLineAction::Clone()
399 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaLineAction( *this ));
400 pClone
->ResetRefCount();
404 void MetaLineAction::Move( long nHorzMove
, long nVertMove
)
406 maStartPt
.Move( nHorzMove
, nVertMove
);
407 maEndPt
.Move( nHorzMove
, nVertMove
);
410 void MetaLineAction::Scale( double fScaleX
, double fScaleY
)
412 ImplScalePoint( maStartPt
, fScaleX
, fScaleY
);
413 ImplScalePoint( maEndPt
, fScaleX
, fScaleY
);
414 ImplScaleLineInfo( maLineInfo
, fScaleX
, fScaleY
);
417 void MetaLineAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
419 MetaAction::Write(rOStm
, pData
);
420 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 2);
422 WritePair( rOStm
, maStartPt
);
423 WritePair( rOStm
, maEndPt
); // Version 1
424 WriteLineInfo( rOStm
, maLineInfo
); // Version 2
427 void MetaLineAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
429 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
432 ReadPair( rIStm
, maStartPt
);
433 ReadPair( rIStm
, maEndPt
);
436 if( aCompat
.GetVersion() >= 2 )
438 ReadLineInfo( rIStm
, maLineInfo
);
442 MetaRectAction::MetaRectAction() :
443 MetaAction(MetaActionType::RECT
)
446 MetaRectAction::~MetaRectAction()
449 MetaRectAction::MetaRectAction( const Rectangle
& rRect
) :
450 MetaAction ( MetaActionType::RECT
),
454 void MetaRectAction::Execute( OutputDevice
* pOut
)
456 pOut
->DrawRect( maRect
);
459 MetaAction
* MetaRectAction::Clone()
461 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaRectAction( *this ));
462 pClone
->ResetRefCount();
466 void MetaRectAction::Move( long nHorzMove
, long nVertMove
)
468 maRect
.Move( nHorzMove
, nVertMove
);
471 void MetaRectAction::Scale( double fScaleX
, double fScaleY
)
473 ImplScaleRect( maRect
, fScaleX
, fScaleY
);
476 void MetaRectAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
478 MetaAction::Write(rOStm
, pData
);
479 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
480 WriteRectangle( rOStm
, maRect
);
483 void MetaRectAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
485 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
486 ReadRectangle( rIStm
, maRect
);
489 MetaRoundRectAction::MetaRoundRectAction() :
490 MetaAction ( MetaActionType::ROUNDRECT
),
495 MetaRoundRectAction::~MetaRoundRectAction()
498 MetaRoundRectAction::MetaRoundRectAction( const Rectangle
& rRect
,
499 sal_uInt32 nHorzRound
, sal_uInt32 nVertRound
) :
500 MetaAction ( MetaActionType::ROUNDRECT
),
502 mnHorzRound ( nHorzRound
),
503 mnVertRound ( nVertRound
)
506 void MetaRoundRectAction::Execute( OutputDevice
* pOut
)
508 pOut
->DrawRect( maRect
, mnHorzRound
, mnVertRound
);
511 MetaAction
* MetaRoundRectAction::Clone()
513 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaRoundRectAction( *this ));
514 pClone
->ResetRefCount();
518 void MetaRoundRectAction::Move( long nHorzMove
, long nVertMove
)
520 maRect
.Move( nHorzMove
, nVertMove
);
523 void MetaRoundRectAction::Scale( double fScaleX
, double fScaleY
)
525 ImplScaleRect( maRect
, fScaleX
, fScaleY
);
526 mnHorzRound
= FRound( mnHorzRound
* fabs(fScaleX
) );
527 mnVertRound
= FRound( mnVertRound
* fabs(fScaleY
) );
530 void MetaRoundRectAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
532 MetaAction::Write(rOStm
, pData
);
533 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
534 WriteRectangle( rOStm
, maRect
);
535 rOStm
.WriteUInt32( mnHorzRound
).WriteUInt32( mnVertRound
);
538 void MetaRoundRectAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
540 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
541 ReadRectangle( rIStm
, maRect
).ReadUInt32( mnHorzRound
).ReadUInt32( mnVertRound
);
544 MetaEllipseAction::MetaEllipseAction() :
545 MetaAction(MetaActionType::ELLIPSE
)
548 MetaEllipseAction::~MetaEllipseAction()
551 MetaEllipseAction::MetaEllipseAction( const Rectangle
& rRect
) :
552 MetaAction ( MetaActionType::ELLIPSE
),
556 void MetaEllipseAction::Execute( OutputDevice
* pOut
)
558 pOut
->DrawEllipse( maRect
);
561 MetaAction
* MetaEllipseAction::Clone()
563 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaEllipseAction( *this ));
564 pClone
->ResetRefCount();
568 void MetaEllipseAction::Move( long nHorzMove
, long nVertMove
)
570 maRect
.Move( nHorzMove
, nVertMove
);
573 void MetaEllipseAction::Scale( double fScaleX
, double fScaleY
)
575 ImplScaleRect( maRect
, fScaleX
, fScaleY
);
578 void MetaEllipseAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
580 MetaAction::Write(rOStm
, pData
);
581 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
582 WriteRectangle( rOStm
, maRect
);
585 void MetaEllipseAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
587 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
588 ReadRectangle( rIStm
, maRect
);
591 MetaArcAction::MetaArcAction() :
592 MetaAction(MetaActionType::ARC
)
595 MetaArcAction::~MetaArcAction()
598 MetaArcAction::MetaArcAction( const Rectangle
& rRect
,
599 const Point
& rStart
, const Point
& rEnd
) :
600 MetaAction ( MetaActionType::ARC
),
602 maStartPt ( rStart
),
606 void MetaArcAction::Execute( OutputDevice
* pOut
)
608 pOut
->DrawArc( maRect
, maStartPt
, maEndPt
);
611 MetaAction
* MetaArcAction::Clone()
613 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaArcAction( *this ));
614 pClone
->ResetRefCount();
618 void MetaArcAction::Move( long nHorzMove
, long nVertMove
)
620 maRect
.Move( nHorzMove
, nVertMove
);
621 maStartPt
.Move( nHorzMove
, nVertMove
);
622 maEndPt
.Move( nHorzMove
, nVertMove
);
625 void MetaArcAction::Scale( double fScaleX
, double fScaleY
)
627 ImplScaleRect( maRect
, fScaleX
, fScaleY
);
628 ImplScalePoint( maStartPt
, fScaleX
, fScaleY
);
629 ImplScalePoint( maEndPt
, fScaleX
, fScaleY
);
632 void MetaArcAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
634 MetaAction::Write(rOStm
, pData
);
635 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
636 WriteRectangle( rOStm
, maRect
);
637 WritePair( rOStm
, maStartPt
);
638 WritePair( rOStm
, maEndPt
);
641 void MetaArcAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
643 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
644 ReadRectangle( rIStm
, maRect
);
645 ReadPair( rIStm
, maStartPt
);
646 ReadPair( rIStm
, maEndPt
);
649 MetaPieAction::MetaPieAction() :
650 MetaAction(MetaActionType::PIE
)
653 MetaPieAction::~MetaPieAction()
656 MetaPieAction::MetaPieAction( const Rectangle
& rRect
,
657 const Point
& rStart
, const Point
& rEnd
) :
658 MetaAction ( MetaActionType::PIE
),
660 maStartPt ( rStart
),
664 void MetaPieAction::Execute( OutputDevice
* pOut
)
666 pOut
->DrawPie( maRect
, maStartPt
, maEndPt
);
669 MetaAction
* MetaPieAction::Clone()
671 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaPieAction( *this ));
672 pClone
->ResetRefCount();
676 void MetaPieAction::Move( long nHorzMove
, long nVertMove
)
678 maRect
.Move( nHorzMove
, nVertMove
);
679 maStartPt
.Move( nHorzMove
, nVertMove
);
680 maEndPt
.Move( nHorzMove
, nVertMove
);
683 void MetaPieAction::Scale( double fScaleX
, double fScaleY
)
685 ImplScaleRect( maRect
, fScaleX
, fScaleY
);
686 ImplScalePoint( maStartPt
, fScaleX
, fScaleY
);
687 ImplScalePoint( maEndPt
, fScaleX
, fScaleY
);
690 void MetaPieAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
692 MetaAction::Write(rOStm
, pData
);
693 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
694 WriteRectangle( rOStm
, maRect
);
695 WritePair( rOStm
, maStartPt
);
696 WritePair( rOStm
, maEndPt
);
699 void MetaPieAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
701 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
702 ReadRectangle( rIStm
, maRect
);
703 ReadPair( rIStm
, maStartPt
);
704 ReadPair( rIStm
, maEndPt
);
707 MetaChordAction::MetaChordAction() :
708 MetaAction(MetaActionType::CHORD
)
711 MetaChordAction::~MetaChordAction()
714 MetaChordAction::MetaChordAction( const Rectangle
& rRect
,
715 const Point
& rStart
, const Point
& rEnd
) :
716 MetaAction ( MetaActionType::CHORD
),
718 maStartPt ( rStart
),
722 void MetaChordAction::Execute( OutputDevice
* pOut
)
724 pOut
->DrawChord( maRect
, maStartPt
, maEndPt
);
727 MetaAction
* MetaChordAction::Clone()
729 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaChordAction( *this ));
730 pClone
->ResetRefCount();
734 void MetaChordAction::Move( long nHorzMove
, long nVertMove
)
736 maRect
.Move( nHorzMove
, nVertMove
);
737 maStartPt
.Move( nHorzMove
, nVertMove
);
738 maEndPt
.Move( nHorzMove
, nVertMove
);
741 void MetaChordAction::Scale( double fScaleX
, double fScaleY
)
743 ImplScaleRect( maRect
, fScaleX
, fScaleY
);
744 ImplScalePoint( maStartPt
, fScaleX
, fScaleY
);
745 ImplScalePoint( maEndPt
, fScaleX
, fScaleY
);
748 void MetaChordAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
750 MetaAction::Write(rOStm
, pData
);
751 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
752 WriteRectangle( rOStm
, maRect
);
753 WritePair( rOStm
, maStartPt
);
754 WritePair( rOStm
, maEndPt
);
757 void MetaChordAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
759 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
760 ReadRectangle( rIStm
, maRect
);
761 ReadPair( rIStm
, maStartPt
);
762 ReadPair( rIStm
, maEndPt
);
765 MetaPolyLineAction::MetaPolyLineAction() :
766 MetaAction(MetaActionType::POLYLINE
)
769 MetaPolyLineAction::~MetaPolyLineAction()
772 MetaPolyLineAction::MetaPolyLineAction( const tools::Polygon
& rPoly
) :
773 MetaAction ( MetaActionType::POLYLINE
),
777 MetaPolyLineAction::MetaPolyLineAction( const tools::Polygon
& rPoly
, const LineInfo
& rLineInfo
) :
778 MetaAction ( MetaActionType::POLYLINE
),
779 maLineInfo ( rLineInfo
),
783 void MetaPolyLineAction::Execute( OutputDevice
* pOut
)
785 if( maLineInfo
.IsDefault() )
786 pOut
->DrawPolyLine( maPoly
);
788 pOut
->DrawPolyLine( maPoly
, maLineInfo
);
791 MetaAction
* MetaPolyLineAction::Clone()
793 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaPolyLineAction( *this ));
794 pClone
->ResetRefCount();
798 void MetaPolyLineAction::Move( long nHorzMove
, long nVertMove
)
800 maPoly
.Move( nHorzMove
, nVertMove
);
803 void MetaPolyLineAction::Scale( double fScaleX
, double fScaleY
)
805 ImplScalePoly( maPoly
, fScaleX
, fScaleY
);
806 ImplScaleLineInfo( maLineInfo
, fScaleX
, fScaleY
);
809 void MetaPolyLineAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
811 MetaAction::Write(rOStm
, pData
);
812 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 3);
814 tools::Polygon aSimplePoly
;
815 maPoly
.AdaptiveSubdivide( aSimplePoly
);
817 WritePolygon( rOStm
, aSimplePoly
); // Version 1
818 WriteLineInfo( rOStm
, maLineInfo
); // Version 2
820 bool bHasPolyFlags
= maPoly
.HasFlags(); // Version 3
821 rOStm
.WriteBool( bHasPolyFlags
);
823 maPoly
.Write( rOStm
);
826 void MetaPolyLineAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
828 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
831 ReadPolygon( rIStm
, maPoly
);
834 if( aCompat
.GetVersion() >= 2 )
835 ReadLineInfo( rIStm
, maLineInfo
);
836 if ( aCompat
.GetVersion() >= 3 )
838 sal_uInt8
bHasPolyFlags(0);
839 rIStm
.ReadUChar( bHasPolyFlags
);
841 maPoly
.Read( rIStm
);
845 MetaPolygonAction::MetaPolygonAction() :
846 MetaAction(MetaActionType::POLYGON
)
849 MetaPolygonAction::~MetaPolygonAction()
852 MetaPolygonAction::MetaPolygonAction( const tools::Polygon
& rPoly
) :
853 MetaAction ( MetaActionType::POLYGON
),
857 void MetaPolygonAction::Execute( OutputDevice
* pOut
)
859 pOut
->DrawPolygon( maPoly
);
862 MetaAction
* MetaPolygonAction::Clone()
864 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaPolygonAction( *this ));
865 pClone
->ResetRefCount();
869 void MetaPolygonAction::Move( long nHorzMove
, long nVertMove
)
871 maPoly
.Move( nHorzMove
, nVertMove
);
874 void MetaPolygonAction::Scale( double fScaleX
, double fScaleY
)
876 ImplScalePoly( maPoly
, fScaleX
, fScaleY
);
879 void MetaPolygonAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
881 MetaAction::Write(rOStm
, pData
);
882 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 2);
884 tools::Polygon aSimplePoly
; // Version 1
885 maPoly
.AdaptiveSubdivide( aSimplePoly
);
886 WritePolygon( rOStm
, aSimplePoly
);
888 bool bHasPolyFlags
= maPoly
.HasFlags(); // Version 2
889 rOStm
.WriteBool( bHasPolyFlags
);
891 maPoly
.Write( rOStm
);
894 void MetaPolygonAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
896 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
898 ReadPolygon( rIStm
, maPoly
); // Version 1
900 if( aCompat
.GetVersion() >= 2 ) // Version 2
902 sal_uInt8
bHasPolyFlags(0);
903 rIStm
.ReadUChar( bHasPolyFlags
);
905 maPoly
.Read( rIStm
);
909 MetaPolyPolygonAction::MetaPolyPolygonAction() :
910 MetaAction(MetaActionType::POLYPOLYGON
)
913 MetaPolyPolygonAction::~MetaPolyPolygonAction()
916 MetaPolyPolygonAction::MetaPolyPolygonAction( const tools::PolyPolygon
& rPolyPoly
) :
917 MetaAction ( MetaActionType::POLYPOLYGON
),
918 maPolyPoly ( rPolyPoly
)
921 void MetaPolyPolygonAction::Execute( OutputDevice
* pOut
)
923 pOut
->DrawPolyPolygon( maPolyPoly
);
926 MetaAction
* MetaPolyPolygonAction::Clone()
928 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaPolyPolygonAction( *this ));
929 pClone
->ResetRefCount();
933 void MetaPolyPolygonAction::Move( long nHorzMove
, long nVertMove
)
935 maPolyPoly
.Move( nHorzMove
, nVertMove
);
938 void MetaPolyPolygonAction::Scale( double fScaleX
, double fScaleY
)
940 for( sal_uInt16 i
= 0, nCount
= maPolyPoly
.Count(); i
< nCount
; i
++ )
941 ImplScalePoly( maPolyPoly
[ i
], fScaleX
, fScaleY
);
944 void MetaPolyPolygonAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
946 MetaAction::Write(rOStm
, pData
);
947 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 2);
949 sal_uInt16 nNumberOfComplexPolygons
= 0;
950 sal_uInt16 i
, nPolyCount
= maPolyPoly
.Count();
952 tools::Polygon aSimplePoly
; // Version 1
953 rOStm
.WriteUInt16( nPolyCount
);
954 for ( i
= 0; i
< nPolyCount
; i
++ )
956 const tools::Polygon
& rPoly
= maPolyPoly
.GetObject( i
);
957 if ( rPoly
.HasFlags() )
958 nNumberOfComplexPolygons
++;
959 rPoly
.AdaptiveSubdivide( aSimplePoly
);
960 WritePolygon( rOStm
, aSimplePoly
);
963 rOStm
.WriteUInt16( nNumberOfComplexPolygons
); // Version 2
964 for ( i
= 0; nNumberOfComplexPolygons
&& ( i
< nPolyCount
); i
++ )
966 const tools::Polygon
& rPoly
= maPolyPoly
.GetObject( i
);
967 if ( rPoly
.HasFlags() )
969 rOStm
.WriteUInt16( i
);
970 rPoly
.Write( rOStm
);
972 nNumberOfComplexPolygons
--;
977 void MetaPolyPolygonAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
979 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
980 ReadPolyPolygon( rIStm
, maPolyPoly
); // Version 1
982 if ( aCompat
.GetVersion() >= 2 ) // Version 2
984 sal_uInt16
nNumberOfComplexPolygons(0);
985 rIStm
.ReadUInt16( nNumberOfComplexPolygons
);
986 const size_t nMinRecordSize
= sizeof(sal_uInt16
);
987 const size_t nMaxRecords
= rIStm
.remainingSize() / nMinRecordSize
;
988 if (nNumberOfComplexPolygons
> nMaxRecords
)
990 SAL_WARN("vcl.gdi", "Parsing error: " << nMaxRecords
<<
991 " max possible entries, but " << nNumberOfComplexPolygons
<< " claimed, truncating");
992 nNumberOfComplexPolygons
= nMaxRecords
;
994 for (sal_uInt16 i
= 0; i
< nNumberOfComplexPolygons
; ++i
)
996 sal_uInt16
nIndex(0);
997 rIStm
.ReadUInt16( nIndex
);
998 tools::Polygon aPoly
;
1000 if (nIndex
>= maPolyPoly
.Count())
1002 SAL_WARN("vcl.gdi", "svm contains polygon index " << nIndex
1003 << " outside possible range " << maPolyPoly
.Count());
1006 maPolyPoly
.Replace( aPoly
, nIndex
);
1011 MetaTextAction::MetaTextAction() :
1012 MetaAction ( MetaActionType::TEXT
),
1017 MetaTextAction::~MetaTextAction()
1020 MetaTextAction::MetaTextAction( const Point
& rPt
, const OUString
& rStr
,
1021 sal_Int32 nIndex
, sal_Int32 nLen
) :
1022 MetaAction ( MetaActionType::TEXT
),
1029 void MetaTextAction::Execute( OutputDevice
* pOut
)
1031 pOut
->DrawText( maPt
, maStr
, mnIndex
, mnLen
);
1034 MetaAction
* MetaTextAction::Clone()
1036 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaTextAction( *this ));
1037 pClone
->ResetRefCount();
1041 void MetaTextAction::Move( long nHorzMove
, long nVertMove
)
1043 maPt
.Move( nHorzMove
, nVertMove
);
1046 void MetaTextAction::Scale( double fScaleX
, double fScaleY
)
1048 ImplScalePoint( maPt
, fScaleX
, fScaleY
);
1051 void MetaTextAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1053 MetaAction::Write(rOStm
, pData
);
1054 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 2);
1055 WritePair( rOStm
, maPt
);
1056 rOStm
.WriteUniOrByteString( maStr
, pData
->meActualCharSet
);
1057 rOStm
.WriteUInt16(mnIndex
);
1058 rOStm
.WriteUInt16(mnLen
);
1060 write_uInt16_lenPrefixed_uInt16s_FromOUString(rOStm
, maStr
); // version 2
1063 void MetaTextAction::Read( SvStream
& rIStm
, ImplMetaReadData
* pData
)
1065 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1066 ReadPair( rIStm
, maPt
);
1067 maStr
= rIStm
.ReadUniOrByteString(pData
->meActualCharSet
);
1068 sal_uInt16
nTmpIndex(0);
1069 rIStm
.ReadUInt16(nTmpIndex
);
1070 mnIndex
= nTmpIndex
;
1071 sal_uInt16
nTmpLen(0);
1072 rIStm
.ReadUInt16(nTmpLen
);
1075 if ( aCompat
.GetVersion() >= 2 ) // Version 2
1076 maStr
= read_uInt16_lenPrefixed_uInt16s_ToOUString(rIStm
);
1079 MetaTextArrayAction::MetaTextArrayAction() :
1080 MetaAction ( MetaActionType::TEXTARRAY
),
1081 mpDXAry ( nullptr ),
1086 MetaTextArrayAction::MetaTextArrayAction( const MetaTextArrayAction
& rAction
) :
1087 MetaAction ( MetaActionType::TEXTARRAY
),
1088 maStartPt ( rAction
.maStartPt
),
1089 maStr ( rAction
.maStr
),
1090 mnIndex ( rAction
.mnIndex
),
1091 mnLen ( rAction
.mnLen
)
1093 if( rAction
.mpDXAry
)
1095 const sal_Int32 nAryLen
= mnLen
;
1097 mpDXAry
= new long[ nAryLen
];
1098 memcpy( mpDXAry
, rAction
.mpDXAry
, nAryLen
* sizeof( long ) );
1104 MetaTextArrayAction::MetaTextArrayAction( const Point
& rStartPt
,
1105 const OUString
& rStr
,
1109 MetaAction ( MetaActionType::TEXTARRAY
),
1110 maStartPt ( rStartPt
),
1115 const sal_Int32 nAryLen
= pDXAry
? mnLen
: 0;
1119 mpDXAry
= new long[ nAryLen
];
1120 memcpy( mpDXAry
, pDXAry
, nAryLen
* sizeof(long) );
1126 MetaTextArrayAction::~MetaTextArrayAction()
1131 void MetaTextArrayAction::Execute( OutputDevice
* pOut
)
1133 pOut
->DrawTextArray( maStartPt
, maStr
, mpDXAry
, mnIndex
, mnLen
);
1136 MetaAction
* MetaTextArrayAction::Clone()
1138 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaTextArrayAction( *this ));
1139 pClone
->ResetRefCount();
1143 void MetaTextArrayAction::Move( long nHorzMove
, long nVertMove
)
1145 maStartPt
.Move( nHorzMove
, nVertMove
);
1148 void MetaTextArrayAction::Scale( double fScaleX
, double fScaleY
)
1150 ImplScalePoint( maStartPt
, fScaleX
, fScaleY
);
1152 if ( mpDXAry
&& mnLen
)
1154 for ( sal_uInt16 i
= 0, nCount
= mnLen
; i
< nCount
; i
++ )
1155 mpDXAry
[ i
] = FRound( mpDXAry
[ i
] * fabs(fScaleX
) );
1159 void MetaTextArrayAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1161 const sal_Int32 nAryLen
= mpDXAry
? mnLen
: 0;
1163 MetaAction::Write(rOStm
, pData
);
1164 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 2);
1165 WritePair( rOStm
, maStartPt
);
1166 rOStm
.WriteUniOrByteString( maStr
, pData
->meActualCharSet
);
1167 rOStm
.WriteUInt16(mnIndex
);
1168 rOStm
.WriteUInt16(mnLen
);
1169 rOStm
.WriteInt32(nAryLen
);
1171 for (sal_Int32 i
= 0; i
< nAryLen
; ++i
)
1172 rOStm
.WriteInt32( mpDXAry
[ i
] );
1174 write_uInt16_lenPrefixed_uInt16s_FromOUString(rOStm
, maStr
); // version 2
1177 void MetaTextArrayAction::Read( SvStream
& rIStm
, ImplMetaReadData
* pData
)
1181 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1182 ReadPair( rIStm
, maStartPt
);
1183 maStr
= rIStm
.ReadUniOrByteString(pData
->meActualCharSet
);
1184 sal_uInt16
nTmpIndex(0);
1185 rIStm
.ReadUInt16(nTmpIndex
);
1186 mnIndex
= nTmpIndex
;
1187 sal_uInt16
nTmpLen(0);
1188 rIStm
.ReadUInt16(nTmpLen
);
1190 sal_Int32
nAryLen(0);
1191 rIStm
.ReadInt32(nAryLen
);
1193 if (mnLen
> maStr
.getLength() - mnIndex
)
1202 // #i9762#, #106172# Ensure that DX array is at least mnLen entries long
1203 if ( mnLen
>= nAryLen
)
1205 mpDXAry
= new (std::nothrow
)long[ mnLen
];
1210 for( i
= 0; i
< nAryLen
; i
++ )
1212 rIStm
.ReadInt32( val
);
1215 // #106172# setup remainder
1216 for( ; i
< mnLen
; i
++ )
1229 if ( aCompat
.GetVersion() >= 2 ) // Version 2
1231 maStr
= read_uInt16_lenPrefixed_uInt16s_ToOUString(rIStm
);
1233 if ( mnIndex
+ mnLen
> maStr
.getLength() )
1242 MetaStretchTextAction::MetaStretchTextAction() :
1243 MetaAction ( MetaActionType::STRETCHTEXT
),
1249 MetaStretchTextAction::~MetaStretchTextAction()
1252 MetaStretchTextAction::MetaStretchTextAction( const Point
& rPt
, sal_uInt32 nWidth
,
1253 const OUString
& rStr
,
1254 sal_Int32 nIndex
, sal_Int32 nLen
) :
1255 MetaAction ( MetaActionType::STRETCHTEXT
),
1263 void MetaStretchTextAction::Execute( OutputDevice
* pOut
)
1265 pOut
->DrawStretchText( maPt
, mnWidth
, maStr
, mnIndex
, mnLen
);
1268 MetaAction
* MetaStretchTextAction::Clone()
1270 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaStretchTextAction( *this ));
1271 pClone
->ResetRefCount();
1275 void MetaStretchTextAction::Move( long nHorzMove
, long nVertMove
)
1277 maPt
.Move( nHorzMove
, nVertMove
);
1280 void MetaStretchTextAction::Scale( double fScaleX
, double fScaleY
)
1282 ImplScalePoint( maPt
, fScaleX
, fScaleY
);
1283 mnWidth
= (sal_uLong
)FRound( mnWidth
* fabs(fScaleX
) );
1286 void MetaStretchTextAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1288 MetaAction::Write(rOStm
, pData
);
1289 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 2);
1290 WritePair( rOStm
, maPt
);
1291 rOStm
.WriteUniOrByteString( maStr
, pData
->meActualCharSet
);
1292 rOStm
.WriteUInt32( mnWidth
);
1293 rOStm
.WriteUInt16( mnIndex
);
1294 rOStm
.WriteUInt16( mnLen
);
1296 write_uInt16_lenPrefixed_uInt16s_FromOUString(rOStm
, maStr
); // version 2
1299 void MetaStretchTextAction::Read( SvStream
& rIStm
, ImplMetaReadData
* pData
)
1301 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1302 ReadPair( rIStm
, maPt
);
1303 maStr
= rIStm
.ReadUniOrByteString(pData
->meActualCharSet
);
1304 rIStm
.ReadUInt32( mnWidth
);
1305 sal_uInt16
nTmpIndex(0);
1306 rIStm
.ReadUInt16(nTmpIndex
);
1307 mnIndex
= nTmpIndex
;
1308 sal_uInt16
nTmpLen(0);
1309 rIStm
.ReadUInt16(nTmpLen
);
1312 if ( aCompat
.GetVersion() >= 2 ) // Version 2
1313 maStr
= read_uInt16_lenPrefixed_uInt16s_ToOUString(rIStm
);
1316 MetaTextRectAction::MetaTextRectAction() :
1317 MetaAction ( MetaActionType::TEXTRECT
),
1318 mnStyle ( DrawTextFlags::NONE
)
1321 MetaTextRectAction::~MetaTextRectAction()
1324 MetaTextRectAction::MetaTextRectAction( const Rectangle
& rRect
,
1325 const OUString
& rStr
, DrawTextFlags nStyle
) :
1326 MetaAction ( MetaActionType::TEXTRECT
),
1332 void MetaTextRectAction::Execute( OutputDevice
* pOut
)
1334 pOut
->DrawText( maRect
, maStr
, mnStyle
);
1337 MetaAction
* MetaTextRectAction::Clone()
1339 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaTextRectAction( *this ));
1340 pClone
->ResetRefCount();
1344 void MetaTextRectAction::Move( long nHorzMove
, long nVertMove
)
1346 maRect
.Move( nHorzMove
, nVertMove
);
1349 void MetaTextRectAction::Scale( double fScaleX
, double fScaleY
)
1351 ImplScaleRect( maRect
, fScaleX
, fScaleY
);
1354 void MetaTextRectAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1356 MetaAction::Write(rOStm
, pData
);
1357 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 2);
1358 WriteRectangle( rOStm
, maRect
);
1359 rOStm
.WriteUniOrByteString( maStr
, pData
->meActualCharSet
);
1360 rOStm
.WriteUInt16( static_cast<sal_uInt16
>(mnStyle
) );
1362 write_uInt16_lenPrefixed_uInt16s_FromOUString(rOStm
, maStr
); // version 2
1365 void MetaTextRectAction::Read( SvStream
& rIStm
, ImplMetaReadData
* pData
)
1367 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1368 ReadRectangle( rIStm
, maRect
);
1369 maStr
= rIStm
.ReadUniOrByteString(pData
->meActualCharSet
);
1371 rIStm
.ReadUInt16( nTmp
);
1372 mnStyle
= static_cast<DrawTextFlags
>(nTmp
);
1374 if ( aCompat
.GetVersion() >= 2 ) // Version 2
1375 maStr
= read_uInt16_lenPrefixed_uInt16s_ToOUString(rIStm
);
1378 MetaTextLineAction::MetaTextLineAction() :
1379 MetaAction ( MetaActionType::TEXTLINE
),
1381 meStrikeout ( STRIKEOUT_NONE
),
1382 meUnderline ( LINESTYLE_NONE
),
1383 meOverline ( LINESTYLE_NONE
)
1386 MetaTextLineAction::~MetaTextLineAction()
1389 MetaTextLineAction::MetaTextLineAction( const Point
& rPos
, long nWidth
,
1390 FontStrikeout eStrikeout
,
1391 FontLineStyle eUnderline
,
1392 FontLineStyle eOverline
) :
1393 MetaAction ( MetaActionType::TEXTLINE
),
1396 meStrikeout ( eStrikeout
),
1397 meUnderline ( eUnderline
),
1398 meOverline ( eOverline
)
1401 void MetaTextLineAction::Execute( OutputDevice
* pOut
)
1403 pOut
->DrawTextLine( maPos
, mnWidth
, meStrikeout
, meUnderline
, meOverline
);
1406 MetaAction
* MetaTextLineAction::Clone()
1408 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaTextLineAction( *this ));
1409 pClone
->ResetRefCount();
1413 void MetaTextLineAction::Move( long nHorzMove
, long nVertMove
)
1415 maPos
.Move( nHorzMove
, nVertMove
);
1418 void MetaTextLineAction::Scale( double fScaleX
, double fScaleY
)
1420 ImplScalePoint( maPos
, fScaleX
, fScaleY
);
1421 mnWidth
= FRound( mnWidth
* fabs(fScaleX
) );
1424 void MetaTextLineAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1426 MetaAction::Write(rOStm
, pData
);
1427 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 2);
1429 WritePair( rOStm
, maPos
);
1430 rOStm
.WriteInt32( mnWidth
);
1431 rOStm
.WriteUInt32( meStrikeout
);
1432 rOStm
.WriteUInt32( meUnderline
);
1434 rOStm
.WriteUInt32( meOverline
);
1437 void MetaTextLineAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1439 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1441 sal_Int32
nTempWidth(0);
1442 ReadPair( rIStm
, maPos
);
1443 rIStm
.ReadInt32( nTempWidth
);
1444 mnWidth
= nTempWidth
;
1445 sal_uInt32
nTempStrikeout(0);
1446 rIStm
.ReadUInt32( nTempStrikeout
);
1447 meStrikeout
= (FontStrikeout
)nTempStrikeout
;
1448 sal_uInt32
nTempUnderline(0);
1449 rIStm
.ReadUInt32( nTempUnderline
);
1450 meUnderline
= (FontLineStyle
)nTempUnderline
;
1451 if ( aCompat
.GetVersion() >= 2 ) {
1452 sal_uInt32
nTempUnderline2(0);
1453 rIStm
.ReadUInt32(nTempUnderline2
);
1454 meUnderline
= (FontLineStyle
)nTempUnderline2
;
1458 MetaBmpAction::MetaBmpAction() :
1459 MetaAction(MetaActionType::BMP
)
1462 MetaBmpAction::~MetaBmpAction()
1465 MetaBmpAction::MetaBmpAction( const Point
& rPt
, const Bitmap
& rBmp
) :
1466 MetaAction ( MetaActionType::BMP
),
1471 void MetaBmpAction::Execute( OutputDevice
* pOut
)
1473 pOut
->DrawBitmap( maPt
, maBmp
);
1476 MetaAction
* MetaBmpAction::Clone()
1478 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaBmpAction( *this ));
1479 pClone
->ResetRefCount();
1483 void MetaBmpAction::Move( long nHorzMove
, long nVertMove
)
1485 maPt
.Move( nHorzMove
, nVertMove
);
1488 void MetaBmpAction::Scale( double fScaleX
, double fScaleY
)
1490 ImplScalePoint( maPt
, fScaleX
, fScaleY
);
1493 void MetaBmpAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1497 MetaAction::Write(rOStm
, pData
);
1498 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
1499 WriteDIB(maBmp
, rOStm
, false, true);
1500 WritePair( rOStm
, maPt
);
1504 void MetaBmpAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1506 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1507 ReadDIB(maBmp
, rIStm
, true);
1508 ReadPair( rIStm
, maPt
);
1511 MetaBmpScaleAction::MetaBmpScaleAction() :
1512 MetaAction(MetaActionType::BMPSCALE
)
1515 MetaBmpScaleAction::~MetaBmpScaleAction()
1518 MetaBmpScaleAction::MetaBmpScaleAction( const Point
& rPt
, const Size
& rSz
,
1519 const Bitmap
& rBmp
) :
1520 MetaAction ( MetaActionType::BMPSCALE
),
1526 void MetaBmpScaleAction::Execute( OutputDevice
* pOut
)
1528 pOut
->DrawBitmap( maPt
, maSz
, maBmp
);
1531 MetaAction
* MetaBmpScaleAction::Clone()
1533 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaBmpScaleAction( *this ));
1534 pClone
->ResetRefCount();
1538 void MetaBmpScaleAction::Move( long nHorzMove
, long nVertMove
)
1540 maPt
.Move( nHorzMove
, nVertMove
);
1543 void MetaBmpScaleAction::Scale( double fScaleX
, double fScaleY
)
1545 Rectangle
aRectangle(maPt
, maSz
);
1546 ImplScaleRect( aRectangle
, fScaleX
, fScaleY
);
1547 maPt
= aRectangle
.TopLeft();
1548 maSz
= aRectangle
.GetSize();
1551 void MetaBmpScaleAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1555 MetaAction::Write(rOStm
, pData
);
1556 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
1557 WriteDIB(maBmp
, rOStm
, false, true);
1558 WritePair( rOStm
, maPt
);
1559 WritePair( rOStm
, maSz
);
1563 void MetaBmpScaleAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1565 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1566 ReadDIB(maBmp
, rIStm
, true);
1567 ReadPair( rIStm
, maPt
);
1568 ReadPair( rIStm
, maSz
);
1571 MetaBmpScalePartAction::MetaBmpScalePartAction() :
1572 MetaAction(MetaActionType::BMPSCALEPART
)
1575 MetaBmpScalePartAction::~MetaBmpScalePartAction()
1578 MetaBmpScalePartAction::MetaBmpScalePartAction( const Point
& rDstPt
, const Size
& rDstSz
,
1579 const Point
& rSrcPt
, const Size
& rSrcSz
,
1580 const Bitmap
& rBmp
) :
1581 MetaAction ( MetaActionType::BMPSCALEPART
),
1589 void MetaBmpScalePartAction::Execute( OutputDevice
* pOut
)
1591 pOut
->DrawBitmap( maDstPt
, maDstSz
, maSrcPt
, maSrcSz
, maBmp
);
1594 MetaAction
* MetaBmpScalePartAction::Clone()
1596 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaBmpScalePartAction( *this ));
1597 pClone
->ResetRefCount();
1601 void MetaBmpScalePartAction::Move( long nHorzMove
, long nVertMove
)
1603 maDstPt
.Move( nHorzMove
, nVertMove
);
1606 void MetaBmpScalePartAction::Scale( double fScaleX
, double fScaleY
)
1608 Rectangle
aRectangle(maDstPt
, maDstSz
);
1609 ImplScaleRect( aRectangle
, fScaleX
, fScaleY
);
1610 maDstPt
= aRectangle
.TopLeft();
1611 maDstSz
= aRectangle
.GetSize();
1614 void MetaBmpScalePartAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1618 MetaAction::Write(rOStm
, pData
);
1619 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
1620 WriteDIB(maBmp
, rOStm
, false, true);
1621 WritePair( rOStm
, maDstPt
);
1622 WritePair( rOStm
, maDstSz
);
1623 WritePair( rOStm
, maSrcPt
);
1624 WritePair( rOStm
, maSrcSz
);
1628 void MetaBmpScalePartAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1630 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1631 ReadDIB(maBmp
, rIStm
, true);
1632 ReadPair( rIStm
, maDstPt
);
1633 ReadPair( rIStm
, maDstSz
);
1634 ReadPair( rIStm
, maSrcPt
);
1635 ReadPair( rIStm
, maSrcSz
);
1638 MetaBmpExAction::MetaBmpExAction() :
1639 MetaAction(MetaActionType::BMPEX
)
1642 MetaBmpExAction::~MetaBmpExAction()
1645 MetaBmpExAction::MetaBmpExAction( const Point
& rPt
, const BitmapEx
& rBmpEx
) :
1646 MetaAction ( MetaActionType::BMPEX
),
1651 void MetaBmpExAction::Execute( OutputDevice
* pOut
)
1653 pOut
->DrawBitmapEx( maPt
, maBmpEx
);
1656 MetaAction
* MetaBmpExAction::Clone()
1658 MetaBmpExAction
* pClone
= new MetaBmpExAction( *this );
1659 pClone
->ResetRefCount();
1663 void MetaBmpExAction::Move( long nHorzMove
, long nVertMove
)
1665 maPt
.Move( nHorzMove
, nVertMove
);
1668 void MetaBmpExAction::Scale( double fScaleX
, double fScaleY
)
1670 ImplScalePoint( maPt
, fScaleX
, fScaleY
);
1673 void MetaBmpExAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1675 if( !!maBmpEx
.GetBitmap() )
1677 MetaAction::Write(rOStm
, pData
);
1678 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
1679 WriteDIBBitmapEx(maBmpEx
, rOStm
);
1680 WritePair( rOStm
, maPt
);
1684 void MetaBmpExAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1686 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1687 ReadDIBBitmapEx(maBmpEx
, rIStm
);
1688 ReadPair( rIStm
, maPt
);
1691 MetaBmpExScaleAction::MetaBmpExScaleAction() :
1692 MetaAction(MetaActionType::BMPEXSCALE
)
1695 MetaBmpExScaleAction::~MetaBmpExScaleAction()
1698 MetaBmpExScaleAction::MetaBmpExScaleAction( const Point
& rPt
, const Size
& rSz
,
1699 const BitmapEx
& rBmpEx
) :
1700 MetaAction ( MetaActionType::BMPEXSCALE
),
1706 void MetaBmpExScaleAction::Execute( OutputDevice
* pOut
)
1708 pOut
->DrawBitmapEx( maPt
, maSz
, maBmpEx
);
1711 MetaAction
* MetaBmpExScaleAction::Clone()
1713 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaBmpExScaleAction( *this ));
1714 pClone
->ResetRefCount();
1718 void MetaBmpExScaleAction::Move( long nHorzMove
, long nVertMove
)
1720 maPt
.Move( nHorzMove
, nVertMove
);
1723 void MetaBmpExScaleAction::Scale( double fScaleX
, double fScaleY
)
1725 Rectangle
aRectangle(maPt
, maSz
);
1726 ImplScaleRect( aRectangle
, fScaleX
, fScaleY
);
1727 maPt
= aRectangle
.TopLeft();
1728 maSz
= aRectangle
.GetSize();
1731 void MetaBmpExScaleAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1733 if( !!maBmpEx
.GetBitmap() )
1735 MetaAction::Write(rOStm
, pData
);
1736 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
1737 WriteDIBBitmapEx(maBmpEx
, rOStm
);
1738 WritePair( rOStm
, maPt
);
1739 WritePair( rOStm
, maSz
);
1743 void MetaBmpExScaleAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1745 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1746 ReadDIBBitmapEx(maBmpEx
, rIStm
);
1747 ReadPair( rIStm
, maPt
);
1748 ReadPair( rIStm
, maSz
);
1751 MetaBmpExScalePartAction::MetaBmpExScalePartAction() :
1752 MetaAction(MetaActionType::BMPEXSCALEPART
)
1755 MetaBmpExScalePartAction::~MetaBmpExScalePartAction()
1758 MetaBmpExScalePartAction::MetaBmpExScalePartAction( const Point
& rDstPt
, const Size
& rDstSz
,
1759 const Point
& rSrcPt
, const Size
& rSrcSz
,
1760 const BitmapEx
& rBmpEx
) :
1761 MetaAction ( MetaActionType::BMPEXSCALEPART
),
1769 void MetaBmpExScalePartAction::Execute( OutputDevice
* pOut
)
1771 pOut
->DrawBitmapEx( maDstPt
, maDstSz
, maSrcPt
, maSrcSz
, maBmpEx
);
1774 MetaAction
* MetaBmpExScalePartAction::Clone()
1776 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaBmpExScalePartAction( *this ));
1777 pClone
->ResetRefCount();
1781 void MetaBmpExScalePartAction::Move( long nHorzMove
, long nVertMove
)
1783 maDstPt
.Move( nHorzMove
, nVertMove
);
1786 void MetaBmpExScalePartAction::Scale( double fScaleX
, double fScaleY
)
1788 Rectangle
aRectangle(maDstPt
, maDstSz
);
1789 ImplScaleRect( aRectangle
, fScaleX
, fScaleY
);
1790 maDstPt
= aRectangle
.TopLeft();
1791 maDstSz
= aRectangle
.GetSize();
1794 void MetaBmpExScalePartAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1796 if( !!maBmpEx
.GetBitmap() )
1798 MetaAction::Write(rOStm
, pData
);
1799 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
1800 WriteDIBBitmapEx(maBmpEx
, rOStm
);
1801 WritePair( rOStm
, maDstPt
);
1802 WritePair( rOStm
, maDstSz
);
1803 WritePair( rOStm
, maSrcPt
);
1804 WritePair( rOStm
, maSrcSz
);
1808 void MetaBmpExScalePartAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1810 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1811 ReadDIBBitmapEx(maBmpEx
, rIStm
);
1812 ReadPair( rIStm
, maDstPt
);
1813 ReadPair( rIStm
, maDstSz
);
1814 ReadPair( rIStm
, maSrcPt
);
1815 ReadPair( rIStm
, maSrcSz
);
1818 MetaMaskAction::MetaMaskAction() :
1819 MetaAction(MetaActionType::MASK
)
1822 MetaMaskAction::~MetaMaskAction()
1825 MetaMaskAction::MetaMaskAction( const Point
& rPt
,
1827 const Color
& rColor
) :
1828 MetaAction ( MetaActionType::MASK
),
1834 void MetaMaskAction::Execute( OutputDevice
* pOut
)
1836 pOut
->DrawMask( maPt
, maBmp
, maColor
);
1839 MetaAction
* MetaMaskAction::Clone()
1841 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaMaskAction( *this ));
1842 pClone
->ResetRefCount();
1846 void MetaMaskAction::Move( long nHorzMove
, long nVertMove
)
1848 maPt
.Move( nHorzMove
, nVertMove
);
1851 void MetaMaskAction::Scale( double fScaleX
, double fScaleY
)
1853 ImplScalePoint( maPt
, fScaleX
, fScaleY
);
1856 void MetaMaskAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1860 MetaAction::Write(rOStm
, pData
);
1861 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
1862 WriteDIB(maBmp
, rOStm
, false, true);
1863 WritePair( rOStm
, maPt
);
1867 void MetaMaskAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1869 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1870 ReadDIB(maBmp
, rIStm
, true);
1871 ReadPair( rIStm
, maPt
);
1874 MetaMaskScaleAction::MetaMaskScaleAction() :
1875 MetaAction(MetaActionType::MASKSCALE
)
1878 MetaMaskScaleAction::~MetaMaskScaleAction()
1881 MetaMaskScaleAction::MetaMaskScaleAction( const Point
& rPt
, const Size
& rSz
,
1883 const Color
& rColor
) :
1884 MetaAction ( MetaActionType::MASKSCALE
),
1891 void MetaMaskScaleAction::Execute( OutputDevice
* pOut
)
1893 pOut
->DrawMask( maPt
, maSz
, maBmp
, maColor
);
1896 MetaAction
* MetaMaskScaleAction::Clone()
1898 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaMaskScaleAction( *this ));
1899 pClone
->ResetRefCount();
1903 void MetaMaskScaleAction::Move( long nHorzMove
, long nVertMove
)
1905 maPt
.Move( nHorzMove
, nVertMove
);
1908 void MetaMaskScaleAction::Scale( double fScaleX
, double fScaleY
)
1910 Rectangle
aRectangle(maPt
, maSz
);
1911 ImplScaleRect( aRectangle
, fScaleX
, fScaleY
);
1912 maPt
= aRectangle
.TopLeft();
1913 maSz
= aRectangle
.GetSize();
1916 void MetaMaskScaleAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1920 MetaAction::Write(rOStm
, pData
);
1921 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
1922 WriteDIB(maBmp
, rOStm
, false, true);
1923 WritePair( rOStm
, maPt
);
1924 WritePair( rOStm
, maSz
);
1928 void MetaMaskScaleAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1930 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1931 ReadDIB(maBmp
, rIStm
, true);
1932 ReadPair( rIStm
, maPt
);
1933 ReadPair( rIStm
, maSz
);
1936 MetaMaskScalePartAction::MetaMaskScalePartAction() :
1937 MetaAction(MetaActionType::MASKSCALEPART
)
1940 MetaMaskScalePartAction::~MetaMaskScalePartAction()
1943 MetaMaskScalePartAction::MetaMaskScalePartAction( const Point
& rDstPt
, const Size
& rDstSz
,
1944 const Point
& rSrcPt
, const Size
& rSrcSz
,
1946 const Color
& rColor
) :
1947 MetaAction ( MetaActionType::MASKSCALEPART
),
1956 void MetaMaskScalePartAction::Execute( OutputDevice
* pOut
)
1958 pOut
->DrawMask( maDstPt
, maDstSz
, maSrcPt
, maSrcSz
, maBmp
, maColor
, MetaActionType::MASKSCALE
);
1961 MetaAction
* MetaMaskScalePartAction::Clone()
1963 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaMaskScalePartAction( *this ));
1964 pClone
->ResetRefCount();
1968 void MetaMaskScalePartAction::Move( long nHorzMove
, long nVertMove
)
1970 maDstPt
.Move( nHorzMove
, nVertMove
);
1973 void MetaMaskScalePartAction::Scale( double fScaleX
, double fScaleY
)
1975 Rectangle
aRectangle(maDstPt
, maDstSz
);
1976 ImplScaleRect( aRectangle
, fScaleX
, fScaleY
);
1977 maDstPt
= aRectangle
.TopLeft();
1978 maDstSz
= aRectangle
.GetSize();
1981 void MetaMaskScalePartAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1985 MetaAction::Write(rOStm
, pData
);
1986 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
1987 WriteDIB(maBmp
, rOStm
, false, true);
1988 maColor
.Write( rOStm
);
1989 WritePair( rOStm
, maDstPt
);
1990 WritePair( rOStm
, maDstSz
);
1991 WritePair( rOStm
, maSrcPt
);
1992 WritePair( rOStm
, maSrcSz
);
1996 void MetaMaskScalePartAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1998 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1999 ReadDIB(maBmp
, rIStm
, true);
2000 maColor
.Read( rIStm
);
2001 ReadPair( rIStm
, maDstPt
);
2002 ReadPair( rIStm
, maDstSz
);
2003 ReadPair( rIStm
, maSrcPt
);
2004 ReadPair( rIStm
, maSrcSz
);
2007 MetaGradientAction::MetaGradientAction() :
2008 MetaAction(MetaActionType::GRADIENT
)
2011 MetaGradientAction::~MetaGradientAction()
2014 MetaGradientAction::MetaGradientAction( const Rectangle
& rRect
, const Gradient
& rGradient
) :
2015 MetaAction ( MetaActionType::GRADIENT
),
2017 maGradient ( rGradient
)
2020 void MetaGradientAction::Execute( OutputDevice
* pOut
)
2022 pOut
->DrawGradient( maRect
, maGradient
);
2025 MetaAction
* MetaGradientAction::Clone()
2027 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaGradientAction( *this ));
2028 pClone
->ResetRefCount();
2032 void MetaGradientAction::Move( long nHorzMove
, long nVertMove
)
2034 maRect
.Move( nHorzMove
, nVertMove
);
2037 void MetaGradientAction::Scale( double fScaleX
, double fScaleY
)
2039 ImplScaleRect( maRect
, fScaleX
, fScaleY
);
2042 void MetaGradientAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2044 MetaAction::Write(rOStm
, pData
);
2045 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2046 WriteRectangle( rOStm
, maRect
);
2047 WriteGradient( rOStm
, maGradient
);
2050 void MetaGradientAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2052 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2053 ReadRectangle( rIStm
, maRect
);
2054 ReadGradient( rIStm
, maGradient
);
2057 MetaGradientExAction::MetaGradientExAction() :
2058 MetaAction ( MetaActionType::GRADIENTEX
)
2061 MetaGradientExAction::MetaGradientExAction( const tools::PolyPolygon
& rPolyPoly
, const Gradient
& rGradient
) :
2062 MetaAction ( MetaActionType::GRADIENTEX
),
2063 maPolyPoly ( rPolyPoly
),
2064 maGradient ( rGradient
)
2067 MetaGradientExAction::~MetaGradientExAction()
2070 void MetaGradientExAction::Execute( OutputDevice
* pOut
)
2072 if( pOut
->GetConnectMetaFile() )
2075 pOut
->GetConnectMetaFile()->AddAction( this );
2079 MetaAction
* MetaGradientExAction::Clone()
2081 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaGradientExAction( *this ));
2082 pClone
->ResetRefCount();
2086 void MetaGradientExAction::Move( long nHorzMove
, long nVertMove
)
2088 maPolyPoly
.Move( nHorzMove
, nVertMove
);
2091 void MetaGradientExAction::Scale( double fScaleX
, double fScaleY
)
2093 for( sal_uInt16 i
= 0, nCount
= maPolyPoly
.Count(); i
< nCount
; i
++ )
2094 ImplScalePoly( maPolyPoly
[ i
], fScaleX
, fScaleY
);
2097 void MetaGradientExAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2099 MetaAction::Write(rOStm
, pData
);
2100 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2102 // #i105373# see comment at MetaTransparentAction::Write
2103 tools::PolyPolygon aNoCurvePolyPolygon
;
2104 maPolyPoly
.AdaptiveSubdivide(aNoCurvePolyPolygon
);
2106 WritePolyPolygon( rOStm
, aNoCurvePolyPolygon
);
2107 WriteGradient( rOStm
, maGradient
);
2110 void MetaGradientExAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2112 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2113 ReadPolyPolygon( rIStm
, maPolyPoly
);
2114 ReadGradient( rIStm
, maGradient
);
2117 MetaHatchAction::MetaHatchAction() :
2118 MetaAction(MetaActionType::HATCH
)
2121 MetaHatchAction::~MetaHatchAction()
2124 MetaHatchAction::MetaHatchAction( const tools::PolyPolygon
& rPolyPoly
, const Hatch
& rHatch
) :
2125 MetaAction ( MetaActionType::HATCH
),
2126 maPolyPoly ( rPolyPoly
),
2130 void MetaHatchAction::Execute( OutputDevice
* pOut
)
2132 pOut
->DrawHatch( maPolyPoly
, maHatch
);
2135 MetaAction
* MetaHatchAction::Clone()
2137 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaHatchAction( *this ));
2138 pClone
->ResetRefCount();
2142 void MetaHatchAction::Move( long nHorzMove
, long nVertMove
)
2144 maPolyPoly
.Move( nHorzMove
, nVertMove
);
2147 void MetaHatchAction::Scale( double fScaleX
, double fScaleY
)
2149 for( sal_uInt16 i
= 0, nCount
= maPolyPoly
.Count(); i
< nCount
; i
++ )
2150 ImplScalePoly( maPolyPoly
[ i
], fScaleX
, fScaleY
);
2153 void MetaHatchAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2155 MetaAction::Write(rOStm
, pData
);
2156 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2158 // #i105373# see comment at MetaTransparentAction::Write
2159 tools::PolyPolygon aNoCurvePolyPolygon
;
2160 maPolyPoly
.AdaptiveSubdivide(aNoCurvePolyPolygon
);
2162 WritePolyPolygon( rOStm
, aNoCurvePolyPolygon
);
2163 WriteHatch( rOStm
, maHatch
);
2166 void MetaHatchAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2168 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2169 ReadPolyPolygon( rIStm
, maPolyPoly
);
2170 ReadHatch( rIStm
, maHatch
);
2173 MetaWallpaperAction::MetaWallpaperAction() :
2174 MetaAction(MetaActionType::WALLPAPER
)
2177 MetaWallpaperAction::~MetaWallpaperAction()
2180 MetaWallpaperAction::MetaWallpaperAction( const Rectangle
& rRect
,
2181 const Wallpaper
& rPaper
) :
2182 MetaAction ( MetaActionType::WALLPAPER
),
2184 maWallpaper ( rPaper
)
2187 void MetaWallpaperAction::Execute( OutputDevice
* pOut
)
2189 pOut
->DrawWallpaper( maRect
, maWallpaper
);
2192 MetaAction
* MetaWallpaperAction::Clone()
2194 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaWallpaperAction( *this ));
2195 pClone
->ResetRefCount();
2199 void MetaWallpaperAction::Move( long nHorzMove
, long nVertMove
)
2201 maRect
.Move( nHorzMove
, nVertMove
);
2204 void MetaWallpaperAction::Scale( double fScaleX
, double fScaleY
)
2206 ImplScaleRect( maRect
, fScaleX
, fScaleY
);
2209 void MetaWallpaperAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2211 MetaAction::Write(rOStm
, pData
);
2212 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2214 WriteWallpaper( rOStm
, maWallpaper
);
2217 void MetaWallpaperAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2219 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2220 ReadWallpaper( rIStm
, maWallpaper
);
2223 MetaClipRegionAction::MetaClipRegionAction() :
2224 MetaAction ( MetaActionType::CLIPREGION
),
2228 MetaClipRegionAction::~MetaClipRegionAction()
2231 MetaClipRegionAction::MetaClipRegionAction( const vcl::Region
& rRegion
, bool bClip
) :
2232 MetaAction ( MetaActionType::CLIPREGION
),
2233 maRegion ( rRegion
),
2237 void MetaClipRegionAction::Execute( OutputDevice
* pOut
)
2240 pOut
->SetClipRegion( maRegion
);
2242 pOut
->SetClipRegion();
2245 MetaAction
* MetaClipRegionAction::Clone()
2247 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaClipRegionAction( *this ));
2248 pClone
->ResetRefCount();
2252 void MetaClipRegionAction::Move( long nHorzMove
, long nVertMove
)
2254 maRegion
.Move( nHorzMove
, nVertMove
);
2257 void MetaClipRegionAction::Scale( double fScaleX
, double fScaleY
)
2259 maRegion
.Scale( fScaleX
, fScaleY
);
2262 void MetaClipRegionAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2264 MetaAction::Write(rOStm
, pData
);
2265 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2267 WriteRegion( rOStm
, maRegion
);
2268 rOStm
.WriteBool( mbClip
);
2271 void MetaClipRegionAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2273 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2274 ReadRegion( rIStm
, maRegion
);
2275 rIStm
.ReadCharAsBool( mbClip
);
2278 MetaISectRectClipRegionAction::MetaISectRectClipRegionAction() :
2279 MetaAction(MetaActionType::ISECTRECTCLIPREGION
)
2282 MetaISectRectClipRegionAction::~MetaISectRectClipRegionAction()
2285 MetaISectRectClipRegionAction::MetaISectRectClipRegionAction( const Rectangle
& rRect
) :
2286 MetaAction ( MetaActionType::ISECTRECTCLIPREGION
),
2290 void MetaISectRectClipRegionAction::Execute( OutputDevice
* pOut
)
2292 pOut
->IntersectClipRegion( maRect
);
2295 MetaAction
* MetaISectRectClipRegionAction::Clone()
2297 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaISectRectClipRegionAction( *this ));
2298 pClone
->ResetRefCount();
2302 void MetaISectRectClipRegionAction::Move( long nHorzMove
, long nVertMove
)
2304 maRect
.Move( nHorzMove
, nVertMove
);
2307 void MetaISectRectClipRegionAction::Scale( double fScaleX
, double fScaleY
)
2309 ImplScaleRect( maRect
, fScaleX
, fScaleY
);
2312 void MetaISectRectClipRegionAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2314 MetaAction::Write(rOStm
, pData
);
2315 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2316 WriteRectangle( rOStm
, maRect
);
2319 void MetaISectRectClipRegionAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2321 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2322 ReadRectangle( rIStm
, maRect
);
2325 MetaISectRegionClipRegionAction::MetaISectRegionClipRegionAction() :
2326 MetaAction(MetaActionType::ISECTREGIONCLIPREGION
)
2329 MetaISectRegionClipRegionAction::~MetaISectRegionClipRegionAction()
2332 MetaISectRegionClipRegionAction::MetaISectRegionClipRegionAction( const vcl::Region
& rRegion
) :
2333 MetaAction ( MetaActionType::ISECTREGIONCLIPREGION
),
2334 maRegion ( rRegion
)
2338 void MetaISectRegionClipRegionAction::Execute( OutputDevice
* pOut
)
2340 pOut
->IntersectClipRegion( maRegion
);
2343 MetaAction
* MetaISectRegionClipRegionAction::Clone()
2345 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaISectRegionClipRegionAction( *this ));
2346 pClone
->ResetRefCount();
2350 void MetaISectRegionClipRegionAction::Move( long nHorzMove
, long nVertMove
)
2352 maRegion
.Move( nHorzMove
, nVertMove
);
2355 void MetaISectRegionClipRegionAction::Scale( double fScaleX
, double fScaleY
)
2357 maRegion
.Scale( fScaleX
, fScaleY
);
2360 void MetaISectRegionClipRegionAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2362 MetaAction::Write(rOStm
, pData
);
2363 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2364 WriteRegion( rOStm
, maRegion
);
2367 void MetaISectRegionClipRegionAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2369 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2370 ReadRegion( rIStm
, maRegion
);
2373 MetaMoveClipRegionAction::MetaMoveClipRegionAction() :
2374 MetaAction ( MetaActionType::MOVECLIPREGION
),
2379 MetaMoveClipRegionAction::~MetaMoveClipRegionAction()
2382 MetaMoveClipRegionAction::MetaMoveClipRegionAction( long nHorzMove
, long nVertMove
) :
2383 MetaAction ( MetaActionType::MOVECLIPREGION
),
2384 mnHorzMove ( nHorzMove
),
2385 mnVertMove ( nVertMove
)
2388 void MetaMoveClipRegionAction::Execute( OutputDevice
* pOut
)
2390 pOut
->MoveClipRegion( mnHorzMove
, mnVertMove
);
2393 MetaAction
* MetaMoveClipRegionAction::Clone()
2395 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaMoveClipRegionAction( *this ));
2396 pClone
->ResetRefCount();
2400 void MetaMoveClipRegionAction::Scale( double fScaleX
, double fScaleY
)
2402 mnHorzMove
= FRound( mnHorzMove
* fScaleX
);
2403 mnVertMove
= FRound( mnVertMove
* fScaleY
);
2406 void MetaMoveClipRegionAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2408 MetaAction::Write(rOStm
, pData
);
2409 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2410 rOStm
.WriteInt32( mnHorzMove
).WriteInt32( mnVertMove
);
2413 void MetaMoveClipRegionAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2415 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2416 sal_Int32
nTmpHM(0), nTmpVM(0);
2417 rIStm
.ReadInt32( nTmpHM
).ReadInt32( nTmpVM
);
2418 mnHorzMove
= nTmpHM
;
2419 mnVertMove
= nTmpVM
;
2422 MetaLineColorAction::MetaLineColorAction() :
2423 MetaAction ( MetaActionType::LINECOLOR
),
2427 MetaLineColorAction::~MetaLineColorAction()
2430 MetaLineColorAction::MetaLineColorAction( const Color
& rColor
, bool bSet
) :
2431 MetaAction ( MetaActionType::LINECOLOR
),
2436 void MetaLineColorAction::Execute( OutputDevice
* pOut
)
2439 pOut
->SetLineColor( maColor
);
2441 pOut
->SetLineColor();
2444 MetaAction
* MetaLineColorAction::Clone()
2446 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaLineColorAction( *this ));
2447 pClone
->ResetRefCount();
2451 void MetaLineColorAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2453 MetaAction::Write(rOStm
, pData
);
2454 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2455 maColor
.Write( rOStm
);
2456 rOStm
.WriteBool( mbSet
);
2459 void MetaLineColorAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2461 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2462 maColor
.Read( rIStm
);
2463 rIStm
.ReadCharAsBool( mbSet
);
2466 MetaFillColorAction::MetaFillColorAction() :
2467 MetaAction ( MetaActionType::FILLCOLOR
),
2471 MetaFillColorAction::~MetaFillColorAction()
2474 MetaFillColorAction::MetaFillColorAction( const Color
& rColor
, bool bSet
) :
2475 MetaAction ( MetaActionType::FILLCOLOR
),
2480 void MetaFillColorAction::Execute( OutputDevice
* pOut
)
2483 pOut
->SetFillColor( maColor
);
2485 pOut
->SetFillColor();
2488 MetaAction
* MetaFillColorAction::Clone()
2490 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaFillColorAction( *this ));
2491 pClone
->ResetRefCount();
2495 void MetaFillColorAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2497 MetaAction::Write(rOStm
, pData
);
2498 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2499 maColor
.Write( rOStm
);
2500 rOStm
.WriteBool( mbSet
);
2503 void MetaFillColorAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2505 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2506 maColor
.Read( rIStm
);
2507 rIStm
.ReadCharAsBool( mbSet
);
2510 MetaTextColorAction::MetaTextColorAction() :
2511 MetaAction(MetaActionType::TEXTCOLOR
)
2514 MetaTextColorAction::~MetaTextColorAction()
2517 MetaTextColorAction::MetaTextColorAction( const Color
& rColor
) :
2518 MetaAction ( MetaActionType::TEXTCOLOR
),
2522 void MetaTextColorAction::Execute( OutputDevice
* pOut
)
2524 pOut
->SetTextColor( maColor
);
2527 MetaAction
* MetaTextColorAction::Clone()
2529 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaTextColorAction( *this ));
2530 pClone
->ResetRefCount();
2534 void MetaTextColorAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2536 MetaAction::Write(rOStm
, pData
);
2537 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2538 maColor
.Write( rOStm
);
2541 void MetaTextColorAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2543 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2544 maColor
.Read( rIStm
);
2547 MetaTextFillColorAction::MetaTextFillColorAction() :
2548 MetaAction ( MetaActionType::TEXTFILLCOLOR
),
2552 MetaTextFillColorAction::~MetaTextFillColorAction()
2555 MetaTextFillColorAction::MetaTextFillColorAction( const Color
& rColor
, bool bSet
) :
2556 MetaAction ( MetaActionType::TEXTFILLCOLOR
),
2561 void MetaTextFillColorAction::Execute( OutputDevice
* pOut
)
2564 pOut
->SetTextFillColor( maColor
);
2566 pOut
->SetTextFillColor();
2569 MetaAction
* MetaTextFillColorAction::Clone()
2571 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaTextFillColorAction( *this ));
2572 pClone
->ResetRefCount();
2576 void MetaTextFillColorAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2578 MetaAction::Write(rOStm
, pData
);
2579 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2580 maColor
.Write( rOStm
);
2581 rOStm
.WriteBool( mbSet
);
2584 void MetaTextFillColorAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2586 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2587 maColor
.Read( rIStm
);
2588 rIStm
.ReadCharAsBool( mbSet
);
2591 MetaTextLineColorAction::MetaTextLineColorAction() :
2592 MetaAction ( MetaActionType::TEXTLINECOLOR
),
2596 MetaTextLineColorAction::~MetaTextLineColorAction()
2599 MetaTextLineColorAction::MetaTextLineColorAction( const Color
& rColor
, bool bSet
) :
2600 MetaAction ( MetaActionType::TEXTLINECOLOR
),
2605 void MetaTextLineColorAction::Execute( OutputDevice
* pOut
)
2608 pOut
->SetTextLineColor( maColor
);
2610 pOut
->SetTextLineColor();
2613 MetaAction
* MetaTextLineColorAction::Clone()
2615 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaTextLineColorAction( *this ));
2616 pClone
->ResetRefCount();
2620 void MetaTextLineColorAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2622 MetaAction::Write(rOStm
, pData
);
2623 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2624 maColor
.Write( rOStm
);
2625 rOStm
.WriteBool( mbSet
);
2628 void MetaTextLineColorAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2630 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2631 maColor
.Read( rIStm
);
2632 rIStm
.ReadCharAsBool( mbSet
);
2635 MetaOverlineColorAction::MetaOverlineColorAction() :
2636 MetaAction ( MetaActionType::OVERLINECOLOR
),
2640 MetaOverlineColorAction::~MetaOverlineColorAction()
2643 MetaOverlineColorAction::MetaOverlineColorAction( const Color
& rColor
, bool bSet
) :
2644 MetaAction ( MetaActionType::OVERLINECOLOR
),
2649 void MetaOverlineColorAction::Execute( OutputDevice
* pOut
)
2652 pOut
->SetOverlineColor( maColor
);
2654 pOut
->SetOverlineColor();
2657 MetaAction
* MetaOverlineColorAction::Clone()
2659 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaOverlineColorAction( *this ));
2660 pClone
->ResetRefCount();
2664 void MetaOverlineColorAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2666 MetaAction::Write(rOStm
, pData
);
2667 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2668 maColor
.Write( rOStm
);
2669 rOStm
.WriteBool( mbSet
);
2672 void MetaOverlineColorAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2674 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2675 maColor
.Read( rIStm
);
2676 rIStm
.ReadCharAsBool( mbSet
);
2679 MetaTextAlignAction::MetaTextAlignAction() :
2680 MetaAction ( MetaActionType::TEXTALIGN
),
2681 maAlign ( ALIGN_TOP
)
2684 MetaTextAlignAction::~MetaTextAlignAction()
2687 MetaTextAlignAction::MetaTextAlignAction( TextAlign aAlign
) :
2688 MetaAction ( MetaActionType::TEXTALIGN
),
2692 void MetaTextAlignAction::Execute( OutputDevice
* pOut
)
2694 pOut
->SetTextAlign( maAlign
);
2697 MetaAction
* MetaTextAlignAction::Clone()
2699 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaTextAlignAction( *this ));
2700 pClone
->ResetRefCount();
2704 void MetaTextAlignAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2706 MetaAction::Write(rOStm
, pData
);
2707 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2708 rOStm
.WriteUInt16( maAlign
);
2711 void MetaTextAlignAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2713 sal_uInt16
nTmp16(0);
2715 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2716 rIStm
.ReadUInt16( nTmp16
); maAlign
= (TextAlign
) nTmp16
;
2719 MetaMapModeAction::MetaMapModeAction() :
2720 MetaAction(MetaActionType::MAPMODE
)
2723 MetaMapModeAction::~MetaMapModeAction()
2726 MetaMapModeAction::MetaMapModeAction( const MapMode
& rMapMode
) :
2727 MetaAction ( MetaActionType::MAPMODE
),
2728 maMapMode ( rMapMode
)
2731 void MetaMapModeAction::Execute( OutputDevice
* pOut
)
2733 pOut
->SetMapMode( maMapMode
);
2736 MetaAction
* MetaMapModeAction::Clone()
2738 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaMapModeAction( *this ));
2739 pClone
->ResetRefCount();
2743 void MetaMapModeAction::Scale( double fScaleX
, double fScaleY
)
2745 Point
aPoint( maMapMode
.GetOrigin() );
2747 ImplScalePoint( aPoint
, fScaleX
, fScaleY
);
2748 maMapMode
.SetOrigin( aPoint
);
2751 void MetaMapModeAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2753 MetaAction::Write(rOStm
, pData
);
2754 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2755 WriteMapMode( rOStm
, maMapMode
);
2758 void MetaMapModeAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2760 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2761 ReadMapMode( rIStm
, maMapMode
);
2764 MetaFontAction::MetaFontAction() :
2765 MetaAction(MetaActionType::FONT
)
2768 MetaFontAction::~MetaFontAction()
2771 MetaFontAction::MetaFontAction( const vcl::Font
& rFont
) :
2772 MetaAction ( MetaActionType::FONT
),
2775 // #96876: because RTL_TEXTENCODING_SYMBOL is often set at the StarSymbol font,
2776 // we change the textencoding to RTL_TEXTENCODING_UNICODE here, which seems
2777 // to be the right way; changing the textencoding at other sources
2778 // is too dangerous at the moment
2779 if ( IsStarSymbol( maFont
.GetFamilyName() )
2780 && ( maFont
.GetCharSet() != RTL_TEXTENCODING_UNICODE
) )
2782 maFont
.SetCharSet( RTL_TEXTENCODING_UNICODE
);
2786 void MetaFontAction::Execute( OutputDevice
* pOut
)
2788 pOut
->SetFont( maFont
);
2791 MetaAction
* MetaFontAction::Clone()
2793 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaFontAction( *this ));
2794 pClone
->ResetRefCount();
2798 void MetaFontAction::Scale( double fScaleX
, double fScaleY
)
2801 FRound(maFont
.GetFontSize().Width() * fabs(fScaleX
)),
2802 FRound(maFont
.GetFontSize().Height() * fabs(fScaleY
)));
2803 maFont
.SetFontSize( aSize
);
2806 void MetaFontAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2808 MetaAction::Write(rOStm
, pData
);
2809 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2810 WriteFont( rOStm
, maFont
);
2811 pData
->meActualCharSet
= maFont
.GetCharSet();
2812 if ( pData
->meActualCharSet
== RTL_TEXTENCODING_DONTKNOW
)
2813 pData
->meActualCharSet
= osl_getThreadTextEncoding();
2816 void MetaFontAction::Read( SvStream
& rIStm
, ImplMetaReadData
* pData
)
2818 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2819 ReadFont( rIStm
, maFont
);
2820 pData
->meActualCharSet
= maFont
.GetCharSet();
2821 if ( pData
->meActualCharSet
== RTL_TEXTENCODING_DONTKNOW
)
2822 pData
->meActualCharSet
= osl_getThreadTextEncoding();
2825 MetaPushAction::MetaPushAction() :
2826 MetaAction ( MetaActionType::PUSH
),
2827 mnFlags ( PushFlags::NONE
)
2830 MetaPushAction::~MetaPushAction()
2833 MetaPushAction::MetaPushAction( PushFlags nFlags
) :
2834 MetaAction ( MetaActionType::PUSH
),
2838 void MetaPushAction::Execute( OutputDevice
* pOut
)
2840 pOut
->Push( mnFlags
);
2843 MetaAction
* MetaPushAction::Clone()
2845 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaPushAction( *this ));
2846 pClone
->ResetRefCount();
2850 void MetaPushAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2852 MetaAction::Write(rOStm
, pData
);
2853 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2854 rOStm
.WriteUInt16( static_cast<sal_uInt16
>(mnFlags
) );
2857 void MetaPushAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2859 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2861 rIStm
.ReadUInt16( tmp
);
2862 mnFlags
= static_cast<PushFlags
>(tmp
);
2865 MetaPopAction::MetaPopAction() :
2866 MetaAction(MetaActionType::POP
)
2869 MetaPopAction::~MetaPopAction()
2872 void MetaPopAction::Execute( OutputDevice
* pOut
)
2877 MetaAction
* MetaPopAction::Clone()
2879 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaPopAction( *this ));
2880 pClone
->ResetRefCount();
2884 void MetaPopAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2886 MetaAction::Write(rOStm
, pData
);
2887 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2890 void MetaPopAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2892 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2895 MetaRasterOpAction::MetaRasterOpAction() :
2896 MetaAction ( MetaActionType::RASTEROP
),
2897 meRasterOp ( ROP_OVERPAINT
)
2900 MetaRasterOpAction::~MetaRasterOpAction()
2903 MetaRasterOpAction::MetaRasterOpAction( RasterOp eRasterOp
) :
2904 MetaAction ( MetaActionType::RASTEROP
),
2905 meRasterOp ( eRasterOp
)
2909 void MetaRasterOpAction::Execute( OutputDevice
* pOut
)
2911 pOut
->SetRasterOp( meRasterOp
);
2914 MetaAction
* MetaRasterOpAction::Clone()
2916 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaRasterOpAction( *this ));
2917 pClone
->ResetRefCount();
2921 void MetaRasterOpAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2923 MetaAction::Write(rOStm
, pData
);
2924 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2925 rOStm
.WriteUInt16( meRasterOp
);
2928 void MetaRasterOpAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2930 sal_uInt16
nTmp16(0);
2932 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2933 rIStm
.ReadUInt16( nTmp16
); meRasterOp
= (RasterOp
) nTmp16
;
2936 MetaTransparentAction::MetaTransparentAction() :
2937 MetaAction ( MetaActionType::Transparent
),
2938 mnTransPercent ( 0 )
2941 MetaTransparentAction::~MetaTransparentAction()
2944 MetaTransparentAction::MetaTransparentAction( const tools::PolyPolygon
& rPolyPoly
, sal_uInt16 nTransPercent
) :
2945 MetaAction ( MetaActionType::Transparent
),
2946 maPolyPoly ( rPolyPoly
),
2947 mnTransPercent ( nTransPercent
)
2950 void MetaTransparentAction::Execute( OutputDevice
* pOut
)
2952 pOut
->DrawTransparent( maPolyPoly
, mnTransPercent
);
2955 MetaAction
* MetaTransparentAction::Clone()
2957 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaTransparentAction( *this ));
2958 pClone
->ResetRefCount();
2962 void MetaTransparentAction::Move( long nHorzMove
, long nVertMove
)
2964 maPolyPoly
.Move( nHorzMove
, nVertMove
);
2967 void MetaTransparentAction::Scale( double fScaleX
, double fScaleY
)
2969 for( sal_uInt16 i
= 0, nCount
= maPolyPoly
.Count(); i
< nCount
; i
++ )
2970 ImplScalePoly( maPolyPoly
[ i
], fScaleX
, fScaleY
);
2973 void MetaTransparentAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2975 MetaAction::Write(rOStm
, pData
);
2976 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2978 // #i105373# The tools::PolyPolygon in this action may be a curve; this
2979 // was ignored until now what is an error. To make older office
2980 // versions work with MetaFiles, i opt for applying AdaptiveSubdivide
2981 // to the PolyPoylgon.
2982 // The alternative would be to really write the curve information
2983 // like in MetaPolyPolygonAction::Write (where someone extended it
2984 // correctly, but not here :-( ).
2985 // The golden solution would be to combine both, but i think it's
2986 // not necessary; a good subdivision will be sufficient.
2987 tools::PolyPolygon aNoCurvePolyPolygon
;
2988 maPolyPoly
.AdaptiveSubdivide(aNoCurvePolyPolygon
);
2990 WritePolyPolygon( rOStm
, aNoCurvePolyPolygon
);
2991 rOStm
.WriteUInt16( mnTransPercent
);
2994 void MetaTransparentAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2996 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2997 ReadPolyPolygon( rIStm
, maPolyPoly
);
2998 rIStm
.ReadUInt16( mnTransPercent
);
3001 MetaFloatTransparentAction::MetaFloatTransparentAction() :
3002 MetaAction(MetaActionType::FLOATTRANSPARENT
)
3005 MetaFloatTransparentAction::~MetaFloatTransparentAction()
3008 MetaFloatTransparentAction::MetaFloatTransparentAction( const GDIMetaFile
& rMtf
, const Point
& rPos
,
3009 const Size
& rSize
, const Gradient
& rGradient
) :
3010 MetaAction ( MetaActionType::FLOATTRANSPARENT
),
3014 maGradient ( rGradient
)
3017 void MetaFloatTransparentAction::Execute( OutputDevice
* pOut
)
3019 pOut
->DrawTransparent( maMtf
, maPoint
, maSize
, maGradient
);
3022 MetaAction
* MetaFloatTransparentAction::Clone()
3024 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaFloatTransparentAction( *this ));
3025 pClone
->ResetRefCount();
3029 void MetaFloatTransparentAction::Move( long nHorzMove
, long nVertMove
)
3031 maPoint
.Move( nHorzMove
, nVertMove
);
3034 void MetaFloatTransparentAction::Scale( double fScaleX
, double fScaleY
)
3036 Rectangle
aRectangle(maPoint
, maSize
);
3037 ImplScaleRect( aRectangle
, fScaleX
, fScaleY
);
3038 maPoint
= aRectangle
.TopLeft();
3039 maSize
= aRectangle
.GetSize();
3042 void MetaFloatTransparentAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
3044 MetaAction::Write(rOStm
, pData
);
3045 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
3047 maMtf
.Write( rOStm
);
3048 WritePair( rOStm
, maPoint
);
3049 WritePair( rOStm
, maSize
);
3050 WriteGradient( rOStm
, maGradient
);
3053 void MetaFloatTransparentAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
3055 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
3056 ReadGDIMetaFile( rIStm
, maMtf
);
3057 ReadPair( rIStm
, maPoint
);
3058 ReadPair( rIStm
, maSize
);
3059 ReadGradient( rIStm
, maGradient
);
3062 MetaEPSAction::MetaEPSAction() :
3063 MetaAction(MetaActionType::EPS
)
3066 MetaEPSAction::~MetaEPSAction()
3069 MetaEPSAction::MetaEPSAction( const Point
& rPoint
, const Size
& rSize
,
3070 const GfxLink
& rGfxLink
, const GDIMetaFile
& rSubst
) :
3071 MetaAction ( MetaActionType::EPS
),
3072 maGfxLink ( rGfxLink
),
3078 void MetaEPSAction::Execute( OutputDevice
* pOut
)
3080 pOut
->DrawEPS( maPoint
, maSize
, maGfxLink
, &maSubst
);
3083 MetaAction
* MetaEPSAction::Clone()
3085 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaEPSAction( *this ));
3086 pClone
->ResetRefCount();
3090 void MetaEPSAction::Move( long nHorzMove
, long nVertMove
)
3092 maPoint
.Move( nHorzMove
, nVertMove
);
3095 void MetaEPSAction::Scale( double fScaleX
, double fScaleY
)
3097 Rectangle
aRectangle(maPoint
, maSize
);
3098 ImplScaleRect( aRectangle
, fScaleX
, fScaleY
);
3099 maPoint
= aRectangle
.TopLeft();
3100 maSize
= aRectangle
.GetSize();
3103 void MetaEPSAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
3105 MetaAction::Write(rOStm
, pData
);
3106 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
3108 WriteGfxLink( rOStm
, maGfxLink
);
3109 WritePair( rOStm
, maPoint
);
3110 WritePair( rOStm
, maSize
);
3111 maSubst
.Write( rOStm
);
3114 void MetaEPSAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
3116 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
3117 ReadGfxLink( rIStm
, maGfxLink
);
3118 ReadPair( rIStm
, maPoint
);
3119 ReadPair( rIStm
, maSize
);
3120 ReadGDIMetaFile( rIStm
, maSubst
);
3123 MetaRefPointAction::MetaRefPointAction() :
3124 MetaAction ( MetaActionType::REFPOINT
),
3128 MetaRefPointAction::~MetaRefPointAction()
3131 MetaRefPointAction::MetaRefPointAction( const Point
& rRefPoint
, bool bSet
) :
3132 MetaAction ( MetaActionType::REFPOINT
),
3133 maRefPoint ( rRefPoint
),
3137 void MetaRefPointAction::Execute( OutputDevice
* pOut
)
3140 pOut
->SetRefPoint( maRefPoint
);
3142 pOut
->SetRefPoint();
3145 MetaAction
* MetaRefPointAction::Clone()
3147 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaRefPointAction( *this ));
3148 pClone
->ResetRefCount();
3152 void MetaRefPointAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
3154 MetaAction::Write(rOStm
, pData
);
3155 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
3157 WritePair( rOStm
, maRefPoint
);
3158 rOStm
.WriteBool( mbSet
);
3161 void MetaRefPointAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
3163 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
3164 ReadPair( rIStm
, maRefPoint
).ReadCharAsBool( mbSet
);
3167 MetaCommentAction::MetaCommentAction() :
3168 MetaAction ( MetaActionType::COMMENT
),
3171 ImplInitDynamicData( nullptr, 0UL );
3174 MetaCommentAction::MetaCommentAction( const MetaCommentAction
& rAct
) :
3175 MetaAction ( MetaActionType::COMMENT
),
3176 maComment ( rAct
.maComment
),
3177 mnValue ( rAct
.mnValue
)
3179 ImplInitDynamicData( rAct
.mpData
, rAct
.mnDataSize
);
3182 MetaCommentAction::MetaCommentAction( const OString
& rComment
, sal_Int32 nValue
, const sal_uInt8
* pData
, sal_uInt32 nDataSize
) :
3183 MetaAction ( MetaActionType::COMMENT
),
3184 maComment ( rComment
),
3187 ImplInitDynamicData( pData
, nDataSize
);
3190 MetaCommentAction::~MetaCommentAction()
3196 void MetaCommentAction::ImplInitDynamicData( const sal_uInt8
* pData
, sal_uInt32 nDataSize
)
3198 if ( nDataSize
&& pData
)
3200 mnDataSize
= nDataSize
;
3201 mpData
= new sal_uInt8
[ mnDataSize
];
3202 memcpy( mpData
, pData
, mnDataSize
);
3211 void MetaCommentAction::Execute( OutputDevice
* pOut
)
3213 if ( pOut
->GetConnectMetaFile() )
3216 pOut
->GetConnectMetaFile()->AddAction( this );
3220 MetaAction
* MetaCommentAction::Clone()
3222 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaCommentAction( *this ));
3223 pClone
->ResetRefCount();
3227 void MetaCommentAction::Move( long nXMove
, long nYMove
)
3229 if ( nXMove
|| nYMove
)
3231 if ( mnDataSize
&& mpData
)
3233 bool bPathStroke
= (maComment
== "XPATHSTROKE_SEQ_BEGIN");
3234 if ( bPathStroke
|| maComment
== "XPATHFILL_SEQ_BEGIN" )
3236 SvMemoryStream
aMemStm( static_cast<void*>(mpData
), mnDataSize
, StreamMode::READ
);
3237 SvMemoryStream aDest
;
3240 SvtGraphicStroke aStroke
;
3241 ReadSvtGraphicStroke( aMemStm
, aStroke
);
3243 tools::Polygon aPath
;
3244 aStroke
.getPath( aPath
);
3245 aPath
.Move( nXMove
, nYMove
);
3246 aStroke
.setPath( aPath
);
3248 tools::PolyPolygon aStartArrow
;
3249 aStroke
.getStartArrow(aStartArrow
);
3250 aStartArrow
.Move(nXMove
, nYMove
);
3251 aStroke
.setStartArrow(aStartArrow
);
3253 tools::PolyPolygon aEndArrow
;
3254 aStroke
.getEndArrow(aEndArrow
);
3255 aEndArrow
.Move(nXMove
, nYMove
);
3256 aStroke
.setEndArrow(aEndArrow
);
3258 WriteSvtGraphicStroke( aDest
, aStroke
);
3262 SvtGraphicFill aFill
;
3263 ReadSvtGraphicFill( aMemStm
, aFill
);
3265 tools::PolyPolygon aPath
;
3266 aFill
.getPath( aPath
);
3267 aPath
.Move( nXMove
, nYMove
);
3268 aFill
.setPath( aPath
);
3270 WriteSvtGraphicFill( aDest
, aFill
);
3273 ImplInitDynamicData( static_cast<const sal_uInt8
*>( aDest
.GetData() ), aDest
.Tell() );
3279 // SJ: 25.07.06 #i56656# we are not able to mirror certain kind of
3280 // comments properly, especially the XPATHSTROKE and XPATHFILL lead to
3281 // problems, so it is better to remove these comments when mirroring
3282 // FIXME: fake comment to apply the next hunk in the right location
3283 void MetaCommentAction::Scale( double fXScale
, double fYScale
)
3285 if ( ( fXScale
!= 1.0 ) || ( fYScale
!= 1.0 ) )
3287 if ( mnDataSize
&& mpData
)
3289 bool bPathStroke
= (maComment
== "XPATHSTROKE_SEQ_BEGIN");
3290 if ( bPathStroke
|| maComment
== "XPATHFILL_SEQ_BEGIN" )
3292 SvMemoryStream
aMemStm( static_cast<void*>(mpData
), mnDataSize
, StreamMode::READ
);
3293 SvMemoryStream aDest
;
3296 SvtGraphicStroke aStroke
;
3297 ReadSvtGraphicStroke( aMemStm
, aStroke
);
3298 aStroke
.scale( fXScale
, fYScale
);
3299 WriteSvtGraphicStroke( aDest
, aStroke
);
3303 SvtGraphicFill aFill
;
3304 ReadSvtGraphicFill( aMemStm
, aFill
);
3305 tools::PolyPolygon aPath
;
3306 aFill
.getPath( aPath
);
3307 aPath
.Scale( fXScale
, fYScale
);
3308 aFill
.setPath( aPath
);
3309 WriteSvtGraphicFill( aDest
, aFill
);
3312 ImplInitDynamicData( static_cast<const sal_uInt8
*>( aDest
.GetData() ), aDest
.Tell() );
3313 } else if( maComment
== "EMF_PLUS_HEADER_INFO" ){
3314 SvMemoryStream
aMemStm( static_cast<void*>(mpData
), mnDataSize
, StreamMode::READ
);
3315 SvMemoryStream aDest
;
3317 sal_Int32
nLeft(0), nRight(0), nTop(0), nBottom(0);
3318 sal_Int32
nPixX(0), nPixY(0), nMillX(0), nMillY(0);
3319 float m11(0), m12(0), m21(0), m22(0), mdx(0), mdy(0);
3322 aMemStm
.ReadInt32( nLeft
).ReadInt32( nTop
).ReadInt32( nRight
).ReadInt32( nBottom
);
3323 aMemStm
.ReadInt32( nPixX
).ReadInt32( nPixY
).ReadInt32( nMillX
).ReadInt32( nMillY
);
3324 aMemStm
.ReadFloat( m11
).ReadFloat( m12
).ReadFloat( m21
).ReadFloat( m22
).ReadFloat( mdx
).ReadFloat( mdy
);
3326 // add scale to the transformation
3333 aDest
.WriteInt32( nLeft
).WriteInt32( nTop
).WriteInt32( nRight
).WriteInt32( nBottom
);
3334 aDest
.WriteInt32( nPixX
).WriteInt32( nPixY
).WriteInt32( nMillX
).WriteInt32( nMillY
);
3335 aDest
.WriteFloat( m11
).WriteFloat( m12
).WriteFloat( m21
).WriteFloat( m22
).WriteFloat( mdx
).WriteFloat( mdy
);
3338 ImplInitDynamicData( static_cast<const sal_uInt8
*>( aDest
.GetData() ), aDest
.Tell() );
3344 void MetaCommentAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
3346 MetaAction::Write(rOStm
, pData
);
3347 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
3348 write_uInt16_lenPrefixed_uInt8s_FromOString(rOStm
, maComment
);
3349 rOStm
.WriteInt32( mnValue
).WriteUInt32( mnDataSize
);
3352 rOStm
.Write( mpData
, mnDataSize
);
3355 void MetaCommentAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
3357 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
3358 maComment
= read_uInt16_lenPrefixed_uInt8s_ToOString(rIStm
);
3359 rIStm
.ReadInt32( mnValue
).ReadUInt32( mnDataSize
);
3361 SAL_INFO("vcl.gdi", "MetaCommentAction::Read " << maComment
);
3367 mpData
= new sal_uInt8
[ mnDataSize
];
3368 rIStm
.Read( mpData
, mnDataSize
);
3374 MetaLayoutModeAction::MetaLayoutModeAction() :
3375 MetaAction ( MetaActionType::LAYOUTMODE
),
3376 mnLayoutMode( TEXT_LAYOUT_DEFAULT
)
3379 MetaLayoutModeAction::~MetaLayoutModeAction()
3382 MetaLayoutModeAction::MetaLayoutModeAction( ComplexTextLayoutMode nLayoutMode
) :
3383 MetaAction ( MetaActionType::LAYOUTMODE
),
3384 mnLayoutMode( nLayoutMode
)
3387 void MetaLayoutModeAction::Execute( OutputDevice
* pOut
)
3389 pOut
->SetLayoutMode( mnLayoutMode
);
3392 MetaAction
* MetaLayoutModeAction::Clone()
3394 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaLayoutModeAction( *this ));
3395 pClone
->ResetRefCount();
3399 void MetaLayoutModeAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
3401 MetaAction::Write(rOStm
, pData
);
3402 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
3403 rOStm
.WriteUInt32( mnLayoutMode
);
3406 void MetaLayoutModeAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
3408 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
3410 rIStm
.ReadUInt32( tmp
);
3411 mnLayoutMode
= static_cast<ComplexTextLayoutMode
>(tmp
);
3414 MetaTextLanguageAction::MetaTextLanguageAction() :
3415 MetaAction ( MetaActionType::TEXTLANGUAGE
),
3416 meTextLanguage( LANGUAGE_DONTKNOW
)
3419 MetaTextLanguageAction::~MetaTextLanguageAction()
3422 MetaTextLanguageAction::MetaTextLanguageAction( LanguageType eTextLanguage
) :
3423 MetaAction ( MetaActionType::TEXTLANGUAGE
),
3424 meTextLanguage( eTextLanguage
)
3427 void MetaTextLanguageAction::Execute( OutputDevice
* pOut
)
3429 pOut
->SetDigitLanguage( meTextLanguage
);
3432 MetaAction
* MetaTextLanguageAction::Clone()
3434 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaTextLanguageAction( *this ));
3435 pClone
->ResetRefCount();
3439 void MetaTextLanguageAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
3441 MetaAction::Write(rOStm
, pData
);
3442 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
3443 rOStm
.WriteUInt16( meTextLanguage
);
3446 void MetaTextLanguageAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
3448 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
3449 rIStm
.ReadUInt16( meTextLanguage
);
3452 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */