11#ifndef OPENXLSX_XLMERGECELLS_HPP
12#define OPENXLSX_XLMERGECELLS_HPP
16# pragma warning(disable : 4251)
17# pragma warning(disable : 4275)
29#include "OpenXLSX-Exports.hpp"
63 [[nodiscard]]
bool contains(uint32_t row, uint16_t col)
const noexcept
64 {
return row >=
top && row <= bottom && col >=
left && col <=
right; }
71 {
return top <= other.bottom &&
bottom >= other.top &&
left <= other.right &&
right >= other.left; }
87 explicit XLMergeCells(
const XMLNode& rootNode, std::vector<std::string_view>
const& nodeOrder);
98 [[nodiscard]]
bool valid()
const;
105 [[nodiscard]]
bool mergeExists(std::string_view reference)
const;
113 [[nodiscard]]
size_t count()
const;
146 void shiftRows(int32_t delta, uint32_t fromRow);
153 void shiftCols(int32_t delta, uint16_t fromCol);
155 void print(std::basic_ostream<char>& ostr)
const;
159 std::vector<std::string_view> m_nodeOrder;
161 std::deque<XLMergeEntry> m_mergeCache;
Definition XLCellReference.hpp:44
XLMergeCells(const XLMergeCells &other)=default
const char * operator[](XLMergeIndex index) const
Definition XLMergeCells.hpp:120
XLMergeCells(XLMergeCells &&other) noexcept=default
XLMergeCells & operator=(XLMergeCells &&other) noexcept=default
bool mergeExists(std::string_view reference) const
Definition XLMergeCells.cpp:130
size_t count() const
Definition XLMergeCells.cpp:154
const char * merge(XLMergeIndex index) const
Definition XLMergeCells.cpp:159
XLMergeCells & operator=(const XLMergeCells &other)=default
XLMergeIndex findMerge(std::string_view reference) const
Definition XLMergeCells.cpp:119
bool valid() const
Definition XLMergeCells.cpp:114
XLMergeIndex findMergeByCell(std::string_view cellRef) const
Definition XLMergeCells.cpp:135
Definition IXLCellProvider.hpp:24
constexpr const XLMergeIndex XLMergeNotFound
Definition XLMergeCells.hpp:36
OpenXLSX_xml_node XMLNode
Definition XLXmlParser.hpp:64
constexpr size_t XLMaxMergeCells
Definition XLMergeCells.hpp:38
int32_t XLMergeIndex
Definition XLMergeCells.hpp:35
Definition XLMergeCells.hpp:75
std::string reference
Definition XLMergeCells.hpp:76
XLRect rect
Definition XLMergeCells.hpp:77
Internal numerical bounds representation for constant-time coordinate tests.
Definition XLMergeCells.hpp:54
uint32_t top
Definition XLMergeCells.hpp:55
uint16_t left
Definition XLMergeCells.hpp:56
uint16_t right
Definition XLMergeCells.hpp:58
uint32_t bottom
Definition XLMergeCells.hpp:57
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:70
bool contains(uint32_t row, uint16_t col) const noexcept
Determine if a cell coordinate is within the merged region.
Definition XLMergeCells.hpp:63