Skip to content

Commit

Permalink
fix ods
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand committed Dec 10, 2023
1 parent 37e1698 commit 23e552d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
19 changes: 13 additions & 6 deletions src/odr/internal/odf/odf_spreadsheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,24 @@ pugi::xml_node Sheet::row_(std::uint32_t row) const {
return {};
}

pugi::xml_node Sheet::cell_(std::uint32_t column, std::uint32_t row) const {
if (auto row_it = util::map::lookup_greater_than(m_rows, row);
row_it != std::end(m_rows)) {
const auto &cells = row_it->second.cells;
if (auto cell_it = util::map::lookup_greater_than(cells, column);
cell_it != std::end(cells)) {
return cell_it->second;
}
}
return {};
}

common::ResolvedStyle Sheet::cell_style_(const abstract::Document *document,
std::uint32_t column,
std::uint32_t row) const {
auto it = m_cells.find({column, row});
if (it == std::end(m_cells)) {
return common::ResolvedStyle();
}

const char *style_name = nullptr;

auto cell_node = it->second->m_node;
auto cell_node = cell_(column, row);
if (auto attr = cell_node.attribute("table:style-name")) {
style_name = attr.value();
}
Expand Down
1 change: 1 addition & 0 deletions src/odr/internal/odf/odf_spreadsheet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Sheet final : public Element, public abstract::Sheet {

pugi::xml_node column_(std::uint32_t) const;
pugi::xml_node row_(std::uint32_t) const;
pugi::xml_node cell_(std::uint32_t column, std::uint32_t row) const;

common::ResolvedStyle cell_style_(const abstract::Document *,
std::uint32_t column,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,18 @@ TableStyle Sheet::style(const abstract::Document *) const {
}

TableColumnStyle Sheet::column_style(const abstract::Document *,
std::uint32_t column) const {
std::uint32_t /*column*/) const {
return TableColumnStyle(); // TODO
}

TableRowStyle Sheet::row_style(const abstract::Document *,
std::uint32_t row) const {
std::uint32_t /*row*/) const {
return TableRowStyle(); // TODO
}

TableCellStyle Sheet::cell_style(const abstract::Document *,
std::uint32_t column,
std::uint32_t row) const {
std::uint32_t /*column*/,
std::uint32_t /*row*/) const {
return TableCellStyle(); // TODO
}

Expand Down

0 comments on commit 23e552d

Please sign in to comment.