• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

xlnt-community / xlnt / 7ff9c3f5-3924-4201-9285-53486e877245

01 May 2025 12:06PM UTC coverage: 81.886% (-0.4%) from 82.27%
7ff9c3f5-3924-4201-9285-53486e877245

push

circleci

web-flow
Publishing coverage to github pages (#79)

Alternative to coveralls, to overcome some disadvantages/inconveniences of this external service, i.e:
 - loading file details sometimes fails due to gateway timeout
 - for forked pull requests:
   - github comment is not posted on PR
   - coverage report not compared with master branch

HTML reports are generated based on the fully open source genhtml (lcov) tool.

Disabled samples and benchmarks while generating coverage report, as coverage report should be based on real unit tests. This slightly decreases the coverage. Some extra unit tests added to overcome the most important coverage losses.

Enabled branch coverage, in addition to the existing line coverage. Disabled coverage reporting for exception branches (for now) as it generates too many (less important) compiler generated branches. 
For more information about exception branches, see https://github.com/gcovr/gcovr/issues/431#issuecomment-705518206

14026 of 18604 branches covered (75.39%)

1 of 1 new or added line in 1 file covered. (100.0%)

58 existing lines in 6 files now uncovered.

11500 of 14044 relevant lines covered (81.89%)

10385.36 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

47.89
./source/detail/serialization/custom_value_traits.cpp
1
// Copyright (c) 2016-2022 Thomas Fussell
2
// Copyright (c) 2024-2025 xlnt-community
3
//
4
// Permission is hereby granted, free of charge, to any person obtaining a copy
5
// of this software and associated documentation files (the "Software"), to deal
6
// in the Software without restriction, including without limitation the rights
7
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
// copies of the Software, and to permit persons to whom the Software is
9
// furnished to do so, subject to the following conditions:
10
//
11
// The above copyright notice and this permission notice shall be included in
12
// all copies or substantial portions of the Software.
13
//
14
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
// THE SOFTWARE
21
//
22
// @license: http://www.opensource.org/licenses/mit-license.php
23
// @author: see AUTHORS file
24

25
#include <detail/serialization/custom_value_traits.hpp>
26

27
namespace xlnt {
28
namespace detail {
29

30
/// <summary>
31
/// Returns the string representation of the underline style.
32
/// </summary>
33
std::string to_string(font::underline_style style)
20✔
34
{
35
    switch (style)
20!
36
    {
37
    case font::underline_style::double_:
4✔
38
        return "double";
8✔
39
    case font::underline_style::double_accounting:
12✔
40
        return "doubleAccounting";
24✔
41
    case font::underline_style::single:
×
42
        return "single";
×
43
    case font::underline_style::single_accounting:
4✔
44
        return "singleAccounting";
8✔
45
    case font::underline_style::none:
×
46
        return "none";
×
47
    }
48

49
    default_case("single");
×
50
}
51

52
/// <summary>
53
/// Returns the string representation of the relationship type.
54
/// </summary>
55
std::string to_string(relationship_type t)
353✔
56
{
57
    switch (t)
353!
58
    {
59
    case relationship_type::office_document:
42✔
60
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
84✔
61
    case relationship_type::thumbnail:
28✔
62
        return "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail";
56✔
63
    case relationship_type::calculation_chain:
5✔
64
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain";
10✔
65
    case relationship_type::extended_properties:
39✔
66
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties";
78✔
67
    case relationship_type::core_properties:
39✔
68
        return "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties";
78✔
69
    case relationship_type::worksheet:
51✔
70
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet";
102✔
71
    case relationship_type::shared_string_table:
30✔
72
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings";
60✔
73
    case relationship_type::stylesheet:
40✔
74
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles";
80✔
75
    case relationship_type::theme:
39✔
76
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";
78✔
77
    case relationship_type::hyperlink:
16✔
78
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink";
32✔
79
    case relationship_type::chartsheet:
×
80
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet";
×
81
    case relationship_type::comments:
8✔
82
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
16✔
83
    case relationship_type::vml_drawing:
8✔
84
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing";
16✔
85
    case relationship_type::custom_properties:
2✔
86
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties";
4✔
87
    case relationship_type::printer_settings:
1✔
88
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/printerSettings";
2✔
89
    case relationship_type::connections:
×
90
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/connections";
×
91
    case relationship_type::custom_property:
×
92
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customProperty";
×
93
    case relationship_type::custom_xml_mappings:
×
94
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlMappings";
×
95
    case relationship_type::dialogsheet:
×
96
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet";
×
97
    case relationship_type::drawings:
2✔
98
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing";
4✔
99
    case relationship_type::external_workbook_references:
×
100
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath";
×
101
    case relationship_type::pivot_table:
×
102
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable";
×
103
    case relationship_type::pivot_table_cache_definition:
×
104
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition";
×
105
    case relationship_type::pivot_table_cache_records:
×
106
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords";
×
107
    case relationship_type::query_table:
×
108
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/queryTable";
×
109
    case relationship_type::shared_workbook_revision_headers:
×
110
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/revisionHeaders";
×
111
    case relationship_type::shared_workbook:
×
112
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedWorkbook";
×
113
    case relationship_type::revision_log:
×
114
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/revisionLog";
×
115
    case relationship_type::shared_workbook_user_data:
×
116
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/usernames";
×
117
    case relationship_type::single_cell_table_definitions:
×
118
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableSingleCells";
×
119
    case relationship_type::table_definition:
×
120
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table";
×
121
    case relationship_type::volatile_dependencies:
×
122
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/volatileDependencies";
×
123
    case relationship_type::vbaproject:
1✔
124
        return "http://schemas.microsoft.com/office/2006/relationships/vbaProject";
2✔
125
    case relationship_type::image:
2✔
126
        return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";
4✔
127
    case relationship_type::unknown:
×
128
        return "unknown";
×
129
    }
130

131
    default_case("unknown");
×
132
}
133

134
std::string to_string(pattern_fill_type fill_type)
206✔
135
{
136
    switch (fill_type)
206!
137
    {
138
    case pattern_fill_type::darkdown:
×
139
        return "darkdown";
×
140
    case pattern_fill_type::darkgray:
×
141
        return "darkgray";
×
142
    case pattern_fill_type::darkgrid:
×
143
        return "darkgrid";
×
144
    case pattern_fill_type::darkhorizontal:
×
145
        return "darkhorizontal";
×
146
    case pattern_fill_type::darktrellis:
×
147
        return "darkhorizontal";
×
148
    case pattern_fill_type::darkup:
×
149
        return "darkup";
×
150
    case pattern_fill_type::darkvertical:
×
151
        return "darkvertical";
×
152
    case pattern_fill_type::gray0625:
×
153
        return "gray0625";
×
154
    case pattern_fill_type::gray125:
39✔
155
        return "gray125";
78✔
156
    case pattern_fill_type::lightdown:
×
157
        return "lightdown";
×
158
    case pattern_fill_type::lightgray:
1✔
159
        return "lightgray";
2✔
160
    case pattern_fill_type::lightgrid:
×
161
        return "lightgrid";
×
162
    case pattern_fill_type::lighthorizontal:
×
163
        return "lighthorizontal";
×
164
    case pattern_fill_type::lighttrellis:
×
165
        return "lighttrellis";
×
166
    case pattern_fill_type::lightup:
×
167
        return "lightup";
×
168
    case pattern_fill_type::lightvertical:
×
169
        return "lightvertical";
×
170
    case pattern_fill_type::mediumgray:
×
171
        return "mediumgray";
×
172
    case pattern_fill_type::solid:
126✔
173
        return "solid";
252✔
174
    case pattern_fill_type::none:
40✔
175
        return "none";
80✔
176
    }
177

178
    default_case("none");
×
179
}
180

181
std::string to_string(gradient_fill_type fill_type)
×
182
{
183
    switch (fill_type)
×
184
    {
185
    case gradient_fill_type::linear:
×
186
        return "linear";
×
187
    case gradient_fill_type::path:
×
188
        return "path";
×
189
    }
190

191
    default_case("linear");
×
192
}
193

194
std::string to_string(border_style style)
116✔
195
{
196
    switch (style)
116!
197
    {
198
    case border_style::dashdot:
×
199
        return "dashDot";
×
200
    case border_style::dashdotdot:
×
201
        return "dashDotDot";
×
202
    case border_style::dashed:
×
203
        return "dashed";
×
204
    case border_style::dotted:
×
205
        return "dotted";
×
206
    case border_style::double_:
24✔
207
        return "double";
48✔
208
    case border_style::hair:
×
209
        return "hair";
×
210
    case border_style::medium:
4✔
211
        return "medium";
8✔
212
    case border_style::mediumdashdot:
×
213
        return "mediumDashDot";
×
214
    case border_style::mediumdashdotdot:
×
215
        return "mediumDashDotDot";
×
216
    case border_style::mediumdashed:
×
217
        return "mediumDashed";
×
218
    case border_style::slantdashdot:
×
219
        return "slantDashDot";
×
220
    case border_style::thick:
8✔
221
        return "thick";
16✔
222
    case border_style::thin:
80✔
223
        return "thin";
160✔
224
    case border_style::none:
×
225
        return "none";
×
226
    }
227

228
    default_case("none");
×
229
}
230

231
std::string to_string(vertical_alignment alignment)
74✔
232
{
233
    switch (alignment)
74!
234
    {
235
    case vertical_alignment::top:
15✔
236
        return "top";
30✔
237
    case vertical_alignment::center:
52✔
238
        return "center";
104✔
239
    case vertical_alignment::bottom:
3✔
240
        return "bottom";
6✔
UNCOV
241
    case vertical_alignment::justify:
×
UNCOV
242
        return "justify";
×
243
    case vertical_alignment::distributed:
4✔
244
        return "distributed";
8✔
245
    }
246

247
    default_case("top");
×
248
}
249

250
std::string to_string(horizontal_alignment alignment)
24✔
251
{
252
    switch (alignment)
24!
253
    {
254
    case horizontal_alignment::general:
2✔
255
        return "general";
4✔
256
    case horizontal_alignment::left:
13✔
257
        return "left";
26✔
258
    case horizontal_alignment::center:
5✔
259
        return "center";
10✔
260
    case horizontal_alignment::right:
4✔
261
        return "right";
8✔
262
    case horizontal_alignment::fill:
×
263
        return "fill";
×
UNCOV
264
    case horizontal_alignment::justify:
×
UNCOV
265
        return "justify";
×
UNCOV
266
    case horizontal_alignment::center_continuous:
×
UNCOV
267
        return "centerContinuous";
×
268
    case horizontal_alignment::distributed:
×
269
        return "distributed";
×
270
    }
271

272
    default_case("general");
×
273
}
274

275
std::string to_string(border_side side)
410✔
276
{
277
    switch (side)
410!
278
    {
279
    case border_side::bottom:
82✔
280
        return "bottom";
164✔
281
    case border_side::top:
82✔
282
        return "top";
164✔
283
    case border_side::start:
82✔
284
        return "left";
164✔
285
    case border_side::end:
82✔
286
        return "right";
164✔
287
    case border_side::horizontal:
×
288
        return "horizontal";
×
289
    case border_side::vertical:
×
290
        return "vertical";
×
291
    case border_side::diagonal:
82✔
292
        return "diagonal";
164✔
293
    }
294

295
    default_case("top");
×
296
}
297

298
std::string to_string(core_property prop)
171✔
299
{
300
    switch (prop)
171!
301
    {
302
    case core_property::category:
4✔
303
        return "category";
8✔
UNCOV
304
    case core_property::content_status:
×
UNCOV
305
        return "contentStatus";
×
306
    case core_property::created:
34✔
307
        return "created";
68✔
308
    case core_property::creator:
36✔
309
        return "creator";
72✔
310
    case core_property::description:
5✔
311
        return "description";
10✔
UNCOV
312
    case core_property::identifier:
×
UNCOV
313
        return "identifier";
×
314
    case core_property::keywords:
4✔
315
        return "keywords";
8✔
316
    case core_property::language:
1✔
317
        return "language";
2✔
318
    case core_property::last_modified_by:
38✔
319
        return "lastModifiedBy";
76✔
UNCOV
320
    case core_property::last_printed:
×
UNCOV
321
        return "lastPrinted";
×
322
    case core_property::modified:
38✔
323
        return "modified";
76✔
324
    case core_property::revision:
1✔
325
        return "revision";
2✔
326
    case core_property::subject:
5✔
327
        return "subject";
10✔
328
    case core_property::title:
5✔
329
        return "title";
10✔
UNCOV
330
    case core_property::version:
×
UNCOV
331
        return "version";
×
332
    }
333

334
    default_case("category");
×
335
}
336

337
std::string to_string(extended_property prop)
378✔
338
{
339
    switch (prop)
378!
340
    {
341
    case extended_property::application:
38✔
342
        return "Application";
76✔
343
    case extended_property::app_version:
37✔
344
        return "AppVersion";
74✔
UNCOV
345
    case extended_property::characters:
×
UNCOV
346
        return "Characters";
×
UNCOV
347
    case extended_property::characters_with_spaces:
×
UNCOV
348
        return "CharactersWithSpaces";
×
349
    case extended_property::company:
34✔
350
        return "Company";
68✔
UNCOV
351
    case extended_property::dig_sig:
×
UNCOV
352
        return "DigSig";
×
353
    case extended_property::doc_security:
37✔
354
        return "DocSecurity";
74✔
355
    case extended_property::heading_pairs:
37✔
356
        return "HeadingPairs";
74✔
UNCOV
357
    case extended_property::hidden_slides:
×
UNCOV
358
        return "HiddenSlides";
×
359
    case extended_property::hyperlinks_changed:
37✔
360
        return "HyperlinksChanged";
74✔
361
    case extended_property::hyperlink_base:
4✔
362
        return "HyperlinkBase";
8✔
UNCOV
363
    case extended_property::h_links:
×
UNCOV
364
        return "HLinks";
×
UNCOV
365
    case extended_property::lines:
×
UNCOV
366
        return "Lines";
×
367
    case extended_property::links_up_to_date:
37✔
368
        return "LinksUpToDate";
74✔
369
    case extended_property::manager:
4✔
370
        return "Manager";
8✔
UNCOV
371
    case extended_property::m_m_clips:
×
UNCOV
372
        return "MMClips";
×
UNCOV
373
    case extended_property::notes:
×
UNCOV
374
        return "Notes";
×
UNCOV
375
    case extended_property::pages:
×
UNCOV
376
        return "Pages";
×
UNCOV
377
    case extended_property::paragraphs:
×
UNCOV
378
        return "Paragraphs";
×
UNCOV
379
    case extended_property::presentation_format:
×
UNCOV
380
        return "PresentationFormat";
×
381
    case extended_property::scale_crop:
37✔
382
        return "ScaleCrop";
74✔
383
    case extended_property::shared_doc:
37✔
384
        return "SharedDoc";
74✔
UNCOV
385
    case extended_property::slides:
×
UNCOV
386
        return "Slides";
×
387
    case extended_property::template_:
1✔
388
        return "Template";
2✔
389
    case extended_property::titles_of_parts:
37✔
390
        return "TitlesOfParts";
74✔
391
    case extended_property::total_time:
1✔
392
        return "TotalTime";
2✔
UNCOV
393
    case extended_property::words:
×
UNCOV
394
        return "Words";
×
395
    }
396

397
    default_case("Application");
×
398
}
399

400
std::string to_string(variant::type type)
37✔
401
{
402
    switch (type)
37!
403
    {
404
    case variant::type::boolean:
×
405
        return "bool";
×
406
    case variant::type::date:
×
407
        return "date";
×
UNCOV
408
    case variant::type::i4:
×
UNCOV
409
        return "i4";
×
410
    case variant::type::lpstr:
37✔
411
        return "lpstr";
74✔
412
    case variant::type::null:
×
413
        return "null";
×
414
    case variant::type::vector:
×
415
        return "vector";
×
416
    }
417

418
    default_case("null");
×
419
}
420

421
std::string to_string(pane_corner corner)
6✔
422
{
423
    switch (corner)
6!
424
    {
425
    case pane_corner::bottom_left:
1✔
426
        return "bottomLeft";
2✔
427
    case pane_corner::bottom_right:
4✔
428
        return "bottomRight";
8✔
429
    case pane_corner::top_left:
×
430
        return "topLeft";
×
431
    case pane_corner::top_right:
1✔
432
        return "topRight";
2✔
433
    }
434

435
    default_case("topLeft");
×
436
}
437

438
std::string to_string(target_mode mode)
×
439
{
440
    switch (mode)
×
441
    {
442
    case target_mode::external:
×
443
        return "External";
×
444
    case target_mode::internal:
×
445
        return "Internal";
×
446
    }
447

448
    default_case("Internal");
×
449
}
450

451
std::string to_string(pane_state state)
2✔
452
{
453
    switch (state)
2!
454
    {
455
    case pane_state::frozen:
2✔
456
        return "frozen";
4✔
457
    case pane_state::frozen_split:
×
458
        return "frozenSplit";
×
459
    case pane_state::split:
×
460
        return "split";
×
461
    }
462

463
    default_case("frozen");
×
464
}
465

466
std::string to_string(orientation orient)
8✔
467
{
468
    switch (orient)
8!
469
    {
470
    case xlnt::orientation::default_orientation:
×
471
        return "default";
×
472
    case xlnt::orientation::landscape:
×
473
        return "landscape";
×
474
    case xlnt::orientation::portrait:
8✔
475
        return "portrait";
16✔
476
    }
477
    default_case("default");
×
478
}
479

480
} // namespace detail
481
} // namespace xlnt
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc