LibreOffice Module vcl (master)  1
wmfwr.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 <sal/config.h>
21 #include <osl/diagnose.h>
22 
23 #include <algorithm>
24 
25 #include "wmfwr.hxx"
26 #include "emfwr.hxx"
27 #include <rtl/crc.h>
28 #include <rtl/tencinfo.h>
29 #include <tools/bigint.hxx>
30 #include <tools/helpers.hxx>
31 #include <tools/tenccvt.hxx>
32 #include <tools/fract.hxx>
33 #include <tools/stream.hxx>
34 #include <vcl/dibtools.hxx>
35 #include <vcl/metaact.hxx>
36 #include <vcl/FilterConfigItem.hxx>
39 #include <memory>
40 #include <vcl/fontcharmap.hxx>
42 
43 // MS Windows defines
44 
45 #define W_META_SETBKMODE 0x0102
46 #define W_META_SETROP2 0x0104
47 #define W_META_SETSTRETCHBLTMODE 0x0107
48 #define W_META_SETTEXTCOLOR 0x0209
49 #define W_META_SETWINDOWORG 0x020B
50 #define W_META_SETWINDOWEXT 0x020C
51 #define W_META_LINETO 0x0213
52 #define W_META_MOVETO 0x0214
53 #define W_META_INTERSECTCLIPRECT 0x0416
54 #define W_META_ARC 0x0817
55 #define W_META_ELLIPSE 0x0418
56 #define W_META_PIE 0x081A
57 #define W_META_RECTANGLE 0x041B
58 #define W_META_ROUNDRECT 0x061C
59 #define W_META_SAVEDC 0x001E
60 #define W_META_SETPIXEL 0x041F
61 #define W_META_TEXTOUT 0x0521
62 #define W_META_POLYGON 0x0324
63 #define W_META_POLYLINE 0x0325
64 #define W_META_ESCAPE 0x0626
65 #define W_META_RESTOREDC 0x0127
66 #define W_META_SELECTOBJECT 0x012D
67 #define W_META_SETTEXTALIGN 0x012E
68 #define W_META_CHORD 0x0830
69 #define W_META_EXTTEXTOUT 0x0a32
70 #define W_META_POLYPOLYGON 0x0538
71 #define W_META_STRETCHDIB 0x0f43
72 #define W_META_DELETEOBJECT 0x01f0
73 #define W_META_CREATEPENINDIRECT 0x02FA
74 #define W_META_CREATEFONTINDIRECT 0x02FB
75 #define W_META_CREATEBRUSHINDIRECT 0x02FC
76 
77 #define W_TRANSPARENT 1
78 #define W_OPAQUE 2
79 
80 #define W_R2_NOT 6
81 #define W_R2_XORPEN 7
82 #define W_R2_COPYPEN 13
83 
84 #define W_TA_NOUPDATECP 0x0000
85 #define W_TA_LEFT 0x0000
86 #define W_TA_RIGHT 0x0002
87 #define W_TA_TOP 0x0000
88 #define W_TA_BOTTOM 0x0008
89 #define W_TA_BASELINE 0x0018
90 #define W_TA_RTLREADING 0x0100
91 
92 #define W_SRCCOPY 0x00CC0020L
93 #define W_SRCPAINT 0x00EE0086L
94 #define W_SRCAND 0x008800C6L
95 #define W_SRCINVERT 0x00660046L
96 #define W_DSTINVERT 0x00550009L
97 
98 #define W_PS_SOLID 0
99 #define W_PS_DASH 1
100 #define W_PS_DOT 2
101 #define W_PS_DASHDOT 3
102 #define W_PS_DASHDOTDOT 4
103 #define W_PS_NULL 5
104 
105 #define W_LF_FACESIZE 32
106 
107 #define W_ANSI_CHARSET 0
108 
109 #define W_DEFAULT_PITCH 0x00
110 #define W_FIXED_PITCH 0x01
111 #define W_VARIABLE_PITCH 0x02
112 
113 #define W_FF_DONTCARE 0x00
114 #define W_FF_ROMAN 0x10
115 #define W_FF_SWISS 0x20
116 #define W_FF_MODERN 0x30
117 #define W_FF_SCRIPT 0x40
118 #define W_FF_DECORATIVE 0x50
119 
120 #define W_FW_DONTCARE 0
121 #define W_FW_THIN 100
122 #define W_FW_LIGHT 300
123 #define W_FW_NORMAL 400
124 #define W_FW_MEDIUM 500
125 #define W_FW_SEMIBOLD 600
126 #define W_FW_BOLD 700
127 #define W_FW_ULTRALIGHT 200
128 #define W_FW_ULTRABOLD 800
129 #define W_FW_BLACK 900
130 
131 #define W_BS_SOLID 0
132 #define W_BS_HOLLOW 1
133 
134 #define W_MFCOMMENT 15
135 
136 #define PRIVATE_ESCAPE_UNICODE 2
137 
139  : bStatus(false)
140  , nLastPercent(0)
141  , pWMF(nullptr)
142  , pVirDev(nullptr)
143  , nMetafileHeaderPos(0)
144  , nMaxRecordSize(0)
145  , nActRecordPos(0)
146  , eSrcRasterOp(RasterOp::OverPaint)
147  , eSrcTextAlign(ALIGN_BASELINE)
148  , pAttrStack(nullptr)
149  , eSrcHorTextAlign(W_TA_LEFT)
150  , eDstROP2(RasterOp::OverPaint)
151  , eDstTextAlign(ALIGN_BASELINE)
152  , eDstHorTextAlign(W_TA_LEFT)
153  , bHandleAllocated{}
154  , nDstPenHandle(0)
155  , nDstFontHandle(0)
156  , nDstBrushHandle(0)
157  , nNumberOfActions(0)
158  , nNumberOfBitmaps(0)
159  , nWrittenActions(0)
160  , nWrittenBitmaps(0)
161  , nActBitmapPercent(0)
162  , bEmbedEMF(false)
163 {
164 }
165 
167 {
168  if ( !xStatusIndicator.is() )
169  return;
170 
171  sal_uLong nPercent;
172 
173  // we simply assume that 16386 actions match to a bitmap
174  // (normally a metafile either contains only actions or some bitmaps and
175  // almost no actions. In which case the ratio is less important)
176 
177  nPercent=((nWrittenBitmaps<<14)+(nActBitmapPercent<<14)/100+nWrittenActions)
178  *100
180 
181  if ( nPercent >= nLastPercent + 3 )
182  {
183  nLastPercent = nPercent;
184  if( nPercent <= 100 )
185  xStatusIndicator->setValue( nPercent );
186  }
187 }
188 
190 {
191  size_t nAction, nActionCount;
192 
193  nActionCount = rMTF.GetActionSize();
194 
195  for ( nAction=0; nAction < nActionCount; nAction++ )
196  {
197  MetaAction* pMA = rMTF.GetAction( nAction );
198 
199  switch( pMA->GetType() )
200  {
201  case MetaActionType::BMP:
208  break;
209  default: break;
210  }
212  }
213 }
214 
215 void WMFWriter::WritePointXY(const Point & rPoint)
216 {
218  pWMF->WriteInt16( aPt.X() ).WriteInt16( aPt.Y() );
219 }
220 
221 void WMFWriter::WritePointYX(const Point & rPoint)
222 {
224  pWMF->WriteInt16( aPt.Y() ).WriteInt16( aPt.X() );
225 }
226 
227 sal_Int32 WMFWriter::ScaleWidth( sal_Int32 nDX )
228 {
230  return aSz.Width();
231 }
232 
233 void WMFWriter::WriteSize(const Size & rSize)
234 {
236  pWMF->WriteInt16( aSz.Width() ).WriteInt16( aSz.Height() );
237 }
238 
240 {
242  pWMF->WriteInt16( aSz.Height() ).WriteInt16( aSz.Width() );
243 }
244 
246 {
247  WritePointYX(Point(rRect.Right()+1,rRect.Bottom()+1));
248  WritePointYX(rRect.TopLeft());
249 }
250 
251 void WMFWriter::WriteColor(const Color & rColor)
252 {
253  pWMF->WriteUChar( rColor.GetRed() ).WriteUChar( rColor.GetGreen() ).WriteUChar( rColor.GetBlue() ).WriteUChar( 0 );
254 }
255 
256 void WMFWriter::WriteRecordHeader(sal_uInt32 nSizeWords, sal_uInt16 nType)
257 {
259  if (nSizeWords>nMaxRecordSize) nMaxRecordSize=nSizeWords;
260  pWMF->WriteUInt32( nSizeWords ).WriteUInt16( nType );
261 }
262 
264 {
265  sal_uLong nPos;
266  sal_uInt32 nSize;
267 
268  nPos=pWMF->Tell(); nSize=nPos-nActRecordPos;
269  if ((nSize & 1)!=0) {
270  pWMF->WriteUChar( 0 );
271  nPos++; nSize++;
272  }
273  nSize/=2;
274  if (nSize>nMaxRecordSize) nMaxRecordSize=nSize;
275  pWMF->Seek(nActRecordPos);
276  pWMF->WriteUInt32( nSize );
277  pWMF->Seek(nPos);
278 }
279 
280 void WMFWriter::WMFRecord_Arc(const tools::Rectangle & rRect, const Point & rStartPt, const Point & rEndPt)
281 {
282  WriteRecordHeader(0x0000000b,W_META_ARC);
283  WritePointYX(rEndPt);
284  WritePointYX(rStartPt);
285  WriteRectangle(rRect);
286 }
287 
288 void WMFWriter::WMFRecord_Chord(const tools::Rectangle & rRect, const Point & rStartPt, const Point & rEndPt)
289 {
290  WriteRecordHeader(0x0000000b,W_META_CHORD);
291  WritePointYX(rEndPt);
292  WritePointYX(rStartPt);
293  WriteRectangle(rRect);
294 }
295 
297 {
299 
300  if( rColor==COL_TRANSPARENT )
302  else
304 
305  WriteColor( rColor );
306  pWMF->WriteUInt16( 0 );
307 }
308 
310 {
311  sal_uInt16 nWeight,i;
312  sal_uInt8 nPitchFamily;
313 
315  WriteHeightWidth(Size(rFont.GetFontSize().Width(),-rFont.GetFontSize().Height()));
316  pWMF->WriteInt16( rFont.GetOrientation().get() ).WriteInt16( rFont.GetOrientation().get() );
317 
318  switch (rFont.GetWeight()) {
319  case WEIGHT_THIN: nWeight=W_FW_THIN; break;
320  case WEIGHT_ULTRALIGHT: nWeight=W_FW_ULTRALIGHT; break;
321  case WEIGHT_LIGHT: nWeight=W_FW_LIGHT; break;
322  case WEIGHT_SEMILIGHT: nWeight=W_FW_LIGHT; break;
323  case WEIGHT_NORMAL: nWeight=W_FW_NORMAL; break;
324  case WEIGHT_MEDIUM: nWeight=W_FW_MEDIUM; break;
325  case WEIGHT_SEMIBOLD: nWeight=W_FW_SEMIBOLD; break;
326  case WEIGHT_BOLD: nWeight=W_FW_BOLD; break;
327  case WEIGHT_ULTRABOLD: nWeight=W_FW_ULTRABOLD; break;
328  case WEIGHT_BLACK: nWeight=W_FW_BLACK; break;
329  default: nWeight=W_FW_DONTCARE;
330  }
331  pWMF->WriteUInt16( nWeight );
332 
333  if (rFont.GetItalic()==ITALIC_NONE) pWMF->WriteUChar( 0 ); else pWMF->WriteUChar( 1 );
334  if (rFont.GetUnderline()==LINESTYLE_NONE) pWMF->WriteUChar( 0 ); else pWMF->WriteUChar( 1 );
335  if (rFont.GetStrikeout()==STRIKEOUT_NONE) pWMF->WriteUChar( 0 ); else pWMF->WriteUChar( 1 );
336 
337  rtl_TextEncoding eFontNameEncoding = rFont.GetCharSet();
338  sal_uInt8 nCharSet = rtl_getBestWindowsCharsetFromTextEncoding( eFontNameEncoding );
339  if ( eFontNameEncoding == RTL_TEXTENCODING_SYMBOL )
340  eFontNameEncoding = RTL_TEXTENCODING_MS_1252;
341  if ( nCharSet == 1 )
342  nCharSet = W_ANSI_CHARSET;
343  pWMF->WriteUChar( nCharSet );
344 
345  pWMF->WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 );
346 
347  switch (rFont.GetPitch()) {
348  case PITCH_FIXED: nPitchFamily=W_FIXED_PITCH; break;
349  case PITCH_VARIABLE: nPitchFamily=W_VARIABLE_PITCH; break;
350  default: nPitchFamily=W_DEFAULT_PITCH;
351  }
352  switch (rFont.GetFamilyType()) {
353  case FAMILY_DECORATIVE: nPitchFamily|=W_FF_DECORATIVE; break;
354  case FAMILY_MODERN: nPitchFamily|=W_FF_MODERN; break;
355  case FAMILY_ROMAN: nPitchFamily|=W_FF_ROMAN; break;
356  case FAMILY_SCRIPT: nPitchFamily|=W_FF_SCRIPT; break;
357  case FAMILY_SWISS: nPitchFamily|=W_FF_SWISS; break;
358  default: nPitchFamily|=W_FF_DONTCARE;
359  }
360  pWMF->WriteUChar( nPitchFamily );
361 
362  OString aFontName(OUStringToOString(rFont.GetFamilyName(), eFontNameEncoding));
363  for ( i = 0; i < W_LF_FACESIZE; i++ )
364  {
365  char nChar = ( i < aFontName.getLength() ) ? aFontName[i] : 0;
366  pWMF->WriteChar( nChar );
367  }
369 }
370 
371 void WMFWriter::WMFRecord_CreatePenIndirect(const Color& rColor, const LineInfo& rLineInfo )
372 {
374  sal_uInt16 nStyle = rColor == COL_TRANSPARENT ? W_PS_NULL : W_PS_SOLID;
375  switch( rLineInfo.GetStyle() )
376  {
377  case LineStyle::Dash :
378  {
379  if ( rLineInfo.GetDotCount() )
380  {
381  if ( !rLineInfo.GetDashCount() )
382  nStyle = W_PS_DOT;
383  else
384  {
385  if ( rLineInfo.GetDotCount() == 1 )
386  nStyle = W_PS_DASHDOT;
387  else
388  nStyle = W_PS_DASHDOTDOT;
389  }
390  }
391  else
392  nStyle = W_PS_DASH;
393  }
394  break;
395  case LineStyle::NONE :
396  nStyle = W_PS_NULL;
397  break;
398  default:
399  break;
400  }
401  pWMF->WriteUInt16( nStyle );
402 
403  WriteSize( Size( rLineInfo.GetWidth(), 0 ) );
404  WriteColor( rColor );
405 }
406 
407 void WMFWriter::WMFRecord_DeleteObject(sal_uInt16 nObjectHandle)
408 {
410  pWMF->WriteUInt16( nObjectHandle );
411 }
412 
414 {
415  WriteRecordHeader(0x00000007,W_META_ELLIPSE);
416  WriteRectangle(rRect);
417 }
418 
419 void WMFWriter::WMFRecord_Escape( sal_uInt32 nEsc, sal_uInt32 nLen, const sal_Int8* pData )
420 {
421 #ifdef OSL_BIGENDIAN
422  sal_uInt32 nTmp = OSL_SWAPDWORD( nEsc );
423  sal_uInt32 nCheckSum = rtl_crc32( 0, &nTmp, 4 );
424 #else
425  sal_uInt32 nCheckSum = rtl_crc32( 0, &nEsc, 4 );
426 #endif
427  if ( nLen )
428  nCheckSum = rtl_crc32( nCheckSum, pData, nLen );
429 
430  WriteRecordHeader( 3 + 9 + ( ( nLen + 1 ) >> 1 ), W_META_ESCAPE );
432  .WriteUInt16( nLen + 14 ) // we will always have a fourteen byte escape header:
433  .WriteUInt16( 0x4f4f ) // OO
434  .WriteUInt32( 0xa2c2a ) // evil magic number
435  .WriteUInt32( nCheckSum ) // crc32 checksum about nEsc & pData
436  .WriteUInt32( nEsc ); // escape number
437  pWMF->WriteBytes( pData, nLen );
438  if ( nLen & 1 )
439  pWMF->WriteUChar( 0 ); // pad byte
440 }
441 
442 /* if return value is true, then a complete unicode string and also a polygon replacement has been written,
443  so there is no more action necessary
444 */
445 bool WMFWriter::WMFRecord_Escape_Unicode( const Point& rPoint, const OUString& rUniStr, const tools::Long* pDXAry )
446 {
447  bool bEscapeUsed = false;
448 
449  sal_uInt32 i, nStringLen = rUniStr.getLength();
450  if ( nStringLen )
451  {
452  // first we will check if a comment is necessary
453  if ( aSrcFont.GetCharSet() != RTL_TEXTENCODING_SYMBOL ) // symbol is always byte character, so there is no unicode loss
454  {
455  const sal_Unicode* pBuf = rUniStr.getStr();
456  const rtl_TextEncoding aTextEncodingOrg = aSrcFont.GetCharSet();
457  OString aByteStr(OUStringToOString(rUniStr, aTextEncodingOrg));
458  OUString aUniStr2(OStringToOUString(aByteStr, aTextEncodingOrg));
459  const sal_Unicode* pConversion = aUniStr2.getStr(); // this is the unicode array after bytestring <-> unistring conversion
460  for ( i = 0; i < nStringLen; i++ )
461  {
462  if ( *pBuf++ != *pConversion++ )
463  break;
464  }
465 
466  if ( i != nStringLen ) // after conversion the characters are not original,
467  { // try again, with determining a better charset from unicode char
468  pBuf = rUniStr.getStr();
469  const sal_Unicode* pCheckChar = pBuf;
470  rtl_TextEncoding aTextEncoding = getBestMSEncodingByChar(*pCheckChar); // try the first character
471  if (aTextEncoding == RTL_TEXTENCODING_DONTKNOW) {
472  aTextEncoding = aTextEncodingOrg;
473  }
474  for ( i = 1; i < nStringLen; i++)
475  {
476  if (aTextEncoding != aTextEncodingOrg) // found something
477  break;
478  pCheckChar++;
479  aTextEncoding = getBestMSEncodingByChar(*pCheckChar); // try the next character
480  if (aTextEncoding == RTL_TEXTENCODING_DONTKNOW) {
481  aTextEncoding = aTextEncodingOrg;
482  }
483  }
484 
485  aByteStr = OUStringToOString(rUniStr, aTextEncoding);
486  aUniStr2 = OStringToOUString(aByteStr, aTextEncoding);
487  pConversion = aUniStr2.getStr(); // this is the unicode array after bytestring <-> unistring conversion
488  for ( i = 0; i < nStringLen; i++ )
489  {
490  if ( *pBuf++ != *pConversion++ )
491  break;
492  }
493  if (i == nStringLen)
494  {
495  aSrcFont.SetCharSet (aTextEncoding);
496  SetAllAttr();
497  }
498  }
499 
500  if ( ( i != nStringLen ) || IsStarSymbol( aSrcFont.GetFamilyName() ) ) // after conversion the characters are not original, so we
501  { // will store the unicode string and a polypoly replacement
502  Color aOldFillColor( aSrcFillColor );
503  Color aOldLineColor( aSrcLineColor );
509  std::vector<tools::PolyPolygon> aPolyPolyVec;
510  if ( pVirDev->GetTextOutlines( aPolyPolyVec, rUniStr ) )
511  {
512  sal_uInt32 nDXCount = pDXAry ? nStringLen : 0;
513  sal_uInt32 nSkipActions = aPolyPolyVec.size();
514  sal_Int32 nStrmLen = 8 +
515  + sizeof( nStringLen ) + ( nStringLen * 2 )
516  + sizeof( nDXCount ) + ( nDXCount * 4 )
517  + sizeof( nSkipActions );
518 
519  SvMemoryStream aMemoryStream( nStrmLen );
521  aMemoryStream.WriteInt32( aPt.X() )
522  .WriteInt32( aPt.Y() )
523  .WriteUInt32( nStringLen );
524  for ( i = 0; i < nStringLen; i++ )
525  aMemoryStream.WriteUInt16( rUniStr[ i ] );
526  aMemoryStream.WriteUInt32( nDXCount );
527  for ( i = 0; i < nDXCount; i++ )
528  aMemoryStream.WriteInt32( pDXAry[ i ] );
529  aMemoryStream.WriteUInt32( nSkipActions );
530  WMFRecord_Escape( PRIVATE_ESCAPE_UNICODE, nStrmLen, static_cast<const sal_Int8*>(aMemoryStream.GetData()) );
531 
532  for ( const auto& rPolyPoly : aPolyPolyVec )
533  {
534  tools::PolyPolygon aPolyPoly( rPolyPoly );
535  aPolyPoly.Move( rPoint.X(), rPoint.Y() );
536  WMFRecord_PolyPolygon( aPolyPoly );
537  }
538  aSrcFillColor = aOldFillColor;
539  aSrcLineColor = aOldLineColor;
540  bEscapeUsed = true;
541  }
542  }
543  }
544  }
545  return bEscapeUsed;
546 }
547 
548 void WMFWriter::WMFRecord_ExtTextOut( const Point& rPoint,
549  const OUString& rString,
550  const tools::Long* pDXAry )
551 {
552  sal_Int32 nOriginalTextLen = rString.getLength();
553 
554  if ( (nOriginalTextLen <= 1) || (pDXAry == nullptr) )
555  {
556  WMFRecord_TextOut(rPoint, rString);
557  return;
558  }
559  rtl_TextEncoding eChrSet = aSrcFont.GetCharSet();
560  OString aByteString(OUStringToOString(rString, eChrSet));
561  TrueExtTextOut(rPoint, rString, aByteString, pDXAry);
562 }
563 
564 void WMFWriter::TrueExtTextOut( const Point& rPoint, const OUString& rString,
565  const OString& rByteString, const tools::Long* pDXAry )
566 {
568  WritePointYX( rPoint );
569  sal_uInt16 nNewTextLen = static_cast<sal_uInt16>(rByteString.getLength());
570  pWMF->WriteUInt16( nNewTextLen ).WriteUInt16( 0 );
571  write_uInt8s_FromOString(*pWMF, rByteString, nNewTextLen);
572  if ( nNewTextLen & 1 )
573  pWMF->WriteUChar( 0 );
574 
575  sal_Int32 nOriginalTextLen = rString.getLength();
576  std::unique_ptr<sal_Int16[]> pConvertedDXAry(new sal_Int16[ nOriginalTextLen ]);
577  sal_Int32 j = 0;
578  pConvertedDXAry[ j++ ] = static_cast<sal_Int16>(ScaleWidth( pDXAry[ 0 ] ));
579  for (sal_Int32 i = 1; i < ( nOriginalTextLen - 1 ); ++i)
580  pConvertedDXAry[ j++ ] = static_cast<sal_Int16>(ScaleWidth( pDXAry[ i ] - pDXAry[ i - 1 ] ));
581  pConvertedDXAry[ j ] = static_cast<sal_Int16>(ScaleWidth( pDXAry[ nOriginalTextLen - 2 ] / ( nOriginalTextLen - 1 ) ));
582 
583  for (sal_Int32 i = 0; i < nOriginalTextLen; ++i)
584  {
585  sal_Int16 nDx = pConvertedDXAry[ i ];
586  pWMF->WriteInt16( nDx );
587  if ( nOriginalTextLen < nNewTextLen )
588  {
589  sal_Unicode nUniChar = rString[i];
590  OString aTemp(&nUniChar, 1, aSrcFont.GetCharSet());
591  j = aTemp.getLength();
592  while ( --j > 0 )
593  pWMF->WriteUInt16( 0 );
594  }
595  }
596  pConvertedDXAry.reset();
598 }
599 
600 void WMFWriter::WMFRecord_LineTo(const Point & rPoint)
601 {
602  WriteRecordHeader(0x00000005,W_META_LINETO);
603  WritePointYX(rPoint);
604 }
605 
606 void WMFWriter::WMFRecord_MoveTo(const Point & rPoint)
607 {
608  WriteRecordHeader(0x00000005,W_META_MOVETO);
609  WritePointYX(rPoint);
610 }
611 
612 void WMFWriter::WMFRecord_Pie(const tools::Rectangle & rRect, const Point & rStartPt, const Point & rEndPt)
613 {
614  WriteRecordHeader(0x0000000b,W_META_PIE);
615  WritePointYX(rEndPt);
616  WritePointYX(rStartPt);
617  WriteRectangle(rRect);
618 }
619 
621 {
622  tools::Polygon aSimplePoly;
623  if ( rPoly.HasFlags() )
624  rPoly.AdaptiveSubdivide( aSimplePoly );
625  else
626  aSimplePoly = rPoly;
627  const sal_uInt16 nSize = aSimplePoly.GetSize();
628  WriteRecordHeader(static_cast<sal_uInt32>(nSize)*2+4,W_META_POLYGON);
629  pWMF->WriteUInt16( nSize );
630  for (sal_uInt16 i=0; i<nSize; ++i)
631  WritePointXY(aSimplePoly.GetPoint(i));
632 }
633 
635 {
636  tools::Polygon aSimplePoly;
637  if ( rPoly.HasFlags() )
638  rPoly.AdaptiveSubdivide( aSimplePoly );
639  else
640  aSimplePoly = rPoly;
641  const sal_uInt16 nSize = aSimplePoly.GetSize();
642  WriteRecordHeader(static_cast<sal_uInt32>(nSize)*2+4,W_META_POLYLINE);
643  pWMF->WriteUInt16( nSize );
644  for (sal_uInt16 i=0; i<nSize; ++i)
645  WritePointXY(aSimplePoly.GetPoint(i));
646 }
647 
649 {
650  const tools::Polygon * pPoly;
651  sal_uInt16 nCount,nSize,i,j;
652 
653  nCount=rPolyPoly.Count();
654  tools::PolyPolygon aSimplePolyPoly( rPolyPoly );
655  for ( i = 0; i < nCount; i++ )
656  {
657  if ( aSimplePolyPoly[ i ].HasFlags() )
658  {
659  tools::Polygon aSimplePoly;
660  aSimplePolyPoly[ i ].AdaptiveSubdivide( aSimplePoly );
661  aSimplePolyPoly[ i ] = aSimplePoly;
662  }
663  }
665  pWMF->WriteUInt16( nCount );
666  for (i=0; i<nCount; i++) pWMF->WriteUInt16( aSimplePolyPoly.GetObject(i).GetSize() );
667  for (i=0; i<nCount; i++) {
668  pPoly=&(aSimplePolyPoly.GetObject(i));
669  nSize=pPoly->GetSize();
670  for (j=0; j<nSize; j++) WritePointXY(pPoly->GetPoint(j));
671  }
673 }
674 
676 {
677  WriteRecordHeader( 0x00000007,W_META_RECTANGLE );
678  WriteRectangle( rRect );
679 }
680 
682 {
684  pWMF->WriteInt16( -1 );
685 }
686 
687 void WMFWriter::WMFRecord_RoundRect(const tools::Rectangle & rRect, tools::Long nHorzRound, tools::Long nVertRound)
688 {
690  WriteHeightWidth(Size(nHorzRound,nVertRound));
691  WriteRectangle(rRect);
692 }
693 
695 {
696  WriteRecordHeader(0x00000003,W_META_SAVEDC);
697 }
698 
699 void WMFWriter::WMFRecord_SelectObject(sal_uInt16 nObjectHandle)
700 {
702  pWMF->WriteUInt16( nObjectHandle );
703 }
704 
705 void WMFWriter::WMFRecord_SetBkMode(bool bTransparent)
706 {
708  if (bTransparent) pWMF->WriteUInt16( W_TRANSPARENT );
709  else pWMF->WriteUInt16( W_OPAQUE );
710 }
711 
713 {
715  pWMF->WriteUInt16( 3 ); // STRETCH_DELETESCANS
716 }
717 
718 void WMFWriter::WMFRecord_SetPixel(const Point & rPoint, const Color & rColor)
719 {
721  WriteColor(rColor);
722  WritePointYX(rPoint);
723 }
724 
726 {
727  sal_uInt16 nROP2;
728 
729  switch (eROP) {
730  case RasterOp::Invert: nROP2=W_R2_NOT; break;
731  case RasterOp::Xor: nROP2=W_R2_XORPEN; break;
732  default: nROP2=W_R2_COPYPEN;
733  }
734  WriteRecordHeader(0x00000004,W_META_SETROP2);
735  pWMF->WriteUInt16( nROP2 );
736 }
737 
738 void WMFWriter::WMFRecord_SetTextAlign(TextAlign eFontAlign, sal_uInt16 eHorTextAlign)
739 {
740  sal_uInt16 nAlign;
741 
742  switch (eFontAlign) {
743  case ALIGN_TOP: nAlign=W_TA_TOP; break;
744  case ALIGN_BOTTOM: nAlign=W_TA_BOTTOM; break;
745  default: nAlign=W_TA_BASELINE;
746  }
747  nAlign|=eHorTextAlign;
748  nAlign|=W_TA_NOUPDATECP;
749 
751  pWMF->WriteUInt16( nAlign );
752 }
753 
755 {
757  WriteColor(rColor);
758 }
759 
761 {
763  WriteHeightWidth(rSize);
764 }
765 
766 void WMFWriter::WMFRecord_SetWindowOrg(const Point & rPoint)
767 {
769  WritePointYX(rPoint);
770 }
771 
772 void WMFWriter::WMFRecord_StretchDIB( const Point & rPoint, const Size & rSize,
773  const Bitmap & rBitmap, sal_uInt32 nROP )
774 {
775  sal_uLong nPosAnf,nPosEnd;
776 
778  MayCallback();
779 
781 
782  // The sequence in the metafile should be:
783  // some parameters (length 22), then the bitmap without FILEHEADER.
784  // As *pWMF << rBitmap generates a FILEHEADER of size 14,
785  // we first write the bitmap at the right position
786  // and overwrite later the FILEHEADER with the parameters.
787  nPosAnf=pWMF->Tell(); // remember position, where parameters should be stored
788  pWMF->WriteInt32( 0 ).WriteInt32( 0 ); // replenish 8 bytes (these 8 bytes +
789  // 14 bytes superfluous FILEHEADER
790  // = 22 bytes parameter)
791 
792  // write bitmap
793  WriteDIB(rBitmap, *pWMF, false, true);
794 
795  // write the parameters:
796  nPosEnd=pWMF->Tell();
797  pWMF->Seek(nPosAnf);
798 
799  // determine raster-op, if nothing was passed
800  if( !nROP )
801  {
802  switch( eSrcRasterOp )
803  {
804  case RasterOp::Invert: nROP = W_DSTINVERT; break;
805  case RasterOp::Xor: nROP = W_SRCINVERT; break;
806  default: nROP = W_SRCCOPY;
807  }
808  }
809 
810  pWMF->WriteUInt32( nROP ).
811  WriteInt16( 0 ).
812  WriteInt16( rBitmap.GetSizePixel().Height() ).
813  WriteInt16( rBitmap.GetSizePixel().Width() ).
814  WriteInt16( 0 ).
815  WriteInt16( 0 );
816 
817  WriteHeightWidth(rSize);
818  WritePointYX(rPoint);
819  pWMF->Seek(nPosEnd);
820 
822 
823  nWrittenBitmaps++;
825 }
826 
827 void WMFWriter::WMFRecord_TextOut(const Point & rPoint, std::u16string_view rStr)
828 {
829  rtl_TextEncoding eChrSet = aSrcFont.GetCharSet();
830  OString aString(OUStringToOString(rStr, eChrSet));
831  TrueTextOut(rPoint, aString);
832 }
833 
834 void WMFWriter::TrueTextOut(const Point & rPoint, const OString& rString)
835 {
837 
839  sal_Int32 nLen = rString.getLength();
840  if ((nLen&1)!=0) pWMF->WriteUChar( 0 );
841  WritePointYX(rPoint);
843 }
844 
846 {
848  WriteRectangle(rRect);
849 }
850 
852 {
853  sal_uInt16 i;
854 
855  for (i=0; i<MAXOBJECTHANDLES; i++) {
856  if (!bHandleAllocated[i]) {
857  bHandleAllocated[i]=true;
858  return i;
859  }
860  }
861  bStatus=false;
862  return 0xffff;
863 }
864 
865 void WMFWriter::FreeHandle(sal_uInt16 nObjectHandle)
866 {
867  if (nObjectHandle<MAXOBJECTHANDLES) bHandleAllocated[nObjectHandle]=false;
868 }
869 
870 void WMFWriter::CreateSelectDeletePen( const Color& rColor, const LineInfo& rLineInfo )
871 {
872  sal_uInt16 nOldHandle;
873 
874  nOldHandle=nDstPenHandle;
876  WMFRecord_CreatePenIndirect( rColor, rLineInfo );
878  if (nOldHandle<MAXOBJECTHANDLES) {
879  WMFRecord_DeleteObject(nOldHandle);
880  FreeHandle(nOldHandle);
881  }
882 }
883 
885 {
886  sal_uInt16 nOldHandle;
887 
888  nOldHandle=nDstFontHandle;
892  if (nOldHandle<MAXOBJECTHANDLES) {
893  WMFRecord_DeleteObject(nOldHandle);
894  FreeHandle(nOldHandle);
895  }
896 }
897 
899 {
900  sal_uInt16 nOldHandle;
901 
902  nOldHandle=nDstBrushHandle;
906  if (nOldHandle<MAXOBJECTHANDLES) {
907  WMFRecord_DeleteObject(nOldHandle);
908  FreeHandle(nOldHandle);
909  }
910 }
911 
913 {
914  if ( eDstROP2 != eSrcRasterOp )
915  {
918  }
919  if ( ( aDstLineColor != aSrcLineColor ) || ( aDstLineInfo != aSrcLineInfo ) )
920  {
924  }
925  if ( aDstFillColor != aSrcFillColor )
926  {
929  }
930 }
931 
933 {
935  if ( aDstTextColor != aSrcTextColor )
936  {
939  }
941  {
945  }
946  if ( aDstFont == aSrcFont )
947  return;
948 
951  {
952  FontCharMapRef xFontCharMap;
953  if ( pVirDev->GetFontCharMap( xFontCharMap ) )
954  {
955  if ( ( xFontCharMap->GetFirstChar() & 0xff00 ) == 0xf000 )
956  aSrcFont.SetCharSet( RTL_TEXTENCODING_SYMBOL );
957  else if ( aSrcFont.GetCharSet() == RTL_TEXTENCODING_SYMBOL )
958  aSrcFont.SetCharSet( RTL_TEXTENCODING_MS_1252 );
959  }
960  }
961 
962  aDstFont = aSrcFont;
964 }
965 
967 {
968  if(!rLinePolygon.count())
969  return;
970 
971  basegfx::B2DPolyPolygon aLinePolyPolygon(rLinePolygon);
972  basegfx::B2DPolyPolygon aFillPolyPolygon;
973 
974  rInfo.applyToB2DPolyPolygon(aLinePolyPolygon, aFillPolyPolygon);
975 
976  if(aLinePolyPolygon.count())
977  {
978  aSrcLineInfo = rInfo;
980 
981  for(auto const& rB2DPolygon : std::as_const(aLinePolyPolygon))
982  {
983  WMFRecord_PolyLine( tools::Polygon(rB2DPolygon) );
984  }
985  }
986 
987  if(!aFillPolyPolygon.count())
988  return;
989 
990  const Color aOldLineColor(aSrcLineColor);
991  const Color aOldFillColor(aSrcFillColor);
992 
994  aSrcFillColor = aOldLineColor;
996 
997  for(auto const& rB2DPolygon : std::as_const(aFillPolyPolygon))
998  {
999  WMFRecord_Polygon( tools::Polygon(rB2DPolygon) );
1000  }
1001 
1002  aSrcLineColor = aOldLineColor;
1003  aSrcFillColor = aOldFillColor;
1005 }
1006 
1008 {
1009  if( !bStatus )
1010  return;
1011 
1012  size_t nACount = rMTF.GetActionSize();
1013 
1015 
1016  for( size_t nA = 0; nA < nACount; nA++ )
1017  {
1018  MetaAction* pMA = rMTF.GetAction( nA );
1019 
1020  switch( pMA->GetType() )
1021  {
1022  case MetaActionType::PIXEL:
1023  {
1024  const MetaPixelAction* pA = static_cast<const MetaPixelAction *>(pMA);
1025  aSrcLineInfo = LineInfo();
1027  WMFRecord_SetPixel( pA->GetPoint(), pA->GetColor() );
1028  }
1029  break;
1030 
1031  case MetaActionType::POINT:
1032  {
1033  const MetaPointAction* pA = static_cast<const MetaPointAction*>(pMA);
1034  const Point& rPt = pA->GetPoint();
1035  aSrcLineInfo = LineInfo();
1037  WMFRecord_MoveTo( rPt);
1038  WMFRecord_LineTo( rPt );
1039  }
1040  break;
1041 
1042  case MetaActionType::LINE:
1043  {
1044  const MetaLineAction* pA = static_cast<const MetaLineAction *>(pMA);
1045  if(pA->GetLineInfo().IsDefault())
1046  {
1047  aSrcLineInfo = pA->GetLineInfo();
1050  WMFRecord_LineTo( pA->GetEndPoint() );
1051  }
1052  else
1053  {
1054  // LineInfo used; handle Dash/Dot and fat lines
1055  basegfx::B2DPolygon aPolygon;
1056  aPolygon.append(basegfx::B2DPoint(pA->GetStartPoint().X(), pA->GetStartPoint().Y()));
1057  aPolygon.append(basegfx::B2DPoint(pA->GetEndPoint().X(), pA->GetEndPoint().Y()));
1058  HandleLineInfoPolyPolygons(pA->GetLineInfo(), aPolygon);
1059  }
1060  }
1061  break;
1062 
1063  case MetaActionType::RECT:
1064  {
1065  const MetaRectAction* pA = static_cast<const MetaRectAction*>(pMA);
1066  aSrcLineInfo = LineInfo();
1068  WMFRecord_Rectangle( pA->GetRect() );
1069  }
1070  break;
1071 
1073  {
1074  const MetaRoundRectAction* pA = static_cast<const MetaRoundRectAction*>(pMA);
1075  aSrcLineInfo = LineInfo();
1077  WMFRecord_RoundRect( pA->GetRect(), pA->GetHorzRound(), pA->GetVertRound() );
1078  }
1079  break;
1080 
1082  {
1083  const MetaEllipseAction* pA = static_cast<const MetaEllipseAction*>(pMA);
1084  aSrcLineInfo = LineInfo();
1086  WMFRecord_Ellipse( pA->GetRect() );
1087  }
1088  break;
1089 
1090  case MetaActionType::ARC:
1091  {
1092  const MetaArcAction* pA = static_cast<const MetaArcAction*>(pMA);
1093  aSrcLineInfo = LineInfo();
1095  WMFRecord_Arc( pA->GetRect(),pA->GetStartPoint(),pA->GetEndPoint() );
1096  }
1097  break;
1098 
1099  case MetaActionType::PIE:
1100  {
1101  const MetaPieAction* pA = static_cast<const MetaPieAction*>(pMA);
1102  aSrcLineInfo = LineInfo();
1104  WMFRecord_Pie( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() );
1105  }
1106  break;
1107 
1108  case MetaActionType::CHORD:
1109  {
1110  const MetaChordAction* pA = static_cast<const MetaChordAction*>(pMA);
1111  aSrcLineInfo = LineInfo();
1113  WMFRecord_Chord( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() );
1114  }
1115  break;
1116 
1118  {
1119  const MetaPolyLineAction* pA = static_cast<const MetaPolyLineAction*>(pMA);
1120  const tools::Polygon& rPoly = pA->GetPolygon();
1121 
1122  if( rPoly.GetSize() )
1123  {
1124  if(pA->GetLineInfo().IsDefault())
1125  {
1126  aSrcLineInfo = pA->GetLineInfo();
1128  WMFRecord_PolyLine( rPoly );
1129  }
1130  else
1131  {
1132  // LineInfo used; handle Dash/Dot and fat lines
1133  HandleLineInfoPolyPolygons(pA->GetLineInfo(), rPoly.getB2DPolygon());
1134  }
1135  }
1136  }
1137  break;
1138 
1140  {
1141  const MetaPolygonAction* pA = static_cast<const MetaPolygonAction*>(pMA);
1142  aSrcLineInfo = LineInfo();
1144  WMFRecord_Polygon( pA->GetPolygon() );
1145  }
1146  break;
1147 
1149  {
1150  const MetaPolyPolygonAction* pA = static_cast<const MetaPolyPolygonAction*>(pMA);
1151  aSrcLineInfo = LineInfo();
1153  WMFRecord_PolyPolygon( pA->GetPolyPolygon() );
1154  }
1155  break;
1156 
1158  {
1159  const MetaTextRectAction * pA = static_cast<const MetaTextRectAction*>(pMA);
1160  OUString aTemp( pA->GetText() );
1161  aSrcLineInfo = LineInfo();
1162  SetAllAttr();
1163 
1164  Point aPos( pA->GetRect().TopLeft() );
1165  if ( !WMFRecord_Escape_Unicode( aPos, aTemp, nullptr ) )
1166  WMFRecord_TextOut( aPos, aTemp );
1167  }
1168  break;
1169 
1170  case MetaActionType::TEXT:
1171  {
1172  const MetaTextAction * pA = static_cast<const MetaTextAction*>(pMA);
1173  OUString aTemp = pA->GetText().copy( pA->GetIndex(), std::min<sal_Int32>(pA->GetText().getLength() - pA->GetIndex(), pA->GetLen()) );
1174  aSrcLineInfo = LineInfo();
1175  SetAllAttr();
1176  if ( !WMFRecord_Escape_Unicode( pA->GetPoint(), aTemp, nullptr ) )
1177  WMFRecord_TextOut( pA->GetPoint(), aTemp );
1178  }
1179  break;
1180 
1182  {
1183  const MetaTextArrayAction* pA = static_cast<const MetaTextArrayAction*>(pMA);
1184 
1185  OUString aTemp = pA->GetText().copy( pA->GetIndex(), std::min<sal_Int32>(pA->GetText().getLength() - pA->GetIndex(), pA->GetLen()) );
1186  aSrcLineInfo = LineInfo();
1187  SetAllAttr();
1188  if ( !WMFRecord_Escape_Unicode( pA->GetPoint(), aTemp, pA->GetDXArray() ) )
1189  WMFRecord_ExtTextOut( pA->GetPoint(), aTemp, pA->GetDXArray() );
1190  }
1191  break;
1192 
1194  {
1195  const MetaStretchTextAction* pA = static_cast<const MetaStretchTextAction *>(pMA);
1196  OUString aTemp = pA->GetText().copy( pA->GetIndex(), std::min<sal_Int32>(pA->GetText().getLength() - pA->GetIndex(), pA->GetLen()) );
1197 
1198  pVirDev->SetFont( aSrcFont );
1199  const sal_Int32 nLen = aTemp.getLength();
1200  std::vector<tools::Long> aDXAry;
1201  const sal_Int32 nNormSize = pVirDev->GetTextArray( aTemp, nLen ? &aDXAry : nullptr );
1202  if (nLen && nNormSize == 0)
1203  {
1204  OSL_FAIL("Impossible div by 0 action: MetaStretchTextAction!");
1205  }
1206  else
1207  {
1208  for ( sal_Int32 i = 0; i < ( nLen - 1 ); i++ )
1209  aDXAry[ i ] = aDXAry[ i ] * static_cast<sal_Int32>(pA->GetWidth()) / nNormSize;
1210  if ( ( nLen <= 1 ) || ( static_cast<sal_Int32>(pA->GetWidth()) == nNormSize ) )
1211  aDXAry.clear();
1212  aSrcLineInfo = LineInfo();
1213  SetAllAttr();
1214  if ( !WMFRecord_Escape_Unicode( pA->GetPoint(), aTemp, aDXAry.empty() ? nullptr : aDXAry.data() ) )
1215  WMFRecord_ExtTextOut( pA->GetPoint(), aTemp, aDXAry.empty() ? nullptr : aDXAry.data() );
1216  }
1217  }
1218  break;
1219 
1220  case MetaActionType::BMP:
1221  {
1222  const MetaBmpAction* pA = static_cast<const MetaBmpAction *>(pMA);
1224  }
1225  break;
1226 
1228  {
1229  const MetaBmpScaleAction* pA = static_cast<const MetaBmpScaleAction*>(pMA);
1230  WMFRecord_StretchDIB( pA->GetPoint(), pA->GetSize(), pA->GetBitmap() );
1231  }
1232  break;
1233 
1235  {
1236  const MetaBmpScalePartAction* pA = static_cast<const MetaBmpScalePartAction*>(pMA);
1237  Bitmap aTmp( pA->GetBitmap() );
1238 
1239  if( aTmp.Crop( tools::Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) ) )
1240  WMFRecord_StretchDIB( pA->GetDestPoint(), pA->GetDestSize(), aTmp );
1241  }
1242  break;
1243 
1244  case MetaActionType::BMPEX:
1245  {
1246  const MetaBmpExAction* pA = static_cast<const MetaBmpExAction *>(pMA);
1247  Bitmap aBmp( pA->GetBitmapEx().GetBitmap() );
1248  Bitmap aMsk( pA->GetBitmapEx().GetAlpha() );
1249 
1250  if( !aMsk.IsEmpty() )
1251  {
1252  aBmp.Replace( aMsk, COL_WHITE );
1253  aMsk.Invert();
1254  WMFRecord_StretchDIB( pA->GetPoint(), aMsk.GetSizePixel(), aBmp, W_SRCPAINT );
1255  WMFRecord_StretchDIB( pA->GetPoint(), aBmp.GetSizePixel(), aBmp, W_SRCAND );
1256  }
1257  else
1258  WMFRecord_StretchDIB( pA->GetPoint(), aBmp.GetSizePixel(), aBmp );
1259  }
1260  break;
1261 
1263  {
1264  const MetaBmpExScaleAction* pA = static_cast<const MetaBmpExScaleAction*>(pMA);
1265  Bitmap aBmp( pA->GetBitmapEx().GetBitmap() );
1266  Bitmap aMsk( pA->GetBitmapEx().GetAlpha() );
1267 
1268  if( !aMsk.IsEmpty() )
1269  {
1270  aBmp.Replace( aMsk, COL_WHITE );
1271  aMsk.Invert();
1272  WMFRecord_StretchDIB( pA->GetPoint(), pA->GetSize(), aMsk, W_SRCPAINT );
1273  WMFRecord_StretchDIB( pA->GetPoint(), pA->GetSize(), aBmp, W_SRCAND );
1274  }
1275  else
1276  WMFRecord_StretchDIB( pA->GetPoint(), pA->GetSize(), aBmp );
1277  }
1278  break;
1279 
1281  {
1282  const MetaBmpExScalePartAction* pA = static_cast<const MetaBmpExScalePartAction*>(pMA);
1283  BitmapEx aBmpEx( pA->GetBitmapEx() );
1284  aBmpEx.Crop( tools::Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) );
1285  Bitmap aBmp( aBmpEx.GetBitmap() );
1286  Bitmap aMsk( aBmpEx.GetAlpha() );
1287 
1288  if( !aMsk.IsEmpty() )
1289  {
1290  aBmp.Replace( aMsk, COL_WHITE );
1291  aMsk.Invert();
1292  WMFRecord_StretchDIB( pA->GetDestPoint(), pA->GetDestSize(), aMsk, W_SRCPAINT );
1293  WMFRecord_StretchDIB( pA->GetDestPoint(), pA->GetDestSize(), aBmp, W_SRCAND );
1294  }
1295  else
1296  WMFRecord_StretchDIB( pA->GetDestPoint(), pA->GetDestSize(), aBmp );
1297  }
1298  break;
1299 
1301  {
1302  const MetaGradientAction* pA = static_cast<const MetaGradientAction*>(pMA);
1303  GDIMetaFile aTmpMtf;
1304 
1305  pVirDev->AddGradientActions( pA->GetRect(), pA->GetGradient(), aTmpMtf );
1306  WriteRecords( aTmpMtf );
1307  }
1308  break;
1309 
1310  case MetaActionType::HATCH:
1311  {
1312  const MetaHatchAction* pA = static_cast<const MetaHatchAction*>(pMA);
1313  GDIMetaFile aTmpMtf;
1314 
1315  pVirDev->AddHatchActions( pA->GetPolyPolygon(), pA->GetHatch(), aTmpMtf );
1316  WriteRecords( aTmpMtf );
1317  }
1318  break;
1319 
1321  {
1322  const MetaWallpaperAction* pA = static_cast<const MetaWallpaperAction*>(pMA);
1323  const Color& rColor = pA->GetWallpaper().GetColor();
1324  const Color aOldLineColor( aSrcLineColor );
1325  const Color aOldFillColor( aSrcFillColor );
1326 
1327  aSrcLineColor = rColor;
1328  aSrcFillColor = rColor;
1329  aSrcLineInfo = LineInfo();
1331  WMFRecord_Rectangle( pA->GetRect() );
1332  aSrcLineColor = aOldLineColor;
1333  aSrcFillColor = aOldFillColor;
1334  }
1335  break;
1336 
1338  {
1339  const MetaISectRectClipRegionAction* pA = static_cast<const MetaISectRectClipRegionAction*>(pMA);
1341  }
1342  break;
1343 
1345  {
1346  const MetaLineColorAction* pA = static_cast<const MetaLineColorAction*>(pMA);
1347 
1348  if( pA->IsSetting() )
1349  aSrcLineColor = pA->GetColor();
1350  else
1352  }
1353  break;
1354 
1356  {
1357  const MetaFillColorAction* pA = static_cast<const MetaFillColorAction*>(pMA);
1358 
1359  if( pA->IsSetting() )
1360  aSrcFillColor = pA->GetColor();
1361  else
1363  }
1364  break;
1365 
1367  {
1368  const MetaTextColorAction* pA = static_cast<const MetaTextColorAction*>(pMA);
1369  aSrcTextColor = pA->GetColor();
1370  }
1371  break;
1372 
1374  {
1375  const MetaTextFillColorAction* pA = static_cast<const MetaTextFillColorAction*>(pMA);
1376  if( pA->IsSetting() )
1377  aSrcFont.SetFillColor( pA->GetColor() );
1378  else
1380  }
1381  break;
1382 
1384  {
1385  const MetaTextAlignAction* pA = static_cast<const MetaTextAlignAction*>(pMA);
1386  eSrcTextAlign = pA->GetTextAlign();
1387  }
1388  break;
1389 
1391  {
1392  const MetaMapModeAction* pA = static_cast<const MetaMapModeAction*>(pMA);
1393 
1394  if (aSrcMapMode!=pA->GetMapMode())
1395  {
1396  if( pA->GetMapMode().GetMapUnit() == MapUnit::MapRelative )
1397  {
1398  const MapMode& aMM = pA->GetMapMode();
1399  Fraction aScaleX = aMM.GetScaleX();
1400  Fraction aScaleY = aMM.GetScaleY();
1401 
1402  Point aOrigin = aSrcMapMode.GetOrigin();
1403  BigInt aX( aOrigin.X() );
1404  aX *= BigInt( aScaleX.GetDenominator() );
1405  if( aOrigin.X() >= 0 )
1406  if( aScaleX.GetNumerator() >= 0 )
1407  aX += BigInt( aScaleX.GetNumerator()/2 );
1408  else
1409  aX -= BigInt( (aScaleX.GetNumerator()+1)/2 );
1410  else
1411  if( aScaleX.GetNumerator() >= 0 )
1412  aX -= BigInt( (aScaleX.GetNumerator()-1)/2 );
1413  else
1414  aX += BigInt( aScaleX.GetNumerator()/2 );
1415  aX /= BigInt( aScaleX.GetNumerator() );
1416  aOrigin.setX( static_cast<tools::Long>(aX) + aMM.GetOrigin().X() );
1417  BigInt aY( aOrigin.Y() );
1418  aY *= BigInt( aScaleY.GetDenominator() );
1419  if( aOrigin.Y() >= 0 )
1420  if( aScaleY.GetNumerator() >= 0 )
1421  aY += BigInt( aScaleY.GetNumerator()/2 );
1422  else
1423  aY -= BigInt( (aScaleY.GetNumerator()+1)/2 );
1424  else
1425  if( aScaleY.GetNumerator() >= 0 )
1426  aY -= BigInt( (aScaleY.GetNumerator()-1)/2 );
1427  else
1428  aY += BigInt( aScaleY.GetNumerator()/2 );
1429  aY /= BigInt( aScaleY.GetNumerator() );
1430  aOrigin.setY( static_cast<tools::Long>(aY) + aMM.GetOrigin().Y() );
1431  aSrcMapMode.SetOrigin( aOrigin );
1432 
1433  aScaleX *= aSrcMapMode.GetScaleX();
1434  aScaleY *= aSrcMapMode.GetScaleY();
1435  aSrcMapMode.SetScaleX( aScaleX );
1436  aSrcMapMode.SetScaleY( aScaleY );
1437  }
1438  else
1439  aSrcMapMode=pA->GetMapMode();
1440  }
1441  }
1442  break;
1443 
1444  case MetaActionType::FONT:
1445  {
1446  const MetaFontAction* pA = static_cast<const MetaFontAction*>(pMA);
1447  aSrcFont = pA->GetFont();
1448 
1449  if ( (aSrcFont.GetCharSet() == RTL_TEXTENCODING_DONTKNOW)
1450  || (aSrcFont.GetCharSet() == RTL_TEXTENCODING_UNICODE) )
1451  {
1452  aSrcFont.SetCharSet( RTL_TEXTENCODING_MS_1252 );
1453  }
1458  }
1459  break;
1460 
1461  case MetaActionType::PUSH:
1462  {
1463  const MetaPushAction* pA = static_cast<const MetaPushAction*>(pMA);
1464 
1466  pAt->nFlags = pA->GetFlags();
1467  pAt->aClipRegion = aSrcClipRegion;
1470  pAt->eRasterOp=eSrcRasterOp;
1471  pAt->aFont=aSrcFont;
1474  pAt->aMapMode=aSrcMapMode;
1475  pAt->aLineInfo=aDstLineInfo;
1476  pAt->pSucc=pAttrStack;
1477  pAttrStack=pAt;
1478 
1479  SetAllAttr(); // update ( now all source attributes are equal to the destination attributes )
1480  WMFRecord_SaveDC();
1481 
1482  }
1483  break;
1484 
1485  case MetaActionType::POP:
1486  {
1488 
1489  if( pAt )
1490  {
1491  aDstLineInfo = pAt->aLineInfo;
1492  aDstLineColor = pAt->aLineColor;
1493  if ( pAt->nFlags & PushFlags::LINECOLOR )
1494  aSrcLineColor = pAt->aLineColor;
1495  aDstFillColor = pAt->aFillColor;
1496  if ( pAt->nFlags & PushFlags::FILLCOLOR )
1497  aSrcFillColor = pAt->aFillColor;
1498  eDstROP2 = pAt->eRasterOp;
1499  if ( pAt->nFlags & PushFlags::RASTEROP )
1500  eSrcRasterOp = pAt->eRasterOp;
1501  aDstFont = pAt->aFont;
1502  if ( pAt->nFlags & PushFlags::FONT )
1503  aSrcFont = pAt->aFont;
1504  eDstTextAlign = pAt->eTextAlign;
1505  if ( pAt->nFlags & ( PushFlags::FONT | PushFlags::TEXTALIGN ) )
1506  eSrcTextAlign = pAt->eTextAlign;
1507  aDstTextColor = pAt->aTextColor;
1508  if ( pAt->nFlags & ( PushFlags::FONT | PushFlags::TEXTCOLOR ) )
1509  aSrcTextColor = pAt->aTextColor;
1510  if ( pAt->nFlags & PushFlags::MAPMODE )
1511  aSrcMapMode = pAt->aMapMode;
1512  aDstClipRegion = pAt->aClipRegion;
1513  if ( pAt->nFlags & PushFlags::CLIPREGION )
1514  aSrcClipRegion = pAt->aClipRegion;
1515 
1517  pAttrStack = pAt->pSucc;
1518  delete pAt;
1519  }
1520  }
1521  break;
1522 
1523  case MetaActionType::EPS :
1524  {
1525  const MetaEPSAction* pA = static_cast<const MetaEPSAction*>(pMA);
1526  const GDIMetaFile& aGDIMetaFile( pA->GetSubstitute() );
1527 
1528  size_t nCount = aGDIMetaFile.GetActionSize();
1529  for ( size_t i = 0; i < nCount; i++ )
1530  {
1531  const MetaAction* pMetaAct = aGDIMetaFile.GetAction( i );
1532  if ( pMetaAct->GetType() == MetaActionType::BMPSCALE )
1533  {
1534  const MetaBmpScaleAction* pBmpScaleAction = static_cast<const MetaBmpScaleAction*>(pMetaAct);
1535  WMFRecord_StretchDIB( pA->GetPoint(), pA->GetSize(), pBmpScaleAction->GetBitmap() );
1536  break;
1537  }
1538  }
1539  }
1540  break;
1541 
1543  {
1544  const MetaRasterOpAction* pA = static_cast<const MetaRasterOpAction*>(pMA);
1545  eSrcRasterOp=pA->GetRasterOp();
1546  }
1547  break;
1548 
1550  {
1551  aSrcLineInfo = LineInfo();
1553  WMFRecord_PolyPolygon( static_cast<const MetaTransparentAction*>(pMA)->GetPolyPolygon() );
1554  }
1555  break;
1556 
1558  {
1559  const MetaFloatTransparentAction* pA = static_cast<const MetaFloatTransparentAction*>(pMA);
1560 
1561  GDIMetaFile aTmpMtf( pA->GetGDIMetaFile() );
1562  Point aSrcPt( aTmpMtf.GetPrefMapMode().GetOrigin() );
1563  const Size aSrcSize( aTmpMtf.GetPrefSize() );
1564  const Point aDestPt( pA->GetPoint() );
1565  const Size aDestSize( pA->GetSize() );
1566  const double fScaleX = aSrcSize.Width() ? static_cast<double>(aDestSize.Width()) / aSrcSize.Width() : 1.0;
1567  const double fScaleY = aSrcSize.Height() ? static_cast<double>(aDestSize.Height()) / aSrcSize.Height() : 1.0;
1568  tools::Long nMoveX, nMoveY;
1569 
1570  aSrcLineInfo = LineInfo();
1571  SetAllAttr();
1572 
1573  if( fScaleX != 1.0 || fScaleY != 1.0 )
1574  {
1575  aTmpMtf.Scale( fScaleX, fScaleY );
1576  aSrcPt.setX( FRound( aSrcPt.X() * fScaleX ) );
1577  aSrcPt.setY( FRound( aSrcPt.Y() * fScaleY ) );
1578  }
1579 
1580  nMoveX = aDestPt.X() - aSrcPt.X();
1581  nMoveY = aDestPt.Y() - aSrcPt.Y();
1582 
1583  if( nMoveX || nMoveY )
1584  aTmpMtf.Move( nMoveX, nMoveY );
1585 
1586  WriteRecords( aTmpMtf );
1587  }
1588  break;
1589 
1591  {
1592  ComplexTextLayoutFlags nLayoutMode = static_cast<const MetaLayoutModeAction*>(pMA)->GetLayoutMode();
1593  eSrcHorTextAlign = 0; // TA_LEFT
1595  {
1597  }
1602  break;
1603  }
1604 
1608  // Explicitly ignored cases
1609  break;
1610 
1611  default:
1612  // TODO: Implement more cases as necessary. Let's not bother with a warning.
1613  break;
1614  }
1615 
1616  nWrittenActions++;
1617  MayCallback();
1618 
1619  if (pWMF->GetError())
1620  bStatus=false;
1621 
1622  if(!bStatus)
1623  break;
1624  }
1625 }
1626 
1627 void WMFWriter::WriteHeader( bool bPlaceable )
1628 {
1629  if( bPlaceable )
1630  {
1631  sal_uInt16 nCheckSum, nValue;
1632  Size aSize( OutputDevice::LogicToLogic(Size(1,1),MapMode(MapUnit::MapInch), aTargetMapMode) );
1633  sal_uInt16 nUnitsPerInch = static_cast<sal_uInt16>( ( aSize.Width() + aSize.Height() ) >> 1 );
1634 
1635  nCheckSum=0;
1636  nValue=0xcdd7; nCheckSum^=nValue; pWMF->WriteUInt16( nValue );
1637  nValue=0x9ac6; nCheckSum^=nValue; pWMF->WriteUInt16( nValue );
1638  nValue=0x0000; nCheckSum^=nValue; pWMF->WriteUInt16( nValue );
1639  nValue=0x0000; nCheckSum^=nValue; pWMF->WriteUInt16( nValue );
1640  nValue=0x0000; nCheckSum^=nValue; pWMF->WriteUInt16( nValue );
1641  nValue=static_cast<sal_uInt16>(aTargetSize.Width()); nCheckSum^=nValue; pWMF->WriteUInt16( nValue );
1642  nValue=static_cast<sal_uInt16>(aTargetSize.Height()); nCheckSum^=nValue; pWMF->WriteUInt16( nValue );
1643  nValue=nUnitsPerInch; nCheckSum^=nValue; pWMF->WriteUInt16( nValue );
1644  nValue=0x0000; nCheckSum^=nValue; pWMF->WriteUInt16( nValue );
1645  nValue=0x0000; nCheckSum^=nValue; pWMF->WriteUInt16( nValue );
1646  pWMF->WriteUInt16( nCheckSum );
1647  }
1648 
1650  pWMF->WriteUInt16( 0x0001 ) // type: file
1651  .WriteUInt16( 0x0009 ) // header length in words
1652  .WriteUInt16( 0x0300 ) // Version as BCD number
1653  .WriteUInt32( 0x00000000 ) // file length (without 1st header), is later corrected by UpdateHeader()
1654  .WriteUInt16( MAXOBJECTHANDLES ) // maximum number of simultaneous objects
1655  .WriteUInt32( 0x00000000 ) // maximum record length, is later corrected by UpdateHeader()
1656  .WriteUInt16( 0x0000 ); // reserved
1657 }
1658 
1660 {
1661  sal_uLong nPos;
1662  sal_uInt32 nFileSize;
1663 
1664  nPos=pWMF->Tell(); // endposition = total size of file
1665  nFileSize=nPos-nMetafileHeaderPos; // subtract size of 1st header
1666  if ((nFileSize&1)!=0) { // if needed round to words
1667  pWMF->WriteUChar( 0 );
1668  nPos++;
1669  nFileSize++;
1670  }
1671  nFileSize>>=1; // convert to number of words
1672  pWMF->Seek(nMetafileHeaderPos+6); // to filesize entry in second header
1673  pWMF->WriteUInt32( nFileSize ); // rectify file size
1674  pWMF->SeekRel(2); // to max-record-length-entry in second header
1675  pWMF->WriteUInt32( nMaxRecordSize ); // and rectify
1676  pWMF->Seek(nPos);
1677 }
1678 
1679 bool WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
1680  FilterConfigItem const * pFConfigItem, bool bPlaceable )
1681 {
1683 
1684  bEmbedEMF = true;
1685  bStatus=true;
1687 
1688  if (pFConfigItem)
1689  {
1690  xStatusIndicator = pFConfigItem->GetStatusIndicator();
1691  if ( xStatusIndicator.is() )
1692  {
1693  xStatusIndicator->start( OUString(), 100 );
1694  }
1695 
1697  auto it = aMap.find("EmbedEMF");
1698  if (it != aMap.end())
1699  {
1700  it->second >>= bEmbedEMF;
1701  }
1702  }
1703  nLastPercent=0;
1704 
1705  pWMF=&rTargetStream;
1706  pWMF->SetEndian(SvStreamEndian::LITTLE);
1707 
1708  nMaxRecordSize=0;
1709 
1710  aSrcMapMode=rMTF.GetPrefMapMode();
1711 
1712  if( bPlaceable )
1713  {
1715  aTargetSize = rMTF.GetPrefSize();
1716  sal_uInt16 nTargetDivisor = CalcSaveTargetMapMode(aTargetMapMode, aTargetSize);
1717  aTargetSize.setWidth( aTargetSize.Width() / nTargetDivisor );
1718  aTargetSize.setHeight( aTargetSize.Height() / nTargetDivisor );
1719  }
1720  else
1721  {
1722  aTargetMapMode = MapMode( MapUnit::MapInch );
1723 
1724  const tools::Long nUnit = pVirDev->LogicToPixel( Size( 1, 1 ), aTargetMapMode ).Width();
1725  const Fraction aFrac( 1, nUnit );
1726 
1727  aTargetMapMode.SetScaleX( aFrac );
1728  aTargetMapMode.SetScaleY( aFrac );
1730  }
1731 
1733 
1734  pAttrStack=nullptr;
1735 
1736  for (bool & rn : bHandleAllocated)
1737  rn=false;
1738 
1739  nDstPenHandle=0xffff;
1740  nDstFontHandle=0xffff;
1741  nDstBrushHandle=0xffff;
1742 
1743  nNumberOfActions=0;
1744  nNumberOfBitmaps=0;
1745  nWrittenActions=0;
1746  nWrittenBitmaps=0;
1748 
1749  CountActionsAndBitmaps(rMTF);
1750 
1751  WriteHeader(bPlaceable);
1752  if( bEmbedEMF )
1753  WriteEmbeddedEMF( rMTF );
1756  WMFRecord_SetBkMode( true );
1757 
1760 
1761  aDstLineInfo = LineInfo();
1764 
1767 
1769 
1770  vcl::Font aFont;
1771  aFont.SetCharSet( GetExtendedTextEncoding( RTL_TEXTENCODING_MS_1252 ) );
1772  aFont.SetColor( COL_WHITE );
1773  aFont.SetAlignment( ALIGN_BASELINE );
1774  aDstFont = aSrcFont = aFont;
1776 
1780 
1783 
1784  // Write records
1785  WriteRecords(rMTF);
1786 
1787  WriteRecordHeader(0x00000003,0x0000); // end of file
1788  UpdateHeader();
1789 
1790  while(pAttrStack)
1791  {
1792  pAt=pAttrStack;
1793  pAttrStack=pAt->pSucc;
1794  delete pAt;
1795  }
1796 
1798 
1799  if ( xStatusIndicator.is() )
1800  xStatusIndicator->end();
1801 
1802  return bStatus;
1803 }
1804 
1806  const Size& rPrefSize)
1807 {
1808  Fraction aDivFrac(2, 1);
1809  sal_uInt16 nDivisor = 1;
1810 
1811  Size aSize = OutputDevice::LogicToLogic( rPrefSize, aSrcMapMode, rMapMode );
1812 
1813  while( nDivisor <= 64 && (aSize.Width() > 32767 || aSize.Height() > 32767) )
1814  {
1815  Fraction aFrac = rMapMode.GetScaleX();
1816 
1817  aFrac *= aDivFrac;
1818  rMapMode.SetScaleX(aFrac);
1819  aFrac = rMapMode.GetScaleY();
1820  aFrac *= aDivFrac;
1821  rMapMode.SetScaleY(aFrac);
1822  nDivisor <<= 1;
1823  aSize = OutputDevice::LogicToLogic( rPrefSize, aSrcMapMode, rMapMode );
1824  }
1825 
1826  return nDivisor;
1827 }
1828 
1830 {
1831  SvMemoryStream aStream;
1832  EMFWriter aEMFWriter(aStream);
1833 
1834  if( !aEMFWriter.WriteEMF( rMTF ) )
1835  return;
1836 
1837  sal_uInt64 const nTotalSize = aStream.Tell();
1838  if( nTotalSize > SAL_MAX_UINT32 )
1839  return;
1840  aStream.Seek( 0 );
1841  sal_uInt32 nRemainingSize = static_cast< sal_uInt32 >( nTotalSize );
1842  sal_uInt32 nRecCounts = ( (nTotalSize - 1) / 0x2000 ) + 1;
1843  sal_uInt16 nCheckSum = 0, nWord;
1844 
1845  sal_uInt32 nPos = 0;
1846 
1847  while( nPos + 1 < nTotalSize )
1848  {
1849  aStream.ReadUInt16( nWord );
1850  nCheckSum ^= nWord;
1851  nPos += 2;
1852  }
1853 
1854  nCheckSum = static_cast< sal_uInt16 >( nCheckSum * -1 );
1855 
1856  aStream.Seek( 0 );
1857  while( nRemainingSize > 0 )
1858  {
1859  sal_uInt32 nCurSize;
1860  if( nRemainingSize > 0x2000 )
1861  {
1862  nCurSize = 0x2000;
1863  nRemainingSize -= 0x2000;
1864  }
1865  else
1866  {
1867  nCurSize = nRemainingSize;
1868  nRemainingSize = 0;
1869  }
1870  WriteEMFRecord( aStream,
1871  nCurSize,
1872  nRemainingSize,
1873  nTotalSize,
1874  nRecCounts,
1875  nCheckSum );
1876  nCheckSum = 0;
1877  }
1878 
1879 }
1880 
1881 void WMFWriter::WriteEMFRecord( SvMemoryStream& rStream, sal_uInt32 nCurSize, sal_uInt32 nRemainingSize,
1882  sal_uInt32 nTotalSize, sal_uInt32 nRecCounts, sal_uInt16 nCheckSum )
1883 {
1884  // according to http://msdn.microsoft.com/en-us/library/dd366152%28PROT.13%29.aspx
1886  pWMF->WriteUInt16( W_MFCOMMENT ) // same as META_ESCAPE_ENHANCED_METAFILE
1887  .WriteUInt16( nCurSize + 34 ) // we will always have a 34 byte escape header:
1888  .WriteUInt32( 0x43464D57 ) // WMFC
1889  .WriteUInt32( 0x00000001 ) // Comment type
1890  .WriteUInt32( 0x00010000 ) // version
1891  .WriteUInt16( nCheckSum ) // check sum
1892  .WriteUInt32( 0 ) // flags = 0
1893  .WriteUInt32( nRecCounts ) // total number of records
1894  .WriteUInt32( nCurSize ) // size of this record's data
1895  .WriteUInt32( nRemainingSize ) // remaining size of data in following records, missing in MSDN documentation
1896  .WriteUInt32( nTotalSize ); // total size of EMF stream
1897 
1898  pWMF->WriteBytes(static_cast<const char*>(rStream.GetData()) + rStream.Tell(), nCurSize);
1899  rStream.SeekRel( nCurSize );
1901 }
1902 
1903 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define W_META_SETPIXEL
Definition: wmfwr.cxx:60
sal_uInt16 Count() const
const Fraction & GetScaleX() const
Definition: mapmod.cxx:142
const LineInfo & GetLineInfo() const
Definition: metaact.hxx:186
#define W_TA_BASELINE
Definition: wmfwr.cxx:89
void WMFRecord_Rectangle(const tools::Rectangle &rRect)
Definition: wmfwr.cxx:675
void CreateSelectDeletePen(const Color &rColor, const LineInfo &rLineInfo)
Definition: wmfwr.cxx:870
void SetFillColor(const Color &)
Definition: font/font.cxx:98
bool GetFontCharMap(FontCharMapRef &rxFontCharMap) const
void WMFRecord_SetROP2(RasterOp eROP)
Definition: wmfwr.cxx:725
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
const tools::Polygon & GetObject(sal_uInt16 nPos) const
#define W_R2_COPYPEN
Definition: wmfwr.cxx:82
bool WriteWMF(const GDIMetaFile &rMTF, SvStream &rTargetStream, FilterConfigItem const *pFilterConfigItem, bool bPlaceable)
Definition: wmfwr.cxx:1679
sal_Int32 GetLen() const
Definition: metaact.hxx:497
const Point & GetPoint() const
Definition: metaact.hxx:716
sal_uInt8 GetRed() const
#define W_BS_SOLID
Definition: wmfwr.cxx:131
void WriteRecordHeader(sal_uInt32 nSizeWords, sal_uInt16 nType)
Definition: wmfwr.cxx:256
const OUString & GetFamilyName() const
Definition: font/font.cxx:829
FAMILY_SCRIPT
void WMFRecord_SetBkMode(bool bTransparent)
Definition: wmfwr.cxx:705
SvStream & WriteUInt16(sal_uInt16 nUInt16)
void MayCallback()
Definition: wmfwr.cxx:166
const GDIMetaFile & GetGDIMetaFile() const
Definition: metaact.hxx:1590
void setWidth(tools::Long nWidth)
void WMFRecord_SetStretchBltMode()
Definition: wmfwr.cxx:712
#define W_META_CREATEPENINDIRECT
Definition: wmfwr.cxx:73
SvStream & WriteInt32(sal_Int32 nInt32)
FAMILY_MODERN
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
#define W_LF_FACESIZE
Definition: wmfwr.cxx:105
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
Definition: map.cxx:1562
void WMFRecord_ExtTextOut(const Point &rPoint, const OUString &rString, const tools::Long *pDXAry)
Definition: wmfwr.cxx:548
signed char sal_Int8
void WMFRecord_SelectObject(sal_uInt16 nObjectHandle)
Definition: wmfwr.cxx:699
#define W_FF_ROMAN
Definition: wmfwr.cxx:114
#define W_META_EXTTEXTOUT
Definition: wmfwr.cxx:69
bool IsSetting() const
Definition: metaact.hxx:1324
const MapMode & GetPrefMapMode() const
Definition: gdimtf.hxx:175
#define W_BS_HOLLOW
Definition: wmfwr.cxx:132
Color aDstLineColor
Definition: wmfwr.hxx:85
#define W_META_RESTOREDC
Definition: wmfwr.cxx:65
void WMFRecord_PolyPolygon(const tools::PolyPolygon &rPolyPoly)
Definition: wmfwr.cxx:648
sal_uIntPtr sal_uLong
long Long
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
void disposeAndClear()
Definition: vclptr.hxx:200
const Point & GetPoint() const
Definition: metaact.hxx:1630
#define W_R2_XORPEN
Definition: wmfwr.cxx:81
WEIGHT_THIN
void WMFRecord_Arc(const tools::Rectangle &rRect, const Point &rStartPt, const Point &rEndPt)
Definition: wmfwr.cxx:280
TextAlign eSrcTextAlign
Definition: wmfwr.hxx:76
const Point & GetPoint() const
Definition: metaact.hxx:1591
WEIGHT_BLACK
#define W_PS_SOLID
Definition: wmfwr.cxx:98
#define W_META_SELECTOBJECT
Definition: wmfwr.cxx:66
sal_uInt64 Seek(sal_uInt64 nPos)
const Size & GetSize() const
Definition: metaact.hxx:717
RasterOp eDstROP2
Definition: wmfwr.hxx:89
WEIGHT_SEMIBOLD
#define W_FW_ULTRABOLD
Definition: wmfwr.cxx:128
sal_uInt16 eSrcHorTextAlign
Definition: wmfwr.hxx:82
const Point & GetEndPoint() const
Definition: metaact.hxx:185
sal_uInt16 nDstPenHandle
Definition: wmfwr.hxx:97
sal_uLong nNumberOfActions
Definition: wmfwr.hxx:103
void SetCharSet(rtl_TextEncoding)
Definition: font/font.cxx:139
const OUString & GetText() const
Definition: metaact.hxx:573
#define W_FW_ULTRALIGHT
Definition: wmfwr.cxx:127
FAMILY_ROMAN
Size GetSizePixel() const
void UpdateHeader()
Definition: wmfwr.cxx:1659
TOOLS_DLLPUBLIC rtl_TextEncoding getBestMSEncodingByChar(sal_Unicode c)
void WriteHeader(bool bPlaceable)
Definition: wmfwr.cxx:1627
tools::Long GetTextArray(const OUString &rStr, std::vector< tools::Long > *pDXAry, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Definition: text.cxx:932
sal_uLong nMetafileHeaderPos
Definition: wmfwr.hxx:66
sal_uInt32 nMaxRecordSize
Definition: wmfwr.hxx:67
WEIGHT_LIGHT
void SetMapMode()
Definition: map.cxx:592
sal_uLong nLastPercent
Definition: wmfwr.hxx:57
RasterOp GetRasterOp() const
Definition: metaact.hxx:1527
sal_uInt64 SeekRel(sal_Int64 nPos)
FontFamily GetFamilyType()
Definition: font/font.cxx:853
void WriteSize(const Size &rSize)
Definition: wmfwr.cxx:233
WEIGHT_BOLD
#define W_FW_SEMIBOLD
Definition: wmfwr.cxx:125
#define SAL_MAX_UINT32
constexpr tools::Long Width() const
HashMap_OWString_Interface aMap
#define W_META_DELETEOBJECT
Definition: wmfwr.cxx:72
#define W_FF_SWISS
Definition: wmfwr.cxx:115
sal_uLong nNumberOfBitmaps
Definition: wmfwr.hxx:104
#define W_META_ROUNDRECT
Definition: wmfwr.cxx:58
#define W_TA_TOP
Definition: wmfwr.cxx:87
sal_uInt16 sal_Unicode
FontItalic GetItalic()
Definition: font/font.cxx:852
#define W_META_SAVEDC
Definition: wmfwr.cxx:59
ErrCode GetError() const
const Point & GetPoint() const
Definition: metaact.hxx:822
#define W_META_SETWINDOWEXT
Definition: wmfwr.cxx:50
#define W_PS_DASH
Definition: wmfwr.cxx:99
LINESTYLE_NONE
void WMFRecord_SetTextAlign(TextAlign eFontAlign, sal_uInt16 eHorTextAlign)
Definition: wmfwr.cxx:738
const OUString & GetText() const
Definition: metaact.hxx:495
const Fraction & GetScaleY() const
Definition: mapmod.cxx:144
const Bitmap & GetBitmap() const
Definition: metaact.hxx:683
void WMFRecord_MoveTo(const Point &rPoint)
Definition: wmfwr.cxx:606
TextAlign GetAlignment() const
Definition: font/font.cxx:827
int nCount
sal_uLong nWrittenBitmaps
Definition: wmfwr.hxx:106
void WMFRecord_CreatePenIndirect(const Color &rColor, const LineInfo &rLineInfo)
Definition: wmfwr.cxx:371
WMFWriter()
Definition: wmfwr.cxx:138
sal_uInt16 nDstBrushHandle
Definition: wmfwr.hxx:97
TextAlign eTextAlign
Definition: wmfwr.hxx:39
std::size_t write_uInt8s_FromOString(SvStream &rStrm, std::string_view rStr, std::size_t nUnits)
const Gradient & GetGradient() const
Definition: metaact.hxx:1013
#define W_FW_LIGHT
Definition: wmfwr.cxx:122
SvStream & WriteUInt32(sal_uInt32 nUInt32)
#define W_FF_DONTCARE
Definition: wmfwr.cxx:113
const Color & GetColor() const
Definition: metaact.hxx:1242
void WMFRecord_SetTextColor(const Color &rColor)
Definition: wmfwr.cxx:754
#define W_DSTINVERT
Definition: wmfwr.cxx:96
const tools::Rectangle & GetRect() const
Definition: metaact.hxx:1161
Color aDstTextColor
Definition: wmfwr.hxx:87
sal_uInt16 CalcSaveTargetMapMode(MapMode &rMapMode, const Size &rPrefSize)
Definition: wmfwr.cxx:1805
#define W_SRCCOPY
Definition: wmfwr.cxx:92
PITCH_VARIABLE
void WriteRectangle(const tools::Rectangle &rRect)
Definition: wmfwr.cxx:245
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
Color aSrcFillColor
Definition: wmfwr.hxx:72
const Size & GetSize() const
Definition: metaact.hxx:823
void WriteRecords(const GDIMetaFile &rMTF)
Definition: wmfwr.cxx:1007
#define W_FF_DECORATIVE
Definition: wmfwr.cxx:118
FAMILY_DECORATIVE
sal_uInt8 GetBlue() const
#define W_FW_THIN
Definition: wmfwr.cxx:121
#define W_FIXED_PITCH
Definition: wmfwr.cxx:110
bool GetTextOutlines(PolyPolyVector &, const OUString &rStr, sal_Int32 nBase=0, sal_Int32 nIndex=0, sal_Int32 nLen=-1, sal_uLong nLayoutWidth=0, const tools::Long *pDXArray=nullptr) const
Definition: text.cxx:2384
void AdaptiveSubdivide(tools::PolyPolygon &rResult) const
void TrueExtTextOut(const Point &rPoint, const OUString &rString, const OString &rByteString, const tools::Long *pDXAry)
Definition: wmfwr.cxx:564
VclPtr< VirtualDevice > pVirDev
Definition: wmfwr.hxx:62
rtl_TextEncoding GetExtendedTextEncoding(rtl_TextEncoding eEncoding)
#define W_PS_NULL
Definition: wmfwr.cxx:103
sal_uInt16 eDstHorTextAlign
Definition: wmfwr.hxx:93
struct WMFWriterAttrStackMember * pSucc
Definition: wmfwr.hxx:34
LineInfo aSrcLineInfo
Definition: wmfwr.hxx:74
#define W_META_SETBKMODE
Definition: wmfwr.cxx:45
#define PRIVATE_ESCAPE_UNICODE
Definition: wmfwr.cxx:136
sal_UCS4 GetFirstChar() const
Get the first character in the font character map.
WEIGHT_SEMILIGHT
UNDERLYING_TYPE get() const
#define W_ANSI_CHARSET
Definition: wmfwr.cxx:107
ALIGN_BASELINE
void SetScaleX(const Fraction &rScaleX)
Definition: mapmod.cxx:110
WMFWriterAttrStackMember * pAttrStack
Definition: wmfwr.hxx:80
Color aSrcTextColor
Definition: wmfwr.hxx:73
const tools::Rectangle & GetRect() const
Definition: metaact.hxx:215
FontPitch GetPitch()
Definition: font/font.cxx:849
const Size & GetPrefSize() const
Definition: gdimtf.hxx:172
void WriteEMFRecord(SvMemoryStream &rStream, sal_uInt32 nCurSize, sal_uInt32 nRemainingSize, sal_uInt32 nTotalSize, sal_uInt32 nRecCounts, sal_uInt16 nCheckSum)
Definition: wmfwr.cxx:1881
#define W_TA_RTLREADING
Definition: wmfwr.cxx:90
#define W_META_STRETCHDIB
Definition: wmfwr.cxx:71
int i
#define W_META_SETTEXTCOLOR
Definition: wmfwr.cxx:48
MapMode aTargetMapMode
Definition: wmfwr.hxx:63
void SetAllAttr()
Definition: wmfwr.cxx:932
#define W_FW_BLACK
Definition: wmfwr.cxx:129
const MapMode & GetMapMode() const
Definition: metaact.hxx:1428
const Point & GetPoint() const
Definition: metaact.hxx:494
bool IsSetting() const
Definition: metaact.hxx:1243
void WMFRecord_SetWindowOrg(const Point &rPoint)
Definition: wmfwr.cxx:766
tools::Long FRound(double fVal)
PITCH_FIXED
#define W_META_CREATEBRUSHINDIRECT
Definition: wmfwr.cxx:75
ComplexTextLayoutFlags
Definition: outdevstate.hxx:65
MapMode aSrcMapMode
Definition: wmfwr.hxx:78
#define W_META_POLYLINE
Definition: wmfwr.cxx:63
#define W_META_CHORD
Definition: wmfwr.cxx:68
#define W_OPAQUE
Definition: wmfwr.cxx:78
const BitmapEx & GetBitmapEx() const
Definition: metaact.hxx:788
const tools::Rectangle & GetRect() const
Definition: metaact.hxx:1012
vcl::Region aClipRegion
Definition: wmfwr.hxx:43
sal_uLong nWrittenActions
Definition: wmfwr.hxx:105
void WMFRecord_CreateBrushIndirect(const Color &rColor)
Definition: wmfwr.cxx:296
WEIGHT_MEDIUM
const Color & GetColor() const
Definition: metaact.hxx:1321
#define W_META_ELLIPSE
Definition: wmfwr.cxx:55
const Size & GetSize() const
Definition: metaact.hxx:1592
void SetOrigin(const Point &rOrigin)
Definition: mapmod.cxx:104
sal_uInt32 GetWidth() const
Definition: metaact.hxx:574
sal_Int32 ScaleWidth(sal_Int32 nDX)
Definition: wmfwr.cxx:227
#define W_VARIABLE_PITCH
Definition: wmfwr.cxx:111
RasterOp eSrcRasterOp
Definition: wmfwr.hxx:75
void WMFRecord_IntersectClipRect(const tools::Rectangle &rRect)
Definition: wmfwr.cxx:845
#define W_META_SETROP2
Definition: wmfwr.cxx:46
bool HasFlags() const
void WMFRecord_Ellipse(const tools::Rectangle &rRect)
Definition: wmfwr.cxx:413
#define W_SRCAND
Definition: wmfwr.cxx:94
#define W_META_SETTEXTALIGN
Definition: wmfwr.cxx:67
constexpr tools::Long Right() const
std::size_t WriteBytes(const void *pData, std::size_t nSize)
WEIGHT_NORMAL
bool WMFRecord_Escape_Unicode(const Point &rPoint, const OUString &rStr, const tools::Long *pDXAry)
Definition: wmfwr.cxx:445
#define W_MFCOMMENT
Definition: wmfwr.cxx:134
WEIGHT_ULTRALIGHT
void Move(tools::Long nHorzMove, tools::Long nVertMove)
#define W_FW_MEDIUM
Definition: wmfwr.cxx:124
void SetScaleY(const Fraction &rScaleY)
Definition: mapmod.cxx:117
bool WriteEMF(const GDIMetaFile &rMtf)
Definition: emfwr.cxx:239
const Size & GetFontSize() const
Definition: font/font.cxx:832
const OUString & GetText() const
Definition: metaact.hxx:611
ALIGN_BOTTOM
void AddGradientActions(const tools::Rectangle &rRect, const Gradient &rGradient, GDIMetaFile &rMtf)
FontStrikeout GetStrikeout() const
Definition: font/font.cxx:871
sal_uInt16 GetSize() const
Color aSrcLineColor
Definition: wmfwr.hxx:71
sal_Int32 GetLen() const
Definition: metaact.hxx:576
const Point & GetPoint() const
Definition: metaact.hxx:789
MapUnit GetMapUnit() const
Definition: mapmod.cxx:138
WEIGHT_ULTRABOLD
::basegfx::B2DPolygon getB2DPolygon() const
ITALIC_NONE
RasterOp
Definition: RasterOp.hxx:22
Size aTargetSize
Definition: wmfwr.hxx:64
#define W_META_INTERSECTCLIPRECT
Definition: wmfwr.cxx:53
void SetLineAndFillAttr()
Definition: wmfwr.cxx:912
const Size & GetSize() const
Definition: metaact.hxx:1631
TextAlign
sal_uLong nActBitmapPercent
Definition: wmfwr.hxx:107
const Bitmap & GetBitmap() const
Definition: metaact.hxx:715
std::size_t write_uInt16_lenPrefixed_uInt8s_FromOString(SvStream &rStrm, std::string_view rStr)
void SetColor(const Color &)
Definition: font/font.cxx:90
constexpr Point TopLeft() const
#define W_FW_DONTCARE
Definition: wmfwr.cxx:120
PushFlags GetFlags() const
Definition: metaact.hxx:1487
#define W_META_SETWINDOWORG
Definition: wmfwr.cxx:49
void SetAlignment(TextAlign)
Definition: font/font.cxx:111
constexpr tools::Long Bottom() const
Bitmap GetBitmap(Color aTransparentReplaceColor) const
Definition: BitmapEx.cxx:203
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:876
const tools::PolyPolygon & GetPolyPolygon() const
Definition: metaact.hxx:1072
void TrueTextOut(const Point &rPoint, const OString &rString)
Definition: wmfwr.cxx:834
#define W_SRCPAINT
Definition: wmfwr.cxx:93
sal_uInt16 nDstFontHandle
Definition: wmfwr.hxx:97
const Point & GetPoint() const
Definition: metaact.hxx:572
bool IsSetting() const
Definition: metaact.hxx:1270
sal_uInt8 GetGreen() const
#define W_META_SETSTRETCHBLTMODE
Definition: wmfwr.cxx:47
const Point & GetPoint(sal_uInt16 nPos) const
void UpdateRecordHeader()
Definition: wmfwr.cxx:263
bool bEmbedEMF
Definition: wmfwr.hxx:109
const Color & GetColor() const
Definition: metaact.hxx:1296
const Point & GetStartPoint() const
Definition: metaact.hxx:184
ALIGN_TOP
const Color & GetColor() const
Definition: font/font.cxx:823
vcl::Region aDstClipRegion
Definition: wmfwr.hxx:95
#define W_R2_NOT
Definition: wmfwr.cxx:80
const css::uno::Sequence< css::beans::PropertyValue > & GetFilterData() const
const BitmapEx & GetBitmapEx() const
Definition: metaact.hxx:821
sal_uInt32 count() const
AlphaMask GetAlpha() const
Definition: BitmapEx.cxx:215
void WMFRecord_CreateFontIndirect(const vcl::Font &rFont)
Definition: wmfwr.cxx:309
void WMFRecord_StretchDIB(const Point &rPoint, const Size &rSize, const Bitmap &rBitmap, sal_uInt32 nROP=0)
Definition: wmfwr.cxx:772
#define W_META_MOVETO
Definition: wmfwr.cxx:52
sal_Int32 GetDenominator() const
#define W_META_POLYPOLYGON
Definition: wmfwr.cxx:70
vcl::Font aSrcFont
Definition: wmfwr.hxx:77
FontWeight GetWeight()
Definition: font/font.cxx:850
constexpr tools::Long Height() const
unsigned char sal_uInt8
void WMFRecord_DeleteObject(sal_uInt16 nObjectHandle)
Definition: wmfwr.cxx:407
void WMFRecord_PolyLine(const tools::Polygon &rPoly)
Definition: wmfwr.cxx:634
void WMFRecord_TextOut(const Point &rPoint, std::u16string_view rString)
Definition: wmfwr.cxx:827
void SetFont(const vcl::Font &rNewFont)
Definition: outdev/font.cxx:52
LineInfo aDstLineInfo
Definition: wmfwr.hxx:88
MetaAction * GetAction(size_t nAction) const
Definition: gdimtf.cxx:184
void WMFRecord_RestoreDC()
Definition: wmfwr.cxx:681
void SetEndian(SvStreamEndian SvStreamEndian)
#define W_META_CREATEFONTINDIRECT
Definition: wmfwr.cxx:74
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
vcl::Region aSrcClipRegion
Definition: wmfwr.hxx:79
void HandleLineInfoPolyPolygons(const LineInfo &rInfo, const basegfx::B2DPolygon &rLinePolygon)
Definition: wmfwr.cxx:966
FAMILY_SWISS
SvStream & WriteUChar(unsigned char nChar)
void WMFRecord_Escape(sal_uInt32 nEsc, sal_uInt32 nLen, const sal_Int8 *pData)
Definition: wmfwr.cxx:419
const Point & GetPoint() const
Definition: metaact.hxx:153
#define W_TA_BOTTOM
Definition: wmfwr.cxx:88
const Point & GetPoint() const
Definition: metaact.hxx:684
bool bStatus
Definition: wmfwr.hxx:55
void WriteHeightWidth(const Size &rSize)
Definition: wmfwr.cxx:239
#define W_TA_RIGHT
Definition: wmfwr.cxx:86
SvStream & WriteInt16(sal_Int16 nInt16)
static VclPtr< reference_type > Create(Arg &&...arg)
A construction helper for VclPtr.
Definition: vclptr.hxx:127
void WMFRecord_Chord(const tools::Rectangle &rRect, const Point &rStartPt, const Point &rEndPt)
Definition: wmfwr.cxx:288
#define W_DEFAULT_PITCH
Definition: wmfwr.cxx:109
void WMFRecord_SetPixel(const Point &rPoint, const Color &rColor)
Definition: wmfwr.cxx:718
sal_uLong nActRecordPos
Definition: wmfwr.hxx:68
sal_uInt64 Tell() const
size_t GetActionSize() const
Definition: gdimtf.cxx:179
Degree10 GetOrientation() const
Definition: font/font.cxx:845
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
sal_Int32 GetNumerator() const
#define MAXOBJECTHANDLES
Definition: wmfwr.hxx:30
void WritePointXY(const Point &rPoint)
Definition: wmfwr.cxx:215
void CountActionsAndBitmaps(const GDIMetaFile &rMTF)
Definition: wmfwr.cxx:189
void AddHatchActions(const tools::PolyPolygon &rPolyPoly, const Hatch &rHatch, GDIMetaFile &rMtf)
const Point & GetOrigin() const
Definition: mapmod.cxx:140
MetaActionType GetType() const
Definition: metaact.hxx:91
#define W_META_ESCAPE
Definition: wmfwr.cxx:64
SvStream & WriteChar(char nChar)
#define W_TA_NOUPDATECP
Definition: wmfwr.cxx:84
css::uno::Reference< css::task::XStatusIndicator > GetStatusIndicator() const
vcl::Font aDstFont
Definition: wmfwr.hxx:91
const Hatch & GetHatch() const
Definition: metaact.hxx:1073
bool bHandleAllocated[MAXOBJECTHANDLES]
Definition: wmfwr.hxx:96
void WriteEmbeddedEMF(const GDIMetaFile &rMTF)
Definition: wmfwr.cxx:1829
void AdaptiveSubdivide(tools::Polygon &rResult, const double d=1.0) const
#define W_FW_NORMAL
Definition: wmfwr.cxx:123
void setHeight(tools::Long nHeight)
FontLineStyle GetUnderline() const
Definition: font/font.cxx:869
void WMFRecord_Polygon(const tools::Polygon &rPoly)
Definition: wmfwr.cxx:620
#define W_FF_SCRIPT
Definition: wmfwr.cxx:117
void FreeHandle(sal_uInt16 nObjectHandle)
Definition: wmfwr.cxx:865
#define W_META_TEXTOUT
Definition: wmfwr.cxx:61
#define W_META_ARC
Definition: wmfwr.cxx:54
#define W_META_LINETO
Definition: wmfwr.cxx:51
css::uno::Reference< css::task::XStatusIndicator > xStatusIndicator
Definition: wmfwr.hxx:59
void WMFRecord_LineTo(const Point &rPoint)
Definition: wmfwr.cxx:600
sal_uInt16 AllocHandle()
Definition: wmfwr.cxx:851
TextAlign GetTextAlign() const
Definition: metaact.hxx:1402
#define W_PS_DASHDOTDOT
Definition: wmfwr.cxx:102
Color aDstFillColor
Definition: wmfwr.hxx:86
#define W_PS_DOT
Definition: wmfwr.cxx:100
STRIKEOUT_NONE
void CreateSelectDeleteFont(const vcl::Font &rFont)
Definition: wmfwr.cxx:884
bool WriteDIB(const Bitmap &rSource, SvStream &rOStm, bool bCompressed, bool bFileHeader)
Definition: dibtools.cxx:1818
bool IsStarSymbol(const OUString &rFontName)
bool Replace(const Bitmap &rMask, const Color &rReplaceColor)
Replace all pixel where the given mask is on with the specified color.
#define W_SRCINVERT
Definition: wmfwr.cxx:95
void WriteColor(const Color &rColor)
Definition: wmfwr.cxx:251
void WMFRecord_SetWindowExt(const Size &rSize)
Definition: wmfwr.cxx:760
const Color & GetColor() const
Definition: metaact.hxx:1269
const GDIMetaFile & GetSubstitute() const
Definition: metaact.hxx:1629
void WMFRecord_RoundRect(const tools::Rectangle &rRect, tools::Long nHorzRound, tools::Long nVertRound)
Definition: wmfwr.cxx:687
#define W_TRANSPARENT
Definition: wmfwr.cxx:77
TextAlign eDstTextAlign
Definition: wmfwr.hxx:90
bool Crop(const tools::Rectangle &rRectPixel)
Crop the bitmap.
Definition: BitmapEx.cxx:354
const vcl::Font & GetFont() const
Definition: metaact.hxx:1462
const tools::Rectangle & GetRect() const
Definition: metaact.hxx:610
#define W_META_RECTANGLE
Definition: wmfwr.cxx:57
sal_Int32 GetIndex() const
Definition: metaact.hxx:575
void CreateSelectDeleteBrush(const Color &rColor)
Definition: wmfwr.cxx:898
SvStream * pWMF
Definition: wmfwr.hxx:61
#define W_META_POLYGON
Definition: wmfwr.cxx:62
sal_Int32 GetIndex() const
Definition: metaact.hxx:496
#define W_FW_BOLD
Definition: wmfwr.cxx:126
rtl_TextEncoding GetCharSet() const
Definition: font/font.cxx:838
void WritePointYX(const Point &rPoint)
Definition: wmfwr.cxx:221
sal_uInt16 nPos
void WMFRecord_Pie(const tools::Rectangle &rRect, const Point &rStartPt, const Point &rEndPt)
Definition: wmfwr.cxx:612
#define W_META_PIE
Definition: wmfwr.cxx:56
sal_Int16 nValue
const void * GetData()
#define W_TA_LEFT
Definition: wmfwr.cxx:85
#define W_PS_DASHDOT
Definition: wmfwr.cxx:101
sal_uInt32 count() const
void WMFRecord_SaveDC()
Definition: wmfwr.cxx:694
#define W_FF_MODERN
Definition: wmfwr.cxx:116