14 #include <oox/token/tokens.hxx>
20 #include <com/sun/star/beans/XPropertySet.hpp>
21 #include <com/sun/star/beans/PropertyValue.hpp>
22 #include <com/sun/star/frame/XModel.hpp>
40 void TableStyle(
const uno::Sequence<beans::PropertyValue>& rStyle);
44 m_pSerializer = std::move(pSerializer);
52 void handleBoolean(
const OUString& aValue, sal_Int32 nToken);
55 void tableStylePPr(
const uno::Sequence<beans::PropertyValue>& rPPr);
57 void tableStyleTableStylePr(
const uno::Sequence<beans::PropertyValue>& rTableStylePr);
59 void tableStyleRPr(
const uno::Sequence<beans::PropertyValue>& rRPr);
61 void tableStyleRRFonts(
const uno::Sequence<beans::PropertyValue>& rRFonts);
63 void tableStyleRLang(
const uno::Sequence<beans::PropertyValue>& rLang);
65 void tableStylePInd(
const uno::Sequence<beans::PropertyValue>& rInd);
67 void tableStylePSpacing(
const uno::Sequence<beans::PropertyValue>& rSpacing);
69 void tableStyleTablePr(
const uno::Sequence<beans::PropertyValue>& rTablePr);
71 void tableStyleTrPr(
const uno::Sequence<beans::PropertyValue>& rTrPr);
73 void tableStyleTcPr(
const uno::Sequence<beans::PropertyValue>& rTcPr);
75 void tableStyleTcBorders(
const uno::Sequence<beans::PropertyValue>& rTcBorders,
76 sal_Int32 nToken = XML_tcBorders);
78 void tableStyleTableInd(
const uno::Sequence<beans::PropertyValue>& rTableInd);
80 void tableStyleTableCellMar(
const uno::Sequence<beans::PropertyValue>& rTableCellMar,
81 sal_Int32 nType = XML_tblCellMar);
83 void tableStyleTcBorder(sal_Int32 nToken,
const uno::Sequence<beans::PropertyValue>& rTcBorder);
85 void tableStyleShd(
const uno::Sequence<beans::PropertyValue>& rShd);
87 void tableStyleRColor(
const uno::Sequence<beans::PropertyValue>& rColor);
95 for (
const auto& rAttribute : rAttributeList)
97 if (rAttribute.Name ==
"val")
98 pAttributeList->add(
FSNS(XML_w, XML_val), rAttribute.Value.get<OUString>().toUtf8());
102 = { {
"firstRow", XML_firstRow },
103 {
"lastRow", XML_lastRow },
104 {
"firstColumn", XML_firstColumn },
105 {
"lastColumn", XML_lastColumn },
106 {
"oddVBand", XML_oddVBand },
107 {
"evenVBand", XML_evenVBand },
108 {
"oddHBand", XML_oddHBand },
109 {
"evenHBand", XML_evenHBand },
110 {
"firstRowFirstColumn", XML_firstRowFirstColumn },
111 {
"firstRowLastColumn", XML_firstRowLastColumn },
112 {
"lastRowFirstColumn", XML_lastRowFirstColumn },
113 {
"lastRowLastColumn", XML_lastRowLastColumn },
117 pAttributeList->add(
FSNS(XML_w,
nToken), rAttribute.Value.get<OUString>().toUtf8());
121 m_pImpl->getSerializer()->singleElementNS(XML_w, XML_cnfStyle, pAttributeList);
127 uno::Reference<beans::XPropertySet> xPropertySet(
128 m_pImpl->getDoc().GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW);
129 uno::Sequence<beans::PropertyValue> aInteropGrabBag;
130 xPropertySet->getPropertyValue(
"InteropGrabBag") >>= aInteropGrabBag;
131 uno::Sequence<beans::PropertyValue> aTableStyles;
132 auto pProp = std::find_if(
133 aInteropGrabBag.begin(), aInteropGrabBag.end(),
134 [](
const beans::PropertyValue& rProp) {
return rProp.Name ==
"tableStyles"; });
135 if (pProp != aInteropGrabBag.end())
136 pProp->Value >>= aTableStyles;
137 if (!aTableStyles.hasElements())
140 if (nCountStylesToWrite > aTableStyles.getLength())
141 nCountStylesToWrite = aTableStyles.getLength();
143 for (sal_Int32
i = 0;
i < nCountStylesToWrite; ++
i)
145 uno::Sequence<beans::PropertyValue> aTableStyle;
146 aTableStyles[
i].Value >>= aTableStyle;
147 m_pImpl->TableStyle(aTableStyle);
152 const uno::Sequence<beans::PropertyValue>& rTableCellMar, sal_Int32 nType)
155 = { {
"left", XML_left }, {
"right", XML_right }, {
"start", XML_start },
156 {
"end", XML_end }, {
"top", XML_top }, {
"bottom", XML_bottom },
159 if (!rTableCellMar.hasElements())
162 m_pSerializer->startElementNS(XML_w, nType);
163 for (
const auto& rProp : rTableCellMar)
168 rProp.Value.get<uno::Sequence<beans::PropertyValue>>());
169 m_pSerializer->singleElementNS(XML_w,
nToken,
FSNS(XML_w, XML_w),
170 OString::number(aMap[
"w"].get<sal_Int32>()),
171 FSNS(XML_w, XML_type), aMap[
"type"].get<OUString>());
174 m_pSerializer->endElementNS(XML_w, nType);
178 sal_Int32 nToken,
const uno::Sequence<beans::PropertyValue>& rTcBorder)
182 {
"color", XML_color },
183 {
"space", XML_space },
184 {
"themeColor", XML_themeColor },
185 {
"themeTint", XML_themeTint },
188 if (!rTcBorder.hasElements())
193 for (
const auto& rProp : rTcBorder)
195 pAttributeList->add(
FSNS(XML_w, nAttrToken), rProp.Value.get<OUString>().toUtf8());
197 m_pSerializer->singleElementNS(XML_w, nToken, pAttributeList);
201 const uno::Sequence<beans::PropertyValue>& rTcBorders, sal_Int32 nToken)
204 {
"right", XML_right },
205 {
"start", XML_start },
208 {
"bottom", XML_bottom },
209 {
"insideH", XML_insideH },
210 {
"insideV", XML_insideV },
211 {
"tl2br", XML_tl2br },
212 {
"tr2bl", XML_tr2bl },
215 if (!rTcBorders.hasElements())
218 m_pSerializer->startElementNS(XML_w, nToken);
219 for (
const auto& rTcBorder : rTcBorders)
221 tableStyleTcBorder(nSubToken,
222 rTcBorder.Value.get<uno::Sequence<beans::PropertyValue>>());
223 m_pSerializer->endElementNS(XML_w, nToken);
228 if (!rShd.hasElements())
233 for (
const auto& rProp : rShd)
235 if (rProp.Name ==
"val")
236 pAttributeList->add(
FSNS(XML_w, XML_val), rProp.Value.get<OUString>().toUtf8());
237 else if (rProp.Name ==
"color")
238 pAttributeList->add(
FSNS(XML_w, XML_color), rProp.Value.get<OUString>().toUtf8());
239 else if (rProp.Name ==
"fill")
240 pAttributeList->add(
FSNS(XML_w, XML_fill), rProp.Value.get<OUString>().toUtf8());
241 else if (rProp.Name ==
"themeFill")
242 pAttributeList->add(
FSNS(XML_w, XML_themeFill), rProp.Value.get<OUString>().toUtf8());
243 else if (rProp.Name ==
"themeFillShade")
244 pAttributeList->add(
FSNS(XML_w, XML_themeFillShade),
245 rProp.Value.get<OUString>().toUtf8());
246 else if (rProp.Name ==
"themeFillTint")
247 pAttributeList->add(
FSNS(XML_w, XML_themeFillTint),
248 rProp.Value.get<OUString>().toUtf8());
250 m_pSerializer->singleElementNS(XML_w, XML_shd, pAttributeList);
255 if (!rColor.hasElements())
260 for (
const auto& rProp : rColor)
262 if (rProp.Name ==
"val")
263 pAttributeList->add(
FSNS(XML_w, XML_val), rProp.Value.get<OUString>().toUtf8());
264 else if (rProp.Name ==
"themeColor")
265 pAttributeList->add(
FSNS(XML_w, XML_themeColor), rProp.Value.get<OUString>().toUtf8());
266 else if (rProp.Name ==
"themeTint")
267 pAttributeList->add(
FSNS(XML_w, XML_themeTint), rProp.Value.get<OUString>().toUtf8());
268 else if (rProp.Name ==
"themeShade")
269 pAttributeList->add(
FSNS(XML_w, XML_themeShade), rProp.Value.get<OUString>().toUtf8());
271 m_pSerializer->singleElementNS(XML_w, XML_color, pAttributeList);
276 if (!rLang.hasElements())
281 for (
const auto& rProp : rLang)
283 if (rProp.Name ==
"eastAsia")
284 pAttributeList->add(
FSNS(XML_w, XML_eastAsia), rProp.Value.get<OUString>().toUtf8());
285 else if (rProp.Name ==
"val")
286 pAttributeList->add(
FSNS(XML_w, XML_val), rProp.Value.get<OUString>().toUtf8());
287 else if (rProp.Name ==
"bidi")
288 pAttributeList->add(
FSNS(XML_w, XML_bidi), rProp.Value.get<OUString>().toUtf8());
290 m_pSerializer->singleElementNS(XML_w, XML_lang, pAttributeList);
294 const uno::Sequence<beans::PropertyValue>& rRFonts)
296 if (!rRFonts.hasElements())
301 for (
const auto& rRFont : rRFonts)
303 if (rRFont.Name ==
"eastAsiaTheme")
304 pAttributeList->add(
FSNS(XML_w, XML_eastAsiaTheme),
305 rRFont.Value.get<OUString>().toUtf8());
306 else if (rRFont.Name ==
"asciiTheme")
307 pAttributeList->add(
FSNS(XML_w, XML_asciiTheme), rRFont.Value.get<OUString>().toUtf8());
308 else if (rRFont.Name ==
"cstheme")
309 pAttributeList->add(
FSNS(XML_w, XML_cstheme), rRFont.Value.get<OUString>().toUtf8());
310 else if (rRFont.Name ==
"hAnsiTheme")
311 pAttributeList->add(
FSNS(XML_w, XML_hAnsiTheme), rRFont.Value.get<OUString>().toUtf8());
313 m_pSerializer->singleElementNS(XML_w, XML_rFonts, pAttributeList);
317 const uno::Sequence<beans::PropertyValue>& rSpacing)
319 if (!rSpacing.hasElements())
324 for (
const auto& rProp : rSpacing)
326 if (rProp.Name ==
"after")
327 pAttributeList->add(
FSNS(XML_w, XML_after), rProp.Value.get<OUString>().toUtf8());
328 else if (rProp.Name ==
"before")
329 pAttributeList->add(
FSNS(XML_w, XML_before), rProp.Value.get<OUString>().toUtf8());
330 else if (rProp.Name ==
"line")
331 pAttributeList->add(
FSNS(XML_w, XML_line), rProp.Value.get<OUString>().toUtf8());
332 else if (rProp.Name ==
"lineRule")
333 pAttributeList->add(
FSNS(XML_w, XML_lineRule), rProp.Value.get<OUString>().toUtf8());
334 else if (rProp.Name ==
"beforeLines")
335 pAttributeList->add(
FSNS(XML_w, XML_beforeLines), rProp.Value.get<OUString>().toUtf8());
336 else if (rProp.Name ==
"ParaTopMarginBeforeAutoSpacing")
338 pAttributeList->add(
FSNS(XML_w, XML_beforeAutospacing),
"1");
339 else if (rProp.Name ==
"afterLines")
340 pAttributeList->add(
FSNS(XML_w, XML_afterLines), rProp.Value.get<OUString>().toUtf8());
341 else if (rProp.Name ==
"ParaBottomMarginAfterAutoSpacing")
343 pAttributeList->add(
FSNS(XML_w, XML_afterAutospacing),
"1");
345 m_pSerializer->singleElementNS(XML_w, XML_spacing, pAttributeList);
350 if (!rInd.hasElements())
355 for (
const auto& rProp : rInd)
357 if (rProp.Name ==
"rightChars")
358 pAttributeList->add(
FSNS(XML_w, XML_rightChars), rProp.Value.get<OUString>().toUtf8());
359 else if (rProp.Name ==
"right")
360 pAttributeList->add(
FSNS(XML_w, XML_right), rProp.Value.get<OUString>().toUtf8());
362 m_pSerializer->singleElementNS(XML_w, XML_ind, pAttributeList);
366 const uno::Sequence<beans::PropertyValue>& rTableInd)
368 if (!rTableInd.hasElements())
373 for (
const auto& rProp : rTableInd)
375 if (rProp.Name ==
"w")
376 pAttributeList->add(
FSNS(XML_w, XML_w), OString::number(rProp.Value.get<sal_Int32>()));
377 else if (rProp.Name ==
"type")
378 pAttributeList->add(
FSNS(XML_w, XML_type), rProp.Value.get<OUString>().toUtf8());
380 m_pSerializer->singleElementNS(XML_w, XML_tblInd, pAttributeList);
385 if (aValue.isEmpty())
390 pAttributeList->add(
FSNS(XML_w, XML_val), aValue.toUtf8());
391 m_pSerializer->singleElementNS(XML_w, nToken, pAttributeList);
396 if (!rRPr.hasElements())
399 m_pSerializer->startElementNS(XML_w, XML_rPr);
401 uno::Sequence<beans::PropertyValue> aRFonts;
402 uno::Sequence<beans::PropertyValue> aLang;
403 uno::Sequence<beans::PropertyValue> aColor;
404 uno::Sequence<beans::PropertyValue> aSpacingSequence;
405 bool bSequenceFlag =
false;
414 for (
const auto& rProp : rRPr)
416 if (rProp.Name ==
"rFonts")
417 aRFonts = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
418 else if (rProp.Name ==
"lang")
419 aLang = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
420 else if (rProp.Name ==
"b")
421 aB = rProp.Value.get<OUString>();
422 else if (rProp.Name ==
"bCs")
423 aBCs = rProp.Value.get<OUString>();
424 else if (rProp.Name ==
"i")
425 aI = rProp.Value.get<OUString>();
426 else if (rProp.Name ==
"color")
427 aColor = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
428 else if (rProp.Name ==
"sz")
429 aSz = rProp.Value.get<OUString>();
430 else if (rProp.Name ==
"szCs")
431 aSzCs = rProp.Value.get<OUString>();
432 else if (rProp.Name ==
"caps")
433 aCaps = rProp.Value.get<OUString>();
434 else if (rProp.Name ==
"smallCaps")
435 aSmallCaps = rProp.Value.get<OUString>();
436 else if (rProp.Name ==
"spacing")
438 if (rProp.Value.has<OUString>())
440 aSpacing = rProp.Value.get<OUString>();
444 aSpacingSequence = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
445 bSequenceFlag =
true;
449 tableStyleRRFonts(aRFonts);
450 tableStyleRLang(aLang);
451 handleBoolean(aB, XML_b);
452 handleBoolean(aBCs, XML_bCs);
453 handleBoolean(aI, XML_i);
454 handleBoolean(aCaps, XML_caps);
455 handleBoolean(aSmallCaps, XML_smallCaps);
456 tableStyleRColor(aColor);
459 m_pSerializer->singleElementNS(XML_w, XML_spacing,
FSNS(XML_w, XML_val),
460 aSpacingSequence[0].
Value.get<OUString>());
462 if (!aSpacing.isEmpty())
463 m_pSerializer->singleElementNS(XML_w, XML_spacing,
FSNS(XML_w, XML_val), aSpacing);
465 m_pSerializer->singleElementNS(XML_w, XML_sz,
FSNS(XML_w, XML_val), aSz);
466 if (!aSzCs.isEmpty())
467 m_pSerializer->singleElementNS(XML_w, XML_szCs,
FSNS(XML_w, XML_val), aSzCs);
469 m_pSerializer->endElementNS(XML_w, XML_rPr);
474 if (!rPPr.hasElements())
477 m_pSerializer->startElementNS(XML_w, XML_pPr);
479 uno::Sequence<beans::PropertyValue> aSpacing;
480 uno::Sequence<beans::PropertyValue> aInd;
481 bool bWordWrap =
false;
483 OUString aSnapToGrid;
484 for (
const auto& rProp : rPPr)
486 if (rProp.Name ==
"spacing")
487 aSpacing = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
488 else if (rProp.Name ==
"ind")
489 aInd = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
490 else if (rProp.Name ==
"wordWrap")
492 else if (rProp.Name ==
"jc")
493 aJc = rProp.Value.get<OUString>();
494 else if (rProp.Name ==
"snapToGrid")
495 aSnapToGrid = rProp.Value.get<OUString>();
498 m_pSerializer->singleElementNS(XML_w, XML_wordWrap);
499 tableStylePInd(aInd);
500 handleBoolean(aSnapToGrid, XML_snapToGrid);
501 tableStylePSpacing(aSpacing);
503 m_pSerializer->singleElementNS(XML_w, XML_jc,
FSNS(XML_w, XML_val), aJc);
505 m_pSerializer->endElementNS(XML_w, XML_pPr);
509 const uno::Sequence<beans::PropertyValue>& rTablePr)
511 if (!rTablePr.hasElements())
514 m_pSerializer->startElementNS(XML_w, XML_tblPr);
516 uno::Sequence<beans::PropertyValue> aTableInd;
517 uno::Sequence<beans::PropertyValue> aTableBorders;
518 uno::Sequence<beans::PropertyValue> aTableCellMar;
519 std::optional<sal_Int32> oTableStyleRowBandSize;
520 std::optional<sal_Int32> oTableStyleColBandSize;
521 for (
const auto& rProp : rTablePr)
523 if (rProp.Name ==
"tblStyleRowBandSize")
524 oTableStyleRowBandSize = rProp.Value.get<sal_Int32>();
525 else if (rProp.Name ==
"tblStyleColBandSize")
526 oTableStyleColBandSize = rProp.Value.get<sal_Int32>();
527 else if (rProp.Name ==
"tblInd")
528 aTableInd = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
529 else if (rProp.Name ==
"tblBorders")
530 aTableBorders = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
531 else if (rProp.Name ==
"tblCellMar")
532 aTableCellMar = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
534 if (oTableStyleRowBandSize)
535 m_pSerializer->singleElementNS(XML_w, XML_tblStyleRowBandSize,
FSNS(XML_w, XML_val),
536 OString::number(*oTableStyleRowBandSize));
537 if (oTableStyleColBandSize)
538 m_pSerializer->singleElementNS(XML_w, XML_tblStyleColBandSize,
FSNS(XML_w, XML_val),
539 OString::number(*oTableStyleColBandSize));
540 tableStyleTableInd(aTableInd);
541 tableStyleTcBorders(aTableBorders, XML_tblBorders);
542 tableStyleTableCellMar(aTableCellMar);
544 m_pSerializer->endElementNS(XML_w, XML_tblPr);
549 if (!rTrPr.hasElements())
552 m_pSerializer->startElementNS(XML_w, XML_trPr);
554 for (
const auto& rProp : rTrPr)
556 if (rProp.Name ==
"tblHeader")
557 m_pSerializer->singleElementNS(XML_w, XML_tblHeader);
560 m_pSerializer->endElementNS(XML_w, XML_trPr);
565 if (!rTcPr.hasElements())
568 m_pSerializer->startElementNS(XML_w, XML_tcPr);
570 uno::Sequence<beans::PropertyValue> aShd;
571 uno::Sequence<beans::PropertyValue> aTcBorders;
572 uno::Sequence<beans::PropertyValue> aTcMar;
574 for (
const auto& rProp : rTcPr)
576 if (rProp.Name ==
"shd")
577 aShd = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
578 else if (rProp.Name ==
"tcBorders")
579 aTcBorders = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
580 else if (rProp.Name ==
"tcMar")
581 aTcMar = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
582 else if (rProp.Name ==
"vAlign")
583 aVAlign = rProp.Value.get<OUString>();
585 tableStyleTcBorders(aTcBorders);
586 tableStyleTableCellMar(aTcMar, XML_tcMar);
588 if (!aVAlign.isEmpty())
589 m_pSerializer->singleElementNS(XML_w, XML_vAlign,
FSNS(XML_w, XML_val), aVAlign);
591 m_pSerializer->endElementNS(XML_w, XML_tcPr);
595 const uno::Sequence<beans::PropertyValue>& rTableStylePr)
597 if (!rTableStylePr.hasElements())
601 uno::Sequence<beans::PropertyValue> aPPr;
602 uno::Sequence<beans::PropertyValue> aRPr;
603 uno::Sequence<beans::PropertyValue> aTablePr;
604 uno::Sequence<beans::PropertyValue> aTrPr;
605 uno::Sequence<beans::PropertyValue> aTcPr;
606 for (
const auto& rProp : rTableStylePr)
608 if (rProp.Name ==
"type")
609 aType = rProp.Value.get<OUString>();
610 else if (rProp.Name ==
"pPr")
611 aPPr = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
612 else if (rProp.Name ==
"rPr")
613 aRPr = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
614 else if (rProp.Name ==
"tblPr")
615 aTablePr = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
616 else if (rProp.Name ==
"trPr")
617 aTrPr = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
618 else if (rProp.Name ==
"tcPr")
619 aTcPr = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
622 m_pSerializer->startElementNS(XML_w, XML_tblStylePr,
FSNS(XML_w, XML_type), aType);
626 if (aTablePr.hasElements())
627 tableStyleTablePr(aTablePr);
631 m_pSerializer->singleElementNS(XML_w, XML_tblPr);
633 tableStyleTrPr(aTrPr);
634 tableStyleTcPr(aTcPr);
636 m_pSerializer->endElementNS(XML_w, XML_tblStylePr);
641 bool bDefault =
false;
642 bool bCustomStyle =
false;
643 bool bQFormat =
false;
644 bool bSemiHidden =
false;
645 bool bUnhideWhenUsed =
false;
650 OUString aUiPriority;
651 uno::Sequence<beans::PropertyValue> aPPr;
652 uno::Sequence<beans::PropertyValue> aRPr;
653 uno::Sequence<beans::PropertyValue> aTablePr;
654 uno::Sequence<beans::PropertyValue> aTcPr;
655 std::vector<uno::Sequence<beans::PropertyValue>> aTableStylePrs;
656 for (
const auto& rProp : rStyle)
658 if (rProp.Name ==
"default")
659 bDefault = rProp.Value.get<
bool>();
660 else if (rProp.Name ==
"customStyle")
661 bCustomStyle = rProp.Value.get<
bool>();
662 else if (rProp.Name ==
"styleId")
663 aStyleId = rProp.Value.get<OUString>();
664 else if (rProp.Name ==
"name")
665 aName = rProp.Value.get<OUString>();
666 else if (rProp.Name ==
"basedOn")
667 aBasedOn = rProp.Value.get<OUString>();
668 else if (rProp.Name ==
"uiPriority")
669 aUiPriority = rProp.Value.get<OUString>();
670 else if (rProp.Name ==
"qFormat")
672 else if (rProp.Name ==
"semiHidden")
674 else if (rProp.Name ==
"unhideWhenUsed")
675 bUnhideWhenUsed =
true;
676 else if (rProp.Name ==
"rsid")
677 aRsid = rProp.Value.get<OUString>();
678 else if (rProp.Name ==
"pPr")
679 aPPr = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
680 else if (rProp.Name ==
"rPr")
681 aRPr = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
682 else if (rProp.Name ==
"tblPr")
683 aTablePr = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
684 else if (rProp.Name ==
"tcPr")
685 aTcPr = rProp.Value.get<uno::Sequence<beans::PropertyValue>>();
686 else if (rProp.Name ==
"tblStylePr")
687 aTableStylePrs.push_back(rProp.Value.get<uno::Sequence<beans::PropertyValue>>());
692 pAttributeList->add(
FSNS(XML_w, XML_type),
"table");
694 pAttributeList->add(
FSNS(XML_w, XML_default),
"1");
696 pAttributeList->add(
FSNS(XML_w, XML_customStyle),
"1");
697 if (!aStyleId.isEmpty())
698 pAttributeList->add(
FSNS(XML_w, XML_styleId), aStyleId.toUtf8());
699 m_pSerializer->startElementNS(XML_w, XML_style, pAttributeList);
701 m_pSerializer->singleElementNS(XML_w, XML_name,
FSNS(XML_w, XML_val), aName);
702 if (!aBasedOn.isEmpty())
703 m_pSerializer->singleElementNS(XML_w, XML_basedOn,
FSNS(XML_w, XML_val), aBasedOn);
704 if (!aUiPriority.isEmpty())
705 m_pSerializer->singleElementNS(XML_w, XML_uiPriority,
FSNS(XML_w, XML_val), aUiPriority);
707 m_pSerializer->singleElementNS(XML_w, XML_semiHidden);
709 m_pSerializer->singleElementNS(XML_w, XML_unhideWhenUsed);
711 m_pSerializer->singleElementNS(XML_w, XML_qFormat);
712 if (!aRsid.isEmpty())
713 m_pSerializer->singleElementNS(XML_w, XML_rsid,
FSNS(XML_w, XML_val), aRsid);
717 tableStyleTablePr(aTablePr);
718 tableStyleTcPr(aTcPr);
719 for (
const uno::Sequence<beans::PropertyValue>&
i : std::as_const(aTableStylePrs))
720 tableStyleTableStylePr(
i);
722 m_pSerializer->endElementNS(XML_w, XML_style);
727 m_pImpl->setSerializer(pSerializer);
734 m_pImpl->setSerializer(pSerializer);
void tableStyleTableInd(const uno::Sequence< beans::PropertyValue > &rTableInd)
Export of w:tblInd.
void tableStyleTablePr(const uno::Sequence< beans::PropertyValue > &rTablePr)
Export of w:tblPr.
Methods in this class handle values in a table style.
void TableStyle(const uno::Sequence< beans::PropertyValue > &rStyle)
void tableStyleRColor(const uno::Sequence< beans::PropertyValue > &rColor)
Export of w:color.
void tableStyleTableCellMar(const uno::Sequence< beans::PropertyValue > &rTableCellMar, sal_Int32 nType=XML_tblCellMar)
Export of w:tblCellMar (and w:tcMar).
std::unique_ptr< Impl > m_pImpl
void tableStylePSpacing(const uno::Sequence< beans::PropertyValue > &rSpacing)
Export of w:spacing.
void TableStyles(sal_Int32 nCountStylesToWrite)
void tableStyleTrPr(const uno::Sequence< beans::PropertyValue > &rTrPr)
Export of w:trPr.
void CnfStyle(const css::uno::Sequence< css::beans::PropertyValue > &rAttributeList)
Writes based on grab-bagged para, cell or row properties.
HashMap_OWString_Interface aMap
void tableStyleTcBorders(const uno::Sequence< beans::PropertyValue > &rTcBorders, sal_Int32 nToken=XML_tcBorders)
Export of w:tcBorders (and w:tblBorders).
void SetSerializer(const sax_fastparser::FSHelperPtr &pSerializer)
void tableStyleRPr(const uno::Sequence< beans::PropertyValue > &rRPr)
Export of w:rPr.
void tableStyleShd(const uno::Sequence< beans::PropertyValue > &rShd)
Export of w:shd.
void tableStyleTableStylePr(const uno::Sequence< beans::PropertyValue > &rTableStylePr)
Export of w:tblStylePr.
void tableStylePPr(const uno::Sequence< beans::PropertyValue > &rPPr)
Export of w:pPr.
static rtl::Reference< FastAttributeList > createAttrList()
void setSerializer(sax_fastparser::FSHelperPtr pSerializer)
std::shared_ptr< FastSerializerHelper > FSHelperPtr
DocxTableStyleExport(SwDoc &rDoc, const sax_fastparser::FSHelperPtr &pSerializer)
void tableStyleTcPr(const uno::Sequence< beans::PropertyValue > &rTcPr)
Export of w:tcPr.
void tableStylePInd(const uno::Sequence< beans::PropertyValue > &rInd)
Export of w:ind in a pPr.
const sax_fastparser::FSHelperPtr & getSerializer() const
constexpr sal_Int32 FSNS(sal_Int32 namespc, sal_Int32 element)
sal_Int32 DocxStringGetToken(DocxStringTokenMap const *pMap, std::u16string_view rName)
void handleBoolean(const OUString &aValue, sal_Int32 nToken)
Handles a boolean value.
if(!pCandidateA->getEnd().equal(pCandidateB->getStart()))
sax_fastparser::FSHelperPtr m_pSerializer
void tableStyleTcBorder(sal_Int32 nToken, const uno::Sequence< beans::PropertyValue > &rTcBorder)
Export of a given table cell border type.
void tableStyleRRFonts(const uno::Sequence< beans::PropertyValue > &rRFonts)
Export of w:rFonts.
void tableStyleRLang(const uno::Sequence< beans::PropertyValue > &rLang)
Export of w:lang.