Skip to content

Commit

Permalink
[write] similar to load, skip Rcpp::String() if cell type is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
JanMarvin committed Dec 28, 2024
1 parent a6d173c commit 26f1308
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/write_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ pugi::xml_document xml_sheet_data(Rcpp::DataFrame row_attr, Rcpp::DataFrame cc)
cell.append_child("v").append_attribute("xml:space").set_value("preserve");
cell.child("v").append_child(pugi::node_pcdata).set_value(" ");
} else {
cell.append_child("v").append_child(pugi::node_pcdata).set_value(to_string(cc_v[i]).c_str());
if (std::string(cc_c_t[i]).empty())
cell.append_child("v").append_child(pugi::node_pcdata).set_value(std::string(cc_v[i]).c_str());
else
cell.append_child("v").append_child(pugi::node_pcdata).set_value(to_string(cc_v[i]).c_str());
}
}

Expand Down

0 comments on commit 26f1308

Please sign in to comment.