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