Skip to content

Commit

Permalink
Fix Excel file corruption when multiple data validation on a sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
ycphs committed Nov 8, 2019
1 parent 40af512 commit 5b43297
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 29 deletions.
8 changes: 4 additions & 4 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ buildCellList <- function(r, t, v) {
.Call(`_openxlsx_buildCellList`, r, t, v)
}

write_worksheet_xml_2 <- function(prior, post, sheet_data, row_heights, R_fileName) {
.Call(`_openxlsx_write_worksheet_xml_2`, prior, post, sheet_data, row_heights, R_fileName)
}

write_worksheet_xml <- function(prior, post, sheet_data, R_fileName) {
.Call(`_openxlsx_write_worksheet_xml`, prior, post, sheet_data, R_fileName)
}
Expand All @@ -137,3 +133,7 @@ build_table_xml <- function(table, tableStyleXML, ref, colNames, showColNames, w
.Call(`_openxlsx_build_table_xml`, table, tableStyleXML, ref, colNames, showColNames, withFilter)
}

write_worksheet_xml_2 <- function(prior, post, sheet_data, row_heights, R_fileName) {
.Call(`_openxlsx_write_worksheet_xml_2`, prior, post, sheet_data, row_heights, R_fileName)
}

12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ install.packages("openxlsx", dependencies = TRUE)
```R
install.packages(c("Rcpp", "devtools"), dependencies = TRUE)
require(devtools)
install_github("david-f1976/openxlsx")
install_github("ycphs/openxlsx")
```

## Bug/feature request
Expand All @@ -42,11 +42,5 @@ Thanks, [here](https://github.com/ycphs/openxlsx/issues).
[Here](https://raw.githubusercontent.com/ycphs/openxlsx/master/NEWS).

## Authors and Contributors
A list is automagically maintained
<<<<<<< HEAD
[here](https://github.com/ycphs/openxlsx/graphs/contributors).
||||||| merged common ancestors
[here](https://github.com/awalker89/openxlsx/graphs/contributors).
=======
[here](https://github.com/awalker89/openxlsx/graphs/contributors).
>>>>>>> a9f00beff7158145926d3c98c5afcccb550c5e2a
A list is automagically maintained [here](https://github.com/ycphs/openxlsx/graphs/contributors).

32 changes: 16 additions & 16 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,21 +354,6 @@ BEGIN_RCPP
return rcpp_result_gen;
END_RCPP
}
// write_worksheet_xml_2
SEXP write_worksheet_xml_2(std::string prior, std::string post, Reference sheet_data, CharacterVector row_heights, std::string R_fileName);
RcppExport SEXP _openxlsx_write_worksheet_xml_2(SEXP priorSEXP, SEXP postSEXP, SEXP sheet_dataSEXP, SEXP row_heightsSEXP, SEXP R_fileNameSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< std::string >::type prior(priorSEXP);
Rcpp::traits::input_parameter< std::string >::type post(postSEXP);
Rcpp::traits::input_parameter< Reference >::type sheet_data(sheet_dataSEXP);
Rcpp::traits::input_parameter< CharacterVector >::type row_heights(row_heightsSEXP);
Rcpp::traits::input_parameter< std::string >::type R_fileName(R_fileNameSEXP);
rcpp_result_gen = Rcpp::wrap(write_worksheet_xml_2(prior, post, sheet_data, row_heights, R_fileName));
return rcpp_result_gen;
END_RCPP
}
// write_worksheet_xml
SEXP write_worksheet_xml(std::string prior, std::string post, Reference sheet_data, std::string R_fileName);
RcppExport SEXP _openxlsx_write_worksheet_xml(SEXP priorSEXP, SEXP postSEXP, SEXP sheet_dataSEXP, SEXP R_fileNameSEXP) {
Expand Down Expand Up @@ -444,6 +429,21 @@ BEGIN_RCPP
return rcpp_result_gen;
END_RCPP
}
// write_worksheet_xml_2
SEXP write_worksheet_xml_2(std::string prior, std::string post, Reference sheet_data, CharacterVector row_heights, std::string R_fileName);
RcppExport SEXP _openxlsx_write_worksheet_xml_2(SEXP priorSEXP, SEXP postSEXP, SEXP sheet_dataSEXP, SEXP row_heightsSEXP, SEXP R_fileNameSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< std::string >::type prior(priorSEXP);
Rcpp::traits::input_parameter< std::string >::type post(postSEXP);
Rcpp::traits::input_parameter< Reference >::type sheet_data(sheet_dataSEXP);
Rcpp::traits::input_parameter< CharacterVector >::type row_heights(row_heightsSEXP);
Rcpp::traits::input_parameter< std::string >::type R_fileName(R_fileNameSEXP);
rcpp_result_gen = Rcpp::wrap(write_worksheet_xml_2(prior, post, sheet_data, row_heights, R_fileName));
return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
{"_openxlsx_calc_column_widths", (DL_FUNC) &_openxlsx_calc_column_widths, 7},
Expand Down Expand Up @@ -474,12 +474,12 @@ static const R_CallMethodDef CallEntries[] = {
{"_openxlsx_buildCellTypes", (DL_FUNC) &_openxlsx_buildCellTypes, 2},
{"_openxlsx_build_cell_merges", (DL_FUNC) &_openxlsx_build_cell_merges, 1},
{"_openxlsx_buildCellList", (DL_FUNC) &_openxlsx_buildCellList, 3},
{"_openxlsx_write_worksheet_xml_2", (DL_FUNC) &_openxlsx_write_worksheet_xml_2, 5},
{"_openxlsx_write_worksheet_xml", (DL_FUNC) &_openxlsx_write_worksheet_xml, 4},
{"_openxlsx_buildMatrixNumeric", (DL_FUNC) &_openxlsx_buildMatrixNumeric, 6},
{"_openxlsx_buildMatrixMixed", (DL_FUNC) &_openxlsx_buildMatrixMixed, 8},
{"_openxlsx_matrixRowInds", (DL_FUNC) &_openxlsx_matrixRowInds, 1},
{"_openxlsx_build_table_xml", (DL_FUNC) &_openxlsx_build_table_xml, 6},
{"_openxlsx_write_worksheet_xml_2", (DL_FUNC) &_openxlsx_write_worksheet_xml_2, 5},
{NULL, NULL, 0}
};

Expand Down

0 comments on commit 5b43297

Please sign in to comment.