awalker89 / openxlsx

R package for .xlsx file reading and writing.
Other
365 stars 78 forks source link

`deleteData()` does not remove hyperlinks #452

Open rkrug opened 5 years ago

rkrug commented 5 years ago

Expected Behavior

when a cell contains a hyperlink, deleteData() "Delete contents and styling from a cell." as stated in the documentation. Content includes also hyperlinks.

Actual Behavior

The text in the cell is removed, but the hyperlink is left.

Steps to Reproduce the Problem

The excel file ExampleHyperlink.xlsx

library(openxlsx)
wb <- openxlsx::loadWorkbook("ExampleHyperlink.xlsx")
openxlsx::openXL(wb)
openxlsx::deleteData(
  wb = wb,
  sheet = 1,
  cols = 1,
  rows = 1
)
openxlsx::openXL(wb)

when you move the mousse over the cell (1,1), it shows the "hand" and when you click in the cell, it goes to the URL.

sessionInfo()


> sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-apple-darwin17.7.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /usr/local/Cellar/openblas/0.3.5/lib/libopenblasp-r0.3.5.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] openxlsx_4.1.1

loaded via a namespace (and not attached):
[1] compiler_3.5.2 tools_3.5.2    Rcpp_1.0.0     zip_1.0.0      packrat_0.5.0 
>