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