use insert function instead of for loop
[LibreOffice.git] / oox / source / drawingml / table / predefined-table-styles.cxx
blob9011b5c8c6288c9a75fc59eab1e635b609cb5a65
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
9 #include <oox/token/tokens.hxx>
10 #include <drawingml/table/tablestyle.hxx>
11 #include <frozen/bits/defines.h>
12 #include <frozen/bits/elsa_std.h>
13 #include <frozen/unordered_map.h>
14 #include <unordered_map>
16 using namespace oox;
17 using namespace oox::drawingml::table;
19 /* tdf#107604
20 * There are predefined table styles that have a
21 * style id (in ppt/slides/slidex.xml) but does not have
22 * corresponding style definition (ppt/tableStyles.xml).
23 * So we should create those styles here for this case.
24 * There are 74 predefined styles and many different
25 * variables. A style map was created by examining all
26 * 74 style properties. And table styles were coded according
27 * to that map. You can see that map in
28 * oox/documentation/predefined-styles-map.ods. We should
29 * define all of these variables to keep the code readable
30 * and change something easily when some styles change.
33 // Create style-id map for using similar attributes of the groups.
34 // (style ids used from here: https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2010/hh273476(v=office.14)?redirectedfrom=MSDN)
35 // and checked all of them.
37 const std::unordered_map<OUString, std::pair<OUString, OUString>> mStyleIdMap{
38 { u"{2D5ABB26-0587-4C30-8999-92F81FD0307C}"_ustr,
39 std::make_pair(u"Themed-Style-1"_ustr, u""_ustr) },
40 { u"{3C2FFA5D-87B4-456A-9821-1D502468CF0F}"_ustr,
41 std::make_pair(u"Themed-Style-1"_ustr, u"Accent1"_ustr) },
42 { u"{284E427A-3D55-4303-BF80-6455036E1DE7}"_ustr,
43 std::make_pair(u"Themed-Style-1"_ustr, u"Accent2"_ustr) },
44 { u"{69C7853C-536D-4A76-A0AE-DD22124D55A5}"_ustr,
45 std::make_pair(u"Themed-Style-1"_ustr, u"Accent3"_ustr) },
46 { u"{775DCB02-9BB8-47FD-8907-85C794F793BA}"_ustr,
47 std::make_pair(u"Themed-Style-1"_ustr, u"Accent4"_ustr) },
48 { u"{35758FB7-9AC5-4552-8A53-C91805E547FA}"_ustr,
49 std::make_pair(u"Themed-Style-1"_ustr, u"Accent5"_ustr) },
50 { u"{08FB837D-C827-4EFA-A057-4D05807E0F7C}"_ustr,
51 std::make_pair(u"Themed-Style-1"_ustr, u"Accent6"_ustr) },
53 { u"{5940675A-B579-460E-94D1-54222C63F5DA}"_ustr,
54 std::make_pair(u"Themed-Style-2"_ustr, u""_ustr) },
55 { u"{D113A9D2-9D6B-4929-AA2D-F23B5EE8CBE7}"_ustr,
56 std::make_pair(u"Themed-Style-2"_ustr, u"Accent1"_ustr) },
57 { u"{18603FDC-E32A-4AB5-989C-0864C3EAD2B8}"_ustr,
58 std::make_pair(u"Themed-Style-2"_ustr, u"Accent2"_ustr) },
59 { u"{306799F8-075E-4A3A-A7F6-7FBC6576F1A4}"_ustr,
60 std::make_pair(u"Themed-Style-2"_ustr, u"Accent3"_ustr) },
61 { u"{E269D01E-BC32-4049-B463-5C60D7B0CCD2}"_ustr,
62 std::make_pair(u"Themed-Style-2"_ustr, u"Accent4"_ustr) },
63 { u"{327F97BB-C833-4FB7-BDE5-3F7075034690}"_ustr,
64 std::make_pair(u"Themed-Style-2"_ustr, u"Accent5"_ustr) },
65 { u"{638B1855-1B75-4FBE-930C-398BA8C253C6}"_ustr,
66 std::make_pair(u"Themed-Style-2"_ustr, u"Accent6"_ustr) },
68 { u"{9D7B26C5-4107-4FEC-AEDC-1716B250A1EF}"_ustr,
69 std::make_pair(u"Light-Style-1"_ustr, u""_ustr) },
70 { u"{3B4B98B0-60AC-42C2-AFA5-B58CD77FA1E5}"_ustr,
71 std::make_pair(u"Light-Style-1"_ustr, u"Accent1"_ustr) },
72 { u"{0E3FDE45-AF77-4B5C-9715-49D594BDF05E}"_ustr,
73 std::make_pair(u"Light-Style-1"_ustr, u"Accent2"_ustr) },
74 { u"{C083E6E3-FA7D-4D7B-A595-EF9225AFEA82}"_ustr,
75 std::make_pair(u"Light-Style-1"_ustr, u"Accent3"_ustr) },
76 { u"{D27102A9-8310-4765-A935-A1911B00CA55}"_ustr,
77 std::make_pair(u"Light-Style-1"_ustr, u"Accent4"_ustr) },
78 { u"{5FD0F851-EC5A-4D38-B0AD-8093EC10F338}"_ustr,
79 std::make_pair(u"Light-Style-1"_ustr, u"Accent5"_ustr) },
80 { u"{68D230F3-CF80-4859-8CE7-A43EE81993B5}"_ustr,
81 std::make_pair(u"Light-Style-1"_ustr, u"Accent6"_ustr) },
83 { u"{7E9639D4-E3E2-4D34-9284-5A2195B3D0D7}"_ustr,
84 std::make_pair(u"Light-Style-2"_ustr, u""_ustr) },
85 { u"{69012ECD-51FC-41F1-AA8D-1B2483CD663E}"_ustr,
86 std::make_pair(u"Light-Style-2"_ustr, u"Accent1"_ustr) },
87 { u"{72833802-FEF1-4C79-8D5D-14CF1EAF98D9}"_ustr,
88 std::make_pair(u"Light-Style-2"_ustr, u"Accent2"_ustr) },
89 { u"{F2DE63D5-997A-4646-A377-4702673A728D}"_ustr,
90 std::make_pair(u"Light-Style-2"_ustr, u"Accent3"_ustr) },
91 { u"{17292A2E-F333-43FB-9621-5CBBE7FDCDCB}"_ustr,
92 std::make_pair(u"Light-Style-2"_ustr, u"Accent4"_ustr) },
93 { u"{5A111915-BE36-4E01-A7E5-04B1672EAD32}"_ustr,
94 std::make_pair(u"Light-Style-2"_ustr, u"Accent5"_ustr) },
95 { u"{912C8C85-51F0-491E-9774-3900AFEF0FD7}"_ustr,
96 std::make_pair(u"Light-Style-2"_ustr, u"Accent6"_ustr) },
98 { u"{616DA210-FB5B-4158-B5E0-FEB733F419BA}"_ustr,
99 std::make_pair(u"Light-Style-3"_ustr, u""_ustr) },
100 { u"{BC89EF96-8CEA-46FF-86C4-4CE0E7609802}"_ustr,
101 std::make_pair(u"Light-Style-3"_ustr, u"Accent1"_ustr) },
102 { u"{5DA37D80-6434-44D0-A028-1B22A696006F}"_ustr,
103 std::make_pair(u"Light-Style-3"_ustr, u"Accent2"_ustr) },
104 { u"{8799B23B-EC83-4686-B30A-512413B5E67A}"_ustr,
105 std::make_pair(u"Light-Style-3"_ustr, u"Accent3"_ustr) },
106 { u"{ED083AE6-46FA-4A59-8FB0-9F97EB10719F}"_ustr,
107 std::make_pair(u"Light-Style-3"_ustr, u"Accent4"_ustr) },
108 { u"{BDBED569-4797-4DF1-A0F4-6AAB3CD982D8}"_ustr,
109 std::make_pair(u"Light-Style-3"_ustr, u"Accent5"_ustr) },
110 { u"{E8B1032C-EA38-4F05-BA0D-38AFFFC7BED3}"_ustr,
111 std::make_pair(u"Light-Style-3"_ustr, u"Accent6"_ustr) },
113 { u"{793D81CF-94F2-401A-BA57-92F5A7B2D0C5}"_ustr,
114 std::make_pair(u"Medium-Style-1"_ustr, u""_ustr) },
115 { u"{B301B821-A1FF-4177-AEE7-76D212191A09}"_ustr,
116 std::make_pair(u"Medium-Style-1"_ustr, u"Accent1"_ustr) },
117 { u"{9DCAF9ED-07DC-4A11-8D7F-57B35C25682E}"_ustr,
118 std::make_pair(u"Medium-Style-1"_ustr, u"Accent2"_ustr) },
119 { u"{1FECB4D8-DB02-4DC6-A0A2-4F2EBAE1DC90}"_ustr,
120 std::make_pair(u"Medium-Style-1"_ustr, u"Accent3"_ustr) },
121 { u"{1E171933-4619-4E11-9A3F-F7608DF75F80}"_ustr,
122 std::make_pair(u"Medium-Style-1"_ustr, u"Accent4"_ustr) },
123 { u"{FABFCF23-3B69-468F-B69F-88F6DE6A72F2}"_ustr,
124 std::make_pair(u"Medium-Style-1"_ustr, u"Accent5"_ustr) },
125 { u"{10A1B5D5-9B99-4C35-A422-299274C87663}"_ustr,
126 std::make_pair(u"Medium-Style-1"_ustr, u"Accent6"_ustr) },
128 { u"{073A0DAA-6AF3-43AB-8588-CEC1D06C72B9}"_ustr,
129 std::make_pair(u"Medium-Style-2"_ustr, u""_ustr) },
130 { u"{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}"_ustr,
131 std::make_pair(u"Medium-Style-2"_ustr, u"Accent1"_ustr) },
132 { u"{21E4AEA4-8DFA-4A89-87EB-49C32662AFE0}"_ustr,
133 std::make_pair(u"Medium-Style-2"_ustr, u"Accent2"_ustr) },
134 { u"{F5AB1C69-6EDB-4FF4-983F-18BD219EF322}"_ustr,
135 std::make_pair(u"Medium-Style-2"_ustr, u"Accent3"_ustr) },
136 { u"{00A15C55-8517-42AA-B614-E9B94910E393}"_ustr,
137 std::make_pair(u"Medium-Style-2"_ustr, u"Accent4"_ustr) },
138 { u"{7DF18680-E054-41AD-8BC1-D1AEF772440D}"_ustr,
139 std::make_pair(u"Medium-Style-2"_ustr, u"Accent5"_ustr) },
140 { u"{93296810-A885-4BE3-A3E7-6D5BEEA58F35}"_ustr,
141 std::make_pair(u"Medium-Style-2"_ustr, u"Accent6"_ustr) },
143 { u"{8EC20E35-A176-4012-BC5E-935CFFF8708E}"_ustr,
144 std::make_pair(u"Medium-Style-3"_ustr, u""_ustr) },
145 { u"{6E25E649-3F16-4E02-A733-19D2CDBF48F0}"_ustr,
146 std::make_pair(u"Medium-Style-3"_ustr, u"Accent1"_ustr) },
147 { u"{85BE263C-DBD7-4A20-BB59-AAB30ACAA65A}"_ustr,
148 std::make_pair(u"Medium-Style-3"_ustr, u"Accent2"_ustr) },
149 { u"{EB344D84-9AFB-497E-A393-DC336BA19D2E}"_ustr,
150 std::make_pair(u"Medium-Style-3"_ustr, u"Accent3"_ustr) },
151 { u"{EB9631B5-78F2-41C9-869B-9F39066F8104}"_ustr,
152 std::make_pair(u"Medium-Style-3"_ustr, u"Accent4"_ustr) },
153 { u"{74C1A8A3-306A-4EB7-A6B1-4F7E0EB9C5D6}"_ustr,
154 std::make_pair(u"Medium-Style-3"_ustr, u"Accent5"_ustr) },
155 { u"{2A488322-F2BA-4B5B-9748-0D474271808F}"_ustr,
156 std::make_pair(u"Medium-Style-3"_ustr, u"Accent6"_ustr) },
158 { u"{D7AC3CCA-C797-4891-BE02-D94E43425B78}"_ustr,
159 std::make_pair(u"Medium-Style-4"_ustr, u""_ustr) },
160 { u"{69CF1AB2-1976-4502-BF36-3FF5EA218861}"_ustr,
161 std::make_pair(u"Medium-Style-4"_ustr, u"Accent1"_ustr) },
162 { u"{8A107856-5554-42FB-B03E-39F5DBC370BA}"_ustr,
163 std::make_pair(u"Medium-Style-4"_ustr, u"Accent2"_ustr) },
164 { u"{0505E3EF-67EA-436B-97B2-0124C06EBD24}"_ustr,
165 std::make_pair(u"Medium-Style-4"_ustr, u"Accent3"_ustr) },
166 { u"{C4B1156A-380E-4F78-BDF5-A606A8083BF9}"_ustr,
167 std::make_pair(u"Medium-Style-4"_ustr, u"Accent4"_ustr) },
168 { u"{22838BEF-8BB2-4498-84A7-C5851F593DF1}"_ustr,
169 std::make_pair(u"Medium-Style-4"_ustr, u"Accent5"_ustr) },
170 { u"{16D9F66E-5EB9-4882-86FB-DCBF35E3C3E4}"_ustr,
171 std::make_pair(u"Medium-Style-4"_ustr, u"Accent6"_ustr) },
173 { u"{E8034E78-7F5D-4C2E-B375-FC64B27BC917}"_ustr,
174 std::make_pair(u"Dark-Style-1"_ustr, u""_ustr) },
175 { u"{125E5076-3810-47DD-B79F-674D7AD40C01}"_ustr,
176 std::make_pair(u"Dark-Style-1"_ustr, u"Accent1"_ustr) },
177 { u"{37CE84F3-28C3-443E-9E96-99CF82512B78}"_ustr,
178 std::make_pair(u"Dark-Style-1"_ustr, u"Accent2"_ustr) },
179 { u"{D03447BB-5D67-496B-8E87-E561075AD55C}"_ustr,
180 std::make_pair(u"Dark-Style-1"_ustr, u"Accent3"_ustr) },
181 { u"{E929F9F4-4A8F-4326-A1B4-22849713DDAB}"_ustr,
182 std::make_pair(u"Dark-Style-1"_ustr, u"Accent4"_ustr) },
183 { u"{8FD4443E-F989-4FC4-A0C8-D5A2AF1F390B}"_ustr,
184 std::make_pair(u"Dark-Style-1"_ustr, u"Accent5"_ustr) },
185 { u"{AF606853-7671-496A-8E4F-DF71F8EC918B}"_ustr,
186 std::make_pair(u"Dark-Style-1"_ustr, u"Accent6"_ustr) },
188 { u"{5202B0CA-FC54-4496-8BCA-5EF66A818D29}"_ustr,
189 std::make_pair(u"Dark-Style-2"_ustr, u""_ustr) },
190 { u"{0660B408-B3CF-4A94-85FC-2B1E0A45F4A2}"_ustr,
191 std::make_pair(u"Dark-Style-2"_ustr, u"Accent1"_ustr) },
192 { u"{91EBBBCC-DAD2-459C-BE2E-F6DE35CF9A28}"_ustr,
193 std::make_pair(u"Dark-Style-2"_ustr, u"Accent3"_ustr) },
194 { u"{46F890A9-2807-4EBB-B81D-B2AA78EC7F39}"_ustr,
195 std::make_pair(u"Dark-Style-2"_ustr, u"Accent5"_ustr) }
198 constexpr frozen::unordered_map<std::u16string_view, sal_Int32, 6> tokens{
199 { u"Accent1", XML_accent1 }, { u"Accent2", XML_accent2 }, { u"Accent3", XML_accent3 },
200 { u"Accent4", XML_accent4 }, { u"Accent5", XML_accent5 }, { u"Accent6", XML_accent6 }
203 sal_Int32 resolveToken(OUString const& rString)
205 auto iterator = tokens.find(rString);
206 if (iterator != tokens.end())
207 return iterator->second;
208 return XML_dk1;
211 void setBorderLineType(const oox::drawingml::LinePropertiesPtr& pLineProp, sal_Int32 nToken)
213 pLineProp->maLineFill.moFillType = nToken;
216 void insertBorderLine(TableStylePart& aTableStylePart, sal_Int32 nToken,
217 const oox::drawingml::LinePropertiesPtr& pLineProp)
219 if (pLineProp->maLineFill.moFillType.has_value())
221 aTableStylePart.getLineBorders().insert(
222 std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(nToken, pLineProp));
226 std::unique_ptr<TableStyle> CreateTableStyle(const OUString& styleId)
228 std::unique_ptr<TableStyle> pTableStyle;
229 pTableStyle.reset(new TableStyle());
231 // Text Style definitions for table parts
233 bool bFirstRowTextBoldStyle = false;
234 bool bFirstColTextBoldStyle = false;
235 bool bLastColTextBoldStyle = false;
237 // Text Color definitions for table parts
239 ::oox::drawingml::Color wholeTblTextColor;
240 ::oox::drawingml::Color firstRowTextColor;
241 ::oox::drawingml::Color firstColTextColor;
242 ::oox::drawingml::Color lastRowTextColor;
243 ::oox::drawingml::Color lastColTextColor;
245 // Fill properties definitions for table parts
247 oox::drawingml::FillPropertiesPtr pWholeTblFillProperties
248 = std::make_shared<oox::drawingml::FillProperties>();
249 oox::drawingml::FillPropertiesPtr pFirstRowFillProperties
250 = std::make_shared<oox::drawingml::FillProperties>();
251 oox::drawingml::FillPropertiesPtr pFirstColFillProperties
252 = std::make_shared<oox::drawingml::FillProperties>();
253 oox::drawingml::FillPropertiesPtr pLastRowFillProperties
254 = std::make_shared<oox::drawingml::FillProperties>();
255 oox::drawingml::FillPropertiesPtr pLastColFillProperties
256 = std::make_shared<oox::drawingml::FillProperties>();
257 oox::drawingml::FillPropertiesPtr pBand1HFillProperties
258 = std::make_shared<oox::drawingml::FillProperties>();
259 oox::drawingml::FillPropertiesPtr pBand1VFillProperties
260 = std::make_shared<oox::drawingml::FillProperties>();
261 oox::drawingml::FillPropertiesPtr pBand2HFillProperties
262 = std::make_shared<oox::drawingml::FillProperties>();
263 oox::drawingml::FillPropertiesPtr pBand2VFillProperties
264 = std::make_shared<oox::drawingml::FillProperties>();
265 oox::drawingml::FillPropertiesPtr pTblBgFillProperties
266 = std::make_shared<oox::drawingml::FillProperties>();
268 // Start table border line properties definitions for table parts
270 oox::drawingml::LinePropertiesPtr pWholeTblLeftBorder
271 = std::make_shared<oox::drawingml::LineProperties>();
272 oox::drawingml::LinePropertiesPtr pWholeTblRightBorder
273 = std::make_shared<oox::drawingml::LineProperties>();
274 oox::drawingml::LinePropertiesPtr pWholeTblTopBorder
275 = std::make_shared<oox::drawingml::LineProperties>();
276 oox::drawingml::LinePropertiesPtr pWholeTblBottomBorder
277 = std::make_shared<oox::drawingml::LineProperties>();
278 oox::drawingml::LinePropertiesPtr pWholeTblInsideHBorder
279 = std::make_shared<oox::drawingml::LineProperties>();
280 oox::drawingml::LinePropertiesPtr pWholeTblInsideVBorder
281 = std::make_shared<oox::drawingml::LineProperties>();
283 oox::drawingml::LinePropertiesPtr pFirstRowLeftBorder
284 = std::make_shared<oox::drawingml::LineProperties>();
285 oox::drawingml::LinePropertiesPtr pFirstRowRightBorder
286 = std::make_shared<oox::drawingml::LineProperties>();
287 oox::drawingml::LinePropertiesPtr pFirstRowTopBorder
288 = std::make_shared<oox::drawingml::LineProperties>();
289 oox::drawingml::LinePropertiesPtr pFirstRowBottomBorder
290 = std::make_shared<oox::drawingml::LineProperties>();
291 oox::drawingml::LinePropertiesPtr pFirstRowInsideHBorder
292 = std::make_shared<oox::drawingml::LineProperties>();
293 oox::drawingml::LinePropertiesPtr pFirstRowInsideVBorder
294 = std::make_shared<oox::drawingml::LineProperties>();
296 oox::drawingml::LinePropertiesPtr pFirstColLeftBorder
297 = std::make_shared<oox::drawingml::LineProperties>();
298 oox::drawingml::LinePropertiesPtr pFirstColRightBorder
299 = std::make_shared<oox::drawingml::LineProperties>();
300 oox::drawingml::LinePropertiesPtr pFirstColTopBorder
301 = std::make_shared<oox::drawingml::LineProperties>();
302 oox::drawingml::LinePropertiesPtr pFirstColBottomBorder
303 = std::make_shared<oox::drawingml::LineProperties>();
304 oox::drawingml::LinePropertiesPtr pFirstColInsideHBorder
305 = std::make_shared<oox::drawingml::LineProperties>();
306 oox::drawingml::LinePropertiesPtr pFirstColInsideVBorder
307 = std::make_shared<oox::drawingml::LineProperties>();
309 oox::drawingml::LinePropertiesPtr pLastColLeftBorder
310 = std::make_shared<oox::drawingml::LineProperties>();
311 oox::drawingml::LinePropertiesPtr pLastColRightBorder
312 = std::make_shared<oox::drawingml::LineProperties>();
313 oox::drawingml::LinePropertiesPtr pLastColTopBorder
314 = std::make_shared<oox::drawingml::LineProperties>();
315 oox::drawingml::LinePropertiesPtr pLastColBottomBorder
316 = std::make_shared<oox::drawingml::LineProperties>();
317 oox::drawingml::LinePropertiesPtr pLastColInsideHBorder
318 = std::make_shared<oox::drawingml::LineProperties>();
319 oox::drawingml::LinePropertiesPtr pLastColInsideVBorder
320 = std::make_shared<oox::drawingml::LineProperties>();
322 oox::drawingml::LinePropertiesPtr pLastRowLeftBorder
323 = std::make_shared<oox::drawingml::LineProperties>();
324 oox::drawingml::LinePropertiesPtr pLastRowRightBorder
325 = std::make_shared<oox::drawingml::LineProperties>();
326 oox::drawingml::LinePropertiesPtr pLastRowTopBorder
327 = std::make_shared<oox::drawingml::LineProperties>();
328 oox::drawingml::LinePropertiesPtr pLastRowBottomBorder
329 = std::make_shared<oox::drawingml::LineProperties>();
330 oox::drawingml::LinePropertiesPtr pLastRowInsideHBorder
331 = std::make_shared<oox::drawingml::LineProperties>();
332 oox::drawingml::LinePropertiesPtr pLastRowInsideVBorder
333 = std::make_shared<oox::drawingml::LineProperties>();
335 oox::drawingml::LinePropertiesPtr pBand1HLeftBorder
336 = std::make_shared<oox::drawingml::LineProperties>();
337 oox::drawingml::LinePropertiesPtr pBand1HRightBorder
338 = std::make_shared<oox::drawingml::LineProperties>();
339 oox::drawingml::LinePropertiesPtr pBand1HTopBorder
340 = std::make_shared<oox::drawingml::LineProperties>();
341 oox::drawingml::LinePropertiesPtr pBand1HBottomBorder
342 = std::make_shared<oox::drawingml::LineProperties>();
343 oox::drawingml::LinePropertiesPtr pBand1HInsideHBorder
344 = std::make_shared<oox::drawingml::LineProperties>();
345 oox::drawingml::LinePropertiesPtr pBand1HInsideVBorder
346 = std::make_shared<oox::drawingml::LineProperties>();
348 oox::drawingml::LinePropertiesPtr pBand1VLeftBorder
349 = std::make_shared<oox::drawingml::LineProperties>();
350 oox::drawingml::LinePropertiesPtr pBand1VRightBorder
351 = std::make_shared<oox::drawingml::LineProperties>();
352 oox::drawingml::LinePropertiesPtr pBand1VTopBorder
353 = std::make_shared<oox::drawingml::LineProperties>();
354 oox::drawingml::LinePropertiesPtr pBand1VBottomBorder
355 = std::make_shared<oox::drawingml::LineProperties>();
356 oox::drawingml::LinePropertiesPtr pBand1VInsideHBorder
357 = std::make_shared<oox::drawingml::LineProperties>();
358 oox::drawingml::LinePropertiesPtr pBand1VInsideVBorder
359 = std::make_shared<oox::drawingml::LineProperties>();
361 oox::drawingml::LinePropertiesPtr pBand2HLeftBorder
362 = std::make_shared<oox::drawingml::LineProperties>();
363 oox::drawingml::LinePropertiesPtr pBand2HRightBorder
364 = std::make_shared<oox::drawingml::LineProperties>();
365 oox::drawingml::LinePropertiesPtr pBand2HTopBorder
366 = std::make_shared<oox::drawingml::LineProperties>();
367 oox::drawingml::LinePropertiesPtr pBand2HBottomBorder
368 = std::make_shared<oox::drawingml::LineProperties>();
369 oox::drawingml::LinePropertiesPtr pBand2HInsideHBorder
370 = std::make_shared<oox::drawingml::LineProperties>();
371 oox::drawingml::LinePropertiesPtr pBand2HInsideVBorder
372 = std::make_shared<oox::drawingml::LineProperties>();
374 oox::drawingml::LinePropertiesPtr pBand2VLeftBorder
375 = std::make_shared<oox::drawingml::LineProperties>();
376 oox::drawingml::LinePropertiesPtr pBand2VRightBorder
377 = std::make_shared<oox::drawingml::LineProperties>();
378 oox::drawingml::LinePropertiesPtr pBand2VTopBorder
379 = std::make_shared<oox::drawingml::LineProperties>();
380 oox::drawingml::LinePropertiesPtr pBand2VBottomBorder
381 = std::make_shared<oox::drawingml::LineProperties>();
382 oox::drawingml::LinePropertiesPtr pBand2VInsideHBorder
383 = std::make_shared<oox::drawingml::LineProperties>();
384 oox::drawingml::LinePropertiesPtr pBand2VInsideVBorder
385 = std::make_shared<oox::drawingml::LineProperties>();
387 // End table border line properties definitions for table parts
389 // Start to set fill types.
391 pTblBgFillProperties->moFillType = XML_solidFill;
392 pWholeTblFillProperties->moFillType = XML_solidFill;
393 pFirstRowFillProperties->moFillType = XML_solidFill;
394 pFirstColFillProperties->moFillType = XML_solidFill;
395 pLastRowFillProperties->moFillType = XML_solidFill;
396 pLastColFillProperties->moFillType = XML_solidFill;
397 pBand1HFillProperties->moFillType = XML_solidFill;
398 pBand1VFillProperties->moFillType = XML_solidFill;
399 pBand2HFillProperties->moFillType = XML_solidFill;
400 pBand2VFillProperties->moFillType = XML_solidFill;
402 // End to set fill types.
404 // Define common properties.
406 pWholeTblLeftBorder->moLineWidth = 12700;
407 pWholeTblRightBorder->moLineWidth = 12700;
408 pWholeTblTopBorder->moLineWidth = 12700;
409 pWholeTblBottomBorder->moLineWidth = 12700;
410 pWholeTblInsideHBorder->moLineWidth = 12700;
411 pWholeTblInsideVBorder->moLineWidth = 12700;
412 pFirstRowBottomBorder->moLineWidth = 12700;
414 pWholeTblLeftBorder->moPresetDash = XML_solid;
415 pWholeTblRightBorder->moPresetDash = XML_solid;
416 pWholeTblTopBorder->moPresetDash = XML_solid;
417 pWholeTblBottomBorder->moPresetDash = XML_solid;
418 pWholeTblInsideHBorder->moPresetDash = XML_solid;
419 pWholeTblInsideVBorder->moPresetDash = XML_solid;
420 pFirstRowBottomBorder->moPresetDash = XML_solid;
422 // Start to handle all style groups.
424 auto it = mStyleIdMap.find(styleId);
425 OUString style_name = it->second.first;
426 OUString accent_name = it->second.second;
428 if (style_name == "Themed-Style-1")
430 if (!accent_name.isEmpty())
432 setBorderLineType(pWholeTblLeftBorder, XML_solidFill);
433 setBorderLineType(pWholeTblRightBorder, XML_solidFill);
434 setBorderLineType(pWholeTblTopBorder, XML_solidFill);
435 setBorderLineType(pWholeTblBottomBorder, XML_solidFill);
436 setBorderLineType(pWholeTblInsideHBorder, XML_solidFill);
437 setBorderLineType(pWholeTblInsideVBorder, XML_solidFill);
438 setBorderLineType(pFirstRowLeftBorder, XML_solidFill);
439 setBorderLineType(pFirstRowRightBorder, XML_solidFill);
440 setBorderLineType(pFirstRowTopBorder, XML_solidFill);
441 setBorderLineType(pFirstRowBottomBorder, XML_solidFill);
442 setBorderLineType(pLastRowLeftBorder, XML_solidFill);
443 setBorderLineType(pLastRowRightBorder, XML_solidFill);
444 setBorderLineType(pLastRowTopBorder, XML_solidFill);
445 setBorderLineType(pLastRowBottomBorder, XML_solidFill);
446 setBorderLineType(pFirstColLeftBorder, XML_solidFill);
447 setBorderLineType(pFirstColRightBorder, XML_solidFill);
448 setBorderLineType(pFirstColTopBorder, XML_solidFill);
449 setBorderLineType(pFirstColBottomBorder, XML_solidFill);
450 setBorderLineType(pFirstColInsideHBorder, XML_solidFill);
451 setBorderLineType(pLastColLeftBorder, XML_solidFill);
452 setBorderLineType(pLastColRightBorder, XML_solidFill);
453 setBorderLineType(pLastColTopBorder, XML_solidFill);
454 setBorderLineType(pLastColBottomBorder, XML_solidFill);
455 setBorderLineType(pLastColInsideHBorder, XML_solidFill);
457 sal_Int32 accent_val = resolveToken(mStyleIdMap.find(styleId)->second.second);
459 wholeTblTextColor.setSchemeClr(XML_dk1);
460 firstRowTextColor.setSchemeClr(XML_lt1);
462 pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
463 pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
464 pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
465 pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
466 pWholeTblInsideHBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
467 pWholeTblInsideVBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
469 pFirstRowLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
470 pFirstRowRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
471 pFirstRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
472 pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
473 pFirstRowFillProperties->maFillColor.setSchemeClr(accent_val);
475 pLastRowLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
476 pLastRowRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
477 pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
478 pLastRowBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
480 pFirstColLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
481 pFirstColRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
482 pFirstColTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
483 pFirstColBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
484 pFirstColInsideHBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
486 pLastColLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
487 pLastColRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
488 pLastColTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
489 pLastColBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
490 pLastColInsideHBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
492 pBand1HFillProperties->maFillColor.setSchemeClr(accent_val);
493 pBand1VFillProperties->maFillColor.setSchemeClr(accent_val);
495 else
497 wholeTblTextColor.setSchemeClr(XML_tx1);
500 pBand1HFillProperties->maFillColor.addTransformation(XML_alpha, 40000);
501 pBand1VFillProperties->maFillColor.addTransformation(XML_alpha, 40000);
503 else if (style_name == "Themed-Style-2")
505 setBorderLineType(pWholeTblLeftBorder, XML_solidFill);
506 setBorderLineType(pWholeTblRightBorder, XML_solidFill);
507 setBorderLineType(pWholeTblTopBorder, XML_solidFill);
508 setBorderLineType(pWholeTblBottomBorder, XML_solidFill);
510 sal_Int32 accent_val;
512 if (!accent_name.isEmpty())
514 setBorderLineType(pFirstRowBottomBorder, XML_solidFill);
515 setBorderLineType(pLastRowTopBorder, XML_solidFill);
516 setBorderLineType(pFirstColRightBorder, XML_solidFill);
517 setBorderLineType(pLastColLeftBorder, XML_solidFill);
519 wholeTblTextColor.setSchemeClr(XML_lt1);
520 firstRowTextColor.setSchemeClr(XML_lt1);
522 accent_val = resolveToken(mStyleIdMap.find(styleId)->second.second);
524 pTblBgFillProperties->maFillColor.setSchemeClr(accent_val);
525 pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
526 pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
527 pFirstColRightBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
528 pLastColLeftBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
529 pBand1HFillProperties->maFillColor.setSchemeClr(XML_lt1);
530 pBand1VFillProperties->maFillColor.setSchemeClr(XML_lt1);
532 else
534 setBorderLineType(pWholeTblInsideVBorder, XML_solidFill);
535 setBorderLineType(pWholeTblInsideHBorder, XML_solidFill);
537 accent_val = XML_tx1;
539 pWholeTblInsideVBorder->maLineFill.maFillColor.setSchemeClr(XML_tx1);
540 pWholeTblInsideHBorder->maLineFill.maFillColor.setSchemeClr(XML_tx1);
543 pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
544 pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
545 pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
546 pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
548 pBand1HFillProperties->maFillColor.addTransformation(XML_alpha, 20000);
549 pBand1VFillProperties->maFillColor.addTransformation(XML_alpha, 20000);
550 pWholeTblLeftBorder->maLineFill.maFillColor.addTransformation(XML_tint, 50000);
551 pWholeTblRightBorder->maLineFill.maFillColor.addTransformation(XML_tint, 50000);
552 pWholeTblTopBorder->maLineFill.maFillColor.addTransformation(XML_tint, 50000);
553 pWholeTblBottomBorder->maLineFill.maFillColor.addTransformation(XML_tint, 50000);
555 else if (style_name == "Light-Style-1")
557 setBorderLineType(pWholeTblTopBorder, XML_solidFill);
558 setBorderLineType(pWholeTblBottomBorder, XML_solidFill);
559 setBorderLineType(pFirstRowBottomBorder, XML_solidFill);
560 setBorderLineType(pLastRowTopBorder, XML_solidFill);
562 bFirstRowTextBoldStyle = true;
563 bFirstColTextBoldStyle = true;
564 bLastColTextBoldStyle = true;
566 wholeTblTextColor.setSchemeClr(XML_tx1);
567 firstRowTextColor.setSchemeClr(XML_tx1);
568 lastColTextColor.setSchemeClr(XML_tx1);
570 sal_Int32 accent_val;
572 if (!accent_name.isEmpty())
573 accent_val = resolveToken(mStyleIdMap.find(styleId)->second.second);
574 else
575 accent_val = XML_tx1;
577 pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
578 pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
579 pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
580 pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
582 pBand1HFillProperties->maFillColor.setSchemeClr(accent_val);
583 pBand1VFillProperties->maFillColor.setSchemeClr(accent_val);
585 pBand1HFillProperties->maFillColor.addTransformation(XML_alpha, 20000);
586 pBand1VFillProperties->maFillColor.addTransformation(XML_alpha, 20000);
588 else if (style_name == "Light-Style-2")
590 setBorderLineType(pWholeTblLeftBorder, XML_solidFill);
591 setBorderLineType(pWholeTblRightBorder, XML_solidFill);
592 setBorderLineType(pWholeTblTopBorder, XML_solidFill);
593 setBorderLineType(pWholeTblBottomBorder, XML_solidFill);
594 setBorderLineType(pLastRowTopBorder, XML_solidFill);
595 setBorderLineType(pBand1HTopBorder, XML_solidFill);
596 setBorderLineType(pBand1HBottomBorder, XML_solidFill);
597 setBorderLineType(pBand1VLeftBorder, XML_solidFill);
598 setBorderLineType(pBand1VRightBorder, XML_solidFill);
599 setBorderLineType(pBand2VLeftBorder, XML_solidFill);
600 setBorderLineType(pBand2VRightBorder, XML_solidFill);
602 wholeTblTextColor.setSchemeClr(XML_tx1);
603 firstRowTextColor.setSchemeClr(XML_bg1);
605 sal_Int32 accent_val;
607 if (!accent_name.isEmpty())
608 accent_val = resolveToken(mStyleIdMap.find(styleId)->second.second);
609 else
610 accent_val = XML_tx1;
612 pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
613 pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
614 pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
615 pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
617 pFirstRowFillProperties->maFillColor.setSchemeClr(accent_val);
618 pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
620 pBand1HTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
621 pBand1HBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
623 pBand1VLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
624 pBand1VRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
626 pBand2VLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
627 pBand2VRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
629 else if (style_name == "Light-Style-3")
631 setBorderLineType(pWholeTblLeftBorder, XML_solidFill);
632 setBorderLineType(pWholeTblRightBorder, XML_solidFill);
633 setBorderLineType(pWholeTblTopBorder, XML_solidFill);
634 setBorderLineType(pWholeTblBottomBorder, XML_solidFill);
635 setBorderLineType(pWholeTblInsideHBorder, XML_solidFill);
636 setBorderLineType(pWholeTblInsideVBorder, XML_solidFill);
637 setBorderLineType(pFirstRowBottomBorder, XML_solidFill);
638 setBorderLineType(pLastRowTopBorder, XML_solidFill);
640 wholeTblTextColor.setSchemeClr(XML_tx1);
642 sal_Int32 accent_val;
644 if (!accent_name.isEmpty())
645 accent_val = resolveToken(mStyleIdMap.find(styleId)->second.second);
646 else
647 accent_val = XML_tx1;
649 pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
650 pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
651 pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
652 pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
653 pWholeTblInsideHBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
654 pWholeTblInsideVBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
656 firstRowTextColor.setSchemeClr(accent_val);
657 pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
658 pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
659 pBand1HFillProperties->maFillColor.setSchemeClr(accent_val);
660 pBand1VFillProperties->maFillColor.setSchemeClr(accent_val);
662 pBand1HFillProperties->maFillColor.addTransformation(XML_alpha, 20000);
663 pBand1VFillProperties->maFillColor.addTransformation(XML_alpha, 20000);
665 else if (style_name == "Medium-Style-1")
667 setBorderLineType(pWholeTblLeftBorder, XML_solidFill);
668 setBorderLineType(pWholeTblRightBorder, XML_solidFill);
669 setBorderLineType(pWholeTblTopBorder, XML_solidFill);
670 setBorderLineType(pWholeTblBottomBorder, XML_solidFill);
671 setBorderLineType(pWholeTblInsideHBorder, XML_solidFill);
672 setBorderLineType(pLastRowTopBorder, XML_solidFill);
674 wholeTblTextColor.setSchemeClr(XML_dk1);
675 firstRowTextColor.setSchemeClr(XML_lt1);
676 pWholeTblFillProperties->maFillColor.setSchemeClr(XML_lt1);
677 pLastRowFillProperties->maFillColor.setSchemeClr(XML_lt1);
679 sal_Int32 accent_val;
681 if (!accent_name.isEmpty())
682 accent_val = resolveToken(mStyleIdMap.find(styleId)->second.second);
683 else
684 accent_val = XML_dk1;
686 pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
687 pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
688 pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
689 pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
690 pWholeTblInsideHBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
692 pFirstRowFillProperties->maFillColor.setSchemeClr(accent_val);
693 pBand1HFillProperties->maFillColor.setSchemeClr(accent_val);
694 pBand1VFillProperties->maFillColor.setSchemeClr(accent_val);
696 pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
698 pBand1HFillProperties->maFillColor.addTransformation(XML_tint, 20000);
699 pBand1VFillProperties->maFillColor.addTransformation(XML_tint, 20000);
701 else if (style_name == "Medium-Style-2")
703 setBorderLineType(pFirstRowBottomBorder, XML_solidFill);
704 setBorderLineType(pLastRowTopBorder, XML_solidFill);
705 setBorderLineType(pWholeTblLeftBorder, XML_solidFill);
706 setBorderLineType(pWholeTblRightBorder, XML_solidFill);
707 setBorderLineType(pWholeTblTopBorder, XML_solidFill);
708 setBorderLineType(pWholeTblBottomBorder, XML_solidFill);
709 setBorderLineType(pWholeTblInsideHBorder, XML_solidFill);
710 setBorderLineType(pWholeTblInsideVBorder, XML_solidFill);
712 wholeTblTextColor.setSchemeClr(XML_dk1);
713 firstRowTextColor.setSchemeClr(XML_lt1);
714 lastRowTextColor.setSchemeClr(XML_lt1);
715 firstColTextColor.setSchemeClr(XML_lt1);
716 lastColTextColor.setSchemeClr(XML_lt1);
717 pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
718 pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
720 pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
721 pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
722 pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
723 pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
724 pWholeTblInsideHBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
725 pWholeTblInsideVBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
727 sal_Int32 accent_val;
729 if (!accent_name.isEmpty())
730 accent_val = resolveToken(mStyleIdMap.find(styleId)->second.second);
731 else
732 accent_val = XML_dk1;
734 pWholeTblFillProperties->maFillColor.setSchemeClr(accent_val);
735 pFirstRowFillProperties->maFillColor.setSchemeClr(accent_val);
736 pLastRowFillProperties->maFillColor.setSchemeClr(accent_val);
737 pFirstColFillProperties->maFillColor.setSchemeClr(accent_val);
738 pLastColFillProperties->maFillColor.setSchemeClr(accent_val);
739 pBand1HFillProperties->maFillColor.setSchemeClr(accent_val);
740 pBand1VFillProperties->maFillColor.setSchemeClr(accent_val);
742 pWholeTblFillProperties->maFillColor.addTransformation(XML_tint, 20000);
743 pBand1HFillProperties->maFillColor.addTransformation(XML_tint, 40000);
744 pBand1VFillProperties->maFillColor.addTransformation(XML_tint, 40000);
746 else if (style_name == "Medium-Style-3")
748 setBorderLineType(pWholeTblTopBorder, XML_solidFill);
749 setBorderLineType(pWholeTblBottomBorder, XML_solidFill);
750 setBorderLineType(pFirstRowBottomBorder, XML_solidFill);
751 setBorderLineType(pLastRowTopBorder, XML_solidFill);
753 wholeTblTextColor.setSchemeClr(XML_dk1);
754 firstColTextColor.setSchemeClr(XML_lt1);
755 lastColTextColor.setSchemeClr(XML_lt1);
756 pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1);
757 pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1);
758 pWholeTblFillProperties->maFillColor.setSchemeClr(XML_lt1);
759 pLastRowFillProperties->maFillColor.setSchemeClr(XML_lt1);
760 pBand1HFillProperties->maFillColor.setSchemeClr(XML_dk1);
761 pBand1VFillProperties->maFillColor.setSchemeClr(XML_dk1);
763 firstRowTextColor.setSchemeClr(XML_lt1);
764 pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1);
765 pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1);
767 sal_Int32 accent_val;
769 if (!accent_name.isEmpty())
770 accent_val = resolveToken(mStyleIdMap.find(styleId)->second.second);
771 else
772 accent_val = XML_dk1;
774 pFirstRowFillProperties->maFillColor.setSchemeClr(accent_val);
775 pFirstColFillProperties->maFillColor.setSchemeClr(accent_val);
776 pLastColFillProperties->maFillColor.setSchemeClr(accent_val);
778 pBand1HFillProperties->maFillColor.addTransformation(XML_tint, 20000);
779 pBand1VFillProperties->maFillColor.addTransformation(XML_tint, 20000);
781 else if (style_name == "Medium-Style-4")
783 setBorderLineType(pWholeTblLeftBorder, XML_solidFill);
784 setBorderLineType(pWholeTblRightBorder, XML_solidFill);
785 setBorderLineType(pWholeTblTopBorder, XML_solidFill);
786 setBorderLineType(pWholeTblBottomBorder, XML_solidFill);
787 setBorderLineType(pWholeTblInsideHBorder, XML_solidFill);
788 setBorderLineType(pWholeTblInsideVBorder, XML_solidFill);
790 wholeTblTextColor.setSchemeClr(XML_dk1);
791 pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1);
792 pLastRowFillProperties->maFillColor.setSchemeClr(XML_dk1);
794 sal_Int32 accent_val;
796 if (!accent_name.isEmpty())
797 accent_val = resolveToken(mStyleIdMap.find(styleId)->second.second);
798 else
799 accent_val = XML_dk1;
801 pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
802 pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
803 pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
804 pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
805 pWholeTblInsideHBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
806 pWholeTblInsideVBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
807 pWholeTblFillProperties->maFillColor.setSchemeClr(accent_val);
809 firstRowTextColor.setSchemeClr(accent_val);
810 pFirstRowFillProperties->maFillColor.setSchemeClr(accent_val);
811 pBand1HFillProperties->maFillColor.setSchemeClr(accent_val);
812 pBand1VFillProperties->maFillColor.setSchemeClr(accent_val);
814 pFirstRowFillProperties->maFillColor.addTransformation(XML_tint, 20000);
815 pLastRowFillProperties->maFillColor.addTransformation(XML_tint, 20000);
816 pWholeTblFillProperties->maFillColor.addTransformation(XML_tint, 20000);
817 pBand1HFillProperties->maFillColor.addTransformation(XML_tint, 40000);
818 pBand1VFillProperties->maFillColor.addTransformation(XML_tint, 40000);
820 else if (style_name == "Dark-Style-1")
822 setBorderLineType(pFirstRowBottomBorder, XML_solidFill);
823 setBorderLineType(pFirstColRightBorder, XML_solidFill);
824 setBorderLineType(pLastColLeftBorder, XML_solidFill);
825 setBorderLineType(pLastRowTopBorder, XML_solidFill);
827 sal_Int32 transform_val;
828 wholeTblTextColor.setSchemeClr(XML_dk1);
829 firstRowTextColor.setSchemeClr(XML_lt1);
830 pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
831 pFirstColRightBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
832 pLastColLeftBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
833 pFirstRowFillProperties->maFillColor.setSchemeClr(XML_dk1);
834 pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
836 sal_Int32 accent_val;
838 if (!accent_name.isEmpty())
840 accent_val = resolveToken(mStyleIdMap.find(styleId)->second.second);
841 transform_val = XML_shade;
843 else
845 accent_val = XML_dk1;
846 transform_val = XML_tint;
849 pWholeTblFillProperties->maFillColor.setSchemeClr(accent_val);
850 pLastRowFillProperties->maFillColor.setSchemeClr(accent_val);
851 pFirstColFillProperties->maFillColor.setSchemeClr(accent_val);
852 pLastColFillProperties->maFillColor.setSchemeClr(accent_val);
853 pBand1HFillProperties->maFillColor.setSchemeClr(accent_val);
854 pBand1VFillProperties->maFillColor.setSchemeClr(accent_val);
856 pWholeTblFillProperties->maFillColor.addTransformation(transform_val, 20000);
857 pBand1HFillProperties->maFillColor.addTransformation(transform_val, 40000);
858 pBand1VFillProperties->maFillColor.addTransformation(transform_val, 40000);
859 pLastColFillProperties->maFillColor.addTransformation(transform_val, 60000);
860 pFirstColFillProperties->maFillColor.addTransformation(transform_val, 60000);
862 else if (style_name == "Dark-Style-2")
864 setBorderLineType(pLastRowTopBorder, XML_solidFill);
866 wholeTblTextColor.setSchemeClr(XML_dk1);
867 firstRowTextColor.setSchemeClr(XML_lt1);
869 pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1);
871 if (accent_name.isEmpty())
872 pFirstRowFillProperties->maFillColor.setSchemeClr(XML_dk1);
873 else if (accent_name == "Accent1")
874 pFirstRowFillProperties->maFillColor.setSchemeClr(XML_accent2);
875 else if (accent_name == "Accent3")
876 pFirstRowFillProperties->maFillColor.setSchemeClr(XML_accent4);
877 else if (accent_name == "Accent5")
878 pFirstRowFillProperties->maFillColor.setSchemeClr(XML_accent6);
880 sal_Int32 accent_val;
882 if (!accent_name.isEmpty())
883 accent_val = resolveToken(mStyleIdMap.find(styleId)->second.second);
884 else
885 accent_val = XML_dk1;
887 pWholeTblFillProperties->maFillColor.setSchemeClr(accent_val);
888 pLastRowFillProperties->maFillColor.setSchemeClr(accent_val);
889 pBand1HFillProperties->maFillColor.setSchemeClr(accent_val);
890 pBand1VFillProperties->maFillColor.setSchemeClr(accent_val);
892 pWholeTblFillProperties->maFillColor.addTransformation(XML_tint, 20000);
893 pBand1HFillProperties->maFillColor.addTransformation(XML_tint, 40000);
894 pBand1VFillProperties->maFillColor.addTransformation(XML_tint, 40000);
895 pLastRowFillProperties->maFillColor.addTransformation(XML_tint, 20000);
898 // End to handle all style groups.
900 // Create a TableStyle from handled properties.
901 pTableStyle->getStyleId() = styleId;
902 pTableStyle->getStyleName() = style_name;
904 pTableStyle->getFirstRow().getTextBoldStyle() = bFirstRowTextBoldStyle;
905 pTableStyle->getFirstCol().getTextBoldStyle() = bFirstColTextBoldStyle;
906 pTableStyle->getLastCol().getTextBoldStyle() = bLastColTextBoldStyle;
908 pTableStyle->getWholeTbl().getTextColor() = std::move(wholeTblTextColor);
909 pTableStyle->getFirstRow().getTextColor() = std::move(firstRowTextColor);
910 pTableStyle->getFirstCol().getTextColor() = std::move(firstColTextColor);
911 pTableStyle->getLastRow().getTextColor() = std::move(lastRowTextColor);
912 pTableStyle->getLastCol().getTextColor() = std::move(lastColTextColor);
914 pTableStyle->getBand1H().getTextColor() = ::oox::drawingml::Color(); //band1HTextColor
915 pTableStyle->getBand1V().getTextColor() = ::oox::drawingml::Color(); //band1VTextColor
916 pTableStyle->getBand2H().getTextColor() = ::oox::drawingml::Color(); //band2HTextColor
917 pTableStyle->getBand2V().getTextColor() = ::oox::drawingml::Color(); //band2VTextColor
919 pTableStyle->getBackgroundFillProperties() = std::move(pTblBgFillProperties);
920 pTableStyle->getWholeTbl().getFillProperties() = std::move(pWholeTblFillProperties);
921 pTableStyle->getFirstRow().getFillProperties() = std::move(pFirstRowFillProperties);
922 pTableStyle->getFirstCol().getFillProperties() = std::move(pFirstColFillProperties);
923 pTableStyle->getLastRow().getFillProperties() = std::move(pLastRowFillProperties);
924 pTableStyle->getLastCol().getFillProperties() = std::move(pLastColFillProperties);
925 pTableStyle->getBand1H().getFillProperties() = std::move(pBand1HFillProperties);
926 pTableStyle->getBand1V().getFillProperties() = std::move(pBand1VFillProperties);
927 pTableStyle->getBand2H().getFillProperties() = std::move(pBand2HFillProperties);
928 pTableStyle->getBand2V().getFillProperties() = std::move(pBand2VFillProperties);
930 insertBorderLine(pTableStyle->getWholeTbl(), XML_left, pWholeTblLeftBorder);
931 insertBorderLine(pTableStyle->getWholeTbl(), XML_right, pWholeTblRightBorder);
932 insertBorderLine(pTableStyle->getWholeTbl(), XML_top, pWholeTblTopBorder);
933 insertBorderLine(pTableStyle->getWholeTbl(), XML_bottom, pWholeTblBottomBorder);
934 insertBorderLine(pTableStyle->getWholeTbl(), XML_insideV, pWholeTblInsideVBorder);
935 insertBorderLine(pTableStyle->getWholeTbl(), XML_insideH, pWholeTblInsideHBorder);
937 insertBorderLine(pTableStyle->getFirstRow(), XML_left, pFirstRowLeftBorder);
938 insertBorderLine(pTableStyle->getFirstRow(), XML_right, pFirstRowRightBorder);
939 insertBorderLine(pTableStyle->getFirstRow(), XML_top, pFirstRowTopBorder);
940 insertBorderLine(pTableStyle->getFirstRow(), XML_bottom, pFirstRowBottomBorder);
941 insertBorderLine(pTableStyle->getFirstRow(), XML_insideV, pFirstRowInsideVBorder);
942 insertBorderLine(pTableStyle->getFirstRow(), XML_insideH, pFirstRowInsideHBorder);
944 insertBorderLine(pTableStyle->getFirstCol(), XML_left, pFirstColLeftBorder);
945 insertBorderLine(pTableStyle->getFirstCol(), XML_right, pFirstColRightBorder);
946 insertBorderLine(pTableStyle->getFirstCol(), XML_top, pFirstColTopBorder);
947 insertBorderLine(pTableStyle->getFirstCol(), XML_bottom, pFirstColBottomBorder);
948 insertBorderLine(pTableStyle->getFirstCol(), XML_insideV, pFirstColInsideVBorder);
949 insertBorderLine(pTableStyle->getFirstCol(), XML_insideH, pFirstColInsideHBorder);
951 insertBorderLine(pTableStyle->getLastRow(), XML_left, pLastRowLeftBorder);
952 insertBorderLine(pTableStyle->getLastRow(), XML_right, pLastRowRightBorder);
953 insertBorderLine(pTableStyle->getLastRow(), XML_top, pLastRowTopBorder);
954 insertBorderLine(pTableStyle->getLastRow(), XML_bottom, pLastRowBottomBorder);
955 insertBorderLine(pTableStyle->getLastRow(), XML_insideV, pLastRowInsideVBorder);
956 insertBorderLine(pTableStyle->getLastRow(), XML_insideH, pLastRowInsideHBorder);
958 insertBorderLine(pTableStyle->getLastCol(), XML_left, pLastColLeftBorder);
959 insertBorderLine(pTableStyle->getLastCol(), XML_right, pLastColRightBorder);
960 insertBorderLine(pTableStyle->getLastCol(), XML_top, pLastColTopBorder);
961 insertBorderLine(pTableStyle->getLastCol(), XML_bottom, pLastColBottomBorder);
962 insertBorderLine(pTableStyle->getLastCol(), XML_insideV, pLastColInsideVBorder);
963 insertBorderLine(pTableStyle->getLastCol(), XML_insideH, pLastColInsideHBorder);
965 insertBorderLine(pTableStyle->getBand1H(), XML_left, pBand1HLeftBorder);
966 insertBorderLine(pTableStyle->getBand1H(), XML_right, pBand1HRightBorder);
967 insertBorderLine(pTableStyle->getBand1H(), XML_top, pBand1HTopBorder);
968 insertBorderLine(pTableStyle->getBand1H(), XML_bottom, pBand1HBottomBorder);
969 insertBorderLine(pTableStyle->getBand1H(), XML_insideV, pBand1HInsideVBorder);
970 insertBorderLine(pTableStyle->getBand1H(), XML_insideH, pBand1HInsideHBorder);
972 insertBorderLine(pTableStyle->getBand1V(), XML_left, pBand1VLeftBorder);
973 insertBorderLine(pTableStyle->getBand1V(), XML_right, pBand1VRightBorder);
974 insertBorderLine(pTableStyle->getBand1V(), XML_top, pBand1VTopBorder);
975 insertBorderLine(pTableStyle->getBand1V(), XML_bottom, pBand1VBottomBorder);
976 insertBorderLine(pTableStyle->getBand1V(), XML_insideV, pBand1VInsideVBorder);
977 insertBorderLine(pTableStyle->getBand1V(), XML_insideH, pBand1VInsideHBorder);
979 insertBorderLine(pTableStyle->getBand2H(), XML_left, pBand2HLeftBorder);
980 insertBorderLine(pTableStyle->getBand2H(), XML_right, pBand2HRightBorder);
981 insertBorderLine(pTableStyle->getBand2H(), XML_top, pBand2HTopBorder);
982 insertBorderLine(pTableStyle->getBand2H(), XML_bottom, pBand2HBottomBorder);
983 insertBorderLine(pTableStyle->getBand2H(), XML_insideV, pBand2HInsideVBorder);
984 insertBorderLine(pTableStyle->getBand2H(), XML_insideH, pBand2HInsideHBorder);
986 insertBorderLine(pTableStyle->getBand2V(), XML_left, pBand2VLeftBorder);
987 insertBorderLine(pTableStyle->getBand2V(), XML_right, pBand2VRightBorder);
988 insertBorderLine(pTableStyle->getBand2V(), XML_top, pBand2VTopBorder);
989 insertBorderLine(pTableStyle->getBand2V(), XML_bottom, pBand2VBottomBorder);
990 insertBorderLine(pTableStyle->getBand2V(), XML_insideV, pBand2VInsideVBorder);
991 insertBorderLine(pTableStyle->getBand2V(), XML_insideH, pBand2VInsideHBorder);
993 return pTableStyle;
996 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */