1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <vcl/mtfxmldump.hxx>
11 #include <tools/XmlWriter.hxx>
12 #include <tools/fract.hxx>
14 #include <vcl/metaact.hxx>
15 #include <vcl/outdev.hxx>
16 #include <rtl/string.hxx>
23 OUString
collectPushFlags(PushFlags nFlags
)
25 if ((nFlags
& PushFlags::ALL
) == PushFlags::ALL
)
27 else if ((nFlags
& PUSH_ALLFONT
) == PUSH_ALLFONT
)
29 else if ((nFlags
& PUSH_ALLTEXT
) == PUSH_ALLTEXT
)
32 std::vector
<OUString
> aStrings
;
34 if (nFlags
& PushFlags::LINECOLOR
)
35 aStrings
.emplace_back("PushLineColor");
36 if (nFlags
& PushFlags::FILLCOLOR
)
37 aStrings
.emplace_back("PushFillColor");
38 if (nFlags
& PushFlags::FONT
)
39 aStrings
.emplace_back("PushFont");
40 if (nFlags
& PushFlags::TEXTCOLOR
)
41 aStrings
.emplace_back("PushTextColor");
42 if (nFlags
& PushFlags::MAPMODE
)
43 aStrings
.emplace_back("PushMapMode");
44 if (nFlags
& PushFlags::CLIPREGION
)
45 aStrings
.emplace_back("PushClipRegion");
46 if (nFlags
& PushFlags::RASTEROP
)
47 aStrings
.emplace_back("PushRasterOp");
48 if (nFlags
& PushFlags::TEXTFILLCOLOR
)
49 aStrings
.emplace_back("PushTextFillColor");
50 if (nFlags
& PushFlags::TEXTALIGN
)
51 aStrings
.emplace_back("PushTextAlign");
52 if (nFlags
& PushFlags::REFPOINT
)
53 aStrings
.emplace_back("PushRefPoint");
54 if (nFlags
& PushFlags::TEXTLINECOLOR
)
55 aStrings
.emplace_back("PushTextLineColor");
56 if (nFlags
& PushFlags::TEXTLAYOUTMODE
)
57 aStrings
.emplace_back("PushTextLayoutMode");
58 if (nFlags
& PushFlags::TEXTLANGUAGE
)
59 aStrings
.emplace_back("PushTextLanguage");
60 if (nFlags
& PushFlags::OVERLINECOLOR
)
61 aStrings
.emplace_back("PushOverlineColor");
68 aString
= aStrings
[0];
69 for (size_t i
= 1; i
< aStrings
.size(); ++i
)
71 aString
+= ", " + aStrings
[i
];
76 OUString
convertDrawTextFlagsToString(DrawTextFlags eDrawTextFlags
)
78 std::vector
<OUString
> aStrings
;
79 if (eDrawTextFlags
& DrawTextFlags::Disable
)
80 aStrings
.emplace_back("Disable");
81 if (eDrawTextFlags
& DrawTextFlags::Mnemonic
)
82 aStrings
.emplace_back("Mnemonic");
83 if (eDrawTextFlags
& DrawTextFlags::Mono
)
84 aStrings
.emplace_back("Mono");
85 if (eDrawTextFlags
& DrawTextFlags::Clip
)
86 aStrings
.emplace_back("Clip");
87 if (eDrawTextFlags
& DrawTextFlags::Left
)
88 aStrings
.emplace_back("Left");
89 if (eDrawTextFlags
& DrawTextFlags::Center
)
90 aStrings
.emplace_back("Center");
91 if (eDrawTextFlags
& DrawTextFlags::Right
)
92 aStrings
.emplace_back("Right");
93 if (eDrawTextFlags
& DrawTextFlags::Top
)
94 aStrings
.emplace_back("Top");
95 if (eDrawTextFlags
& DrawTextFlags::VCenter
)
96 aStrings
.emplace_back("VCenter");
97 if (eDrawTextFlags
& DrawTextFlags::Bottom
)
98 aStrings
.emplace_back("Bottom");
99 if (eDrawTextFlags
& DrawTextFlags::EndEllipsis
)
100 aStrings
.emplace_back("EndEllipsis");
101 if (eDrawTextFlags
& DrawTextFlags::PathEllipsis
)
102 aStrings
.emplace_back("PathEllipsis");
103 if (eDrawTextFlags
& DrawTextFlags::MultiLine
)
104 aStrings
.emplace_back("MultiLine");
105 if (eDrawTextFlags
& DrawTextFlags::WordBreak
)
106 aStrings
.emplace_back("WordBreak");
107 if (eDrawTextFlags
& DrawTextFlags::NewsEllipsis
)
108 aStrings
.emplace_back("NewsEllipsis");
109 if (eDrawTextFlags
& DrawTextFlags::WordBreakHyphenation
)
110 aStrings
.emplace_back("WordBreakHyphenation");
111 if (eDrawTextFlags
& DrawTextFlags::CenterEllipsis
)
112 aStrings
.emplace_back("CenterEllipsis");
113 if (eDrawTextFlags
& DrawTextFlags::HideMnemonic
)
114 aStrings
.emplace_back("HideMnemonic");
118 if (aStrings
.empty())
121 aString
= aStrings
[0];
122 for (size_t i
= 1; i
< aStrings
.size(); ++i
)
124 aString
+= " " + aStrings
[i
];
129 OUString
convertRopToString(RasterOp eRop
)
133 case RasterOp::OverPaint
: return "overpaint";
134 case RasterOp::Xor
: return "xor";
135 case RasterOp::N0
: return "0";
136 case RasterOp::N1
: return "1";
137 case RasterOp::Invert
: return "invert";
142 OUString
convertTextAlignToString(TextAlign eAlign
)
146 case ALIGN_BASELINE
: return "baseline";
147 case ALIGN_BOTTOM
: return "bottom";
148 case ALIGN_TOP
: return "top";
149 case TextAlign_FORCE_EQUAL_SIZE
: return "equalsize";
154 OUString
convertColorToString(Color aColor
)
156 OUString aRGBString
= aColor
.AsRGBHexString();
157 return "#" + aRGBString
;
160 OUString
convertLineStyleToString(LineStyle eAlign
)
164 case LineStyle::NONE
: return "none";
165 case LineStyle::Solid
: return "solid";
166 case LineStyle::Dash
: return "dash";
172 OUString
convertLineJoinToString(basegfx::B2DLineJoin eJoin
)
177 case basegfx::B2DLineJoin::NONE
: return "none";
178 case basegfx::B2DLineJoin::Bevel
: return "bevel";
179 case basegfx::B2DLineJoin::Miter
: return "miter";
180 case basegfx::B2DLineJoin::Round
: return "round";
184 OUString
convertLineCapToString(css::drawing::LineCap eCap
)
189 case css::drawing::LineCap_BUTT
: return "butt";
190 case css::drawing::LineCap_ROUND
: return "round";
191 case css::drawing::LineCap_SQUARE
: return "square";
195 OUString
convertPolygonFlags(PolyFlags eFlags
)
200 case PolyFlags::Normal
: return "normal";
201 case PolyFlags::Control
: return "control";
202 case PolyFlags::Smooth
: return "smooth";
203 case PolyFlags::Symmetric
: return "symmetric";
207 OUString
convertFontWeigthToString(FontWeight eFontWeight
)
211 case WEIGHT_DONTKNOW
: return "unknown";
212 case WEIGHT_THIN
: return "thin";
213 case WEIGHT_ULTRALIGHT
: return "ultralight";
214 case WEIGHT_LIGHT
: return "light";
215 case WEIGHT_SEMILIGHT
: return "semilight";
216 case WEIGHT_NORMAL
: return "normal";
217 case WEIGHT_MEDIUM
: return "medium";
218 case WEIGHT_SEMIBOLD
: return "semibold";
219 case WEIGHT_BOLD
: return "bold";
220 case WEIGHT_ULTRABOLD
: return "ultrabold";
221 case WEIGHT_BLACK
: return "black";
222 case FontWeight_FORCE_EQUAL_SIZE
: return "equalsize";
227 OUString
convertFontStrikeoutToString(FontStrikeout eFontStrikeout
)
229 switch (eFontStrikeout
)
231 case STRIKEOUT_NONE
: return "none";
232 case STRIKEOUT_SINGLE
: return "single";
233 case STRIKEOUT_DOUBLE
: return "double";
234 case STRIKEOUT_DONTKNOW
: return "dontknow";
235 case STRIKEOUT_BOLD
: return "bold";
236 case STRIKEOUT_SLASH
: return "slash";
237 case STRIKEOUT_X
: return "x";
238 case FontStrikeout_FORCE_EQUAL_SIZE
: return "equalsize";
243 OUString
convertFontLineStyleToString(FontLineStyle eFontLineStyle
)
245 switch (eFontLineStyle
)
247 case LINESTYLE_NONE
: return "none";
248 case LINESTYLE_SINGLE
: return "single";
249 case LINESTYLE_DOUBLE
: return "double";
250 case LINESTYLE_DOTTED
: return "dotted";
251 case LINESTYLE_DONTKNOW
: return "dontknow";
252 case LINESTYLE_DASH
: return "dash";
253 case LINESTYLE_LONGDASH
: return "longdash";
254 case LINESTYLE_DASHDOT
: return "dashdot";
255 case LINESTYLE_DASHDOTDOT
: return "dashdotdot";
256 case LINESTYLE_SMALLWAVE
: return "smallwave";
257 case LINESTYLE_WAVE
: return "wave";
258 case LINESTYLE_DOUBLEWAVE
: return "doublewave";
259 case LINESTYLE_BOLD
: return "bold";
260 case LINESTYLE_BOLDDOTTED
: return "bolddotted";
261 case LINESTYLE_BOLDDASH
: return "bolddash";
262 case LINESTYLE_BOLDLONGDASH
: return "boldlongdash";
263 case LINESTYLE_BOLDDASHDOT
: return "bolddashdot";
264 case LINESTYLE_BOLDDASHDOTDOT
: return "bolddashdotdot";
265 case LINESTYLE_BOLDWAVE
: return "boldwave";
266 case FontLineStyle_FORCE_EQUAL_SIZE
: return "equalsize";
271 OString
convertLineStyleToString(const MetaActionType nActionType
)
275 case MetaActionType::NONE
: return "null";
276 case MetaActionType::PIXEL
: return "pixel";
277 case MetaActionType::POINT
: return "point";
278 case MetaActionType::LINE
: return "line";
279 case MetaActionType::RECT
: return "rect";
280 case MetaActionType::ROUNDRECT
: return "roundrect";
281 case MetaActionType::ELLIPSE
: return "ellipse";
282 case MetaActionType::ARC
: return "arc";
283 case MetaActionType::PIE
: return "pie";
284 case MetaActionType::CHORD
: return "chord";
285 case MetaActionType::POLYLINE
: return "polyline";
286 case MetaActionType::POLYGON
: return "polygon";
287 case MetaActionType::POLYPOLYGON
: return "polypolygon";
288 case MetaActionType::TEXT
: return "text";
289 case MetaActionType::TEXTARRAY
: return "textarray";
290 case MetaActionType::STRETCHTEXT
: return "stretchtext";
291 case MetaActionType::TEXTRECT
: return "textrect";
292 case MetaActionType::TEXTLINE
: return "textline";
293 case MetaActionType::BMP
: return "bmp";
294 case MetaActionType::BMPSCALE
: return "bmpscale";
295 case MetaActionType::BMPSCALEPART
: return "bmpscalepart";
296 case MetaActionType::BMPEX
: return "bmpex";
297 case MetaActionType::BMPEXSCALE
: return "bmpexscale";
298 case MetaActionType::BMPEXSCALEPART
: return "bmpexscalepart";
299 case MetaActionType::MASK
: return "mask";
300 case MetaActionType::MASKSCALE
: return "maskscale";
301 case MetaActionType::MASKSCALEPART
: return "maskscalepart";
302 case MetaActionType::GRADIENT
: return "gradient";
303 case MetaActionType::GRADIENTEX
: return "gradientex";
304 case MetaActionType::HATCH
: return "hatch";
305 case MetaActionType::WALLPAPER
: return "wallpaper";
306 case MetaActionType::CLIPREGION
: return "clipregion";
307 case MetaActionType::ISECTRECTCLIPREGION
: return "sectrectclipregion";
308 case MetaActionType::ISECTREGIONCLIPREGION
: return "sectregionclipregion";
309 case MetaActionType::MOVECLIPREGION
: return "moveclipregion";
310 case MetaActionType::LINECOLOR
: return "linecolor";
311 case MetaActionType::FILLCOLOR
: return "fillcolor";
312 case MetaActionType::TEXTCOLOR
: return "textcolor";
313 case MetaActionType::TEXTFILLCOLOR
: return "textfillcolor";
314 case MetaActionType::TEXTLINECOLOR
: return "textlinecolor";
315 case MetaActionType::OVERLINECOLOR
: return "overlinecolor";
316 case MetaActionType::TEXTALIGN
: return "textalign";
317 case MetaActionType::MAPMODE
: return "mapmode";
318 case MetaActionType::FONT
: return "font";
319 case MetaActionType::PUSH
: return "push";
320 case MetaActionType::POP
: return "pop";
321 case MetaActionType::RASTEROP
: return "rasterop";
322 case MetaActionType::Transparent
: return "transparent";
323 case MetaActionType::FLOATTRANSPARENT
: return "floattransparent";
324 case MetaActionType::EPS
: return "eps";
325 case MetaActionType::REFPOINT
: return "refpoint";
326 case MetaActionType::COMMENT
: return "comment";
327 case MetaActionType::LAYOUTMODE
: return "layoutmode";
328 case MetaActionType::TEXTLANGUAGE
: return "textlanguage";
333 OUString
convertBitmapExTransparentType(TransparentType eType
)
338 case TransparentType::NONE
: return "none";
339 case TransparentType::Bitmap
: return "bitmap";
340 case TransparentType::Color
: return "color";
344 OUString
convertMapUnitToString(MapUnit eUnit
)
349 case MapUnit::LASTENUMDUMMY
: return "LASTENUMDUMMY";
350 case MapUnit::Map1000thInch
: return "Map1000thInch";
351 case MapUnit::Map100thInch
: return "Map100thInch";
352 case MapUnit::Map100thMM
: return "Map100thMM";
353 case MapUnit::Map10thInch
: return "Map10thInch";
354 case MapUnit::Map10thMM
: return "Map10thMM";
355 case MapUnit::MapAppFont
: return "MapAppFont";
356 case MapUnit::MapCM
: return "MapCM";
357 case MapUnit::MapInch
: return "MapInch";
358 case MapUnit::MapMM
: return "MapMM";
359 case MapUnit::MapPixel
: return "MapPixel";
360 case MapUnit::MapPoint
: return "MapPoint";
361 case MapUnit::MapRelative
: return "MapRelative";
362 case MapUnit::MapSysFont
: return "MapSysFont";
363 case MapUnit::MapTwip
: return "MapTwip";
367 OUString
convertFractionToString(const Fraction
& aFraction
)
369 std::stringstream ss
;
373 return OUString::createFromAscii(ss
.str().c_str());
376 OUString
convertGradientStyle(GradientStyle eStyle
)
380 case GradientStyle::Linear
: return "Linear";
381 case GradientStyle::Axial
: return "Axial";
382 case GradientStyle::Radial
: return "Radial";
383 case GradientStyle::Elliptical
: return "Elliptical";
384 case GradientStyle::Square
: return "Square";
385 case GradientStyle::Rect
: return "Rect";
386 case GradientStyle::FORCE_EQUAL_SIZE
: return "ForceEqualSize";
391 OUString
convertHatchStyle(HatchStyle eStyle
)
395 case HatchStyle::Single
: return "Single";
396 case HatchStyle::Double
: return "Double";
397 case HatchStyle::Triple
: return "Triple";
398 case HatchStyle::FORCE_EQUAL_SIZE
: return "ForceEqualSize";
403 OUString
convertWallpaperStyleToString(WallpaperStyle eWallpaperStyle
)
405 switch (eWallpaperStyle
)
407 case WallpaperStyle::NONE
: return "NONE";
408 case WallpaperStyle::Tile
: return "Tile";
409 case WallpaperStyle::Center
: return "Center";
410 case WallpaperStyle::Scale
: return "Scale";
411 case WallpaperStyle::TopLeft
: return "TopLeft";
412 case WallpaperStyle::Top
: return "Top";
413 case WallpaperStyle::TopRight
: return "TopRight";
414 case WallpaperStyle::Left
: return "Left";
415 case WallpaperStyle::Right
: return "Right";
416 case WallpaperStyle::BottomLeft
: return "BottomLeft";
417 case WallpaperStyle::Bottom
: return "Bottom";
418 case WallpaperStyle::BottomRight
: return "BottomRight";
419 case WallpaperStyle::ApplicationGradient
: return "ApplicationGradient";
424 OUString
hex32(sal_uInt32 nNumber
)
426 std::stringstream ss
;
427 ss
<< std::hex
<< std::setfill('0') << std::setw(8) << nNumber
;
428 return OUString::createFromAscii(ss
.str().c_str());
431 void writePoint(tools::XmlWriter
& rWriter
, Point
const& rPoint
)
433 rWriter
.attribute("x", rPoint
.X());
434 rWriter
.attribute("y", rPoint
.Y());
437 void writeStartPoint(tools::XmlWriter
& rWriter
, Point
const& rPoint
)
439 rWriter
.attribute("startx", rPoint
.X());
440 rWriter
.attribute("starty", rPoint
.Y());
443 void writeEndPoint(tools::XmlWriter
& rWriter
, Point
const& rPoint
)
445 rWriter
.attribute("endx", rPoint
.X());
446 rWriter
.attribute("endy", rPoint
.Y());
449 void writeSize(tools::XmlWriter
& rWriter
, Size
const& rSize
)
451 rWriter
.attribute("width", rSize
.Width());
452 rWriter
.attribute("height", rSize
.Height());
455 void writeRectangle(tools::XmlWriter
& rWriter
, tools::Rectangle
const& rRectangle
)
457 rWriter
.attribute("left", rRectangle
.Left());
458 rWriter
.attribute("top", rRectangle
.Top());
459 if (rRectangle
.IsWidthEmpty())
460 rWriter
.attribute("right", OString("empty"));
462 rWriter
.attribute("right", rRectangle
.Right());
463 if (rRectangle
.IsHeightEmpty())
464 rWriter
.attribute("bottom", OString("empty"));
466 rWriter
.attribute("bottom", rRectangle
.Bottom());
469 void writeLineInfo(tools::XmlWriter
& rWriter
, LineInfo
const& rLineInfo
)
471 rWriter
.attribute("style", convertLineStyleToString(rLineInfo
.GetStyle()));
472 rWriter
.attribute("width", rLineInfo
.GetWidth());
473 rWriter
.attribute("dashlen", rLineInfo
.GetDashLen());
474 rWriter
.attribute("dashcount", rLineInfo
.GetDashCount());
475 rWriter
.attribute("dotlen", rLineInfo
.GetDotLen());
476 rWriter
.attribute("dotcount", rLineInfo
.GetDotCount());
477 rWriter
.attribute("distance", rLineInfo
.GetDistance());
478 rWriter
.attribute("join", convertLineJoinToString(rLineInfo
.GetLineJoin()));
479 rWriter
.attribute("cap", convertLineCapToString(rLineInfo
.GetLineCap()));
482 void writeGradient(tools::XmlWriter
& rWriter
, Gradient
const& rGradient
)
484 rWriter
.attribute("style", convertGradientStyle(rGradient
.GetStyle()));
485 rWriter
.attribute("startcolor", convertColorToString(rGradient
.GetStartColor()));
486 rWriter
.attribute("endcolor", convertColorToString(rGradient
.GetEndColor()));
487 rWriter
.attribute("angle", rGradient
.GetAngle());
488 rWriter
.attribute("border", rGradient
.GetBorder());
489 rWriter
.attribute("offsetx", rGradient
.GetOfsX());
490 rWriter
.attribute("offsety", rGradient
.GetOfsY());
491 rWriter
.attribute("startintensity", rGradient
.GetStartIntensity());
492 rWriter
.attribute("endintensity", rGradient
.GetEndIntensity());
493 rWriter
.attribute("steps", rGradient
.GetSteps());
496 } // anonymous namespace
498 MetafileXmlDump::MetafileXmlDump()
500 maFilter
.fill(false);
503 MetafileXmlDump::~MetafileXmlDump()
506 void MetafileXmlDump::filterActionType(const MetaActionType nActionType
, bool bShouldFilter
)
508 maFilter
[nActionType
] = bShouldFilter
;
511 void MetafileXmlDump::filterAllActionTypes()
516 void MetafileXmlDump::dump(const GDIMetaFile
& rMetaFile
, SvStream
& rStream
)
518 tools::XmlWriter
aWriter(&rStream
);
519 aWriter
.startDocument();
520 aWriter
.startElement("metafile");
522 writeXml(rMetaFile
, aWriter
);
524 aWriter
.endElement();
525 aWriter
.endDocument();
528 void MetafileXmlDump::writeXml(const GDIMetaFile
& rMetaFile
, tools::XmlWriter
& rWriter
)
530 for(size_t nAction
= 0; nAction
< rMetaFile
.GetActionSize(); ++nAction
)
532 MetaAction
* pAction
= rMetaFile
.GetAction(nAction
);
533 const MetaActionType nActionType
= pAction
->GetType();
534 if (maFilter
[nActionType
])
537 OString sCurrentElementTag
= convertLineStyleToString(nActionType
);
541 case MetaActionType::NONE
:
543 rWriter
.startElement(sCurrentElementTag
);
544 rWriter
.endElement();
548 case MetaActionType::PIXEL
:
550 auto* pMetaAction
= static_cast<MetaPixelAction
*>(pAction
);
551 rWriter
.startElement(sCurrentElementTag
);
552 writePoint(rWriter
, pMetaAction
->GetPoint());
553 rWriter
.attribute("color", convertColorToString(pMetaAction
->GetColor()));
554 rWriter
.endElement();
558 case MetaActionType::POINT
:
560 auto* pMetaAction
= static_cast<MetaPointAction
*>(pAction
);
561 rWriter
.startElement(sCurrentElementTag
);
562 writePoint(rWriter
, pMetaAction
->GetPoint());
563 rWriter
.endElement();
567 case MetaActionType::LINE
:
569 MetaLineAction
* pMetaLineAction
= static_cast<MetaLineAction
*>(pAction
);
570 rWriter
.startElement(sCurrentElementTag
);
571 writeStartPoint(rWriter
, pMetaLineAction
->GetStartPoint());
572 writeEndPoint(rWriter
, pMetaLineAction
->GetEndPoint());
574 writeLineInfo(rWriter
, pMetaLineAction
->GetLineInfo());
575 rWriter
.endElement();
579 case MetaActionType::RECT
:
581 MetaRectAction
* pMetaAction
= static_cast<MetaRectAction
*>(pAction
);
582 rWriter
.startElement(sCurrentElementTag
);
583 writeRectangle(rWriter
, pMetaAction
->GetRect());
584 rWriter
.endElement();
588 case MetaActionType::ROUNDRECT
:
590 auto pMetaAction
= static_cast<MetaRoundRectAction
*>(pAction
);
591 rWriter
.startElement(sCurrentElementTag
);
592 writeRectangle(rWriter
, pMetaAction
->GetRect());
593 rWriter
.attribute("horizontalround", pMetaAction
->GetHorzRound());
594 rWriter
.attribute("verticalround", pMetaAction
->GetVertRound());
595 rWriter
.endElement();
599 case MetaActionType::ELLIPSE
:
601 auto pMetaAction
= static_cast<MetaEllipseAction
*>(pAction
);
602 rWriter
.startElement(sCurrentElementTag
);
603 writeRectangle(rWriter
, pMetaAction
->GetRect());
604 rWriter
.endElement();
608 case MetaActionType::ARC
:
610 auto pMetaAction
= static_cast<MetaArcAction
*>(pAction
);
611 rWriter
.startElement(sCurrentElementTag
);
612 writeRectangle(rWriter
, pMetaAction
->GetRect());
613 writeStartPoint(rWriter
, pMetaAction
->GetStartPoint());
614 writeEndPoint(rWriter
, pMetaAction
->GetEndPoint());
615 rWriter
.endElement();
619 case MetaActionType::PIE
:
621 auto pMetaAction
= static_cast<MetaPieAction
*>(pAction
);
622 rWriter
.startElement(sCurrentElementTag
);
623 writeRectangle(rWriter
, pMetaAction
->GetRect());
624 writeStartPoint(rWriter
, pMetaAction
->GetStartPoint());
625 writeEndPoint(rWriter
, pMetaAction
->GetEndPoint());
626 rWriter
.endElement();
630 case MetaActionType::CHORD
:
632 auto pMetaAction
= static_cast<MetaChordAction
*>(pAction
);
633 rWriter
.startElement(sCurrentElementTag
);
634 writeRectangle(rWriter
, pMetaAction
->GetRect());
635 writeStartPoint(rWriter
, pMetaAction
->GetStartPoint());
636 writeEndPoint(rWriter
, pMetaAction
->GetEndPoint());
637 rWriter
.endElement();
641 case MetaActionType::POLYLINE
:
643 MetaPolyLineAction
* pMetaPolyLineAction
= static_cast<MetaPolyLineAction
*>(pAction
);
644 rWriter
.startElement(sCurrentElementTag
);
646 writeLineInfo(rWriter
, pMetaPolyLineAction
->GetLineInfo());
648 tools::Polygon aPolygon
= pMetaPolyLineAction
->GetPolygon();
649 bool bFlags
= aPolygon
.HasFlags();
650 for (sal_uInt16 i
= 0; i
< aPolygon
.GetSize(); i
++)
652 rWriter
.startElement("point");
653 writePoint(rWriter
, aPolygon
[i
]);
655 rWriter
.attribute("flags", convertPolygonFlags(aPolygon
.GetFlags(i
)));
656 rWriter
.endElement();
659 rWriter
.endElement();
663 case MetaActionType::POLYGON
:
665 MetaPolygonAction
* pMetaPolygonAction
= static_cast<MetaPolygonAction
*>(pAction
);
666 rWriter
.startElement(sCurrentElementTag
);
668 tools::Polygon aPolygon
= pMetaPolygonAction
->GetPolygon();
669 bool bFlags
= aPolygon
.HasFlags();
670 for (sal_uInt16 i
= 0; i
< aPolygon
.GetSize(); i
++)
672 rWriter
.startElement("point");
673 writePoint(rWriter
, aPolygon
[i
]);
675 rWriter
.attribute("flags", convertPolygonFlags(aPolygon
.GetFlags(i
)));
676 rWriter
.endElement();
679 rWriter
.endElement();
683 case MetaActionType::POLYPOLYGON
:
685 MetaPolyPolygonAction
*const pMetaPolyPolygonAction
= static_cast<MetaPolyPolygonAction
*>(pAction
);
686 rWriter
.startElement(sCurrentElementTag
);
688 tools::PolyPolygon
const& rPolyPolygon(pMetaPolyPolygonAction
->GetPolyPolygon());
690 for (sal_uInt16 j
= 0; j
< rPolyPolygon
.Count(); ++j
)
692 rWriter
.startElement("polygon");
693 tools::Polygon
const& rPolygon
= rPolyPolygon
[j
];
694 bool bFlags
= rPolygon
.HasFlags();
695 for (sal_uInt16 i
= 0; i
< rPolygon
.GetSize(); ++i
)
697 rWriter
.startElement("point");
698 writePoint(rWriter
, rPolygon
[i
]);
700 rWriter
.attribute("flags", convertPolygonFlags(rPolygon
.GetFlags(i
)));
701 rWriter
.endElement();
703 rWriter
.endElement();
706 rWriter
.endElement();
710 case MetaActionType::TEXT
:
712 auto* pMeta
= static_cast<MetaTextAction
*>(pAction
);
713 rWriter
.startElement(sCurrentElementTag
);
714 writePoint(rWriter
, pMeta
->GetPoint());
715 rWriter
.attribute("index", pMeta
->GetIndex());
716 rWriter
.attribute("length", pMeta
->GetLen());
717 rWriter
.startElement("textcontent");
718 rWriter
.content(pMeta
->GetText());
719 rWriter
.endElement();
721 rWriter
.endElement();
725 case MetaActionType::TEXTARRAY
:
727 MetaTextArrayAction
* pMetaTextArrayAction
= static_cast<MetaTextArrayAction
*>(pAction
);
728 rWriter
.startElement(sCurrentElementTag
);
730 sal_Int32 aIndex
= pMetaTextArrayAction
->GetIndex();
731 sal_Int32 aLength
= pMetaTextArrayAction
->GetLen();
733 writePoint(rWriter
, pMetaTextArrayAction
->GetPoint());
734 rWriter
.attribute("index", aIndex
);
735 rWriter
.attribute("length", aLength
);
737 if (pMetaTextArrayAction
->GetDXArray())
739 rWriter
.startElement("dxarray");
740 OUStringBuffer sDxLengthString
;
741 for (sal_Int32 i
= 0; i
< aLength
- aIndex
; ++i
)
743 sDxLengthString
.append(OUString::number(pMetaTextArrayAction
->GetDXArray()[aIndex
+ i
]));
744 sDxLengthString
.append(" ");
746 rWriter
.content(sDxLengthString
.makeStringAndClear());
747 rWriter
.endElement();
750 rWriter
.startElement("text");
751 rWriter
.content(pMetaTextArrayAction
->GetText());
752 rWriter
.endElement();
754 rWriter
.endElement();
758 case MetaActionType::STRETCHTEXT
:
760 auto* pMeta
= static_cast<MetaStretchTextAction
*>(pAction
);
761 rWriter
.startElement(sCurrentElementTag
);
763 writePoint(rWriter
, pMeta
->GetPoint());
764 rWriter
.attribute("index", pMeta
->GetIndex());
765 rWriter
.attribute("length", pMeta
->GetLen());
766 rWriter
.attribute("width", pMeta
->GetWidth());
768 rWriter
.startElement("textcontent");
769 rWriter
.content(pMeta
->GetText());
770 rWriter
.endElement();
772 rWriter
.endElement();
776 case MetaActionType::TEXTRECT
:
778 auto* pMeta
= static_cast<MetaTextRectAction
*>(pAction
);
779 rWriter
.startElement(sCurrentElementTag
);
780 writeRectangle(rWriter
, pMeta
->GetRect());
781 rWriter
.startElement("textcontent");
782 rWriter
.content(pMeta
->GetText());
783 rWriter
.endElement();
785 rWriter
.startElement("style");
786 rWriter
.content(convertDrawTextFlagsToString(pMeta
->GetStyle()));
787 rWriter
.endElement();
789 rWriter
.endElement();
793 case MetaActionType::BMP
:
795 auto pMeta
= static_cast<MetaBmpAction
*>(pAction
);
796 rWriter
.startElement(sCurrentElementTag
);
797 writePoint(rWriter
, pMeta
->GetPoint());
798 rWriter
.attribute("crc", hex32(pMeta
->GetBitmap().GetChecksum()));
799 rWriter
.endElement();
803 case MetaActionType::BMPSCALE
:
805 auto pMeta
= static_cast<MetaBmpScaleAction
*>(pAction
);
806 rWriter
.startElement(sCurrentElementTag
);
807 writePoint(rWriter
, pMeta
->GetPoint());
808 writeSize(rWriter
, pMeta
->GetSize());
809 rWriter
.attribute("crc", hex32(pMeta
->GetBitmap().GetChecksum()));
810 rWriter
.endElement();
814 case MetaActionType::BMPSCALEPART
:
816 auto pMeta
= static_cast<MetaBmpScalePartAction
*>(pAction
);
817 rWriter
.startElement(sCurrentElementTag
);
818 rWriter
.attribute("destx", pMeta
->GetDestPoint().X());
819 rWriter
.attribute("desty", pMeta
->GetDestPoint().Y());
820 rWriter
.attribute("destwidth", pMeta
->GetDestSize().Width());
821 rWriter
.attribute("destheight", pMeta
->GetDestSize().Height());
822 rWriter
.attribute("srcx", pMeta
->GetSrcPoint().X());
823 rWriter
.attribute("srcy", pMeta
->GetSrcPoint().Y());
824 rWriter
.attribute("srcwidth", pMeta
->GetSrcSize().Width());
825 rWriter
.attribute("srcheight", pMeta
->GetSrcSize().Height());
826 rWriter
.attribute("crc", hex32(pMeta
->GetBitmap().GetChecksum()));
827 rWriter
.endElement();
831 case MetaActionType::BMPEX
:
833 auto pMeta
= static_cast<MetaBmpExAction
*>(pAction
);
834 rWriter
.startElement(sCurrentElementTag
);
835 writePoint(rWriter
, pMeta
->GetPoint());
836 rWriter
.attribute("crc", hex32(pMeta
->GetBitmapEx().GetBitmap().GetChecksum()));
837 rWriter
.attribute("transparenttype", convertBitmapExTransparentType(pMeta
->GetBitmapEx().GetTransparentType()));
838 rWriter
.endElement();
842 case MetaActionType::BMPEXSCALE
:
844 auto pMeta
= static_cast<MetaBmpExScaleAction
*>(pAction
);
845 rWriter
.startElement(sCurrentElementTag
);
846 writePoint(rWriter
, pMeta
->GetPoint());
847 writeSize(rWriter
, pMeta
->GetSize());
848 rWriter
.attribute("crc", hex32(pMeta
->GetBitmapEx().GetBitmap().GetChecksum()));
849 rWriter
.attribute("transparenttype", convertBitmapExTransparentType(pMeta
->GetBitmapEx().GetTransparentType()));
850 rWriter
.endElement();
854 case MetaActionType::BMPEXSCALEPART
:
856 auto pMeta
= static_cast<MetaBmpExScalePartAction
*>(pAction
);
857 rWriter
.startElement(sCurrentElementTag
);
858 rWriter
.attribute("destx", pMeta
->GetDestPoint().X());
859 rWriter
.attribute("desty", pMeta
->GetDestPoint().Y());
860 rWriter
.attribute("destwidth", pMeta
->GetDestSize().Width());
861 rWriter
.attribute("destheight", pMeta
->GetDestSize().Height());
862 rWriter
.attribute("srcx", pMeta
->GetSrcPoint().X());
863 rWriter
.attribute("srcy", pMeta
->GetSrcPoint().Y());
864 rWriter
.attribute("srcwidth", pMeta
->GetSrcSize().Width());
865 rWriter
.attribute("srcheight", pMeta
->GetSrcSize().Height());
866 rWriter
.attribute("crc", hex32(pMeta
->GetBitmapEx().GetBitmap().GetChecksum()));
867 rWriter
.attribute("transparenttype", convertBitmapExTransparentType(pMeta
->GetBitmapEx().GetTransparentType()));
868 rWriter
.endElement();
872 case MetaActionType::MASK
:
874 auto pMeta
= static_cast<MetaMaskAction
*>(pAction
);
875 rWriter
.startElement(sCurrentElementTag
);
876 writePoint(rWriter
, pMeta
->GetPoint());
877 rWriter
.attribute("crc", hex32(pMeta
->GetBitmap().GetChecksum()));
878 rWriter
.attribute("color", convertColorToString(pMeta
->GetColor()));
879 rWriter
.endElement();
883 case MetaActionType::MASKSCALE
:
885 auto pMeta
= static_cast<MetaMaskScaleAction
*>(pAction
);
886 rWriter
.startElement(sCurrentElementTag
);
887 writePoint(rWriter
, pMeta
->GetPoint());
888 writeSize(rWriter
, pMeta
->GetSize());
889 rWriter
.attribute("crc", hex32(pMeta
->GetBitmap().GetChecksum()));
890 rWriter
.attribute("color", convertColorToString(pMeta
->GetColor()));
891 rWriter
.endElement();
895 case MetaActionType::MASKSCALEPART
:
897 auto pMeta
= static_cast<MetaMaskScalePartAction
*>(pAction
);
898 rWriter
.startElement(sCurrentElementTag
);
899 rWriter
.attribute("destx", pMeta
->GetDestPoint().X());
900 rWriter
.attribute("desty", pMeta
->GetDestPoint().Y());
901 rWriter
.attribute("destwidth", pMeta
->GetDestSize().Width());
902 rWriter
.attribute("destheight", pMeta
->GetDestSize().Height());
903 rWriter
.attribute("srcx", pMeta
->GetSrcPoint().X());
904 rWriter
.attribute("srcy", pMeta
->GetSrcPoint().Y());
905 rWriter
.attribute("srcwidth", pMeta
->GetSrcSize().Width());
906 rWriter
.attribute("srcheight", pMeta
->GetSrcSize().Height());
907 rWriter
.attribute("crc", hex32(pMeta
->GetBitmap().GetChecksum()));
908 rWriter
.attribute("color", convertColorToString(pMeta
->GetColor()));
909 rWriter
.endElement();
913 case MetaActionType::GRADIENT
:
915 const MetaGradientAction
* pMeta
= static_cast<MetaGradientAction
*>(pAction
);
917 rWriter
.startElement(sCurrentElementTag
);
918 writeGradient(rWriter
, pMeta
->GetGradient());
920 rWriter
.startElement("rectangle");
921 writeRectangle(rWriter
, pMeta
->GetRect());
922 rWriter
.endElement();
924 rWriter
.endElement();
928 case MetaActionType::HATCH
:
930 auto* const pMetaHatchAction
= static_cast<MetaHatchAction
*>(pAction
);
931 rWriter
.startElement(sCurrentElementTag
);
933 tools::PolyPolygon
const& rPolyPolygon(pMetaHatchAction
->GetPolyPolygon());
935 for (sal_uInt16 j
= 0; j
< rPolyPolygon
.Count(); ++j
)
937 rWriter
.startElement("polygon");
938 tools::Polygon
const& rPolygon
= rPolyPolygon
[j
];
939 bool bFlags
= rPolygon
.HasFlags();
940 for (sal_uInt16 i
= 0; i
< rPolygon
.GetSize(); ++i
)
942 rWriter
.startElement("point");
943 writePoint(rWriter
, rPolygon
[i
]);
945 rWriter
.attribute("flags", convertPolygonFlags(rPolygon
.GetFlags(i
)));
946 rWriter
.endElement();
948 rWriter
.endElement();
951 rWriter
.startElement("hatch");
952 const auto& rHatch
= pMetaHatchAction
->GetHatch();
953 rWriter
.attribute("style", convertHatchStyle(rHatch
.GetStyle()));
954 rWriter
.attribute("color", convertColorToString(rHatch
.GetColor()));
955 rWriter
.attribute("distance", sal_Int32(rHatch
.GetDistance()));
956 rWriter
.attribute("angle", sal_Int32(rHatch
.GetAngle()));
957 rWriter
.endElement();
959 rWriter
.endElement();
963 case MetaActionType::WALLPAPER
:
965 const auto* pMetaAction
= static_cast<const MetaWallpaperAction
*>(pAction
);
966 rWriter
.startElement(sCurrentElementTag
);
968 writeRectangle(rWriter
, pMetaAction
->GetRect());
970 rWriter
.startElement("wallpaper");
971 const auto& rWallpaper
= pMetaAction
->GetWallpaper();
973 rWriter
.attribute("color", convertColorToString(rWallpaper
.GetColor()));
975 WallpaperStyle eStyle
= rWallpaper
.GetStyle();
976 rWriter
.attribute("style", convertWallpaperStyleToString(eStyle
));
978 if (rWallpaper
.IsBitmap())
980 rWriter
.startElement("bitmap");
981 BitmapEx
const & rBitmapEx
= rWallpaper
.GetBitmap();
982 rWriter
.attribute("crc", hex32(rBitmapEx
.GetChecksum()));
983 rWriter
.attribute("transparenttype", convertBitmapExTransparentType(rBitmapEx
.GetTransparentType()));
984 rWriter
.attribute("bitcount", hex32(rBitmapEx
.GetBitmap().GetBitCount()));
985 rWriter
.attribute("width", hex32(rBitmapEx
.GetSizePixel().Width()));
986 rWriter
.attribute("height", hex32(rBitmapEx
.GetSizePixel().Height()));
987 rWriter
.endElement();
990 if (rWallpaper
.IsGradient())
992 rWriter
.startElement("gradient");
993 Gradient aGradient
= rWallpaper
.GetGradient();
994 writeGradient(rWriter
, aGradient
);
995 rWriter
.endElement();
998 if (rWallpaper
.IsRect())
1000 tools::Rectangle aRect
= rWallpaper
.GetRect();
1001 rWriter
.startElement("rectangle");
1002 writeRectangle(rWriter
, aRect
);
1003 rWriter
.endElement();
1006 rWriter
.attribute("fixed", rWallpaper
.IsFixed() ? "true" : "false");
1007 rWriter
.attribute("scrollable", rWallpaper
.IsScrollable() ? "true" : "false");
1009 rWriter
.endElement();
1011 rWriter
.endElement();
1015 case MetaActionType::CLIPREGION
:
1017 const auto* pMetaClipRegionAction
= static_cast<const MetaClipRegionAction
*>(pAction
);
1018 rWriter
.startElement(sCurrentElementTag
);
1020 // FIXME for now we dump only the bounding box; this is
1021 // enough for the tests we have, but may need extending to
1022 // dumping the real polypolygon in the future
1023 tools::Rectangle aRectangle
= pMetaClipRegionAction
->GetRegion().GetBoundRect();
1024 writeRectangle(rWriter
, aRectangle
);
1025 rWriter
.endElement();
1029 case MetaActionType::ISECTRECTCLIPREGION
:
1031 MetaISectRectClipRegionAction
* pMetaISectRectClipRegionAction
= static_cast<MetaISectRectClipRegionAction
*>(pAction
);
1032 rWriter
.startElement(sCurrentElementTag
);
1034 tools::Rectangle aRectangle
= pMetaISectRectClipRegionAction
->GetRect();
1035 writeRectangle(rWriter
, aRectangle
);
1036 rWriter
.endElement();
1040 case MetaActionType::ISECTREGIONCLIPREGION
:
1042 MetaISectRegionClipRegionAction
* pMetaISectRegionClipRegionAction
= static_cast<MetaISectRegionClipRegionAction
*>(pAction
);
1043 rWriter
.startElement(sCurrentElementTag
);
1045 // FIXME for now we dump only the bounding box; this is
1046 // enough for the tests we have, but may need extending to
1047 // dumping the real polypolygon in the future
1048 tools::Rectangle aRectangle
= pMetaISectRegionClipRegionAction
->GetRegion().GetBoundRect();
1049 writeRectangle(rWriter
, aRectangle
);
1050 rWriter
.endElement();
1054 // case MetaActionType::MOVECLIPREGION:
1056 case MetaActionType::LINECOLOR
:
1058 MetaLineColorAction
* pMetaLineColorAction
= static_cast<MetaLineColorAction
*>(pAction
);
1059 rWriter
.startElement(sCurrentElementTag
);
1061 rWriter
.attribute("color", convertColorToString(pMetaLineColorAction
->GetColor()));
1062 rWriter
.endElement();
1066 case MetaActionType::FILLCOLOR
:
1068 MetaFillColorAction
* pMetaFillColorAction
= static_cast<MetaFillColorAction
*>(pAction
);
1069 rWriter
.startElement(sCurrentElementTag
);
1071 rWriter
.attribute("color", convertColorToString(pMetaFillColorAction
->GetColor()));
1072 rWriter
.endElement();
1076 case MetaActionType::TEXTCOLOR
:
1078 MetaTextColorAction
* pMetaTextColorAction
= static_cast<MetaTextColorAction
*>(pAction
);
1079 rWriter
.startElement(sCurrentElementTag
);
1081 rWriter
.attribute("color", convertColorToString(pMetaTextColorAction
->GetColor()));
1082 rWriter
.endElement();
1086 case MetaActionType::TEXTFILLCOLOR
:
1088 MetaTextFillColorAction
* pMetaTextFillColorAction
= static_cast<MetaTextFillColorAction
*>(pAction
);
1089 rWriter
.startElement(sCurrentElementTag
);
1091 rWriter
.attribute("color", convertColorToString(pMetaTextFillColorAction
->GetColor()));
1093 if (pMetaTextFillColorAction
->IsSetting())
1094 rWriter
.attribute("setting", OUString("true"));
1096 rWriter
.endElement();
1100 case MetaActionType::TEXTALIGN
:
1102 MetaTextAlignAction
* pMetaTextAlignAction
= static_cast<MetaTextAlignAction
*>(pAction
);
1103 rWriter
.startElement(sCurrentElementTag
);
1104 OUString sAlign
= convertTextAlignToString(pMetaTextAlignAction
->GetTextAlign());
1105 if (!sAlign
.isEmpty())
1106 rWriter
.attribute("align", sAlign
);
1107 rWriter
.endElement();
1111 case MetaActionType::MAPMODE
:
1113 const MetaMapModeAction
* pMeta
= static_cast<MetaMapModeAction
*>(pAction
);
1114 MapMode aMapMode
= pMeta
->GetMapMode();
1115 rWriter
.startElement(sCurrentElementTag
);
1116 rWriter
.attribute("mapunit", convertMapUnitToString( aMapMode
.GetMapUnit() ));
1117 writePoint(rWriter
, aMapMode
.GetOrigin());
1118 rWriter
.attribute("scalex", convertFractionToString(aMapMode
.GetScaleX()));
1119 rWriter
.attribute("scaley", convertFractionToString(aMapMode
.GetScaleY()));
1120 rWriter
.endElement();
1124 case MetaActionType::FONT
:
1126 MetaFontAction
* pMetaFontAction
= static_cast<MetaFontAction
*>(pAction
);
1127 rWriter
.startElement(sCurrentElementTag
);
1129 vcl::Font aFont
= pMetaFontAction
->GetFont();
1131 rWriter
.attribute("color", convertColorToString(aFont
.GetColor()));
1132 rWriter
.attribute("fillcolor", convertColorToString(aFont
.GetFillColor()));
1133 rWriter
.attribute("name", aFont
.GetFamilyName());
1134 rWriter
.attribute("stylename", aFont
.GetStyleName());
1135 rWriter
.attribute("width", aFont
.GetFontSize().Width());
1136 rWriter
.attribute("height", aFont
.GetFontSize().Height());
1137 rWriter
.attribute("orientation", aFont
.GetOrientation());
1138 rWriter
.attribute("weight", convertFontWeigthToString(aFont
.GetWeight()));
1140 rWriter
.endElement();
1144 case MetaActionType::PUSH
:
1146 MetaPushAction
* pMetaPushAction
= static_cast<MetaPushAction
*>(pAction
);
1147 rWriter
.startElement(sCurrentElementTag
);
1149 rWriter
.attribute("flags", collectPushFlags(pMetaPushAction
->GetFlags()));
1153 case MetaActionType::POP
:
1155 rWriter
.endElement();
1159 case MetaActionType::RASTEROP
:
1161 MetaRasterOpAction
* pMetaRasterOpAction
= static_cast<MetaRasterOpAction
*>(pAction
);
1162 rWriter
.startElement(sCurrentElementTag
);
1164 if (pMetaRasterOpAction
->GetRasterOp() != RasterOp::OverPaint
)
1166 rWriter
.attribute("operation", convertRopToString(pMetaRasterOpAction
->GetRasterOp()));
1168 rWriter
.endElement();
1172 case MetaActionType::Transparent
:
1174 const MetaTransparentAction
* pMeta
= static_cast<MetaTransparentAction
*>(pAction
);
1176 rWriter
.startElement(sCurrentElementTag
);
1177 rWriter
.attribute("transparence", pMeta
->GetTransparence());
1179 tools::PolyPolygon
const& rPolyPolygon(pMeta
->GetPolyPolygon());
1181 for (sal_uInt16 j
= 0; j
< rPolyPolygon
.Count(); ++j
)
1183 rWriter
.startElement("polygon");
1184 tools::Polygon
const& rPolygon
= rPolyPolygon
[j
];
1185 bool bFlags
= rPolygon
.HasFlags();
1186 for (sal_uInt16 i
= 0; i
< rPolygon
.GetSize(); ++i
)
1188 rWriter
.startElement("point");
1189 writePoint(rWriter
, rPolygon
[i
]);
1191 rWriter
.attribute("flags", convertPolygonFlags(rPolygon
.GetFlags(i
)));
1192 rWriter
.endElement();
1194 rWriter
.endElement();
1197 rWriter
.endElement();
1201 //case MetaActionType::EPS:
1202 //case MetaActionType::REFPOINT:
1204 case MetaActionType::TEXTLINECOLOR
:
1206 MetaTextLineColorAction
* pMetaTextLineColorAction
= static_cast<MetaTextLineColorAction
*>(pAction
);
1207 rWriter
.startElement(sCurrentElementTag
);
1209 rWriter
.attribute("color", convertColorToString(pMetaTextLineColorAction
->GetColor()));
1210 rWriter
.endElement();
1214 case MetaActionType::TEXTLINE
:
1216 auto* pMeta
= static_cast<MetaTextLineAction
*>(pAction
);
1217 rWriter
.startElement(sCurrentElementTag
);
1218 writePoint(rWriter
, pMeta
->GetStartPoint());
1219 rWriter
.attribute("width", pMeta
->GetWidth());
1220 rWriter
.attribute("strikeout", convertFontStrikeoutToString(pMeta
->GetStrikeout()));
1221 rWriter
.attribute("underline", convertFontLineStyleToString(pMeta
->GetUnderline()));
1222 rWriter
.attribute("overline", convertFontLineStyleToString(pMeta
->GetOverline()));
1223 rWriter
.endElement();
1227 //case MetaActionType::FLOATTRANSPARENT:
1228 //case MetaActionType::GRADIENTEX:
1229 //case MetaActionType::LAYOUTMODE:
1230 //case MetaActionType::TEXTLANGUAGE:
1232 case MetaActionType::OVERLINECOLOR
:
1234 const auto* pMetaAction
= static_cast<MetaOverlineColorAction
*>(pAction
);
1235 rWriter
.startElement(sCurrentElementTag
);
1236 rWriter
.attribute("color", convertColorToString(pMetaAction
->GetColor()));
1237 rWriter
.endElement();
1241 case MetaActionType::COMMENT
:
1243 MetaCommentAction
* pMetaCommentAction
= static_cast<MetaCommentAction
*>(pAction
);
1244 rWriter
.startElement(sCurrentElementTag
);
1246 if (pMetaCommentAction
->GetDataSize() > 0)
1248 rWriter
.attribute("datasize", pMetaCommentAction
->GetDataSize());
1250 if (!pMetaCommentAction
->GetComment().isEmpty())
1252 rWriter
.startElement("comment");
1253 rWriter
.content(pMetaCommentAction
->GetComment());
1254 rWriter
.endElement();
1257 rWriter
.endElement();
1263 rWriter
.startElement(sCurrentElementTag
);
1264 rWriter
.attribute("note", OString("not implemented in xml dump"));
1265 rWriter
.endElement();
1272 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */