LibreOffice Module oox (master) 1
ThemeExport.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
11
12#include <oox/token/namespaces.hxx>
13#include <oox/token/properties.hxx>
14#include <oox/token/tokens.hxx>
15#include <oox/export/utils.hxx>
18#include <sax/fshelper.hxx>
19#include <sax/fastattribs.hxx>
20#include <unordered_map>
22#include <frozen/bits/defines.h>
23#include <frozen/bits/elsa_std.h>
24#include <frozen/unordered_map.h>
25
26namespace oox
27{
28namespace
29{
30void writeRelativeRectangle(sax_fastparser::FSHelperPtr pFS, sal_Int32 nToken,
31 model::RelativeRectangle const& rRelativeRectangle)
32{
33 pFS->singleElementNS(XML_a, nToken, XML_l, OString::number(rRelativeRectangle.mnLeft), XML_t,
34 OString::number(rRelativeRectangle.mnTop), XML_r,
35 OString::number(rRelativeRectangle.mnRight), XML_b,
36 OString::number(rRelativeRectangle.mnBottom));
37}
38} // end anonymous namespace
39
41 oox::drawingml::DocumentType eDocumentType)
42 : mpFilterBase(pFilterBase)
43 , meDocumentType(eDocumentType)
44{
45}
46
47void ThemeExport::write(OUString const& rPath, model::Theme const& rTheme)
48{
50 rPath, "application/vnd.openxmlformats-officedocument.theme+xml");
51
52 OUString aThemeName = rTheme.GetName();
53
54 mpFS->startElementNS(XML_a, XML_theme, FSNS(XML_xmlns, XML_a),
55 mpFilterBase->getNamespaceURL(OOX_NS(dml)), FSNS(XML_xmlns, XML_r),
56 mpFilterBase->getNamespaceURL(OOX_NS(officeRel)), XML_name, aThemeName);
57
58 mpFS->startElementNS(XML_a, XML_themeElements);
59
60 const auto pColorSet = rTheme.getColorSet();
61
62 mpFS->startElementNS(XML_a, XML_clrScheme, XML_name, pColorSet->getName());
63 writeColorSet(rTheme);
64 mpFS->endElementNS(XML_a, XML_clrScheme);
65
66 model::FontScheme const& rFontScheme = rTheme.getFontScheme();
67 mpFS->startElementNS(XML_a, XML_fontScheme, XML_name, rFontScheme.getName());
68 writeFontScheme(rFontScheme);
69 mpFS->endElementNS(XML_a, XML_fontScheme);
70
71 model::FormatScheme const& rFormatScheme = rTheme.getFormatScheme();
72 mpFS->startElementNS(XML_a, XML_fmtScheme);
73 writeFormatScheme(rFormatScheme);
74 mpFS->endElementNS(XML_a, XML_fmtScheme);
75
76 mpFS->endElementNS(XML_a, XML_themeElements);
77 mpFS->endElementNS(XML_a, XML_theme);
78
79 mpFS->endDocument();
80}
81
82namespace
83{
84void fillAttrList(rtl::Reference<sax_fastparser::FastAttributeList> const& pAttrList,
85 model::ThemeFont const& rThemeFont)
86{
87 if (rThemeFont.maTypeface.isEmpty())
88 {
89 pAttrList->add(XML_typeface, ""); // 'typeface' attribute is mandatory
90 return;
91 }
92
93 pAttrList->add(XML_typeface, rThemeFont.maTypeface);
94
95 if (!rThemeFont.maPanose.isEmpty())
96 pAttrList->add(XML_panose, rThemeFont.maPanose);
97
98 pAttrList->add(XML_pitchFamily, OString::number(rThemeFont.getPitchFamily()));
99 pAttrList->add(XML_charset, OString::number(rThemeFont.maCharset));
100}
101
102} // end anonymous ns
103
105{
106 mpFS->startElementNS(XML_a, XML_majorFont);
107
108 {
110 fillAttrList(aAttrList, rFontScheme.getMajorLatin());
111 mpFS->singleElementNS(XML_a, XML_latin, aAttrList);
112 }
113 {
115 fillAttrList(aAttrList, rFontScheme.getMajorAsian());
116 mpFS->singleElementNS(XML_a, XML_ea, aAttrList);
117 }
118 {
120 fillAttrList(aAttrList, rFontScheme.getMajorComplex());
121 mpFS->singleElementNS(XML_a, XML_cs, aAttrList);
122 }
123
124 mpFS->endElementNS(XML_a, XML_majorFont);
125
126 mpFS->startElementNS(XML_a, XML_minorFont);
127
128 {
130 fillAttrList(aAttrList, rFontScheme.getMinorLatin());
131 mpFS->singleElementNS(XML_a, XML_latin, aAttrList);
132 }
133 {
135 fillAttrList(aAttrList, rFontScheme.getMinorAsian());
136 mpFS->singleElementNS(XML_a, XML_ea, aAttrList);
137 }
138 {
140 fillAttrList(aAttrList, rFontScheme.getMinorComplex());
141 mpFS->singleElementNS(XML_a, XML_cs, aAttrList);
142 }
143
144 mpFS->endElementNS(XML_a, XML_minorFont);
145
146 return true;
147}
148
149namespace
150{
151constexpr frozen::unordered_map<model::TransformationType, sal_Int32, 4> constTransformTypeTokenMap{
154 { model::TransformationType::LumMod, XML_lumMod },
155 { model::TransformationType::LumOff, XML_lumOff },
156};
157
158constexpr frozen::unordered_map<model::ThemeColorType, const char*, 12> constThemeColorTypeTokenMap{
163 { model::ThemeColorType::Accent1, "accent1" },
164 { model::ThemeColorType::Accent2, "accent2" },
165 { model::ThemeColorType::Accent3, "accent3" },
166 { model::ThemeColorType::Accent4, "accent4" },
167 { model::ThemeColorType::Accent5, "accent5" },
168 { model::ThemeColorType::Accent6, "accent6" },
171};
172
173constexpr frozen::unordered_map<model::SystemColorType, const char*, 30>
174 constSystemColorTypeTokenMap{
175 { model::SystemColorType::DarkShadow3D, "3dDkShadow" },
176 { model::SystemColorType::Light3D, "3dLight" },
177 { model::SystemColorType::ActiveBorder, "activeBorder" },
178 { model::SystemColorType::ActiveCaption, "activeCaption" },
179 { model::SystemColorType::AppWorkspace, "appWorkspace" },
180 { model::SystemColorType::Background, "background" },
182 { model::SystemColorType::ButtonHighlight, "btnHighlight" },
185 { model::SystemColorType::CaptionText, "captionText" },
186 { model::SystemColorType::GradientActiveCaption, "gradientActiveCaption" },
187 { model::SystemColorType::GradientInactiveCaption, "gradientInactiveCaption" },
188 { model::SystemColorType::GrayText, "grayText" },
189 { model::SystemColorType::Highlight, "highlight" },
190 { model::SystemColorType::HighlightText, "highlightText" },
191 { model::SystemColorType::HotLight, "hotLight" },
192 { model::SystemColorType::InactiveBorder, "inactiveBorder" },
193 { model::SystemColorType::InactiveCaption, "inactiveCaption" },
194 { model::SystemColorType::InactiveCaptionText, "inactiveCaptionText" },
196 { model::SystemColorType::InfoText, "infoText" },
198 { model::SystemColorType::MenuBar, "menuBar" },
199 { model::SystemColorType::MenuHighlight, "menuHighlight" },
200 { model::SystemColorType::MenuText, "menuText" },
201 { model::SystemColorType::ScrollBar, "scrollBar" },
202 { model::SystemColorType::Window, "window" },
203 { model::SystemColorType::WindowFrame, "windowFrame" },
204 { model::SystemColorType::WindowText, "windowText" }
205 };
206
207constexpr frozen::unordered_map<sal_Int32, model::ThemeColorType, 12> constTokenMap{
208 { XML_dk1, model::ThemeColorType::Dark1 },
210 { XML_dk2, model::ThemeColorType::Dark2 },
212 { XML_accent1, model::ThemeColorType::Accent1 },
213 { XML_accent2, model::ThemeColorType::Accent2 },
214 { XML_accent3, model::ThemeColorType::Accent3 },
215 { XML_accent4, model::ThemeColorType::Accent4 },
216 { XML_accent5, model::ThemeColorType::Accent5 },
217 { XML_accent6, model::ThemeColorType::Accent6 },
220};
221
222} // end anonymous ns
223
225 std::vector<model::Transformation> const& rTransformations)
226{
227 for (model::Transformation const& rTransformation : rTransformations)
228 {
229 auto iterator = constTransformTypeTokenMap.find(rTransformation.meType);
230 if (iterator != constTransformTypeTokenMap.end())
231 {
232 sal_Int32 nToken = iterator->second;
233 mpFS->singleElementNS(XML_a, nToken, XML_val,
234 OString::number(rTransformation.mnValue * 10));
235 }
236 }
237}
238
240{
241 auto aColor = rComplexColor.getRGBColor();
242 mpFS->startElementNS(XML_a, XML_srgbClr, XML_val, I32SHEX(sal_Int32(aColor)));
243 mpFS->endElementNS(XML_a, XML_srgbClr);
244}
245
247{
248 mpFS->startElementNS(XML_a, XML_scrgbClr, XML_r, OString::number(rComplexColor.mnComponent1),
249 XML_g, OString::number(rComplexColor.mnComponent2), XML_b,
250 OString::number(rComplexColor.mnComponent3));
252 mpFS->endElementNS(XML_a, XML_scrgbClr);
253}
254
256{
257 mpFS->startElementNS(XML_a, XML_hslClr, XML_hue, OString::number(rComplexColor.mnComponent1),
258 XML_sat, OString::number(rComplexColor.mnComponent2), XML_lum,
259 OString::number(rComplexColor.mnComponent3));
261 mpFS->endElementNS(XML_a, XML_hslClr);
262}
263
265{
266 auto iterator = constThemeColorTypeTokenMap.find(rComplexColor.meSchemeType);
267 if (iterator != constThemeColorTypeTokenMap.end())
268 {
269 const char* sValue = iterator->second;
270 mpFS->startElementNS(XML_a, XML_schemeClr, XML_val, sValue);
272 mpFS->endElementNS(XML_a, XML_schemeClr);
273 }
274}
275
277{
278 auto iterator = constSystemColorTypeTokenMap.find(rComplexColor.meSystemColorType);
279 if (iterator != constSystemColorTypeTokenMap.end())
280 {
281 const char* sValue = iterator->second;
282 mpFS->startElementNS(XML_a, XML_sysClr, XML_val, sValue);
283 //XML_lastClr
285 mpFS->endElementNS(XML_a, XML_schemeClr);
286 }
287}
288
290{
291 mpFS->startElementNS(XML_a, XML_schemeClr, XML_val, "phClr");
293 mpFS->endElementNS(XML_a, XML_schemeClr);
294}
295
297{
298 switch (rComplexColor.meType)
299 {
301 break;
303 writeColorRGB(rComplexColor);
304 break;
306 writeColorCRGB(rComplexColor);
307 break;
309 writeColorHSL(rComplexColor);
310 break;
312 writeColorScheme(rComplexColor);
313 break;
315 break;
317 writeColorSystem(rComplexColor);
318 break;
320 writeColorPlaceholder(rComplexColor);
321 break;
322 }
323}
324
326{
327 mpFS->startElementNS(XML_a, XML_solidFill);
328 writeComplexColor(rSolidFill.maColor);
329 mpFS->endElementNS(XML_a, XML_solidFill);
330}
331
333{
334 mpFS->startElementNS(XML_a, XML_gradFill);
335 mpFS->startElementNS(XML_a, XML_gsLst);
336 for (auto const& rStop : rGradientFill.maGradientStops)
337 {
338 mpFS->startElementNS(XML_a, XML_gs, XML_pos,
339 OString::number(sal_Int32(rStop.mfPosition * 100000.0)));
340 writeComplexColor(rStop.maColor);
341 mpFS->endElementNS(XML_a, XML_gs);
342 }
343 mpFS->endElementNS(XML_a, XML_gsLst);
344
345 if (rGradientFill.meGradientType == model::GradientType::Linear)
346 {
347 mpFS->singleElementNS(XML_a, XML_lin, XML_ang,
348 OString::number(rGradientFill.maLinearGradient.mnAngle), XML_scaled,
349 rGradientFill.maLinearGradient.mbScaled ? "1" : "0");
350 }
351 else
352 {
353 OString sPathType;
354 switch (rGradientFill.meGradientType)
355 {
357 sPathType = "circle";
358 break;
360 sPathType = "rect";
361 break;
363 sPathType = "shape";
364 break;
365 default:
366 break;
367 }
368
369 if (!sPathType.isEmpty())
370 {
371 mpFS->startElementNS(XML_a, XML_path, XML_path, sPathType);
372 writeRelativeRectangle(mpFS, XML_fillToRect, rGradientFill.maFillToRectangle);
373 mpFS->endElementNS(XML_a, XML_path);
374 }
375 }
376 writeRelativeRectangle(mpFS, XML_tileRect, rGradientFill.maTileRectangle);
377 mpFS->endElementNS(XML_a, XML_gradFill);
378}
379
381{
382 OString sPresetType;
383 switch (rPatternFill.mePatternPreset)
384 {
386 sPresetType = "pct5";
387 break;
389 sPresetType = "pct10";
390 break;
392 sPresetType = "pct20";
393 break;
395 sPresetType = "pct25";
396 break;
398 sPresetType = "pct30";
399 break;
401 sPresetType = "pct40";
402 break;
404 sPresetType = "pct50";
405 break;
407 sPresetType = "pct60";
408 break;
410 sPresetType = "pct70";
411 break;
413 sPresetType = "pct75";
414 break;
416 sPresetType = "pct80";
417 break;
419 sPresetType = "pct90";
420 break;
422 sPresetType = "horz";
423 break;
425 sPresetType = "vert";
426 break;
428 sPresetType = "ltHorz";
429 break;
431 sPresetType = "ltVert";
432 break;
434 sPresetType = "dkHorz";
435 break;
437 sPresetType = "dkVert";
438 break;
440 sPresetType = "narHorz";
441 break;
443 sPresetType = "narVert";
444 break;
446 sPresetType = "dashHorz";
447 break;
449 sPresetType = "dashVert";
450 break;
452 sPresetType = "cross";
453 break;
455 sPresetType = "dnDiag";
456 break;
458 sPresetType = "upDiag";
459 break;
461 sPresetType = "ltDnDiag";
462 break;
464 sPresetType = "ltUpDiag";
465 break;
467 sPresetType = "dkDnDiag";
468 break;
470 sPresetType = "dkUpDiag";
471 break;
473 sPresetType = "wdDnDiag";
474 break;
476 sPresetType = "wdUpDiag";
477 break;
479 sPresetType = "dashDnDiag";
480 break;
482 sPresetType = "dashUpDiag";
483 break;
485 sPresetType = "diagCross";
486 break;
488 sPresetType = "smCheck";
489 break;
491 sPresetType = "lgCheck";
492 break;
494 sPresetType = "smGrid";
495 break;
497 sPresetType = "lgGrid";
498 break;
500 sPresetType = "dotGrid";
501 break;
503 sPresetType = "smConfetti";
504 break;
506 sPresetType = "lgConfetti";
507 break;
509 sPresetType = "horzBrick";
510 break;
512 sPresetType = "diagBrick";
513 break;
515 sPresetType = "solidDmnd";
516 break;
518 sPresetType = "openDmnd";
519 break;
521 sPresetType = "dotDmnd";
522 break;
524 sPresetType = "plaid";
525 break;
527 sPresetType = "sphere";
528 break;
530 sPresetType = "weave";
531 break;
533 sPresetType = "divot";
534 break;
536 sPresetType = "shingle";
537 break;
539 sPresetType = "wave";
540 break;
542 sPresetType = "trellis";
543 break;
545 sPresetType = "zigZag";
546 break;
547 default:
548 break;
549 }
550
551 if (!sPresetType.isEmpty())
552 {
553 mpFS->startElementNS(XML_a, XML_pattFill, XML_prst, sPresetType);
554
555 mpFS->startElementNS(XML_a, XML_fgClr);
557 mpFS->endElementNS(XML_a, XML_fgClr);
558
559 mpFS->startElementNS(XML_a, XML_bgClr);
561 mpFS->endElementNS(XML_a, XML_bgClr);
562
563 mpFS->endElementNS(XML_a, XML_pattFill);
564 }
565}
566
567namespace
568{
569OString convertFlipMode(model::FlipMode eFlipMode)
570{
571 switch (eFlipMode)
572 {
574 return "x";
576 return "y";
578 return "xy";
580 return "none";
581 }
582 return "none";
583}
584
585OString convertRectangleAlignment(model::RectangleAlignment eFlipMode)
586{
587 switch (eFlipMode)
588 {
590 return "tl";
592 return "t";
594 return "tr";
596 return "l";
598 return "ctr";
600 return "r";
602 return "bl";
604 return "b";
606 return "br";
608 break;
609 }
610 return {};
611}
612} // end anonymous ns
613
615{
616 if (!rBlipFill.mxGraphic.is())
617 return;
619 Graphic aGraphic(rBlipFill.mxGraphic);
620 aExporter.writeBlip(aGraphic, rBlipFill.maBlipEffects, false);
621}
622
624{
625 mpFS->startElementNS(XML_a, XML_blipFill, XML_rotWithShape,
626 rBlipFill.mbRotateWithShape ? "1" : "0"
627 /*XML_dpi*/);
628
629 writeBlip(rBlipFill);
630
631 writeRelativeRectangle(mpFS, XML_srcRect, rBlipFill.maClipRectangle);
632
633 if (rBlipFill.meMode == model::BitmapMode::Tile)
634 {
635 OString aFlipMode = convertFlipMode(rBlipFill.meTileFlipMode);
636 OString aAlignment = convertRectangleAlignment(rBlipFill.meTileAlignment);
637
638 mpFS->startElementNS(XML_a, XML_tile, XML_tx, OString::number(rBlipFill.mnTileOffsetX),
639 XML_ty, OString::number(rBlipFill.mnTileOffsetY), XML_sx,
640 OString::number(rBlipFill.mnTileScaleX), XML_sy,
641 OString::number(rBlipFill.mnTileScaleY), XML_flip, aFlipMode, XML_algn,
642 aAlignment);
643 mpFS->endElementNS(XML_a, XML_tile);
644 }
645 else if (rBlipFill.meMode == model::BitmapMode::Stretch)
646 {
647 mpFS->startElementNS(XML_a, XML_stretch);
648 writeRelativeRectangle(mpFS, XML_fillRect, rBlipFill.maFillRectangle);
649 mpFS->endElementNS(XML_a, XML_stretch);
650 }
651
652 mpFS->endElementNS(XML_a, XML_blipFill);
653}
654
656{
657 switch (rFillStyle.mpFill->meType)
658 {
661 {
662 auto* pSolidFill = static_cast<model::SolidFill*>(rFillStyle.mpFill.get());
663 writeSolidFill(*pSolidFill);
664 }
665 break;
667 {
668 auto* pGradientFill = static_cast<model::GradientFill*>(rFillStyle.mpFill.get());
669 writeGradientFill(*pGradientFill);
670 }
671 break;
673 {
674 auto* pPatternFill = static_cast<model::PatternFill*>(rFillStyle.mpFill.get());
675 writePatternFill(*pPatternFill);
676 }
677 break;
679 {
680 auto* pBlipFill = static_cast<model::BlipFill*>(rFillStyle.mpFill.get());
681 writeBlipFill(*pBlipFill);
682 }
683 break;
684 }
685}
686
688{
689 writeFillStyle(rFillStyle);
690}
691
693{
694 OString sCap;
695 switch (rLineStyle.meCapType)
696 {
698 sCap = "flat";
699 break;
701 sCap = "rnd";
702 break;
704 sCap = "sq";
705 break;
707 break;
708 }
709
710 OString sPenAlign;
711 switch (rLineStyle.mePenAlignment)
712 {
714 sPenAlign = "ctr";
715 break;
717 sPenAlign = "in";
718 break;
720 break;
721 }
722
723 OString sCompoundLine;
724 switch (rLineStyle.meCompoundLineType)
725 {
727 sCompoundLine = "sng";
728 break;
730 sCompoundLine = "dbl";
731 break;
733 sCompoundLine = "thickThin";
734 break;
736 sCompoundLine = "thinThick";
737 break;
739 sCompoundLine = "tri";
740 break;
742 break;
743 }
744
745 mpFS->startElementNS(XML_a, XML_ln, XML_w, OString::number(rLineStyle.mnWidth), XML_cap,
746 sax_fastparser::UseIf(sCap, !sCap.isEmpty()), XML_cmpd,
747 sax_fastparser::UseIf(sCompoundLine, !sCompoundLine.isEmpty()), XML_algn,
748 sax_fastparser::UseIf(sPenAlign, !sPenAlign.isEmpty()));
749
751 {
752 OString sPresetType;
753 switch (rLineStyle.maLineDash.mePresetType)
754 {
756 sPresetType = "dot";
757 break;
759 sPresetType = "dash";
760 break;
762 sPresetType = "lgDash";
763 break;
765 sPresetType = "dashDot";
766 break;
768 sPresetType = "lgDashDot";
769 break;
771 sPresetType = "lgDashDotDot";
772 break;
774 sPresetType = "solid";
775 break;
777 sPresetType = "sysDash";
778 break;
780 sPresetType = "sysDot";
781 break;
783 sPresetType = "sysDashDot";
784 break;
786 sPresetType = "sysDashDotDot";
787 break;
789 break;
790 }
791 mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, sPresetType);
792 }
793
795 {
796 switch (rLineStyle.maLineJoin.meType)
797 {
799 mpFS->singleElementNS(XML_a, XML_round);
800 break;
802 mpFS->singleElementNS(XML_a, XML_bevel);
803 break;
805 {
806 sal_Int32 nMiterLimit = rLineStyle.maLineJoin.mnMiterLimit;
807 mpFS->singleElementNS(
808 XML_a, XML_miter, XML_lim,
809 sax_fastparser::UseIf(OString::number(nMiterLimit), nMiterLimit > 0));
810 }
811 break;
813 break;
814 }
815 }
816
817 mpFS->endElementNS(XML_a, XML_ln);
818}
819
821{
822 mpFS->startElementNS(XML_a, XML_effectStyle);
823 mpFS->singleElementNS(XML_a, XML_effectLst);
824 mpFS->endElementNS(XML_a, XML_effectStyle);
825}
826
828{
829 // Format Scheme: 3 or more per list but only 3 will be used currently
830
831 // Fill Style List
832 rFormatScheme.ensureFillStyleList();
833 mpFS->startElementNS(XML_a, XML_fillStyleLst);
834 for (auto const& rFillStyle : rFormatScheme.getFillStyleList())
835 {
836 writeFillStyle(rFillStyle);
837 }
838 mpFS->endElementNS(XML_a, XML_fillStyleLst);
839
840 // Line Style List
841 rFormatScheme.ensureLineStyleList();
842 mpFS->startElementNS(XML_a, XML_lnStyleLst);
843 for (auto const& rLineStyle : rFormatScheme.getLineStyleList())
844 {
845 writeLineStyle(rLineStyle);
846 }
847 mpFS->endElementNS(XML_a, XML_lnStyleLst);
848
849 // Effect Style List
850 rFormatScheme.ensureEffectStyleList();
851 mpFS->startElementNS(XML_a, XML_effectStyleLst);
852 {
853 for (auto const& rEffectStyle : rFormatScheme.getEffectStyleList())
854 {
855 writeEffectStyle(rEffectStyle);
856 }
857 }
858 mpFS->endElementNS(XML_a, XML_effectStyleLst);
859
860 // Background Fill Style List
861 rFormatScheme.ensureBackgroundFillStyleList();
862 mpFS->startElementNS(XML_a, XML_bgFillStyleLst);
863 for (auto const& rFillStyle : rFormatScheme.getBackgroundFillStyleList())
864 {
865 writeBackgroundFillStyle(rFillStyle);
866 }
867 mpFS->endElementNS(XML_a, XML_bgFillStyleLst);
868
869 return true;
870}
871
873{
874 static const constexpr std::array<sal_Int32, 12> constTokenArray
875 = { XML_dk1, XML_lt1, XML_dk2, XML_lt2, XML_accent1, XML_accent2,
876 XML_accent3, XML_accent4, XML_accent5, XML_accent6, XML_hlink, XML_folHlink };
877
878 const auto pColorSet = rTheme.getColorSet();
879 if (!pColorSet)
880 return false;
881
882 for (auto nToken : constTokenArray)
883 {
884 auto iterator = constTokenMap.find(nToken);
885 if (iterator != constTokenMap.end())
886 {
887 model::ThemeColorType eColorType = iterator->second;
888 Color aColor = pColorSet->getColor(eColorType);
889 mpFS->startElementNS(XML_a, nToken);
890 mpFS->singleElementNS(XML_a, XML_srgbClr, XML_val, I32SHEX(sal_Int32(aColor)));
891 mpFS->endElementNS(XML_a, nToken);
892 }
893 }
894
895 return true;
896}
897
898} // end namespace oox
899
900/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 mnTileOffsetX
css::uno::Reference< css::graphic::XGraphic > mxGraphic
sal_Int32 mnTileOffsetY
std::vector< BlipEffect > maBlipEffects
RelativeRectangle maClipRectangle
BitmapMode meMode
RectangleAlignment meTileAlignment
sal_Int32 mnTileScaleY
RelativeRectangle maFillRectangle
FlipMode meTileFlipMode
sal_Int32 mnTileScaleX
ThemeColorType meSchemeType
sal_Int32 mnComponent2
std::vector< Transformation > maTransformations
SystemColorType meSystemColorType
sal_Int32 mnComponent1
sal_Int32 mnComponent3
Color getRGBColor() const
std::shared_ptr< Fill > mpFill
ThemeFont const & getMinorAsian() const
ThemeFont const & getMajorComplex() const
ThemeFont const & getMajorLatin() const
ThemeFont const & getMajorAsian() const
ThemeFont const & getMinorLatin() const
const OUString & getName() const
ThemeFont const & getMinorComplex() const
void ensureBackgroundFillStyleList() const
void ensureFillStyleList() const
std::vector< LineStyle > const & getLineStyleList() const
std::vector< FillStyle > const & getBackgroundFillStyleList() const
std::vector< EffectStyle > const & getEffectStyleList() const
void ensureEffectStyleList() const
void ensureLineStyleList() const
std::vector< FillStyle > const & getFillStyleList() const
GradientType meGradientType
LinearGradientProperties maLinearGradient
RelativeRectangle maFillToRectangle
RelativeRectangle maTileRectangle
std::vector< GradientStop > maGradientStops
PenAlignmentType mePenAlignment
sal_Int32 mnWidth
CompoundLineType meCompoundLineType
LineDash maLineDash
LineJoin maLineJoin
ComplexColor maBackgroundColor
PatternPreset mePatternPreset
ComplexColor maForegroundColor
ComplexColor maColor
std::shared_ptr< model::ColorSet > const & getColorSet() const
FontScheme const & getFontScheme() const
const OUString & GetName() const
FormatScheme const & getFormatScheme() const
void writeBlip(model::BlipFill const &rBlipFill)
void writeEffectStyle(model::EffectStyle const &rEffectStyle)
void writeFillStyle(model::FillStyle const &rFillStyle)
oox::core::XmlFilterBase * mpFilterBase
Definition: ThemeExport.hxx:38
void writeColorCRGB(model::ComplexColor const &rComplexColor)
void writeLineStyle(model::LineStyle const &rLineStyle)
void writeSolidFill(model::SolidFill const &rSolidFill)
oox::drawingml::DocumentType meDocumentType
Definition: ThemeExport.hxx:39
void writeColorHSL(model::ComplexColor const &rComplexColor)
void writePatternFill(model::PatternFill const &rPatternFill)
void writeBlipFill(model::BlipFill const &rBlipFill)
bool writeFontScheme(model::FontScheme const &rFontScheme)
void writeGradientFill(model::GradientFill const &rGradientFill)
bool writeFormatScheme(model::FormatScheme const &rFormatScheme)
bool writeColorSet(model::Theme const &rTheme)
void writeBackgroundFillStyle(model::FillStyle const &rFillStyle)
void writeComplexColor(model::ComplexColor const &rComplexColor)
void writeColorPlaceholder(model::ComplexColor const &rComplexColor)
void write(OUString const &rPath, model::Theme const &rTheme)
Definition: ThemeExport.cxx:47
void writeColorSystem(model::ComplexColor const &rComplexColor)
sax_fastparser::FSHelperPtr mpFS
Definition: ThemeExport.hxx:40
void writeColorRGB(model::ComplexColor const &rComplexColor)
void writeColorScheme(model::ComplexColor const &rComplexColor)
void writeColorTransformations(std::vector< model::Transformation > const &rTransformations)
ThemeExport(oox::core::XmlFilterBase *pFilterBase, oox::drawingml::DocumentType eDocumentType)
Definition: ThemeExport.cxx:40
::sax_fastparser::FSHelperPtr openFragmentStreamWithSerializer(const OUString &rStreamName, const OUString &rMediaType)
Opens specified output stream from the base storage with specified media type and returns new fast se...
OUString getNamespaceURL(sal_Int32 nNSID) const
OUString writeBlip(Graphic const &rGraphic, std::vector< model::BlipEffect > const &rEffects, bool bRelPathToMedia=false)
Definition: drawingml.cxx:1286
static rtl::Reference< FastAttributeList > createAttrList()
constexpr sal_Int32 FSNS(sal_Int32 namespc, sal_Int32 element)
ThemeColorType
RectangleAlignment
const char * UseIf(const char *s, bool bUse)
std::shared_ptr< FastSerializerHelper > FSHelperPtr
DefTokenId nToken
PresetDashType mePresetType
sal_Int32 mnMiterLimit
LineJoinType meType
sal_Int32 maCharset
OUString maTypeface
sal_Int16 getPitchFamily() const
OString I32SHEX(sal_Int32 x)
Definition: utils.hxx:31