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  sal_Int32 accent_val = tokens[mStyleIdMap[styleId].second];
466 
467  if (style_name == "Themed-Style-1")
468  {
469  if (!accent_name.isEmpty())
470  {
471  accent_val = tokens[mStyleIdMap[styleId].second];
472 
473  wholeTblTextColor.setSchemeClr(XML_dk1);
474  firstRowTextColor.setSchemeClr(XML_lt1);
475 
476  pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
477  pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
478  pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
479  pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
480  pWholeTblInsideHBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
481  pWholeTblInsideVBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
482 
483  pFirstRowLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
484  pFirstRowRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
485  pFirstRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
486  pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
487  pFirstRowFillProperties->maFillColor.setSchemeClr(accent_val);
488 
489  pLastRowLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
490  pLastRowRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
491  pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
492  pLastRowBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
493 
494  pFirstColLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
495  pFirstColRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
496  pFirstColTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
497  pFirstColBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
498  pFirstColInsideHBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
499 
500  pLastColLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
501  pLastColRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
502  pLastColTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
503  pLastColBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
504  pLastColInsideHBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
505 
506  pBand1HFillProperties->maFillColor.setSchemeClr(accent_val);
507  pBand1VFillProperties->maFillColor.setSchemeClr(accent_val);
508  }
509  else
510  {
511  wholeTblTextColor.setSchemeClr(XML_tx1);
512  }
513 
514  pBand1HFillProperties->maFillColor.addTransformation(XML_alpha, 40000);
515  pBand1VFillProperties->maFillColor.addTransformation(XML_alpha, 40000);
516  }
517  else if (style_name == "Themed-Style-2")
518  {
519  if (!accent_name.isEmpty())
520  {
521  wholeTblTextColor.setSchemeClr(XML_lt1);
522  firstRowTextColor.setSchemeClr(XML_lt1);
523 
524  accent_val = tokens[mStyleIdMap[styleId].second];
525 
526  pTblBgFillProperties->maFillColor.setSchemeClr(accent_val);
527  pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
528  pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
529  pFirstColRightBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
530  pLastColLeftBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
531  pBand1HFillProperties->maFillColor.setSchemeClr(XML_lt1);
532  pBand1VFillProperties->maFillColor.setSchemeClr(XML_lt1);
533  }
534  else
535  {
536  accent_val = XML_tx1;
537 
538  pWholeTblInsideVBorder->maLineFill.maFillColor.setSchemeClr(XML_tx1);
539  pWholeTblInsideHBorder->maLineFill.maFillColor.setSchemeClr(XML_tx1);
540  }
541 
542  pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
543  pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
544  pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
545  pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
546 
547  pBand1HFillProperties->maFillColor.addTransformation(XML_alpha, 20000);
548  pBand1VFillProperties->maFillColor.addTransformation(XML_alpha, 20000);
549  pWholeTblLeftBorder->maLineFill.maFillColor.addTransformation(XML_tint, 50000);
550  pWholeTblRightBorder->maLineFill.maFillColor.addTransformation(XML_tint, 50000);
551  pWholeTblTopBorder->maLineFill.maFillColor.addTransformation(XML_tint, 50000);
552  pWholeTblBottomBorder->maLineFill.maFillColor.addTransformation(XML_tint, 50000);
553  }
554  else if (style_name == "Light-Style-1")
555  {
556  wholeTblTextColor.setSchemeClr(XML_tx1);
557 
558  if (!accent_name.isEmpty())
559  accent_val = tokens[mStyleIdMap[styleId].second];
560  else
561  accent_val = XML_tx1;
562 
563  pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
564  pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
565  pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
566  pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
567 
568  firstRowTextColor.setSchemeClr(accent_val);
569 
570  pBand1HFillProperties->maFillColor.setSchemeClr(accent_val);
571  pBand1VFillProperties->maFillColor.setSchemeClr(accent_val);
572 
573  pBand1HFillProperties->maFillColor.addTransformation(XML_alpha, 20000);
574  pBand1VFillProperties->maFillColor.addTransformation(XML_alpha, 20000);
575  }
576  else if (style_name == "Light-Style-2")
577  {
578  wholeTblTextColor.setSchemeClr(XML_tx1);
579  firstRowTextColor.setSchemeClr(XML_bg1);
580 
581  if (!accent_name.isEmpty())
582  accent_val = tokens[mStyleIdMap[styleId].second];
583  else
584  accent_val = XML_tx1;
585 
586  pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
587  pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
588  pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
589  pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
590 
591  pFirstRowFillProperties->maFillColor.setSchemeClr(accent_val);
592  pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
593 
594  pBand1HTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
595  pBand1HBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
596 
597  pBand1VLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
598  pBand1VRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
599 
600  pBand2VLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
601  pBand2VRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
602  }
603  else if (style_name == "Light-Style-3")
604  {
605  wholeTblTextColor.setSchemeClr(XML_tx1);
606 
607  if (!accent_name.isEmpty())
608  accent_val = tokens[mStyleIdMap[styleId].second];
609  else
610  accent_val = XML_tx1;
611 
612  pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
613  pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
614  pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
615  pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
616  pWholeTblInsideHBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
617  pWholeTblInsideVBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
618 
619  firstRowTextColor.setSchemeClr(accent_val);
620  pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
621  pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
622  pBand1HFillProperties->maFillColor.setSchemeClr(accent_val);
623  pBand1VFillProperties->maFillColor.setSchemeClr(accent_val);
624 
625  pBand1HFillProperties->maFillColor.addTransformation(XML_alpha, 20000);
626  pBand1VFillProperties->maFillColor.addTransformation(XML_alpha, 20000);
627  }
628  else if (style_name == "Medium-Style-1")
629  {
630  wholeTblTextColor.setSchemeClr(XML_dk1);
631  firstRowTextColor.setSchemeClr(XML_lt1);
632  pWholeTblFillProperties->maFillColor.setSchemeClr(XML_lt1);
633  pLastRowFillProperties->maFillColor.setSchemeClr(XML_lt1);
634 
635  if (!accent_name.isEmpty())
636  accent_val = tokens[mStyleIdMap[styleId].second];
637  else
638  accent_val = XML_dk1;
639 
640  pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
641  pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
642  pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
643  pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
644  pWholeTblInsideHBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
645 
646  pFirstRowFillProperties->maFillColor.setSchemeClr(accent_val);
647  pBand1HFillProperties->maFillColor.setSchemeClr(accent_val);
648  pBand1VFillProperties->maFillColor.setSchemeClr(accent_val);
649 
650  pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
651 
652  pBand1HFillProperties->maFillColor.addTransformation(XML_tint, 20000);
653  pBand1VFillProperties->maFillColor.addTransformation(XML_tint, 20000);
654  }
655  else if (style_name == "Medium-Style-2")
656  {
657  wholeTblTextColor.setSchemeClr(XML_dk1);
658  firstRowTextColor.setSchemeClr(XML_lt1);
659  lastRowTextColor.setSchemeClr(XML_lt1);
660  firstColTextColor.setSchemeClr(XML_lt1);
661  lastColTextColor.setSchemeClr(XML_lt1);
662  pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
663  pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
664 
665  pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
666  pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
667  pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
668  pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
669  pWholeTblInsideHBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
670  pWholeTblInsideVBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
671 
672  if (!accent_name.isEmpty())
673  accent_val = tokens[mStyleIdMap[styleId].second];
674  else
675  accent_val = XML_dk1;
676 
677  pWholeTblFillProperties->maFillColor.setSchemeClr(accent_val);
678  pFirstRowFillProperties->maFillColor.setSchemeClr(accent_val);
679  pLastRowFillProperties->maFillColor.setSchemeClr(accent_val);
680  pFirstColFillProperties->maFillColor.setSchemeClr(accent_val);
681  pLastColFillProperties->maFillColor.setSchemeClr(accent_val);
682  pBand1HFillProperties->maFillColor.setSchemeClr(accent_val);
683  pBand1VFillProperties->maFillColor.setSchemeClr(accent_val);
684 
685  pWholeTblFillProperties->maFillColor.addTransformation(XML_tint, 20000);
686  pBand1HFillProperties->maFillColor.addTransformation(XML_tint, 40000);
687  pBand1VFillProperties->maFillColor.addTransformation(XML_tint, 40000);
688  }
689  else if (style_name == "Medium-Style-3")
690  {
691  wholeTblTextColor.setSchemeClr(XML_dk1);
692  firstColTextColor.setSchemeClr(XML_lt1);
693  lastColTextColor.setSchemeClr(XML_lt1);
694  pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1);
695  pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1);
696  pWholeTblFillProperties->maFillColor.setSchemeClr(XML_lt1);
697  pLastRowFillProperties->maFillColor.setSchemeClr(XML_lt1);
698  pBand1HFillProperties->maFillColor.setSchemeClr(XML_dk1);
699  pBand1VFillProperties->maFillColor.setSchemeClr(XML_dk1);
700 
701  firstRowTextColor.setSchemeClr(XML_lt1);
702  pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1);
703  pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1);
704 
705  if (!accent_name.isEmpty())
706  accent_val = tokens[mStyleIdMap[styleId].second];
707  else
708  accent_val = XML_dk1;
709 
710  pFirstRowFillProperties->maFillColor.setSchemeClr(accent_val);
711  pFirstColFillProperties->maFillColor.setSchemeClr(accent_val);
712  pLastColFillProperties->maFillColor.setSchemeClr(accent_val);
713 
714  pBand1HFillProperties->maFillColor.addTransformation(XML_tint, 20000);
715  pBand1VFillProperties->maFillColor.addTransformation(XML_tint, 20000);
716  }
717  else if (style_name == "Medium-Style-4")
718  {
719  wholeTblTextColor.setSchemeClr(XML_dk1);
720  pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1);
721  pLastRowFillProperties->maFillColor.setSchemeClr(XML_dk1);
722 
723  if (!accent_name.isEmpty())
724  accent_val = tokens[mStyleIdMap[styleId].second];
725  else
726  accent_val = XML_dk1;
727 
728  pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
729  pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
730  pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
731  pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
732  pWholeTblInsideHBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
733  pWholeTblInsideVBorder->maLineFill.maFillColor.setSchemeClr(accent_val);
734  pWholeTblFillProperties->maFillColor.setSchemeClr(accent_val);
735 
736  firstRowTextColor.setSchemeClr(accent_val);
737  pFirstRowFillProperties->maFillColor.setSchemeClr(accent_val);
738  pBand1HFillProperties->maFillColor.setSchemeClr(accent_val);
739  pBand1VFillProperties->maFillColor.setSchemeClr(accent_val);
740 
741  pFirstRowFillProperties->maFillColor.addTransformation(XML_tint, 20000);
742  pLastRowFillProperties->maFillColor.addTransformation(XML_tint, 20000);
743  pWholeTblFillProperties->maFillColor.addTransformation(XML_tint, 20000);
744  pBand1HFillProperties->maFillColor.addTransformation(XML_tint, 40000);
745  pBand1VFillProperties->maFillColor.addTransformation(XML_tint, 40000);
746  }
747  else if (style_name == "Dark-Style-1")
748  {
749  sal_Int32 transform_val;
750  wholeTblTextColor.setSchemeClr(XML_dk1);
751  firstRowTextColor.setSchemeClr(XML_lt1);
752  pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
753  pFirstColRightBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
754  pLastColLeftBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
755  pFirstRowFillProperties->maFillColor.setSchemeClr(XML_dk1);
756  pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1);
757 
758  if (!accent_name.isEmpty())
759  {
760  accent_val = tokens[mStyleIdMap[styleId].second];
761  transform_val = XML_shade;
762  }
763  else
764  {
765  accent_val = XML_dk1;
766  transform_val = XML_tint;
767  }
768 
769  pWholeTblFillProperties->maFillColor.setSchemeClr(accent_val);
770  pLastRowFillProperties->maFillColor.setSchemeClr(accent_val);
771  pFirstColFillProperties->maFillColor.setSchemeClr(accent_val);
772  pLastColFillProperties->maFillColor.setSchemeClr(accent_val);
773  pBand1HFillProperties->maFillColor.setSchemeClr(accent_val);
774  pBand1VFillProperties->maFillColor.setSchemeClr(accent_val);
775 
776  pWholeTblFillProperties->maFillColor.addTransformation(transform_val, 20000);
777  pBand1HFillProperties->maFillColor.addTransformation(transform_val, 40000);
778  pBand1VFillProperties->maFillColor.addTransformation(transform_val, 40000);
779  pLastColFillProperties->maFillColor.addTransformation(transform_val, 60000);
780  pFirstColFillProperties->maFillColor.addTransformation(transform_val, 60000);
781  }
782  else if (style_name == "Dark-Style-2")
783  {
784  wholeTblTextColor.setSchemeClr(XML_dk1);
785  firstRowTextColor.setSchemeClr(XML_lt1);
786 
787  pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1);
788 
789  if (accent_name.isEmpty())
790  pFirstRowFillProperties->maFillColor.setSchemeClr(XML_dk1);
791  else if (accent_name == "Accent1")
792  pFirstRowFillProperties->maFillColor.setSchemeClr(XML_accent2);
793  else if (accent_name == "Accent3")
794  pFirstRowFillProperties->maFillColor.setSchemeClr(XML_accent4);
795  else if (accent_name == "Accent5")
796  pFirstRowFillProperties->maFillColor.setSchemeClr(XML_accent6);
797 
798  if (!accent_name.isEmpty())
799  accent_val = tokens[mStyleIdMap[styleId].second];
800  else
801  accent_val = XML_dk1;
802 
803  pWholeTblFillProperties->maFillColor.setSchemeClr(accent_val);
804  pLastRowFillProperties->maFillColor.setSchemeClr(accent_val);
805  pBand1HFillProperties->maFillColor.setSchemeClr(accent_val);
806  pBand1VFillProperties->maFillColor.setSchemeClr(accent_val);
807 
808  pWholeTblFillProperties->maFillColor.addTransformation(XML_tint, 20000);
809  pBand1HFillProperties->maFillColor.addTransformation(XML_tint, 40000);
810  pBand1VFillProperties->maFillColor.addTransformation(XML_tint, 40000);
811  pLastRowFillProperties->maFillColor.addTransformation(XML_tint, 20000);
812  }
813 
814  // End to handle all style groups.
815 
816  // Create a TableStyle from handled properties.
817 
818  pTableStyle->getWholeTbl().getTextColor() = wholeTblTextColor;
819  pTableStyle->getFirstRow().getTextColor() = firstRowTextColor;
820  pTableStyle->getFirstCol().getTextColor() = firstColTextColor;
821  pTableStyle->getLastRow().getTextColor() = lastRowTextColor;
822  pTableStyle->getLastCol().getTextColor() = lastColTextColor;
823  pTableStyle->getBand1H().getTextColor() = band1HTextColor;
824  pTableStyle->getBand1V().getTextColor() = band1VTextColor;
825  pTableStyle->getBand2H().getTextColor() = band2HTextColor;
826  pTableStyle->getBand2V().getTextColor() = band2VTextColor;
827 
828  pTableStyle->getBackgroundFillProperties() = pTblBgFillProperties;
829  pTableStyle->getWholeTbl().getFillProperties() = pWholeTblFillProperties;
830  pTableStyle->getFirstRow().getFillProperties() = pFirstRowFillProperties;
831  pTableStyle->getFirstCol().getFillProperties() = pFirstColFillProperties;
832  pTableStyle->getLastRow().getFillProperties() = pLastRowFillProperties;
833  pTableStyle->getLastCol().getFillProperties() = pLastColFillProperties;
834  pTableStyle->getBand1H().getFillProperties() = pBand1HFillProperties;
835  pTableStyle->getBand1V().getFillProperties() = pBand1VFillProperties;
836  pTableStyle->getBand2H().getFillProperties() = pBand2HFillProperties;
837  pTableStyle->getBand2V().getFillProperties() = pBand2VFillProperties;
838 
839  pTableStyle->getWholeTbl().getLineBorders().insert(
840  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_left, pWholeTblLeftBorder));
841  pTableStyle->getWholeTbl().getLineBorders().insert(
842  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_right, pWholeTblRightBorder));
843  pTableStyle->getWholeTbl().getLineBorders().insert(
844  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_top, pWholeTblTopBorder));
845  pTableStyle->getWholeTbl().getLineBorders().insert(
846  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_bottom,
847  pWholeTblBottomBorder));
848  pTableStyle->getWholeTbl().getLineBorders().insert(
849  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_insideH,
850  pWholeTblInsideHBorder));
851  pTableStyle->getWholeTbl().getLineBorders().insert(
852  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_insideV,
853  pWholeTblInsideVBorder));
854 
855  pTableStyle->getFirstRow().getLineBorders().insert(
856  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_left, pFirstRowLeftBorder));
857  pTableStyle->getFirstRow().getLineBorders().insert(
858  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_right, pFirstRowRightBorder));
859  pTableStyle->getFirstRow().getLineBorders().insert(
860  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_top, pFirstRowTopBorder));
861  pTableStyle->getFirstRow().getLineBorders().insert(
862  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_bottom,
863  pFirstRowBottomBorder));
864  pTableStyle->getFirstRow().getLineBorders().insert(
865  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_insideH,
866  pFirstRowInsideHBorder));
867  pTableStyle->getFirstRow().getLineBorders().insert(
868  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_insideV,
869  pFirstRowInsideVBorder));
870 
871  pTableStyle->getFirstCol().getLineBorders().insert(
872  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_left, pFirstColLeftBorder));
873  pTableStyle->getFirstCol().getLineBorders().insert(
874  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_right, pFirstColRightBorder));
875  pTableStyle->getFirstCol().getLineBorders().insert(
876  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_top, pFirstColTopBorder));
877  pTableStyle->getFirstCol().getLineBorders().insert(
878  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_bottom,
879  pFirstColBottomBorder));
880  pTableStyle->getFirstCol().getLineBorders().insert(
881  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_insideH,
882  pFirstColInsideHBorder));
883  pTableStyle->getFirstCol().getLineBorders().insert(
884  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_insideV,
885  pFirstColInsideVBorder));
886 
887  pTableStyle->getLastRow().getLineBorders().insert(
888  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_left, pLastRowLeftBorder));
889  pTableStyle->getLastRow().getLineBorders().insert(
890  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_right, pLastRowRightBorder));
891  pTableStyle->getLastRow().getLineBorders().insert(
892  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_top, pLastRowTopBorder));
893  pTableStyle->getLastRow().getLineBorders().insert(
894  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_bottom,
895  pLastRowBottomBorder));
896  pTableStyle->getLastRow().getLineBorders().insert(
897  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_insideH,
898  pLastRowInsideHBorder));
899  pTableStyle->getLastRow().getLineBorders().insert(
900  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_insideV,
901  pLastRowInsideVBorder));
902 
903  pTableStyle->getLastCol().getLineBorders().insert(
904  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_left, pLastColLeftBorder));
905  pTableStyle->getLastCol().getLineBorders().insert(
906  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_right, pLastColRightBorder));
907  pTableStyle->getLastCol().getLineBorders().insert(
908  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_top, pLastColTopBorder));
909  pTableStyle->getLastCol().getLineBorders().insert(
910  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_bottom,
911  pLastColBottomBorder));
912  pTableStyle->getLastCol().getLineBorders().insert(
913  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_insideH,
914  pLastColInsideHBorder));
915  pTableStyle->getLastCol().getLineBorders().insert(
916  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_insideV,
917  pLastColInsideVBorder));
918 
919  pTableStyle->getBand1H().getLineBorders().insert(
920  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_left, pBand1HLeftBorder));
921  pTableStyle->getBand1H().getLineBorders().insert(
922  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_right, pBand1HRightBorder));
923  pTableStyle->getBand1H().getLineBorders().insert(
924  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_top, pBand1HTopBorder));
925  pTableStyle->getBand1H().getLineBorders().insert(
926  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_bottom, pBand1HBottomBorder));
927  pTableStyle->getBand1H().getLineBorders().insert(
928  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_insideH,
929  pBand1HInsideHBorder));
930  pTableStyle->getBand1H().getLineBorders().insert(
931  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_insideV,
932  pBand1HInsideVBorder));
933 
934  pTableStyle->getBand1V().getLineBorders().insert(
935  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_left, pBand1VLeftBorder));
936  pTableStyle->getBand1V().getLineBorders().insert(
937  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_right, pBand1VRightBorder));
938  pTableStyle->getBand1V().getLineBorders().insert(
939  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_top, pBand1VTopBorder));
940  pTableStyle->getBand1V().getLineBorders().insert(
941  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_bottom, pBand1VBottomBorder));
942  pTableStyle->getBand1V().getLineBorders().insert(
943  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_insideH,
944  pBand1VInsideHBorder));
945  pTableStyle->getBand1V().getLineBorders().insert(
946  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_insideV,
947  pBand1VInsideVBorder));
948 
949  pTableStyle->getBand2H().getLineBorders().insert(
950  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_left, pBand2HLeftBorder));
951  pTableStyle->getBand2H().getLineBorders().insert(
952  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_right, pBand2HRightBorder));
953  pTableStyle->getBand2H().getLineBorders().insert(
954  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_top, pBand2HTopBorder));
955  pTableStyle->getBand2H().getLineBorders().insert(
956  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_bottom, pBand2HBottomBorder));
957  pTableStyle->getBand2H().getLineBorders().insert(
958  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_insideH,
959  pBand2HInsideHBorder));
960  pTableStyle->getBand2H().getLineBorders().insert(
961  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_insideV,
962  pBand2HInsideVBorder));
963 
964  pTableStyle->getBand2V().getLineBorders().insert(
965  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_left, pBand2VLeftBorder));
966  pTableStyle->getBand2V().getLineBorders().insert(
967  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_right, pBand2VRightBorder));
968  pTableStyle->getBand2V().getLineBorders().insert(
969  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_top, pBand2VTopBorder));
970  pTableStyle->getBand2V().getLineBorders().insert(
971  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_bottom, pBand2VBottomBorder));
972  pTableStyle->getBand2V().getLineBorders().insert(
973  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_insideH,
974  pBand2VInsideHBorder));
975  pTableStyle->getBand2V().getLineBorders().insert(
976  std::pair<sal_Int32, ::oox::drawingml::LinePropertiesPtr>(XML_insideV,
977  pBand2VInsideVBorder));
978 
979  return pTableStyle;
980 }
981 
982 /* 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)