OpenXLSX 1.12.1
Modern C++ Excel Library (Fork of OpenXLSX by Kenneth Troldal Balslev)
Loading...
Searching...
No Matches
XLXmlSchema.hpp
Go to the documentation of this file.
1/*
2 * OpenXLSX-NX - Modern High-Performance C++ Excel Library
3 *
4 * Original work Copyright (c) 2018-2025, Kenneth Troldal Balslev and OpenXLSX contributors
5 * Modified work Copyright (c) 2026, Curry Tang and OpenXLSX-NX contributors
6 *
7 * Distributed under the BSD 3-Clause License.
8 * See LICENSE.md in the project root or https://opensource.org/licenses/BSD-3-Clause
9 */
10
11#ifndef OPENXLSX_XLXMLSCHEMA_HPP
12#define OPENXLSX_XLXMLSCHEMA_HPP
13
14#include "OpenXLSX-Exports.hpp"
15#include "XLXmlHelpers.hpp"
16#include "XLXmlParser.hpp"
17
18#include <algorithm>
19#include <cstdint>
20#include <string>
21#include <string_view>
22
23namespace OpenXLSX
24{
25 namespace XmlNS
26 {
27 inline constexpr std::string_view SpreadsheetML = "http://schemas.openxmlformats.org/spreadsheetml/2006/main";
28 inline constexpr std::string_view Relationships = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
29 inline constexpr std::string_view PackageRelationships = "http://schemas.openxmlformats.org/package/2006/relationships";
30 inline constexpr std::string_view DrawingML = "http://schemas.openxmlformats.org/drawingml/2006/main";
31 inline constexpr std::string_view SpreadsheetDrawing = "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing";
32 inline constexpr std::string_view VML = "urn:schemas-microsoft-com:vml";
33 inline constexpr std::string_view OfficeVML = "urn:schemas-microsoft-com:office:office";
34 inline constexpr std::string_view ExcelVML = "urn:schemas-microsoft-com:office:excel";
35 inline constexpr std::string_view ContentTypes = "http://schemas.openxmlformats.org/package/2006/content-types";
36 inline constexpr std::string_view CoreProperties = "http://schemas.openxmlformats.org/package/2006/metadata/core-properties";
37 inline constexpr std::string_view ExtendedProperties = "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties";
38 inline constexpr std::string_view CustomProperties = "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties";
39 } // namespace XmlNS
40
41 namespace XmlTag
42 {
43 inline constexpr const char* Cell = "c";
44 inline constexpr const char* Row = "row";
45 inline constexpr const char* Value = "v";
46 inline constexpr const char* Formula = "f";
47 inline constexpr const char* InlineStr = "is";
48 inline constexpr const char* Text = "t";
49 inline constexpr const char* SheetData = "sheetData";
50 inline constexpr const char* Dimension = "dimension";
51 inline constexpr const char* MergeCells = "mergeCells";
52 inline constexpr const char* MergeCell = "mergeCell";
53 inline constexpr const char* DataValidations = "dataValidations";
54 inline constexpr const char* DataValidation = "dataValidation";
55 inline constexpr const char* AutoFilter = "autoFilter";
56 inline constexpr const char* SheetView = "sheetView";
57 inline constexpr const char* SheetViews = "sheetViews";
58 inline constexpr const char* Pane = "pane";
59 inline constexpr const char* Selection = "selection";
60 inline constexpr const char* PageSetup = "pageSetup";
61 inline constexpr const char* PageMargins = "pageMargins";
62 inline constexpr const char* HeaderFooter = "headerFooter";
63 inline constexpr const char* SheetPr = "sheetPr";
64 inline constexpr const char* TabColor = "tabColor";
65 inline constexpr const char* TableParts = "tableParts";
66 inline constexpr const char* TablePart = "tablePart";
67 inline constexpr const char* Drawing = "drawing";
68 inline constexpr const char* LegacyDrawing = "legacyDrawing";
69 inline constexpr const char* Table = "table";
70 inline constexpr const char* TableColumns = "tableColumns";
71 inline constexpr const char* TableColumn = "tableColumn";
72 inline constexpr const char* TableStyleInfo = "tableStyleInfo";
73 inline constexpr const char* FilterColumn = "filterColumn";
74 inline constexpr const char* CustomFilters = "customFilters";
75 inline constexpr const char* CustomFilter = "customFilter";
76 inline constexpr const char* Filters = "filters";
77 inline constexpr const char* Filter = "filter";
78 inline constexpr const char* Comments = "comments";
79 inline constexpr const char* Authors = "authors";
80 inline constexpr const char* Author = "author";
81 inline constexpr const char* CommentList = "commentList";
82 inline constexpr const char* Comment = "comment";
83 inline constexpr const char* TextBody = "text";
84 inline constexpr const char* Col = "col";
85 inline constexpr const char* Cols = "cols";
86 } // namespace XmlTag
87
88 namespace XmlAttr
89 {
90 inline constexpr const char* Ref = "r";
91 inline constexpr const char* Type = "t";
92 inline constexpr const char* Style = "s";
93 inline constexpr const char* ColStyle = "style";
94 inline constexpr const char* Sqref = "sqref";
95 inline constexpr const char* Val = "val";
96 inline constexpr const char* Name = "name";
97 inline constexpr const char* Id = "id";
98 inline constexpr const char* SheetId = "sheetId";
99 inline constexpr const char* State = "state";
100 inline constexpr const char* Rgb = "rgb";
101 inline constexpr const char* Spans = "spans";
102 inline constexpr const char* Hidden = "hidden";
103 inline constexpr const char* CustomHeight = "customHeight";
104 inline constexpr const char* Ht = "ht";
105 inline constexpr const char* Count = "count";
106 inline constexpr const char* DisplayName = "displayName";
107 inline constexpr const char* HeaderRowCount = "headerRowCount";
108 inline constexpr const char* TotalsRowCount = "totalsRowCount";
109 inline constexpr const char* TotalsRowShown = "totalsRowShown";
110 inline constexpr const char* TotalsRowFunction = "totalsRowFunction";
111 inline constexpr const char* TotalsRowLabel = "totalsRowLabel";
112 inline constexpr const char* ShowFirstColumn = "showFirstColumn";
113 inline constexpr const char* ShowLastColumn = "showLastColumn";
114 inline constexpr const char* ShowRowStripes = "showRowStripes";
115 inline constexpr const char* ShowColumnStripes = "showColumnStripes";
116 inline constexpr const char* XfId = "xfId";
117 inline constexpr const char* FontId = "fontId";
118 inline constexpr const char* FillId = "fillId";
119 inline constexpr const char* BorderId = "borderId";
120 inline constexpr const char* NumFmtId = "numFmtId";
121 inline constexpr const char* AuthorId = "authorId";
122 inline constexpr const char* ShapeId = "shapeId";
123 inline constexpr const char* Min = "min";
124 inline constexpr const char* Max = "max";
125 inline constexpr const char* Width = "width";
126 inline constexpr const char* CustomWidth = "customWidth";
127 inline constexpr const char* OutlineLevel = "outlineLevel";
128 inline constexpr const char* Collapsed = "collapsed";
129 inline constexpr const char* DyDescent = "x14ac:dyDescent";
130 inline constexpr const char* WorkbookViewId = "workbookViewId";
131 inline constexpr const char* TabSelected = "tabSelected";
132 inline constexpr const char* ShowGridLines = "showGridLines";
133 inline constexpr const char* ShowRowColHeaders = "showRowColHeaders";
134 inline constexpr const char* ZoomScale = "zoomScale";
135 inline constexpr const char* XSplit = "xSplit";
136 inline constexpr const char* YSplit = "ySplit";
137 inline constexpr const char* TopLeftCell = "topLeftCell";
138 inline constexpr const char* ActivePane = "activePane";
139 } // namespace XmlAttr
140
145 {
146 uint32_t id{0};
147 std::string name;
148 std::string displayName;
149 std::string rangeRef;
150 uint32_t headerRowCount{1};
151 uint32_t totalsRowCount{0};
152 bool totalsRowShown{false};
153
154 friend bool operator==(const XLTableProperties& a, const XLTableProperties& b) noexcept
155 {
156 return a.id == b.id && a.name == b.name && a.displayName == b.displayName &&
157 a.rangeRef == b.rangeRef && a.headerRowCount == b.headerRowCount &&
158 a.totalsRowCount == b.totalsRowCount && a.totalsRowShown == b.totalsRowShown;
159 }
160 friend bool operator!=(const XLTableProperties& a, const XLTableProperties& b) noexcept { return !(a == b); }
161 };
162
168 {
169 uint32_t rowIndex{0};
170 float height{0.0f};
171 uint32_t styleIndex{0};
172 uint8_t outlineLevel{0};
173 bool customHeight{false};
174 bool hidden{false};
175 bool collapsed{false};
176
177 friend bool operator==(const XLRowProperties& a, const XLRowProperties& b) noexcept
178 {
179 return a.rowIndex == b.rowIndex && a.height == b.height &&
180 a.styleIndex == b.styleIndex && a.outlineLevel == b.outlineLevel &&
181 a.customHeight == b.customHeight && a.hidden == b.hidden && a.collapsed == b.collapsed;
182 }
183 friend bool operator!=(const XLRowProperties& a, const XLRowProperties& b) noexcept { return !(a == b); }
184 };
185
191 {
192 uint16_t minCol{1};
193 uint16_t maxCol{1};
194 float width{0.0f};
195 uint32_t styleIndex{0};
196 uint8_t outlineLevel{0};
197 bool customWidth{false};
198 bool hidden{false};
199 bool collapsed{false};
200
201 friend bool operator==(const XLColumnProperties& a, const XLColumnProperties& b) noexcept
202 {
203 return a.minCol == b.minCol && a.maxCol == b.maxCol && a.width == b.width &&
204 a.styleIndex == b.styleIndex && a.outlineLevel == b.outlineLevel &&
205 a.customWidth == b.customWidth && a.hidden == b.hidden && a.collapsed == b.collapsed;
206 }
207 friend bool operator!=(const XLColumnProperties& a, const XLColumnProperties& b) noexcept { return !(a == b); }
208 };
209
214 {
215 uint16_t xSplit{0};
216 uint32_t ySplit{0};
217 std::string topLeftCell;
218 std::string state{"frozen"};
219 std::string activePane;
220
221 [[nodiscard]] bool empty() const noexcept { return xSplit == 0 && ySplit == 0; }
222
223 friend bool operator==(const XLPaneProperties& a, const XLPaneProperties& b) noexcept
224 {
225 return a.xSplit == b.xSplit && a.ySplit == b.ySplit && a.topLeftCell == b.topLeftCell &&
226 a.state == b.state && a.activePane == b.activePane;
227 }
228 friend bool operator!=(const XLPaneProperties& a, const XLPaneProperties& b) noexcept { return !(a == b); }
229 };
230
231 namespace XmlOps
232 {
233 [[nodiscard]] inline XLRowProperties readRowProps(XMLNode node) noexcept
234 {
235 XLRowProperties props;
236 if (node.empty()) return props;
237 props.rowIndex = node.attribute(XmlAttr::Ref).as_uint();
238 props.height = node.attribute(XmlAttr::Ht).as_float();
239 props.customHeight = node.attribute(XmlAttr::CustomHeight).as_bool();
240 props.hidden = node.attribute(XmlAttr::Hidden).as_bool();
241 props.outlineLevel = static_cast<uint8_t>(std::clamp(node.attribute(XmlAttr::OutlineLevel).as_uint(0), 0u, 7u));
242 props.collapsed = node.attribute(XmlAttr::Collapsed).as_bool();
243 props.styleIndex = node.attribute(XmlAttr::Style).as_uint();
244 return props;
245 }
246
247 inline void writeRowProps(XMLNode node, const XLRowProperties& props)
248 {
249 if (node.empty()) return;
250 if (props.rowIndex > 0) setAttr(node, XmlAttr::Ref, props.rowIndex);
251 if (props.height > 0.0f || props.customHeight) {
252 setAttr(node, XmlAttr::Ht, props.height);
253 setAttr(node, XmlAttr::CustomHeight, props.customHeight ? "1" : "0");
254 }
255 if (props.hidden) {
256 setAttr(node, XmlAttr::Hidden, "1");
257 } else {
259 }
260 uint8_t lvl = static_cast<uint8_t>(std::clamp(static_cast<unsigned>(props.outlineLevel), 0u, 7u));
261 if (lvl > 0) {
262 setAttr(node, XmlAttr::OutlineLevel, lvl);
263 } else {
265 }
266 if (props.collapsed) {
267 setAttr(node, XmlAttr::Collapsed, "1");
268 } else {
270 }
271 if (props.styleIndex > 0) {
272 setAttr(node, XmlAttr::Style, props.styleIndex);
273 } else {
275 }
276 }
277
278 [[nodiscard]] inline XLColumnProperties readColProps(XMLNode node) noexcept
279 {
280 XLColumnProperties props;
281 if (node.empty()) return props;
282 props.minCol = static_cast<uint16_t>(node.attribute(XmlAttr::Min).as_uint(1));
283 props.maxCol = static_cast<uint16_t>(node.attribute(XmlAttr::Max).as_uint(1));
284 props.width = node.attribute(XmlAttr::Width).as_float(0.0f);
285 props.customWidth = node.attribute(XmlAttr::CustomWidth).as_bool();
286 props.hidden = node.attribute(XmlAttr::Hidden).as_bool();
287 props.outlineLevel = static_cast<uint8_t>(std::clamp(node.attribute(XmlAttr::OutlineLevel).as_uint(0), 0u, 7u));
288 props.collapsed = node.attribute(XmlAttr::Collapsed).as_bool();
289 props.styleIndex = node.attribute(XmlAttr::ColStyle).as_uint(0);
290 return props;
291 }
292
293 inline void writeColProps(XMLNode node, const XLColumnProperties& props)
294 {
295 if (node.empty()) return;
296 setAttr(node, XmlAttr::Min, props.minCol);
297 setAttr(node, XmlAttr::Max, props.maxCol);
298 if (props.width > 0.0f || props.customWidth) {
299 setAttr(node, XmlAttr::Width, props.width);
300 setAttr(node, XmlAttr::CustomWidth, props.customWidth ? "1" : "0");
301 }
302 if (props.hidden) {
303 setAttr(node, XmlAttr::Hidden, "1");
304 } else {
306 }
307 uint8_t lvl = static_cast<uint8_t>(std::clamp(static_cast<unsigned>(props.outlineLevel), 0u, 7u));
308 if (lvl > 0) {
309 setAttr(node, XmlAttr::OutlineLevel, lvl);
310 } else {
312 }
313 if (props.collapsed) {
314 setAttr(node, XmlAttr::Collapsed, "1");
315 } else {
317 }
318 if (props.styleIndex > 0) {
320 } else {
322 }
323 }
324
325 [[nodiscard]] inline XLPaneProperties readPaneProps(XMLNode sheetViewNode) noexcept
326 {
327 XLPaneProperties props;
328 if (sheetViewNode.empty()) return props;
329 auto pane = sheetViewNode.child(XmlTag::Pane);
330 if (pane.empty()) return props;
331 props.xSplit = static_cast<uint16_t>(pane.attribute(XmlAttr::XSplit).as_uint(0));
332 props.ySplit = pane.attribute(XmlAttr::YSplit).as_uint(0);
333 props.topLeftCell = pane.attribute(XmlAttr::TopLeftCell).value();
334 props.state = pane.attribute(XmlAttr::State).as_string("frozen");
335 props.activePane = pane.attribute(XmlAttr::ActivePane).value();
336 return props;
337 }
338
339 inline void writePaneProps(XMLNode sheetViewNode, const XLPaneProperties& props)
340 {
341 if (sheetViewNode.empty()) return;
342 // Clean existing pane and selection per ECMA-376 invariant
343 sheetViewNode.remove_child(XmlTag::Pane);
344 while (auto sel = sheetViewNode.child(XmlTag::Selection)) {
345 sheetViewNode.remove_child(sel);
346 }
347 if (props.empty()) return;
348
349 // 1. ECMA-376 strict sequence: <pane> MUST precede <selection>
350 auto pane = sheetViewNode.prepend_child(XmlTag::Pane);
351 if (props.xSplit > 0) setAttr(pane, XmlAttr::XSplit, props.xSplit);
352 if (props.ySplit > 0) setAttr(pane, XmlAttr::YSplit, props.ySplit);
353 if (!props.topLeftCell.empty()) setAttr(pane, XmlAttr::TopLeftCell, props.topLeftCell);
354 if (!props.state.empty()) setAttr(pane, XmlAttr::State, props.state);
355 if (!props.activePane.empty()) setAttr(pane, XmlAttr::ActivePane, props.activePane);
356
357 // 2. <selection> appended after <pane>
358 if (props.xSplit > 0 && props.ySplit > 0) {
359 auto sel1 = sheetViewNode.insert_child_after(XmlTag::Selection, pane);
360 setAttr(sel1, XmlTag::Pane, "topRight");
361 auto sel2 = sheetViewNode.insert_child_after(XmlTag::Selection, sel1);
362 setAttr(sel2, XmlTag::Pane, "bottomLeft");
363 }
364 }
365
366 [[nodiscard]] inline XLTableProperties readTableProps(XMLNode node)
367 {
368 XLTableProperties props;
369 if (node.empty()) return props;
370 props.id = node.attribute(XmlAttr::Id).as_uint();
371 props.name = node.attribute(XmlAttr::Name).value();
373 props.rangeRef = node.attribute(XmlAttr::Ref).value();
377 return props;
378 }
379
380 inline void writeTableProps(XMLNode node, const XLTableProperties& props)
381 {
382 if (node.empty()) return;
383 if (props.id > 0) setAttr(node, XmlAttr::Id, props.id);
384 if (!props.name.empty()) setAttr(node, XmlAttr::Name, props.name);
385 if (!props.displayName.empty()) setAttr(node, XmlAttr::DisplayName, props.displayName);
386 if (!props.rangeRef.empty()) setAttr(node, XmlAttr::Ref, props.rangeRef);
389 if (props.totalsRowShown) setAttr(node, XmlAttr::TotalsRowShown, "1");
390 }
391 } // namespace XmlOps
392
399 {
400 public:
401 explicit CellNodeView(XMLNode node) noexcept : m_node(node) {}
402
403 [[nodiscard]] bool empty() const noexcept { return m_node.empty(); }
404 [[nodiscard]] XMLNode node() const noexcept { return m_node; }
405
406 [[nodiscard]] const char* ref() const noexcept { return m_node.attribute(XmlAttr::Ref).value(); }
407
408 [[nodiscard]] const char* type() const noexcept { return m_node.attribute(XmlAttr::Type).value(); }
409
410 [[nodiscard]] uint32_t styleIndex() const noexcept { return m_node.attribute(XmlAttr::Style).as_uint(); }
411
412 [[nodiscard]] const char* value() const noexcept
413 {
414 auto v = m_node.child(XmlTag::Value);
415 return v.text().get();
416 }
417
418 [[nodiscard]] const char* formula() const noexcept
419 {
420 auto f = m_node.child(XmlTag::Formula);
421 return f.text().get();
422 }
423
424 [[nodiscard]] bool hasFormula() const noexcept { return !m_node.child(XmlTag::Formula).empty(); }
425
426 private:
427 XMLNode m_node;
428 };
429
430} // namespace OpenXLSX
431
432#endif // OPENXLSX_XLXMLSCHEMA_HPP
Layer-2 OOXML DOM idioms built on the frozen XLXmlParser substrate.
uint32_t styleIndex() const noexcept
Definition XLXmlSchema.hpp:410
XMLNode node() const noexcept
Definition XLXmlSchema.hpp:404
bool hasFormula() const noexcept
Definition XLXmlSchema.hpp:424
const char * type() const noexcept
Definition XLXmlSchema.hpp:408
const char * formula() const noexcept
Definition XLXmlSchema.hpp:418
CellNodeView(XMLNode node) noexcept
Definition XLXmlSchema.hpp:401
const char * value() const noexcept
Definition XLXmlSchema.hpp:412
const char * ref() const noexcept
Definition XLXmlSchema.hpp:406
bool empty() const noexcept
Definition XLXmlSchema.hpp:403
bool remove_attribute(const char *name_)
Definition XLXmlParser.cpp:126
XMLNode prepend_child(T type_=node_element)
Definition XLXmlParser.hpp:164
XMLNode child(const char *name_) const
Definition XLXmlParser.cpp:150
XMLAttribute attribute(const char *name_) const
Definition XLXmlParser.cpp:96
bool empty() const
Definition XLXmlParser.cpp:58
bool remove_child(const char *name_)
Definition XLXmlParser.cpp:228
XMLNode insert_child_after(T type_, const XMLNode &node)
Definition XLXmlParser.hpp:172
bool as_bool(bool def=false) const
Definition XLXmlParser.cpp:617
unsigned int as_uint(unsigned int def=0) const
Definition XLXmlParser.cpp:599
const char * value() const
Definition XLXmlParser.cpp:521
Definition XLXmlSchema.hpp:89
constexpr const char * CustomWidth
Definition XLXmlSchema.hpp:126
constexpr const char * XSplit
Definition XLXmlSchema.hpp:135
constexpr const char * Ht
Definition XLXmlSchema.hpp:104
constexpr const char * TotalsRowFunction
Definition XLXmlSchema.hpp:110
constexpr const char * ShowGridLines
Definition XLXmlSchema.hpp:132
constexpr const char * TotalsRowShown
Definition XLXmlSchema.hpp:109
constexpr const char * BorderId
Definition XLXmlSchema.hpp:119
constexpr const char * Width
Definition XLXmlSchema.hpp:125
constexpr const char * Min
Definition XLXmlSchema.hpp:123
constexpr const char * ShowFirstColumn
Definition XLXmlSchema.hpp:112
constexpr const char * CustomHeight
Definition XLXmlSchema.hpp:103
constexpr const char * TotalsRowLabel
Definition XLXmlSchema.hpp:111
constexpr const char * Count
Definition XLXmlSchema.hpp:105
constexpr const char * TotalsRowCount
Definition XLXmlSchema.hpp:108
constexpr const char * WorkbookViewId
Definition XLXmlSchema.hpp:130
constexpr const char * ActivePane
Definition XLXmlSchema.hpp:138
constexpr const char * ZoomScale
Definition XLXmlSchema.hpp:134
constexpr const char * NumFmtId
Definition XLXmlSchema.hpp:120
constexpr const char * ColStyle
Definition XLXmlSchema.hpp:93
constexpr const char * Val
Definition XLXmlSchema.hpp:95
constexpr const char * Spans
Definition XLXmlSchema.hpp:101
constexpr const char * Hidden
Definition XLXmlSchema.hpp:102
constexpr const char * TopLeftCell
Definition XLXmlSchema.hpp:137
constexpr const char * FillId
Definition XLXmlSchema.hpp:118
constexpr const char * FontId
Definition XLXmlSchema.hpp:117
constexpr const char * Ref
Definition XLXmlSchema.hpp:90
constexpr const char * AuthorId
Definition XLXmlSchema.hpp:121
constexpr const char * Collapsed
Definition XLXmlSchema.hpp:128
constexpr const char * ShowRowColHeaders
Definition XLXmlSchema.hpp:133
constexpr const char * Sqref
Definition XLXmlSchema.hpp:94
constexpr const char * Rgb
Definition XLXmlSchema.hpp:100
constexpr const char * SheetId
Definition XLXmlSchema.hpp:98
constexpr const char * DyDescent
Definition XLXmlSchema.hpp:129
constexpr const char * State
Definition XLXmlSchema.hpp:99
constexpr const char * ShowRowStripes
Definition XLXmlSchema.hpp:114
constexpr const char * HeaderRowCount
Definition XLXmlSchema.hpp:107
constexpr const char * ShowColumnStripes
Definition XLXmlSchema.hpp:115
constexpr const char * TabSelected
Definition XLXmlSchema.hpp:131
constexpr const char * YSplit
Definition XLXmlSchema.hpp:136
constexpr const char * Id
Definition XLXmlSchema.hpp:97
constexpr const char * XfId
Definition XLXmlSchema.hpp:116
constexpr const char * Name
Definition XLXmlSchema.hpp:96
constexpr const char * Style
Definition XLXmlSchema.hpp:92
constexpr const char * Type
Definition XLXmlSchema.hpp:91
constexpr const char * ShowLastColumn
Definition XLXmlSchema.hpp:113
constexpr const char * DisplayName
Definition XLXmlSchema.hpp:106
constexpr const char * OutlineLevel
Definition XLXmlSchema.hpp:127
constexpr const char * Max
Definition XLXmlSchema.hpp:124
constexpr const char * ShapeId
Definition XLXmlSchema.hpp:122
Definition XLXmlSchema.hpp:26
constexpr std::string_view ContentTypes
Definition XLXmlSchema.hpp:35
constexpr std::string_view CustomProperties
Definition XLXmlSchema.hpp:38
constexpr std::string_view CoreProperties
Definition XLXmlSchema.hpp:36
constexpr std::string_view VML
Definition XLXmlSchema.hpp:32
constexpr std::string_view PackageRelationships
Definition XLXmlSchema.hpp:29
constexpr std::string_view Relationships
Definition XLXmlSchema.hpp:28
constexpr std::string_view SpreadsheetDrawing
Definition XLXmlSchema.hpp:31
constexpr std::string_view DrawingML
Definition XLXmlSchema.hpp:30
constexpr std::string_view OfficeVML
Definition XLXmlSchema.hpp:33
constexpr std::string_view ExtendedProperties
Definition XLXmlSchema.hpp:37
constexpr std::string_view SpreadsheetML
Definition XLXmlSchema.hpp:27
constexpr std::string_view ExcelVML
Definition XLXmlSchema.hpp:34
Definition XLXmlSchema.hpp:232
void writePaneProps(XMLNode sheetViewNode, const XLPaneProperties &props)
Definition XLXmlSchema.hpp:339
void writeTableProps(XMLNode node, const XLTableProperties &props)
Definition XLXmlSchema.hpp:380
XLColumnProperties readColProps(XMLNode node) noexcept
Definition XLXmlSchema.hpp:278
XLRowProperties readRowProps(XMLNode node) noexcept
Definition XLXmlSchema.hpp:233
void writeColProps(XMLNode node, const XLColumnProperties &props)
Definition XLXmlSchema.hpp:293
XLTableProperties readTableProps(XMLNode node)
Definition XLXmlSchema.hpp:366
void writeRowProps(XMLNode node, const XLRowProperties &props)
Definition XLXmlSchema.hpp:247
XLPaneProperties readPaneProps(XMLNode sheetViewNode) noexcept
Definition XLXmlSchema.hpp:325
Definition XLXmlSchema.hpp:42
constexpr const char * Pane
Definition XLXmlSchema.hpp:58
constexpr const char * Author
Definition XLXmlSchema.hpp:80
constexpr const char * Table
Definition XLXmlSchema.hpp:69
constexpr const char * AutoFilter
Definition XLXmlSchema.hpp:55
constexpr const char * Text
Definition XLXmlSchema.hpp:48
constexpr const char * TableParts
Definition XLXmlSchema.hpp:65
constexpr const char * TextBody
Definition XLXmlSchema.hpp:83
constexpr const char * MergeCell
Definition XLXmlSchema.hpp:52
constexpr const char * Filters
Definition XLXmlSchema.hpp:76
constexpr const char * Dimension
Definition XLXmlSchema.hpp:50
constexpr const char * PageMargins
Definition XLXmlSchema.hpp:61
constexpr const char * Drawing
Definition XLXmlSchema.hpp:67
constexpr const char * Formula
Definition XLXmlSchema.hpp:46
constexpr const char * InlineStr
Definition XLXmlSchema.hpp:47
constexpr const char * Value
Definition XLXmlSchema.hpp:45
constexpr const char * SheetView
Definition XLXmlSchema.hpp:56
constexpr const char * DataValidation
Definition XLXmlSchema.hpp:54
constexpr const char * TableColumns
Definition XLXmlSchema.hpp:70
constexpr const char * FilterColumn
Definition XLXmlSchema.hpp:73
constexpr const char * SheetPr
Definition XLXmlSchema.hpp:63
constexpr const char * Comment
Definition XLXmlSchema.hpp:82
constexpr const char * TableStyleInfo
Definition XLXmlSchema.hpp:72
constexpr const char * PageSetup
Definition XLXmlSchema.hpp:60
constexpr const char * TableColumn
Definition XLXmlSchema.hpp:71
constexpr const char * Comments
Definition XLXmlSchema.hpp:78
constexpr const char * DataValidations
Definition XLXmlSchema.hpp:53
constexpr const char * Cell
Definition XLXmlSchema.hpp:43
constexpr const char * HeaderFooter
Definition XLXmlSchema.hpp:62
constexpr const char * Authors
Definition XLXmlSchema.hpp:79
constexpr const char * CustomFilter
Definition XLXmlSchema.hpp:75
constexpr const char * Row
Definition XLXmlSchema.hpp:44
constexpr const char * Selection
Definition XLXmlSchema.hpp:59
constexpr const char * TablePart
Definition XLXmlSchema.hpp:66
constexpr const char * Cols
Definition XLXmlSchema.hpp:85
constexpr const char * LegacyDrawing
Definition XLXmlSchema.hpp:68
constexpr const char * TabColor
Definition XLXmlSchema.hpp:64
constexpr const char * Filter
Definition XLXmlSchema.hpp:77
constexpr const char * SheetData
Definition XLXmlSchema.hpp:49
constexpr const char * CustomFilters
Definition XLXmlSchema.hpp:74
constexpr const char * Col
Definition XLXmlSchema.hpp:84
constexpr const char * MergeCells
Definition XLXmlSchema.hpp:51
constexpr const char * SheetViews
Definition XLXmlSchema.hpp:57
constexpr const char * CommentList
Definition XLXmlSchema.hpp:81
Definition IXLCellProvider.hpp:24
XMLAttribute setAttr(XMLNode &node, const char *attrName, const char *attrVal)
Ensure attribute exists and always set its value (string).
Definition XLXmlHelpers.hpp:162
OpenXLSX_xml_node XMLNode
Definition XLXmlParser.hpp:64
Plain POD properties describing an OOXML Column (<col> element).
Definition XLXmlSchema.hpp:191
friend bool operator!=(const XLColumnProperties &a, const XLColumnProperties &b) noexcept
Definition XLXmlSchema.hpp:207
float width
Column width in character units.
Definition XLXmlSchema.hpp:194
bool collapsed
Definition XLXmlSchema.hpp:199
friend bool operator==(const XLColumnProperties &a, const XLColumnProperties &b) noexcept
Definition XLXmlSchema.hpp:201
bool hidden
Definition XLXmlSchema.hpp:198
uint16_t minCol
Start column (1-based, 1..16384).
Definition XLXmlSchema.hpp:192
uint16_t maxCol
End column (1-based, 1..16384).
Definition XLXmlSchema.hpp:193
bool customWidth
Definition XLXmlSchema.hpp:197
uint32_t styleIndex
Style index referencing cellXfs.
Definition XLXmlSchema.hpp:195
uint8_t outlineLevel
Outline grouping level (0..7).
Definition XLXmlSchema.hpp:196
Value-semantic POD properties describing worksheet window panes and freeze state.
Definition XLXmlSchema.hpp:214
std::string state
"frozen" or "split"
Definition XLXmlSchema.hpp:218
std::string activePane
"bottomRight", "topRight", or "bottomLeft"
Definition XLXmlSchema.hpp:219
friend bool operator==(const XLPaneProperties &a, const XLPaneProperties &b) noexcept
Definition XLXmlSchema.hpp:223
bool empty() const noexcept
Definition XLXmlSchema.hpp:221
friend bool operator!=(const XLPaneProperties &a, const XLPaneProperties &b) noexcept
Definition XLXmlSchema.hpp:228
uint16_t xSplit
Frozen column count (0 = no vertical split).
Definition XLXmlSchema.hpp:215
uint32_t ySplit
Frozen row count (0 = no horizontal split).
Definition XLXmlSchema.hpp:216
std::string topLeftCell
Top-left visible cell in active pane (e.g. "C5").
Definition XLXmlSchema.hpp:217
Plain POD properties describing an OOXML Row (<row> element).
Definition XLXmlSchema.hpp:168
float height
Row height in points.
Definition XLXmlSchema.hpp:170
friend bool operator!=(const XLRowProperties &a, const XLRowProperties &b) noexcept
Definition XLXmlSchema.hpp:183
bool hidden
Definition XLXmlSchema.hpp:174
uint32_t rowIndex
Row index (1-based, 1..1048576).
Definition XLXmlSchema.hpp:169
friend bool operator==(const XLRowProperties &a, const XLRowProperties &b) noexcept
Definition XLXmlSchema.hpp:177
uint8_t outlineLevel
Outline grouping level (0..7).
Definition XLXmlSchema.hpp:172
bool customHeight
Definition XLXmlSchema.hpp:173
bool collapsed
Definition XLXmlSchema.hpp:175
uint32_t styleIndex
Style index referencing cellXfs.
Definition XLXmlSchema.hpp:171
Plain POD properties describing an OOXML Table (ECMA-376.
Definition XLXmlSchema.hpp:145
uint32_t headerRowCount
Definition XLXmlSchema.hpp:150
uint32_t id
Definition XLXmlSchema.hpp:146
std::string displayName
Definition XLXmlSchema.hpp:148
std::string name
Definition XLXmlSchema.hpp:147
friend bool operator!=(const XLTableProperties &a, const XLTableProperties &b) noexcept
Definition XLXmlSchema.hpp:160
uint32_t totalsRowCount
Definition XLXmlSchema.hpp:151
std::string rangeRef
Definition XLXmlSchema.hpp:149
friend bool operator==(const XLTableProperties &a, const XLTableProperties &b) noexcept
Definition XLXmlSchema.hpp:154
bool totalsRowShown
Definition XLXmlSchema.hpp:152