Skip to content

Commit

Permalink
element identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand committed Nov 28, 2023
1 parent d5e9883 commit 4812d0e
Show file tree
Hide file tree
Showing 16 changed files with 1,117 additions and 792 deletions.
196 changes: 114 additions & 82 deletions src/odr/document_element.cpp

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions src/odr/document_element.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ class Circle;
class CustomShape;
class Image;

using ElementIdentifier = std::uint64_t;
using ColumnIndex = std::uint32_t;
using RowIndex = std::uint32_t;

enum class ElementType {
none,

Expand Down Expand Up @@ -168,6 +172,7 @@ class Element {
protected:
const internal::abstract::Document *m_document{nullptr};
internal::abstract::Element *m_element{nullptr};
ElementIdentifier m_elementId{0};
};

class ElementIterator {
Expand All @@ -193,6 +198,7 @@ class ElementIterator {
private:
const internal::abstract::Document *m_document{nullptr};
internal::abstract::Element *m_element{nullptr};
ElementIdentifier m_elementId{0};
};

template <typename T> class TypedElement : public Element {
Expand Down Expand Up @@ -252,9 +258,9 @@ class Sheet final : public TypedElement<internal::abstract::Sheet> {
[[nodiscard]] TableDimensions
content(std::optional<TableDimensions> range) const;

[[nodiscard]] TableColumn column(std::uint32_t column) const;
[[nodiscard]] TableRow row(std::uint32_t row) const;
[[nodiscard]] TableCell cell(std::uint32_t column, std::uint32_t row) const;
[[nodiscard]] TableColumn column(ColumnIndex column) const;
[[nodiscard]] TableRow row(RowIndex row) const;
[[nodiscard]] TableCell cell(ColumnIndex column, RowIndex row) const;

[[nodiscard]] ElementRange shapes() const;

Expand Down
2 changes: 0 additions & 2 deletions src/odr/internal/abstract/document.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef ODR_INTERNAL_ABSTRACT_DOCUMENT_H
#define ODR_INTERNAL_ABSTRACT_DOCUMENT_H

#include <odr/document.hpp>

#include <memory>

namespace odr {
Expand Down
Loading

0 comments on commit 4812d0e

Please sign in to comment.