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