Skip to content

Commit

Permalink
initial implementation of calcChain parser. I can only imagine how ma…
Browse files Browse the repository at this point in the history
…ny problems I'm overlooking here
  • Loading branch information
tfussell committed Mar 13, 2017
1 parent f908dca commit c11fcd1
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions source/detail/xlsx_producer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,13 +711,25 @@ void xlsx_producer::write_calculation_chain(const relationship & /*rel*/)
{
write_start_element(constants::ns("spreadsheetml"), "calcChain");
write_namespace(constants::ns("spreadsheetml"), "");
/*
write_start_element(constants::ns("spreadsheetml"), "c");
write_attribute("r", "B2");
write_attribute("i", "1");
write_attribute("l", "1");
write_end_element(constants::ns("spreadsheetml"), "c");
*/

std::size_t ws_index = 1;

for (auto ws : source_)
{
for (auto row : ws)
{
for (auto cell : row)
{
if (!cell.has_formula()) continue;

write_start_element(constants::ns("spreadsheetml"), "c");
write_attribute("r", cell.reference().to_string());
write_attribute("i", ws_index);
write_end_element(constants::ns("spreadsheetml"), "c");
}
}
}

write_end_element(constants::ns("spreadsheetml"), "calcChain");
}

Expand Down

0 comments on commit c11fcd1

Please sign in to comment.