1#ifndef OPENXLSX_XLMERGECELLS_HPP
2#define OPENXLSX_XLMERGECELLS_HPP
6# pragma warning(disable : 4251)
7# pragma warning(disable : 4275)
19#include "OpenXLSX-Exports.hpp"
53 [[nodiscard]]
bool contains(uint32_t row, uint16_t col)
const noexcept
54 {
return row >= top && row <= bottom && col >= left && col <= right; }
61 {
return top <= other.bottom && bottom >= other.top && left <= other.right && right >= other.left; }
77 explicit XLMergeCells(
const XMLNode& rootNode, std::vector<std::string_view>
const& nodeOrder);
88 [[nodiscard]]
bool valid()
const;
93 [[nodiscard]]
XLMergeIndex findMerge(std::string_view reference)
const;
95 [[nodiscard]]
bool mergeExists(std::string_view reference)
const;
100 [[nodiscard]]
XLMergeIndex findMergeByCell(std::string_view cellRef)
const;
103 [[nodiscard]]
size_t count()
const;
108 [[nodiscard]]
const char* merge(
XLMergeIndex index)
const;
136 void shiftRows(int32_t delta, uint32_t fromRow);
143 void shiftCols(int32_t delta, uint16_t fromCol);
145 void print(std::basic_ostream<char>& ostr)
const;
149 std::vector<std::string_view> m_nodeOrder;
151 std::deque<XLMergeEntry> m_mergeCache;
Definition XLXmlParser.hpp:84
Definition XLCellReference.hpp:34
Manages merged cell ranges in a worksheet.
Definition XLMergeCells.hpp:38
XLMergeCells(const XLMergeCells &other)=default
const char * operator[](XLMergeIndex index) const
Definition XLMergeCells.hpp:110
XLMergeCells(XLMergeCells &&other) noexcept=default
XLMergeCells & operator=(XLMergeCells &&other) noexcept=default
XLMergeCells & operator=(const XLMergeCells &other)=default
Definition IZipArchive.hpp:18
constexpr const XLMergeIndex XLMergeNotFound
Definition XLMergeCells.hpp:26
constexpr size_t XLMaxMergeCells
Definition XLMergeCells.hpp:28
int32_t XLMergeIndex
Definition XLMergeCells.hpp:25
Definition XLMergeCells.hpp:65
std::string reference
Definition XLMergeCells.hpp:66
XLRect rect
Definition XLMergeCells.hpp:67
Internal numerical bounds representation for constant-time coordinate tests.
Definition XLMergeCells.hpp:44
uint32_t top
Definition XLMergeCells.hpp:45
uint16_t left
Definition XLMergeCells.hpp:46
uint16_t right
Definition XLMergeCells.hpp:48
uint32_t bottom
Definition XLMergeCells.hpp:47
bool overlaps(const XLRect &other) const noexcept
Detect spatial intersection between two regions to prevent overlapping merges, which are illegal in t...
Definition XLMergeCells.hpp:60
bool contains(uint32_t row, uint16_t col) const noexcept
Determine if a cell coordinate is within the merged region.
Definition XLMergeCells.hpp:53