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( tools::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
= tools::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 tools::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 tools::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 tools::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 tools::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 tools::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 tools::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 mpDXAry
.reset( new long[ mnLen
] );
1096 memcpy( mpDXAry
.get(), rAction
.mpDXAry
.get(), mnLen
* sizeof( long ) );
1100 MetaTextArrayAction::MetaTextArrayAction( const Point
& rStartPt
,
1101 const OUString
& rStr
,
1105 MetaAction ( MetaActionType::TEXTARRAY
),
1106 maStartPt ( rStartPt
),
1111 const sal_Int32 nAryLen
= pDXAry
? mnLen
: 0;
1115 mpDXAry
.reset( new long[ nAryLen
] );
1116 memcpy( mpDXAry
.get(), pDXAry
, nAryLen
* sizeof(long) );
1120 MetaTextArrayAction::~MetaTextArrayAction()
1124 void MetaTextArrayAction::Execute( OutputDevice
* pOut
)
1126 pOut
->DrawTextArray( maStartPt
, maStr
, mpDXAry
.get(), mnIndex
, mnLen
);
1129 MetaAction
* MetaTextArrayAction::Clone()
1131 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaTextArrayAction( *this ));
1132 pClone
->ResetRefCount();
1136 void MetaTextArrayAction::Move( long nHorzMove
, long nVertMove
)
1138 maStartPt
.Move( nHorzMove
, nVertMove
);
1141 void MetaTextArrayAction::Scale( double fScaleX
, double fScaleY
)
1143 ImplScalePoint( maStartPt
, fScaleX
, fScaleY
);
1145 if ( mpDXAry
&& mnLen
)
1147 for ( sal_uInt16 i
= 0, nCount
= mnLen
; i
< nCount
; i
++ )
1148 mpDXAry
[ i
] = FRound( mpDXAry
[ i
] * fabs(fScaleX
) );
1152 void MetaTextArrayAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1154 const sal_Int32 nAryLen
= mpDXAry
? mnLen
: 0;
1156 MetaAction::Write(rOStm
, pData
);
1157 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 2);
1158 WritePair( rOStm
, maStartPt
);
1159 rOStm
.WriteUniOrByteString( maStr
, pData
->meActualCharSet
);
1160 rOStm
.WriteUInt16(mnIndex
);
1161 rOStm
.WriteUInt16(mnLen
);
1162 rOStm
.WriteInt32(nAryLen
);
1164 for (sal_Int32 i
= 0; i
< nAryLen
; ++i
)
1165 rOStm
.WriteInt32( mpDXAry
[ i
] );
1167 write_uInt16_lenPrefixed_uInt16s_FromOUString(rOStm
, maStr
); // version 2
1170 void MetaTextArrayAction::Read( SvStream
& rIStm
, ImplMetaReadData
* pData
)
1174 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1175 ReadPair( rIStm
, maStartPt
);
1176 maStr
= rIStm
.ReadUniOrByteString(pData
->meActualCharSet
);
1177 sal_uInt16
nTmpIndex(0);
1178 rIStm
.ReadUInt16(nTmpIndex
);
1179 mnIndex
= nTmpIndex
;
1180 sal_uInt16
nTmpLen(0);
1181 rIStm
.ReadUInt16(nTmpLen
);
1183 sal_Int32
nAryLen(0);
1184 rIStm
.ReadInt32(nAryLen
);
1186 if (mnLen
> maStr
.getLength() - mnIndex
)
1195 // #i9762#, #106172# Ensure that DX array is at least mnLen entries long
1196 if ( mnLen
>= nAryLen
)
1198 mpDXAry
.reset( new (std::nothrow
)long[ mnLen
] );
1203 for( i
= 0; i
< nAryLen
; i
++ )
1205 rIStm
.ReadInt32( val
);
1208 // #106172# setup remainder
1209 for( ; i
< mnLen
; i
++ )
1222 if ( aCompat
.GetVersion() >= 2 ) // Version 2
1224 maStr
= read_uInt16_lenPrefixed_uInt16s_ToOUString(rIStm
);
1226 if ( mnIndex
+ mnLen
> maStr
.getLength() )
1234 MetaStretchTextAction::MetaStretchTextAction() :
1235 MetaAction ( MetaActionType::STRETCHTEXT
),
1241 MetaStretchTextAction::~MetaStretchTextAction()
1244 MetaStretchTextAction::MetaStretchTextAction( const Point
& rPt
, sal_uInt32 nWidth
,
1245 const OUString
& rStr
,
1246 sal_Int32 nIndex
, sal_Int32 nLen
) :
1247 MetaAction ( MetaActionType::STRETCHTEXT
),
1255 void MetaStretchTextAction::Execute( OutputDevice
* pOut
)
1257 pOut
->DrawStretchText( maPt
, mnWidth
, maStr
, mnIndex
, mnLen
);
1260 MetaAction
* MetaStretchTextAction::Clone()
1262 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaStretchTextAction( *this ));
1263 pClone
->ResetRefCount();
1267 void MetaStretchTextAction::Move( long nHorzMove
, long nVertMove
)
1269 maPt
.Move( nHorzMove
, nVertMove
);
1272 void MetaStretchTextAction::Scale( double fScaleX
, double fScaleY
)
1274 ImplScalePoint( maPt
, fScaleX
, fScaleY
);
1275 mnWidth
= (sal_uLong
)FRound( mnWidth
* fabs(fScaleX
) );
1278 void MetaStretchTextAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1280 MetaAction::Write(rOStm
, pData
);
1281 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 2);
1282 WritePair( rOStm
, maPt
);
1283 rOStm
.WriteUniOrByteString( maStr
, pData
->meActualCharSet
);
1284 rOStm
.WriteUInt32( mnWidth
);
1285 rOStm
.WriteUInt16( mnIndex
);
1286 rOStm
.WriteUInt16( mnLen
);
1288 write_uInt16_lenPrefixed_uInt16s_FromOUString(rOStm
, maStr
); // version 2
1291 void MetaStretchTextAction::Read( SvStream
& rIStm
, ImplMetaReadData
* pData
)
1293 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1294 ReadPair( rIStm
, maPt
);
1295 maStr
= rIStm
.ReadUniOrByteString(pData
->meActualCharSet
);
1296 rIStm
.ReadUInt32( mnWidth
);
1297 sal_uInt16
nTmpIndex(0);
1298 rIStm
.ReadUInt16(nTmpIndex
);
1299 mnIndex
= nTmpIndex
;
1300 sal_uInt16
nTmpLen(0);
1301 rIStm
.ReadUInt16(nTmpLen
);
1304 if ( aCompat
.GetVersion() >= 2 ) // Version 2
1305 maStr
= read_uInt16_lenPrefixed_uInt16s_ToOUString(rIStm
);
1308 MetaTextRectAction::MetaTextRectAction() :
1309 MetaAction ( MetaActionType::TEXTRECT
),
1310 mnStyle ( DrawTextFlags::NONE
)
1313 MetaTextRectAction::~MetaTextRectAction()
1316 MetaTextRectAction::MetaTextRectAction( const tools::Rectangle
& rRect
,
1317 const OUString
& rStr
, DrawTextFlags nStyle
) :
1318 MetaAction ( MetaActionType::TEXTRECT
),
1324 void MetaTextRectAction::Execute( OutputDevice
* pOut
)
1326 pOut
->DrawText( maRect
, maStr
, mnStyle
);
1329 MetaAction
* MetaTextRectAction::Clone()
1331 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaTextRectAction( *this ));
1332 pClone
->ResetRefCount();
1336 void MetaTextRectAction::Move( long nHorzMove
, long nVertMove
)
1338 maRect
.Move( nHorzMove
, nVertMove
);
1341 void MetaTextRectAction::Scale( double fScaleX
, double fScaleY
)
1343 ImplScaleRect( maRect
, fScaleX
, fScaleY
);
1346 void MetaTextRectAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1348 MetaAction::Write(rOStm
, pData
);
1349 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 2);
1350 WriteRectangle( rOStm
, maRect
);
1351 rOStm
.WriteUniOrByteString( maStr
, pData
->meActualCharSet
);
1352 rOStm
.WriteUInt16( static_cast<sal_uInt16
>(mnStyle
) );
1354 write_uInt16_lenPrefixed_uInt16s_FromOUString(rOStm
, maStr
); // version 2
1357 void MetaTextRectAction::Read( SvStream
& rIStm
, ImplMetaReadData
* pData
)
1359 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1360 ReadRectangle( rIStm
, maRect
);
1361 maStr
= rIStm
.ReadUniOrByteString(pData
->meActualCharSet
);
1363 rIStm
.ReadUInt16( nTmp
);
1364 mnStyle
= static_cast<DrawTextFlags
>(nTmp
);
1366 if ( aCompat
.GetVersion() >= 2 ) // Version 2
1367 maStr
= read_uInt16_lenPrefixed_uInt16s_ToOUString(rIStm
);
1370 MetaTextLineAction::MetaTextLineAction() :
1371 MetaAction ( MetaActionType::TEXTLINE
),
1373 meStrikeout ( STRIKEOUT_NONE
),
1374 meUnderline ( LINESTYLE_NONE
),
1375 meOverline ( LINESTYLE_NONE
)
1378 MetaTextLineAction::~MetaTextLineAction()
1381 MetaTextLineAction::MetaTextLineAction( const Point
& rPos
, long nWidth
,
1382 FontStrikeout eStrikeout
,
1383 FontLineStyle eUnderline
,
1384 FontLineStyle eOverline
) :
1385 MetaAction ( MetaActionType::TEXTLINE
),
1388 meStrikeout ( eStrikeout
),
1389 meUnderline ( eUnderline
),
1390 meOverline ( eOverline
)
1393 void MetaTextLineAction::Execute( OutputDevice
* pOut
)
1395 pOut
->DrawTextLine( maPos
, mnWidth
, meStrikeout
, meUnderline
, meOverline
);
1398 MetaAction
* MetaTextLineAction::Clone()
1400 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaTextLineAction( *this ));
1401 pClone
->ResetRefCount();
1405 void MetaTextLineAction::Move( long nHorzMove
, long nVertMove
)
1407 maPos
.Move( nHorzMove
, nVertMove
);
1410 void MetaTextLineAction::Scale( double fScaleX
, double fScaleY
)
1412 ImplScalePoint( maPos
, fScaleX
, fScaleY
);
1413 mnWidth
= FRound( mnWidth
* fabs(fScaleX
) );
1416 void MetaTextLineAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1418 MetaAction::Write(rOStm
, pData
);
1419 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 2);
1421 WritePair( rOStm
, maPos
);
1422 rOStm
.WriteInt32( mnWidth
);
1423 rOStm
.WriteUInt32( meStrikeout
);
1424 rOStm
.WriteUInt32( meUnderline
);
1426 rOStm
.WriteUInt32( meOverline
);
1429 void MetaTextLineAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1431 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1433 sal_Int32
nTempWidth(0);
1434 ReadPair( rIStm
, maPos
);
1435 rIStm
.ReadInt32(nTempWidth
);
1436 mnWidth
= nTempWidth
;
1438 sal_uInt32
nTempStrikeout(0);
1439 rIStm
.ReadUInt32( nTempStrikeout
);
1440 meStrikeout
= (FontStrikeout
)nTempStrikeout
;
1442 sal_uInt32
nTempUnderline(0);
1443 rIStm
.ReadUInt32( nTempUnderline
);
1444 meUnderline
= (FontLineStyle
)nTempUnderline
;
1446 if (aCompat
.GetVersion() >= 2)
1448 sal_uInt32
nTempOverline(0);
1449 rIStm
.ReadUInt32(nTempOverline
);
1450 meOverline
= (FontLineStyle
)nTempOverline
;
1454 MetaBmpAction::MetaBmpAction() :
1455 MetaAction(MetaActionType::BMP
)
1458 MetaBmpAction::~MetaBmpAction()
1461 MetaBmpAction::MetaBmpAction( const Point
& rPt
, const Bitmap
& rBmp
) :
1462 MetaAction ( MetaActionType::BMP
),
1467 void MetaBmpAction::Execute( OutputDevice
* pOut
)
1469 pOut
->DrawBitmap( maPt
, maBmp
);
1472 MetaAction
* MetaBmpAction::Clone()
1474 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaBmpAction( *this ));
1475 pClone
->ResetRefCount();
1479 void MetaBmpAction::Move( long nHorzMove
, long nVertMove
)
1481 maPt
.Move( nHorzMove
, nVertMove
);
1484 void MetaBmpAction::Scale( double fScaleX
, double fScaleY
)
1486 ImplScalePoint( maPt
, fScaleX
, fScaleY
);
1489 void MetaBmpAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1493 MetaAction::Write(rOStm
, pData
);
1494 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
1495 WriteDIB(maBmp
, rOStm
, false, true);
1496 WritePair( rOStm
, maPt
);
1500 void MetaBmpAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1502 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1503 ReadDIB(maBmp
, rIStm
, true);
1504 ReadPair( rIStm
, maPt
);
1507 MetaBmpScaleAction::MetaBmpScaleAction() :
1508 MetaAction(MetaActionType::BMPSCALE
)
1511 MetaBmpScaleAction::~MetaBmpScaleAction()
1514 MetaBmpScaleAction::MetaBmpScaleAction( const Point
& rPt
, const Size
& rSz
,
1515 const Bitmap
& rBmp
) :
1516 MetaAction ( MetaActionType::BMPSCALE
),
1522 void MetaBmpScaleAction::Execute( OutputDevice
* pOut
)
1524 pOut
->DrawBitmap( maPt
, maSz
, maBmp
);
1527 MetaAction
* MetaBmpScaleAction::Clone()
1529 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaBmpScaleAction( *this ));
1530 pClone
->ResetRefCount();
1534 void MetaBmpScaleAction::Move( long nHorzMove
, long nVertMove
)
1536 maPt
.Move( nHorzMove
, nVertMove
);
1539 void MetaBmpScaleAction::Scale( double fScaleX
, double fScaleY
)
1541 tools::Rectangle
aRectangle(maPt
, maSz
);
1542 ImplScaleRect( aRectangle
, fScaleX
, fScaleY
);
1543 maPt
= aRectangle
.TopLeft();
1544 maSz
= aRectangle
.GetSize();
1547 void MetaBmpScaleAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1551 MetaAction::Write(rOStm
, pData
);
1552 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
1553 WriteDIB(maBmp
, rOStm
, false, true);
1554 WritePair( rOStm
, maPt
);
1555 WritePair( rOStm
, maSz
);
1559 void MetaBmpScaleAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1561 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1562 ReadDIB(maBmp
, rIStm
, true);
1563 ReadPair( rIStm
, maPt
);
1564 ReadPair( rIStm
, maSz
);
1567 MetaBmpScalePartAction::MetaBmpScalePartAction() :
1568 MetaAction(MetaActionType::BMPSCALEPART
)
1571 MetaBmpScalePartAction::~MetaBmpScalePartAction()
1574 MetaBmpScalePartAction::MetaBmpScalePartAction( const Point
& rDstPt
, const Size
& rDstSz
,
1575 const Point
& rSrcPt
, const Size
& rSrcSz
,
1576 const Bitmap
& rBmp
) :
1577 MetaAction ( MetaActionType::BMPSCALEPART
),
1585 void MetaBmpScalePartAction::Execute( OutputDevice
* pOut
)
1587 pOut
->DrawBitmap( maDstPt
, maDstSz
, maSrcPt
, maSrcSz
, maBmp
);
1590 MetaAction
* MetaBmpScalePartAction::Clone()
1592 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaBmpScalePartAction( *this ));
1593 pClone
->ResetRefCount();
1597 void MetaBmpScalePartAction::Move( long nHorzMove
, long nVertMove
)
1599 maDstPt
.Move( nHorzMove
, nVertMove
);
1602 void MetaBmpScalePartAction::Scale( double fScaleX
, double fScaleY
)
1604 tools::Rectangle
aRectangle(maDstPt
, maDstSz
);
1605 ImplScaleRect( aRectangle
, fScaleX
, fScaleY
);
1606 maDstPt
= aRectangle
.TopLeft();
1607 maDstSz
= aRectangle
.GetSize();
1610 void MetaBmpScalePartAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1614 MetaAction::Write(rOStm
, pData
);
1615 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
1616 WriteDIB(maBmp
, rOStm
, false, true);
1617 WritePair( rOStm
, maDstPt
);
1618 WritePair( rOStm
, maDstSz
);
1619 WritePair( rOStm
, maSrcPt
);
1620 WritePair( rOStm
, maSrcSz
);
1624 void MetaBmpScalePartAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1626 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1627 ReadDIB(maBmp
, rIStm
, true);
1628 ReadPair( rIStm
, maDstPt
);
1629 ReadPair( rIStm
, maDstSz
);
1630 ReadPair( rIStm
, maSrcPt
);
1631 ReadPair( rIStm
, maSrcSz
);
1634 MetaBmpExAction::MetaBmpExAction() :
1635 MetaAction(MetaActionType::BMPEX
)
1638 MetaBmpExAction::~MetaBmpExAction()
1641 MetaBmpExAction::MetaBmpExAction( const Point
& rPt
, const BitmapEx
& rBmpEx
) :
1642 MetaAction ( MetaActionType::BMPEX
),
1647 void MetaBmpExAction::Execute( OutputDevice
* pOut
)
1649 pOut
->DrawBitmapEx( maPt
, maBmpEx
);
1652 MetaAction
* MetaBmpExAction::Clone()
1654 MetaBmpExAction
* pClone
= new MetaBmpExAction( *this );
1655 pClone
->ResetRefCount();
1659 void MetaBmpExAction::Move( long nHorzMove
, long nVertMove
)
1661 maPt
.Move( nHorzMove
, nVertMove
);
1664 void MetaBmpExAction::Scale( double fScaleX
, double fScaleY
)
1666 ImplScalePoint( maPt
, fScaleX
, fScaleY
);
1669 void MetaBmpExAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1671 if( !!maBmpEx
.GetBitmap() )
1673 MetaAction::Write(rOStm
, pData
);
1674 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
1675 WriteDIBBitmapEx(maBmpEx
, rOStm
);
1676 WritePair( rOStm
, maPt
);
1680 void MetaBmpExAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1682 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1683 ReadDIBBitmapEx(maBmpEx
, rIStm
);
1684 ReadPair( rIStm
, maPt
);
1687 MetaBmpExScaleAction::MetaBmpExScaleAction() :
1688 MetaAction(MetaActionType::BMPEXSCALE
)
1691 MetaBmpExScaleAction::~MetaBmpExScaleAction()
1694 MetaBmpExScaleAction::MetaBmpExScaleAction( const Point
& rPt
, const Size
& rSz
,
1695 const BitmapEx
& rBmpEx
) :
1696 MetaAction ( MetaActionType::BMPEXSCALE
),
1702 void MetaBmpExScaleAction::Execute( OutputDevice
* pOut
)
1704 pOut
->DrawBitmapEx( maPt
, maSz
, maBmpEx
);
1707 MetaAction
* MetaBmpExScaleAction::Clone()
1709 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaBmpExScaleAction( *this ));
1710 pClone
->ResetRefCount();
1714 void MetaBmpExScaleAction::Move( long nHorzMove
, long nVertMove
)
1716 maPt
.Move( nHorzMove
, nVertMove
);
1719 void MetaBmpExScaleAction::Scale( double fScaleX
, double fScaleY
)
1721 tools::Rectangle
aRectangle(maPt
, maSz
);
1722 ImplScaleRect( aRectangle
, fScaleX
, fScaleY
);
1723 maPt
= aRectangle
.TopLeft();
1724 maSz
= aRectangle
.GetSize();
1727 void MetaBmpExScaleAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1729 if( !!maBmpEx
.GetBitmap() )
1731 MetaAction::Write(rOStm
, pData
);
1732 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
1733 WriteDIBBitmapEx(maBmpEx
, rOStm
);
1734 WritePair( rOStm
, maPt
);
1735 WritePair( rOStm
, maSz
);
1739 void MetaBmpExScaleAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1741 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1742 ReadDIBBitmapEx(maBmpEx
, rIStm
);
1743 ReadPair( rIStm
, maPt
);
1744 ReadPair( rIStm
, maSz
);
1747 MetaBmpExScalePartAction::MetaBmpExScalePartAction() :
1748 MetaAction(MetaActionType::BMPEXSCALEPART
)
1751 MetaBmpExScalePartAction::~MetaBmpExScalePartAction()
1754 MetaBmpExScalePartAction::MetaBmpExScalePartAction( const Point
& rDstPt
, const Size
& rDstSz
,
1755 const Point
& rSrcPt
, const Size
& rSrcSz
,
1756 const BitmapEx
& rBmpEx
) :
1757 MetaAction ( MetaActionType::BMPEXSCALEPART
),
1765 void MetaBmpExScalePartAction::Execute( OutputDevice
* pOut
)
1767 pOut
->DrawBitmapEx( maDstPt
, maDstSz
, maSrcPt
, maSrcSz
, maBmpEx
);
1770 MetaAction
* MetaBmpExScalePartAction::Clone()
1772 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaBmpExScalePartAction( *this ));
1773 pClone
->ResetRefCount();
1777 void MetaBmpExScalePartAction::Move( long nHorzMove
, long nVertMove
)
1779 maDstPt
.Move( nHorzMove
, nVertMove
);
1782 void MetaBmpExScalePartAction::Scale( double fScaleX
, double fScaleY
)
1784 tools::Rectangle
aRectangle(maDstPt
, maDstSz
);
1785 ImplScaleRect( aRectangle
, fScaleX
, fScaleY
);
1786 maDstPt
= aRectangle
.TopLeft();
1787 maDstSz
= aRectangle
.GetSize();
1790 void MetaBmpExScalePartAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1792 if( !!maBmpEx
.GetBitmap() )
1794 MetaAction::Write(rOStm
, pData
);
1795 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
1796 WriteDIBBitmapEx(maBmpEx
, rOStm
);
1797 WritePair( rOStm
, maDstPt
);
1798 WritePair( rOStm
, maDstSz
);
1799 WritePair( rOStm
, maSrcPt
);
1800 WritePair( rOStm
, maSrcSz
);
1804 void MetaBmpExScalePartAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1806 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1807 ReadDIBBitmapEx(maBmpEx
, rIStm
);
1808 ReadPair( rIStm
, maDstPt
);
1809 ReadPair( rIStm
, maDstSz
);
1810 ReadPair( rIStm
, maSrcPt
);
1811 ReadPair( rIStm
, maSrcSz
);
1814 MetaMaskAction::MetaMaskAction() :
1815 MetaAction(MetaActionType::MASK
)
1818 MetaMaskAction::~MetaMaskAction()
1821 MetaMaskAction::MetaMaskAction( const Point
& rPt
,
1823 const Color
& rColor
) :
1824 MetaAction ( MetaActionType::MASK
),
1830 void MetaMaskAction::Execute( OutputDevice
* pOut
)
1832 pOut
->DrawMask( maPt
, maBmp
, maColor
);
1835 MetaAction
* MetaMaskAction::Clone()
1837 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaMaskAction( *this ));
1838 pClone
->ResetRefCount();
1842 void MetaMaskAction::Move( long nHorzMove
, long nVertMove
)
1844 maPt
.Move( nHorzMove
, nVertMove
);
1847 void MetaMaskAction::Scale( double fScaleX
, double fScaleY
)
1849 ImplScalePoint( maPt
, fScaleX
, fScaleY
);
1852 void MetaMaskAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1856 MetaAction::Write(rOStm
, pData
);
1857 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
1858 WriteDIB(maBmp
, rOStm
, false, true);
1859 WritePair( rOStm
, maPt
);
1863 void MetaMaskAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1865 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1866 ReadDIB(maBmp
, rIStm
, true);
1867 ReadPair( rIStm
, maPt
);
1870 MetaMaskScaleAction::MetaMaskScaleAction() :
1871 MetaAction(MetaActionType::MASKSCALE
)
1874 MetaMaskScaleAction::~MetaMaskScaleAction()
1877 MetaMaskScaleAction::MetaMaskScaleAction( const Point
& rPt
, const Size
& rSz
,
1879 const Color
& rColor
) :
1880 MetaAction ( MetaActionType::MASKSCALE
),
1887 void MetaMaskScaleAction::Execute( OutputDevice
* pOut
)
1889 pOut
->DrawMask( maPt
, maSz
, maBmp
, maColor
);
1892 MetaAction
* MetaMaskScaleAction::Clone()
1894 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaMaskScaleAction( *this ));
1895 pClone
->ResetRefCount();
1899 void MetaMaskScaleAction::Move( long nHorzMove
, long nVertMove
)
1901 maPt
.Move( nHorzMove
, nVertMove
);
1904 void MetaMaskScaleAction::Scale( double fScaleX
, double fScaleY
)
1906 tools::Rectangle
aRectangle(maPt
, maSz
);
1907 ImplScaleRect( aRectangle
, fScaleX
, fScaleY
);
1908 maPt
= aRectangle
.TopLeft();
1909 maSz
= aRectangle
.GetSize();
1912 void MetaMaskScaleAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1916 MetaAction::Write(rOStm
, pData
);
1917 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
1918 WriteDIB(maBmp
, rOStm
, false, true);
1919 WritePair( rOStm
, maPt
);
1920 WritePair( rOStm
, maSz
);
1924 void MetaMaskScaleAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1926 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1927 ReadDIB(maBmp
, rIStm
, true);
1928 ReadPair( rIStm
, maPt
);
1929 ReadPair( rIStm
, maSz
);
1932 MetaMaskScalePartAction::MetaMaskScalePartAction() :
1933 MetaAction(MetaActionType::MASKSCALEPART
)
1936 MetaMaskScalePartAction::~MetaMaskScalePartAction()
1939 MetaMaskScalePartAction::MetaMaskScalePartAction( const Point
& rDstPt
, const Size
& rDstSz
,
1940 const Point
& rSrcPt
, const Size
& rSrcSz
,
1942 const Color
& rColor
) :
1943 MetaAction ( MetaActionType::MASKSCALEPART
),
1952 void MetaMaskScalePartAction::Execute( OutputDevice
* pOut
)
1954 pOut
->DrawMask( maDstPt
, maDstSz
, maSrcPt
, maSrcSz
, maBmp
, maColor
, MetaActionType::MASKSCALE
);
1957 MetaAction
* MetaMaskScalePartAction::Clone()
1959 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaMaskScalePartAction( *this ));
1960 pClone
->ResetRefCount();
1964 void MetaMaskScalePartAction::Move( long nHorzMove
, long nVertMove
)
1966 maDstPt
.Move( nHorzMove
, nVertMove
);
1969 void MetaMaskScalePartAction::Scale( double fScaleX
, double fScaleY
)
1971 tools::Rectangle
aRectangle(maDstPt
, maDstSz
);
1972 ImplScaleRect( aRectangle
, fScaleX
, fScaleY
);
1973 maDstPt
= aRectangle
.TopLeft();
1974 maDstSz
= aRectangle
.GetSize();
1977 void MetaMaskScalePartAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
1981 MetaAction::Write(rOStm
, pData
);
1982 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
1983 WriteDIB(maBmp
, rOStm
, false, true);
1984 maColor
.Write( rOStm
);
1985 WritePair( rOStm
, maDstPt
);
1986 WritePair( rOStm
, maDstSz
);
1987 WritePair( rOStm
, maSrcPt
);
1988 WritePair( rOStm
, maSrcSz
);
1992 void MetaMaskScalePartAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
1994 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
1995 ReadDIB(maBmp
, rIStm
, true);
1996 maColor
.Read( rIStm
);
1997 ReadPair( rIStm
, maDstPt
);
1998 ReadPair( rIStm
, maDstSz
);
1999 ReadPair( rIStm
, maSrcPt
);
2000 ReadPair( rIStm
, maSrcSz
);
2003 MetaGradientAction::MetaGradientAction() :
2004 MetaAction(MetaActionType::GRADIENT
)
2007 MetaGradientAction::~MetaGradientAction()
2010 MetaGradientAction::MetaGradientAction( const tools::Rectangle
& rRect
, const Gradient
& rGradient
) :
2011 MetaAction ( MetaActionType::GRADIENT
),
2013 maGradient ( rGradient
)
2016 void MetaGradientAction::Execute( OutputDevice
* pOut
)
2018 pOut
->DrawGradient( maRect
, maGradient
);
2021 MetaAction
* MetaGradientAction::Clone()
2023 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaGradientAction( *this ));
2024 pClone
->ResetRefCount();
2028 void MetaGradientAction::Move( long nHorzMove
, long nVertMove
)
2030 maRect
.Move( nHorzMove
, nVertMove
);
2033 void MetaGradientAction::Scale( double fScaleX
, double fScaleY
)
2035 ImplScaleRect( maRect
, fScaleX
, fScaleY
);
2038 void MetaGradientAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2040 MetaAction::Write(rOStm
, pData
);
2041 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2042 WriteRectangle( rOStm
, maRect
);
2043 WriteGradient( rOStm
, maGradient
);
2046 void MetaGradientAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2048 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2049 ReadRectangle( rIStm
, maRect
);
2050 ReadGradient( rIStm
, maGradient
);
2053 MetaGradientExAction::MetaGradientExAction() :
2054 MetaAction ( MetaActionType::GRADIENTEX
)
2057 MetaGradientExAction::MetaGradientExAction( const tools::PolyPolygon
& rPolyPoly
, const Gradient
& rGradient
) :
2058 MetaAction ( MetaActionType::GRADIENTEX
),
2059 maPolyPoly ( rPolyPoly
),
2060 maGradient ( rGradient
)
2063 MetaGradientExAction::~MetaGradientExAction()
2066 void MetaGradientExAction::Execute( OutputDevice
* pOut
)
2068 if( pOut
->GetConnectMetaFile() )
2071 pOut
->GetConnectMetaFile()->AddAction( this );
2075 MetaAction
* MetaGradientExAction::Clone()
2077 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaGradientExAction( *this ));
2078 pClone
->ResetRefCount();
2082 void MetaGradientExAction::Move( long nHorzMove
, long nVertMove
)
2084 maPolyPoly
.Move( nHorzMove
, nVertMove
);
2087 void MetaGradientExAction::Scale( double fScaleX
, double fScaleY
)
2089 for( sal_uInt16 i
= 0, nCount
= maPolyPoly
.Count(); i
< nCount
; i
++ )
2090 ImplScalePoly( maPolyPoly
[ i
], fScaleX
, fScaleY
);
2093 void MetaGradientExAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2095 MetaAction::Write(rOStm
, pData
);
2096 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2098 // #i105373# see comment at MetaTransparentAction::Write
2099 tools::PolyPolygon aNoCurvePolyPolygon
;
2100 maPolyPoly
.AdaptiveSubdivide(aNoCurvePolyPolygon
);
2102 WritePolyPolygon( rOStm
, aNoCurvePolyPolygon
);
2103 WriteGradient( rOStm
, maGradient
);
2106 void MetaGradientExAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2108 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2109 ReadPolyPolygon( rIStm
, maPolyPoly
);
2110 ReadGradient( rIStm
, maGradient
);
2113 MetaHatchAction::MetaHatchAction() :
2114 MetaAction(MetaActionType::HATCH
)
2117 MetaHatchAction::~MetaHatchAction()
2120 MetaHatchAction::MetaHatchAction( const tools::PolyPolygon
& rPolyPoly
, const Hatch
& rHatch
) :
2121 MetaAction ( MetaActionType::HATCH
),
2122 maPolyPoly ( rPolyPoly
),
2126 void MetaHatchAction::Execute( OutputDevice
* pOut
)
2128 pOut
->DrawHatch( maPolyPoly
, maHatch
);
2131 MetaAction
* MetaHatchAction::Clone()
2133 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaHatchAction( *this ));
2134 pClone
->ResetRefCount();
2138 void MetaHatchAction::Move( long nHorzMove
, long nVertMove
)
2140 maPolyPoly
.Move( nHorzMove
, nVertMove
);
2143 void MetaHatchAction::Scale( double fScaleX
, double fScaleY
)
2145 for( sal_uInt16 i
= 0, nCount
= maPolyPoly
.Count(); i
< nCount
; i
++ )
2146 ImplScalePoly( maPolyPoly
[ i
], fScaleX
, fScaleY
);
2149 void MetaHatchAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2151 MetaAction::Write(rOStm
, pData
);
2152 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2154 // #i105373# see comment at MetaTransparentAction::Write
2155 tools::PolyPolygon aNoCurvePolyPolygon
;
2156 maPolyPoly
.AdaptiveSubdivide(aNoCurvePolyPolygon
);
2158 WritePolyPolygon( rOStm
, aNoCurvePolyPolygon
);
2159 WriteHatch( rOStm
, maHatch
);
2162 void MetaHatchAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2164 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2165 ReadPolyPolygon( rIStm
, maPolyPoly
);
2166 ReadHatch( rIStm
, maHatch
);
2169 MetaWallpaperAction::MetaWallpaperAction() :
2170 MetaAction(MetaActionType::WALLPAPER
)
2173 MetaWallpaperAction::~MetaWallpaperAction()
2176 MetaWallpaperAction::MetaWallpaperAction( const tools::Rectangle
& rRect
,
2177 const Wallpaper
& rPaper
) :
2178 MetaAction ( MetaActionType::WALLPAPER
),
2180 maWallpaper ( rPaper
)
2183 void MetaWallpaperAction::Execute( OutputDevice
* pOut
)
2185 pOut
->DrawWallpaper( maRect
, maWallpaper
);
2188 MetaAction
* MetaWallpaperAction::Clone()
2190 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaWallpaperAction( *this ));
2191 pClone
->ResetRefCount();
2195 void MetaWallpaperAction::Move( long nHorzMove
, long nVertMove
)
2197 maRect
.Move( nHorzMove
, nVertMove
);
2200 void MetaWallpaperAction::Scale( double fScaleX
, double fScaleY
)
2202 ImplScaleRect( maRect
, fScaleX
, fScaleY
);
2205 void MetaWallpaperAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2207 MetaAction::Write(rOStm
, pData
);
2208 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2210 WriteWallpaper( rOStm
, maWallpaper
);
2213 void MetaWallpaperAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2215 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2216 ReadWallpaper( rIStm
, maWallpaper
);
2219 MetaClipRegionAction::MetaClipRegionAction() :
2220 MetaAction ( MetaActionType::CLIPREGION
),
2224 MetaClipRegionAction::~MetaClipRegionAction()
2227 MetaClipRegionAction::MetaClipRegionAction( const vcl::Region
& rRegion
, bool bClip
) :
2228 MetaAction ( MetaActionType::CLIPREGION
),
2229 maRegion ( rRegion
),
2233 void MetaClipRegionAction::Execute( OutputDevice
* pOut
)
2236 pOut
->SetClipRegion( maRegion
);
2238 pOut
->SetClipRegion();
2241 MetaAction
* MetaClipRegionAction::Clone()
2243 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaClipRegionAction( *this ));
2244 pClone
->ResetRefCount();
2248 void MetaClipRegionAction::Move( long nHorzMove
, long nVertMove
)
2250 maRegion
.Move( nHorzMove
, nVertMove
);
2253 void MetaClipRegionAction::Scale( double fScaleX
, double fScaleY
)
2255 maRegion
.Scale( fScaleX
, fScaleY
);
2258 void MetaClipRegionAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2260 MetaAction::Write(rOStm
, pData
);
2261 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2263 WriteRegion( rOStm
, maRegion
);
2264 rOStm
.WriteBool( mbClip
);
2267 void MetaClipRegionAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2269 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2270 ReadRegion( rIStm
, maRegion
);
2271 rIStm
.ReadCharAsBool( mbClip
);
2274 MetaISectRectClipRegionAction::MetaISectRectClipRegionAction() :
2275 MetaAction(MetaActionType::ISECTRECTCLIPREGION
)
2278 MetaISectRectClipRegionAction::~MetaISectRectClipRegionAction()
2281 MetaISectRectClipRegionAction::MetaISectRectClipRegionAction( const tools::Rectangle
& rRect
) :
2282 MetaAction ( MetaActionType::ISECTRECTCLIPREGION
),
2286 void MetaISectRectClipRegionAction::Execute( OutputDevice
* pOut
)
2288 pOut
->IntersectClipRegion( maRect
);
2291 MetaAction
* MetaISectRectClipRegionAction::Clone()
2293 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaISectRectClipRegionAction( *this ));
2294 pClone
->ResetRefCount();
2298 void MetaISectRectClipRegionAction::Move( long nHorzMove
, long nVertMove
)
2300 maRect
.Move( nHorzMove
, nVertMove
);
2303 void MetaISectRectClipRegionAction::Scale( double fScaleX
, double fScaleY
)
2305 ImplScaleRect( maRect
, fScaleX
, fScaleY
);
2308 void MetaISectRectClipRegionAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2310 MetaAction::Write(rOStm
, pData
);
2311 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2312 WriteRectangle( rOStm
, maRect
);
2315 void MetaISectRectClipRegionAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2317 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2318 ReadRectangle( rIStm
, maRect
);
2321 MetaISectRegionClipRegionAction::MetaISectRegionClipRegionAction() :
2322 MetaAction(MetaActionType::ISECTREGIONCLIPREGION
)
2325 MetaISectRegionClipRegionAction::~MetaISectRegionClipRegionAction()
2328 MetaISectRegionClipRegionAction::MetaISectRegionClipRegionAction( const vcl::Region
& rRegion
) :
2329 MetaAction ( MetaActionType::ISECTREGIONCLIPREGION
),
2330 maRegion ( rRegion
)
2334 void MetaISectRegionClipRegionAction::Execute( OutputDevice
* pOut
)
2336 pOut
->IntersectClipRegion( maRegion
);
2339 MetaAction
* MetaISectRegionClipRegionAction::Clone()
2341 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaISectRegionClipRegionAction( *this ));
2342 pClone
->ResetRefCount();
2346 void MetaISectRegionClipRegionAction::Move( long nHorzMove
, long nVertMove
)
2348 maRegion
.Move( nHorzMove
, nVertMove
);
2351 void MetaISectRegionClipRegionAction::Scale( double fScaleX
, double fScaleY
)
2353 maRegion
.Scale( fScaleX
, fScaleY
);
2356 void MetaISectRegionClipRegionAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2358 MetaAction::Write(rOStm
, pData
);
2359 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2360 WriteRegion( rOStm
, maRegion
);
2363 void MetaISectRegionClipRegionAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2365 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2366 ReadRegion( rIStm
, maRegion
);
2369 MetaMoveClipRegionAction::MetaMoveClipRegionAction() :
2370 MetaAction ( MetaActionType::MOVECLIPREGION
),
2375 MetaMoveClipRegionAction::~MetaMoveClipRegionAction()
2378 MetaMoveClipRegionAction::MetaMoveClipRegionAction( long nHorzMove
, long nVertMove
) :
2379 MetaAction ( MetaActionType::MOVECLIPREGION
),
2380 mnHorzMove ( nHorzMove
),
2381 mnVertMove ( nVertMove
)
2384 void MetaMoveClipRegionAction::Execute( OutputDevice
* pOut
)
2386 pOut
->MoveClipRegion( mnHorzMove
, mnVertMove
);
2389 MetaAction
* MetaMoveClipRegionAction::Clone()
2391 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaMoveClipRegionAction( *this ));
2392 pClone
->ResetRefCount();
2396 void MetaMoveClipRegionAction::Scale( double fScaleX
, double fScaleY
)
2398 mnHorzMove
= FRound( mnHorzMove
* fScaleX
);
2399 mnVertMove
= FRound( mnVertMove
* fScaleY
);
2402 void MetaMoveClipRegionAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2404 MetaAction::Write(rOStm
, pData
);
2405 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2406 rOStm
.WriteInt32( mnHorzMove
).WriteInt32( mnVertMove
);
2409 void MetaMoveClipRegionAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2411 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2412 sal_Int32
nTmpHM(0), nTmpVM(0);
2413 rIStm
.ReadInt32( nTmpHM
).ReadInt32( nTmpVM
);
2414 mnHorzMove
= nTmpHM
;
2415 mnVertMove
= nTmpVM
;
2418 MetaLineColorAction::MetaLineColorAction() :
2419 MetaAction ( MetaActionType::LINECOLOR
),
2423 MetaLineColorAction::~MetaLineColorAction()
2426 MetaLineColorAction::MetaLineColorAction( const Color
& rColor
, bool bSet
) :
2427 MetaAction ( MetaActionType::LINECOLOR
),
2432 void MetaLineColorAction::Execute( OutputDevice
* pOut
)
2435 pOut
->SetLineColor( maColor
);
2437 pOut
->SetLineColor();
2440 MetaAction
* MetaLineColorAction::Clone()
2442 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaLineColorAction( *this ));
2443 pClone
->ResetRefCount();
2447 void MetaLineColorAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2449 MetaAction::Write(rOStm
, pData
);
2450 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2451 maColor
.Write( rOStm
);
2452 rOStm
.WriteBool( mbSet
);
2455 void MetaLineColorAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2457 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2458 maColor
.Read( rIStm
);
2459 rIStm
.ReadCharAsBool( mbSet
);
2462 MetaFillColorAction::MetaFillColorAction() :
2463 MetaAction ( MetaActionType::FILLCOLOR
),
2467 MetaFillColorAction::~MetaFillColorAction()
2470 MetaFillColorAction::MetaFillColorAction( const Color
& rColor
, bool bSet
) :
2471 MetaAction ( MetaActionType::FILLCOLOR
),
2476 void MetaFillColorAction::Execute( OutputDevice
* pOut
)
2479 pOut
->SetFillColor( maColor
);
2481 pOut
->SetFillColor();
2484 MetaAction
* MetaFillColorAction::Clone()
2486 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaFillColorAction( *this ));
2487 pClone
->ResetRefCount();
2491 void MetaFillColorAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2493 MetaAction::Write(rOStm
, pData
);
2494 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2495 maColor
.Write( rOStm
);
2496 rOStm
.WriteBool( mbSet
);
2499 void MetaFillColorAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2501 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2502 maColor
.Read( rIStm
);
2503 rIStm
.ReadCharAsBool( mbSet
);
2506 MetaTextColorAction::MetaTextColorAction() :
2507 MetaAction(MetaActionType::TEXTCOLOR
)
2510 MetaTextColorAction::~MetaTextColorAction()
2513 MetaTextColorAction::MetaTextColorAction( const Color
& rColor
) :
2514 MetaAction ( MetaActionType::TEXTCOLOR
),
2518 void MetaTextColorAction::Execute( OutputDevice
* pOut
)
2520 pOut
->SetTextColor( maColor
);
2523 MetaAction
* MetaTextColorAction::Clone()
2525 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaTextColorAction( *this ));
2526 pClone
->ResetRefCount();
2530 void MetaTextColorAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2532 MetaAction::Write(rOStm
, pData
);
2533 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2534 maColor
.Write( rOStm
);
2537 void MetaTextColorAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2539 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2540 maColor
.Read( rIStm
);
2543 MetaTextFillColorAction::MetaTextFillColorAction() :
2544 MetaAction ( MetaActionType::TEXTFILLCOLOR
),
2548 MetaTextFillColorAction::~MetaTextFillColorAction()
2551 MetaTextFillColorAction::MetaTextFillColorAction( const Color
& rColor
, bool bSet
) :
2552 MetaAction ( MetaActionType::TEXTFILLCOLOR
),
2557 void MetaTextFillColorAction::Execute( OutputDevice
* pOut
)
2560 pOut
->SetTextFillColor( maColor
);
2562 pOut
->SetTextFillColor();
2565 MetaAction
* MetaTextFillColorAction::Clone()
2567 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaTextFillColorAction( *this ));
2568 pClone
->ResetRefCount();
2572 void MetaTextFillColorAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2574 MetaAction::Write(rOStm
, pData
);
2575 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2576 maColor
.Write( rOStm
);
2577 rOStm
.WriteBool( mbSet
);
2580 void MetaTextFillColorAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2582 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2583 maColor
.Read( rIStm
);
2584 rIStm
.ReadCharAsBool( mbSet
);
2587 MetaTextLineColorAction::MetaTextLineColorAction() :
2588 MetaAction ( MetaActionType::TEXTLINECOLOR
),
2592 MetaTextLineColorAction::~MetaTextLineColorAction()
2595 MetaTextLineColorAction::MetaTextLineColorAction( const Color
& rColor
, bool bSet
) :
2596 MetaAction ( MetaActionType::TEXTLINECOLOR
),
2601 void MetaTextLineColorAction::Execute( OutputDevice
* pOut
)
2604 pOut
->SetTextLineColor( maColor
);
2606 pOut
->SetTextLineColor();
2609 MetaAction
* MetaTextLineColorAction::Clone()
2611 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaTextLineColorAction( *this ));
2612 pClone
->ResetRefCount();
2616 void MetaTextLineColorAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2618 MetaAction::Write(rOStm
, pData
);
2619 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2620 maColor
.Write( rOStm
);
2621 rOStm
.WriteBool( mbSet
);
2624 void MetaTextLineColorAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2626 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2627 maColor
.Read( rIStm
);
2628 rIStm
.ReadCharAsBool( mbSet
);
2631 MetaOverlineColorAction::MetaOverlineColorAction() :
2632 MetaAction ( MetaActionType::OVERLINECOLOR
),
2636 MetaOverlineColorAction::~MetaOverlineColorAction()
2639 MetaOverlineColorAction::MetaOverlineColorAction( const Color
& rColor
, bool bSet
) :
2640 MetaAction ( MetaActionType::OVERLINECOLOR
),
2645 void MetaOverlineColorAction::Execute( OutputDevice
* pOut
)
2648 pOut
->SetOverlineColor( maColor
);
2650 pOut
->SetOverlineColor();
2653 MetaAction
* MetaOverlineColorAction::Clone()
2655 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaOverlineColorAction( *this ));
2656 pClone
->ResetRefCount();
2660 void MetaOverlineColorAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2662 MetaAction::Write(rOStm
, pData
);
2663 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2664 maColor
.Write( rOStm
);
2665 rOStm
.WriteBool( mbSet
);
2668 void MetaOverlineColorAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2670 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2671 maColor
.Read( rIStm
);
2672 rIStm
.ReadCharAsBool( mbSet
);
2675 MetaTextAlignAction::MetaTextAlignAction() :
2676 MetaAction ( MetaActionType::TEXTALIGN
),
2677 maAlign ( ALIGN_TOP
)
2680 MetaTextAlignAction::~MetaTextAlignAction()
2683 MetaTextAlignAction::MetaTextAlignAction( TextAlign aAlign
) :
2684 MetaAction ( MetaActionType::TEXTALIGN
),
2688 void MetaTextAlignAction::Execute( OutputDevice
* pOut
)
2690 pOut
->SetTextAlign( maAlign
);
2693 MetaAction
* MetaTextAlignAction::Clone()
2695 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaTextAlignAction( *this ));
2696 pClone
->ResetRefCount();
2700 void MetaTextAlignAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2702 MetaAction::Write(rOStm
, pData
);
2703 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2704 rOStm
.WriteUInt16( maAlign
);
2707 void MetaTextAlignAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2709 sal_uInt16
nTmp16(0);
2711 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2712 rIStm
.ReadUInt16( nTmp16
); maAlign
= (TextAlign
) nTmp16
;
2715 MetaMapModeAction::MetaMapModeAction() :
2716 MetaAction(MetaActionType::MAPMODE
)
2719 MetaMapModeAction::~MetaMapModeAction()
2722 MetaMapModeAction::MetaMapModeAction( const MapMode
& rMapMode
) :
2723 MetaAction ( MetaActionType::MAPMODE
),
2724 maMapMode ( rMapMode
)
2727 void MetaMapModeAction::Execute( OutputDevice
* pOut
)
2729 pOut
->SetMapMode( maMapMode
);
2732 MetaAction
* MetaMapModeAction::Clone()
2734 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaMapModeAction( *this ));
2735 pClone
->ResetRefCount();
2739 void MetaMapModeAction::Scale( double fScaleX
, double fScaleY
)
2741 Point
aPoint( maMapMode
.GetOrigin() );
2743 ImplScalePoint( aPoint
, fScaleX
, fScaleY
);
2744 maMapMode
.SetOrigin( aPoint
);
2747 void MetaMapModeAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2749 MetaAction::Write(rOStm
, pData
);
2750 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2751 WriteMapMode( rOStm
, maMapMode
);
2754 void MetaMapModeAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2756 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2757 ReadMapMode( rIStm
, maMapMode
);
2760 MetaFontAction::MetaFontAction() :
2761 MetaAction(MetaActionType::FONT
)
2764 MetaFontAction::~MetaFontAction()
2767 MetaFontAction::MetaFontAction( const vcl::Font
& rFont
) :
2768 MetaAction ( MetaActionType::FONT
),
2771 // #96876: because RTL_TEXTENCODING_SYMBOL is often set at the StarSymbol font,
2772 // we change the textencoding to RTL_TEXTENCODING_UNICODE here, which seems
2773 // to be the right way; changing the textencoding at other sources
2774 // is too dangerous at the moment
2775 if ( IsStarSymbol( maFont
.GetFamilyName() )
2776 && ( maFont
.GetCharSet() != RTL_TEXTENCODING_UNICODE
) )
2778 maFont
.SetCharSet( RTL_TEXTENCODING_UNICODE
);
2782 void MetaFontAction::Execute( OutputDevice
* pOut
)
2784 pOut
->SetFont( maFont
);
2787 MetaAction
* MetaFontAction::Clone()
2789 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaFontAction( *this ));
2790 pClone
->ResetRefCount();
2794 void MetaFontAction::Scale( double fScaleX
, double fScaleY
)
2797 FRound(maFont
.GetFontSize().Width() * fabs(fScaleX
)),
2798 FRound(maFont
.GetFontSize().Height() * fabs(fScaleY
)));
2799 maFont
.SetFontSize( aSize
);
2802 void MetaFontAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2804 MetaAction::Write(rOStm
, pData
);
2805 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2806 WriteFont( rOStm
, maFont
);
2807 pData
->meActualCharSet
= maFont
.GetCharSet();
2808 if ( pData
->meActualCharSet
== RTL_TEXTENCODING_DONTKNOW
)
2809 pData
->meActualCharSet
= osl_getThreadTextEncoding();
2812 void MetaFontAction::Read( SvStream
& rIStm
, ImplMetaReadData
* pData
)
2814 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2815 ReadFont( rIStm
, maFont
);
2816 pData
->meActualCharSet
= maFont
.GetCharSet();
2817 if ( pData
->meActualCharSet
== RTL_TEXTENCODING_DONTKNOW
)
2818 pData
->meActualCharSet
= osl_getThreadTextEncoding();
2821 MetaPushAction::MetaPushAction() :
2822 MetaAction ( MetaActionType::PUSH
),
2823 mnFlags ( PushFlags::NONE
)
2826 MetaPushAction::~MetaPushAction()
2829 MetaPushAction::MetaPushAction( PushFlags nFlags
) :
2830 MetaAction ( MetaActionType::PUSH
),
2834 void MetaPushAction::Execute( OutputDevice
* pOut
)
2836 pOut
->Push( mnFlags
);
2839 MetaAction
* MetaPushAction::Clone()
2841 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaPushAction( *this ));
2842 pClone
->ResetRefCount();
2846 void MetaPushAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2848 MetaAction::Write(rOStm
, pData
);
2849 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2850 rOStm
.WriteUInt16( static_cast<sal_uInt16
>(mnFlags
) );
2853 void MetaPushAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2855 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2857 rIStm
.ReadUInt16( tmp
);
2858 mnFlags
= static_cast<PushFlags
>(tmp
);
2861 MetaPopAction::MetaPopAction() :
2862 MetaAction(MetaActionType::POP
)
2865 MetaPopAction::~MetaPopAction()
2868 void MetaPopAction::Execute( OutputDevice
* pOut
)
2873 MetaAction
* MetaPopAction::Clone()
2875 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaPopAction( *this ));
2876 pClone
->ResetRefCount();
2880 void MetaPopAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2882 MetaAction::Write(rOStm
, pData
);
2883 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2886 void MetaPopAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2888 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2891 MetaRasterOpAction::MetaRasterOpAction() :
2892 MetaAction ( MetaActionType::RASTEROP
),
2893 meRasterOp ( RasterOp::OverPaint
)
2896 MetaRasterOpAction::~MetaRasterOpAction()
2899 MetaRasterOpAction::MetaRasterOpAction( RasterOp eRasterOp
) :
2900 MetaAction ( MetaActionType::RASTEROP
),
2901 meRasterOp ( eRasterOp
)
2905 void MetaRasterOpAction::Execute( OutputDevice
* pOut
)
2907 pOut
->SetRasterOp( meRasterOp
);
2910 MetaAction
* MetaRasterOpAction::Clone()
2912 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaRasterOpAction( *this ));
2913 pClone
->ResetRefCount();
2917 void MetaRasterOpAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2919 MetaAction::Write(rOStm
, pData
);
2920 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2921 rOStm
.WriteUInt16( (sal_uInt16
)meRasterOp
);
2924 void MetaRasterOpAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2926 sal_uInt16
nTmp16(0);
2928 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2929 rIStm
.ReadUInt16( nTmp16
); meRasterOp
= (RasterOp
) nTmp16
;
2932 MetaTransparentAction::MetaTransparentAction() :
2933 MetaAction ( MetaActionType::Transparent
),
2934 mnTransPercent ( 0 )
2937 MetaTransparentAction::~MetaTransparentAction()
2940 MetaTransparentAction::MetaTransparentAction( const tools::PolyPolygon
& rPolyPoly
, sal_uInt16 nTransPercent
) :
2941 MetaAction ( MetaActionType::Transparent
),
2942 maPolyPoly ( rPolyPoly
),
2943 mnTransPercent ( nTransPercent
)
2946 void MetaTransparentAction::Execute( OutputDevice
* pOut
)
2948 pOut
->DrawTransparent( maPolyPoly
, mnTransPercent
);
2951 MetaAction
* MetaTransparentAction::Clone()
2953 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaTransparentAction( *this ));
2954 pClone
->ResetRefCount();
2958 void MetaTransparentAction::Move( long nHorzMove
, long nVertMove
)
2960 maPolyPoly
.Move( nHorzMove
, nVertMove
);
2963 void MetaTransparentAction::Scale( double fScaleX
, double fScaleY
)
2965 for( sal_uInt16 i
= 0, nCount
= maPolyPoly
.Count(); i
< nCount
; i
++ )
2966 ImplScalePoly( maPolyPoly
[ i
], fScaleX
, fScaleY
);
2969 void MetaTransparentAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
2971 MetaAction::Write(rOStm
, pData
);
2972 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
2974 // #i105373# The tools::PolyPolygon in this action may be a curve; this
2975 // was ignored until now what is an error. To make older office
2976 // versions work with MetaFiles, i opt for applying AdaptiveSubdivide
2977 // to the PolyPolygon.
2978 // The alternative would be to really write the curve information
2979 // like in MetaPolyPolygonAction::Write (where someone extended it
2980 // correctly, but not here :-( ).
2981 // The golden solution would be to combine both, but i think it's
2982 // not necessary; a good subdivision will be sufficient.
2983 tools::PolyPolygon aNoCurvePolyPolygon
;
2984 maPolyPoly
.AdaptiveSubdivide(aNoCurvePolyPolygon
);
2986 WritePolyPolygon( rOStm
, aNoCurvePolyPolygon
);
2987 rOStm
.WriteUInt16( mnTransPercent
);
2990 void MetaTransparentAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
2992 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
2993 ReadPolyPolygon( rIStm
, maPolyPoly
);
2994 rIStm
.ReadUInt16( mnTransPercent
);
2997 MetaFloatTransparentAction::MetaFloatTransparentAction() :
2998 MetaAction(MetaActionType::FLOATTRANSPARENT
)
3001 MetaFloatTransparentAction::~MetaFloatTransparentAction()
3004 MetaFloatTransparentAction::MetaFloatTransparentAction( const GDIMetaFile
& rMtf
, const Point
& rPos
,
3005 const Size
& rSize
, const Gradient
& rGradient
) :
3006 MetaAction ( MetaActionType::FLOATTRANSPARENT
),
3010 maGradient ( rGradient
)
3013 void MetaFloatTransparentAction::Execute( OutputDevice
* pOut
)
3015 pOut
->DrawTransparent( maMtf
, maPoint
, maSize
, maGradient
);
3018 MetaAction
* MetaFloatTransparentAction::Clone()
3020 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaFloatTransparentAction( *this ));
3021 pClone
->ResetRefCount();
3025 void MetaFloatTransparentAction::Move( long nHorzMove
, long nVertMove
)
3027 maPoint
.Move( nHorzMove
, nVertMove
);
3030 void MetaFloatTransparentAction::Scale( double fScaleX
, double fScaleY
)
3032 tools::Rectangle
aRectangle(maPoint
, maSize
);
3033 ImplScaleRect( aRectangle
, fScaleX
, fScaleY
);
3034 maPoint
= aRectangle
.TopLeft();
3035 maSize
= aRectangle
.GetSize();
3038 void MetaFloatTransparentAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
3040 MetaAction::Write(rOStm
, pData
);
3041 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
3043 maMtf
.Write( rOStm
);
3044 WritePair( rOStm
, maPoint
);
3045 WritePair( rOStm
, maSize
);
3046 WriteGradient( rOStm
, maGradient
);
3049 void MetaFloatTransparentAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
3051 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
3052 ReadGDIMetaFile( rIStm
, maMtf
);
3053 ReadPair( rIStm
, maPoint
);
3054 ReadPair( rIStm
, maSize
);
3055 ReadGradient( rIStm
, maGradient
);
3058 MetaEPSAction::MetaEPSAction() :
3059 MetaAction(MetaActionType::EPS
)
3062 MetaEPSAction::~MetaEPSAction()
3065 MetaEPSAction::MetaEPSAction( const Point
& rPoint
, const Size
& rSize
,
3066 const GfxLink
& rGfxLink
, const GDIMetaFile
& rSubst
) :
3067 MetaAction ( MetaActionType::EPS
),
3068 maGfxLink ( rGfxLink
),
3074 void MetaEPSAction::Execute( OutputDevice
* pOut
)
3076 pOut
->DrawEPS( maPoint
, maSize
, maGfxLink
, &maSubst
);
3079 MetaAction
* MetaEPSAction::Clone()
3081 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaEPSAction( *this ));
3082 pClone
->ResetRefCount();
3086 void MetaEPSAction::Move( long nHorzMove
, long nVertMove
)
3088 maPoint
.Move( nHorzMove
, nVertMove
);
3091 void MetaEPSAction::Scale( double fScaleX
, double fScaleY
)
3093 tools::Rectangle
aRectangle(maPoint
, maSize
);
3094 ImplScaleRect( aRectangle
, fScaleX
, fScaleY
);
3095 maPoint
= aRectangle
.TopLeft();
3096 maSize
= aRectangle
.GetSize();
3099 void MetaEPSAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
3101 MetaAction::Write(rOStm
, pData
);
3102 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
3104 WriteGfxLink( rOStm
, maGfxLink
);
3105 WritePair( rOStm
, maPoint
);
3106 WritePair( rOStm
, maSize
);
3107 maSubst
.Write( rOStm
);
3110 void MetaEPSAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
3112 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
3113 ReadGfxLink( rIStm
, maGfxLink
);
3114 ReadPair( rIStm
, maPoint
);
3115 ReadPair( rIStm
, maSize
);
3116 ReadGDIMetaFile( rIStm
, maSubst
);
3119 MetaRefPointAction::MetaRefPointAction() :
3120 MetaAction ( MetaActionType::REFPOINT
),
3124 MetaRefPointAction::~MetaRefPointAction()
3127 MetaRefPointAction::MetaRefPointAction( const Point
& rRefPoint
, bool bSet
) :
3128 MetaAction ( MetaActionType::REFPOINT
),
3129 maRefPoint ( rRefPoint
),
3133 void MetaRefPointAction::Execute( OutputDevice
* pOut
)
3136 pOut
->SetRefPoint( maRefPoint
);
3138 pOut
->SetRefPoint();
3141 MetaAction
* MetaRefPointAction::Clone()
3143 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaRefPointAction( *this ));
3144 pClone
->ResetRefCount();
3148 void MetaRefPointAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
3150 MetaAction::Write(rOStm
, pData
);
3151 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
3153 WritePair( rOStm
, maRefPoint
);
3154 rOStm
.WriteBool( mbSet
);
3157 void MetaRefPointAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
3159 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
3160 ReadPair( rIStm
, maRefPoint
).ReadCharAsBool( mbSet
);
3163 MetaCommentAction::MetaCommentAction() :
3164 MetaAction ( MetaActionType::COMMENT
),
3167 ImplInitDynamicData( nullptr, 0UL );
3170 MetaCommentAction::MetaCommentAction( const MetaCommentAction
& rAct
) :
3171 MetaAction ( MetaActionType::COMMENT
),
3172 maComment ( rAct
.maComment
),
3173 mnValue ( rAct
.mnValue
)
3175 ImplInitDynamicData( rAct
.mpData
, rAct
.mnDataSize
);
3178 MetaCommentAction::MetaCommentAction( const OString
& rComment
, sal_Int32 nValue
, const sal_uInt8
* pData
, sal_uInt32 nDataSize
) :
3179 MetaAction ( MetaActionType::COMMENT
),
3180 maComment ( rComment
),
3183 ImplInitDynamicData( pData
, nDataSize
);
3186 MetaCommentAction::~MetaCommentAction()
3192 void MetaCommentAction::ImplInitDynamicData( const sal_uInt8
* pData
, sal_uInt32 nDataSize
)
3194 if ( nDataSize
&& pData
)
3196 mnDataSize
= nDataSize
;
3197 mpData
= new sal_uInt8
[ mnDataSize
];
3198 memcpy( mpData
, pData
, mnDataSize
);
3207 void MetaCommentAction::Execute( OutputDevice
* pOut
)
3209 if ( pOut
->GetConnectMetaFile() )
3212 pOut
->GetConnectMetaFile()->AddAction( this );
3216 MetaAction
* MetaCommentAction::Clone()
3218 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaCommentAction( *this ));
3219 pClone
->ResetRefCount();
3223 void MetaCommentAction::Move( long nXMove
, long nYMove
)
3225 if ( nXMove
|| nYMove
)
3227 if ( mnDataSize
&& mpData
)
3229 bool bPathStroke
= (maComment
== "XPATHSTROKE_SEQ_BEGIN");
3230 if ( bPathStroke
|| maComment
== "XPATHFILL_SEQ_BEGIN" )
3232 SvMemoryStream
aMemStm( static_cast<void*>(mpData
), mnDataSize
, StreamMode::READ
);
3233 SvMemoryStream aDest
;
3236 SvtGraphicStroke aStroke
;
3237 ReadSvtGraphicStroke( aMemStm
, aStroke
);
3239 tools::Polygon aPath
;
3240 aStroke
.getPath( aPath
);
3241 aPath
.Move( nXMove
, nYMove
);
3242 aStroke
.setPath( aPath
);
3244 tools::PolyPolygon aStartArrow
;
3245 aStroke
.getStartArrow(aStartArrow
);
3246 aStartArrow
.Move(nXMove
, nYMove
);
3247 aStroke
.setStartArrow(aStartArrow
);
3249 tools::PolyPolygon aEndArrow
;
3250 aStroke
.getEndArrow(aEndArrow
);
3251 aEndArrow
.Move(nXMove
, nYMove
);
3252 aStroke
.setEndArrow(aEndArrow
);
3254 WriteSvtGraphicStroke( aDest
, aStroke
);
3258 SvtGraphicFill aFill
;
3259 ReadSvtGraphicFill( aMemStm
, aFill
);
3261 tools::PolyPolygon aPath
;
3262 aFill
.getPath( aPath
);
3263 aPath
.Move( nXMove
, nYMove
);
3264 aFill
.setPath( aPath
);
3266 WriteSvtGraphicFill( aDest
, aFill
);
3269 ImplInitDynamicData( static_cast<const sal_uInt8
*>( aDest
.GetData() ), aDest
.Tell() );
3275 // SJ: 25.07.06 #i56656# we are not able to mirror certain kind of
3276 // comments properly, especially the XPATHSTROKE and XPATHFILL lead to
3277 // problems, so it is better to remove these comments when mirroring
3278 // FIXME: fake comment to apply the next hunk in the right location
3279 void MetaCommentAction::Scale( double fXScale
, double fYScale
)
3281 if ( ( fXScale
!= 1.0 ) || ( fYScale
!= 1.0 ) )
3283 if ( mnDataSize
&& mpData
)
3285 bool bPathStroke
= (maComment
== "XPATHSTROKE_SEQ_BEGIN");
3286 if ( bPathStroke
|| maComment
== "XPATHFILL_SEQ_BEGIN" )
3288 SvMemoryStream
aMemStm( static_cast<void*>(mpData
), mnDataSize
, StreamMode::READ
);
3289 SvMemoryStream aDest
;
3292 SvtGraphicStroke aStroke
;
3293 ReadSvtGraphicStroke( aMemStm
, aStroke
);
3294 aStroke
.scale( fXScale
, fYScale
);
3295 WriteSvtGraphicStroke( aDest
, aStroke
);
3299 SvtGraphicFill aFill
;
3300 ReadSvtGraphicFill( aMemStm
, aFill
);
3301 tools::PolyPolygon aPath
;
3302 aFill
.getPath( aPath
);
3303 aPath
.Scale( fXScale
, fYScale
);
3304 aFill
.setPath( aPath
);
3305 WriteSvtGraphicFill( aDest
, aFill
);
3308 ImplInitDynamicData( static_cast<const sal_uInt8
*>( aDest
.GetData() ), aDest
.Tell() );
3309 } else if( maComment
== "EMF_PLUS_HEADER_INFO" ){
3310 SvMemoryStream
aMemStm( static_cast<void*>(mpData
), mnDataSize
, StreamMode::READ
);
3311 SvMemoryStream aDest
;
3313 sal_Int32
nLeft(0), nRight(0), nTop(0), nBottom(0);
3314 sal_Int32
nPixX(0), nPixY(0), nMillX(0), nMillY(0);
3315 float m11(0), m12(0), m21(0), m22(0), mdx(0), mdy(0);
3318 aMemStm
.ReadInt32( nLeft
).ReadInt32( nTop
).ReadInt32( nRight
).ReadInt32( nBottom
);
3319 aMemStm
.ReadInt32( nPixX
).ReadInt32( nPixY
).ReadInt32( nMillX
).ReadInt32( nMillY
);
3320 aMemStm
.ReadFloat( m11
).ReadFloat( m12
).ReadFloat( m21
).ReadFloat( m22
).ReadFloat( mdx
).ReadFloat( mdy
);
3322 // add scale to the transformation
3329 aDest
.WriteInt32( nLeft
).WriteInt32( nTop
).WriteInt32( nRight
).WriteInt32( nBottom
);
3330 aDest
.WriteInt32( nPixX
).WriteInt32( nPixY
).WriteInt32( nMillX
).WriteInt32( nMillY
);
3331 aDest
.WriteFloat( m11
).WriteFloat( m12
).WriteFloat( m21
).WriteFloat( m22
).WriteFloat( mdx
).WriteFloat( mdy
);
3334 ImplInitDynamicData( static_cast<const sal_uInt8
*>( aDest
.GetData() ), aDest
.Tell() );
3340 void MetaCommentAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
3342 MetaAction::Write(rOStm
, pData
);
3343 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
3344 write_uInt16_lenPrefixed_uInt8s_FromOString(rOStm
, maComment
);
3345 rOStm
.WriteInt32( mnValue
).WriteUInt32( mnDataSize
);
3348 rOStm
.WriteBytes( mpData
, mnDataSize
);
3351 void MetaCommentAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
3353 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
3354 maComment
= read_uInt16_lenPrefixed_uInt8s_ToOString(rIStm
);
3355 rIStm
.ReadInt32( mnValue
).ReadUInt32( mnDataSize
);
3357 if (mnDataSize
> rIStm
.remainingSize())
3359 SAL_WARN("vcl.gdi", "Parsing error: " << rIStm
.remainingSize() <<
3360 " available data, but " << mnDataSize
<< " claimed, truncating");
3361 mnDataSize
= rIStm
.remainingSize();
3364 SAL_INFO("vcl.gdi", "MetaCommentAction::Read " << maComment
);
3370 mpData
= new sal_uInt8
[ mnDataSize
];
3371 rIStm
.ReadBytes(mpData
, mnDataSize
);
3377 MetaLayoutModeAction::MetaLayoutModeAction() :
3378 MetaAction ( MetaActionType::LAYOUTMODE
),
3379 mnLayoutMode( ComplexTextLayoutFlags::Default
)
3382 MetaLayoutModeAction::~MetaLayoutModeAction()
3385 MetaLayoutModeAction::MetaLayoutModeAction( ComplexTextLayoutFlags nLayoutMode
) :
3386 MetaAction ( MetaActionType::LAYOUTMODE
),
3387 mnLayoutMode( nLayoutMode
)
3390 void MetaLayoutModeAction::Execute( OutputDevice
* pOut
)
3392 pOut
->SetLayoutMode( mnLayoutMode
);
3395 MetaAction
* MetaLayoutModeAction::Clone()
3397 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaLayoutModeAction( *this ));
3398 pClone
->ResetRefCount();
3402 void MetaLayoutModeAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
3404 MetaAction::Write(rOStm
, pData
);
3405 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
3406 rOStm
.WriteUInt32( (sal_uInt32
)mnLayoutMode
);
3409 void MetaLayoutModeAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
3411 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
3413 rIStm
.ReadUInt32( tmp
);
3414 mnLayoutMode
= static_cast<ComplexTextLayoutFlags
>(tmp
);
3417 MetaTextLanguageAction::MetaTextLanguageAction() :
3418 MetaAction ( MetaActionType::TEXTLANGUAGE
),
3419 meTextLanguage( LANGUAGE_DONTKNOW
)
3422 MetaTextLanguageAction::~MetaTextLanguageAction()
3425 MetaTextLanguageAction::MetaTextLanguageAction( LanguageType eTextLanguage
) :
3426 MetaAction ( MetaActionType::TEXTLANGUAGE
),
3427 meTextLanguage( eTextLanguage
)
3430 void MetaTextLanguageAction::Execute( OutputDevice
* pOut
)
3432 pOut
->SetDigitLanguage( meTextLanguage
);
3435 MetaAction
* MetaTextLanguageAction::Clone()
3437 MetaAction
* pClone
= static_cast<MetaAction
*>(new MetaTextLanguageAction( *this ));
3438 pClone
->ResetRefCount();
3442 void MetaTextLanguageAction::Write( SvStream
& rOStm
, ImplMetaWriteData
* pData
)
3444 MetaAction::Write(rOStm
, pData
);
3445 VersionCompat
aCompat(rOStm
, StreamMode::WRITE
, 1);
3446 rOStm
.WriteUInt16( (sal_uInt16
)meTextLanguage
);
3449 void MetaTextLanguageAction::Read( SvStream
& rIStm
, ImplMetaReadData
* )
3451 VersionCompat
aCompat(rIStm
, StreamMode::READ
);
3452 sal_uInt16 nTmp
= 0;
3453 rIStm
.ReadUInt16( nTmp
);
3454 meTextLanguage
= static_cast<LanguageType
>(nTmp
);
3457 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */