Branch data TLA Line data Source code
1 : : #pragma once
2 : :
3 : : #include <cstddef>
4 : : #include <string>
5 : :
6 : : #include <xlnt/utils/optional.hpp>
7 : :
8 : : namespace xlnt {
9 : :
10 : : class alignment;
11 : : class border;
12 : : class fill;
13 : : class font;
14 : : class number_format;
15 : : class protection;
16 : :
17 : : namespace detail {
18 : :
19 : : struct stylesheet;
20 : :
21 : : struct style_impl
22 : : {
23 : : stylesheet *parent = nullptr;
24 : :
25 :CBC 38 : bool operator==(const style_impl& rhs) const
26 : : {
27 : : // not comparing parent
28 : 38 : return name == rhs.name
29 [ + - ]: 38 : && formatting_record_id == rhs.formatting_record_id
30 [ + - ]: 38 : && custom_builtin == rhs.custom_builtin
31 [ + - ]: 38 : && hidden_style == rhs.hidden_style
32 [ + - ]: 38 : && builtin_id == rhs.builtin_id
33 [ + - ]: 38 : && outline_style == rhs.outline_style
34 [ + - ]: 38 : && alignment_id == rhs.alignment_id
35 [ + - ]: 38 : && alignment_applied == rhs.alignment_applied
36 [ + - ]: 38 : && border_id == rhs.border_id
37 [ + - ]: 38 : && border_applied == rhs.border_applied
38 [ + - ]: 38 : && fill_id == rhs.fill_id
39 [ + - ]: 38 : && fill_applied == rhs.fill_applied
40 [ + - ]: 38 : && font_id == rhs.font_id
41 [ + - ]: 38 : && font_applied == rhs.font_applied
42 [ + - ]: 38 : && number_format_id == rhs.number_format_id
43 [ + - ]: 38 : && number_format_applied == number_format_applied
44 [ + - ]: 38 : && protection_id == rhs.protection_id
45 [ + - ]: 38 : && protection_applied == rhs.protection_applied
46 [ + - ]: 38 : && pivot_button_ == rhs.pivot_button_
47 [ + - + - ]: 76 : && quote_prefix_ == rhs.quote_prefix_;
48 : : }
49 : :
50 : : bool operator!=(const style_impl& rhs) const
51 : : {
52 : : return !(*this == rhs);
53 : : }
54 : :
55 : : std::string name;
56 : : std::size_t formatting_record_id = 0;
57 : :
58 : : bool custom_builtin = false;
59 : : bool hidden_style = false;
60 : :
61 : : optional<std::size_t> builtin_id;
62 : : optional<std::size_t> outline_style;
63 : :
64 : : optional<std::size_t> alignment_id;
65 : : optional<bool> alignment_applied;
66 : :
67 : : optional<std::size_t> border_id;
68 : : optional<bool> border_applied;
69 : :
70 : : optional<std::size_t> fill_id;
71 : : optional<bool> fill_applied;
72 : :
73 : : optional<std::size_t> font_id;
74 : : optional<bool> font_applied;
75 : :
76 : : optional<std::size_t> number_format_id;
77 : : optional<bool> number_format_applied;
78 : :
79 : : optional<std::size_t> protection_id;
80 : : optional<bool> protection_applied;
81 : :
82 : : bool pivot_button_ = false;
83 : : bool quote_prefix_ = false;
84 : : };
85 : :
86 : : } // namespace detail
87 : : } // namespace xlnt
|