Skip to content

Commit

Permalink
* re-organize comment functions
Browse files Browse the repository at this point in the history
  • Loading branch information
JanMarvin committed Jul 19, 2023
1 parent 949184a commit 063ca7c
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 63 deletions.
10 changes: 8 additions & 2 deletions R/class-comment.R
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,21 @@ create_comment <- function(text,
invisible(wbComment$new(text = text, author = author, style = style, visible = visible, width = width[1], height = height[1]))
}

#' Internal comment functions
#'
#' Users are advised to use [wb_add_comment()] and [wb_remove_comment()]
#' @name comment_internal
NULL

#' @name write_comment
#' @rdname comment_internal
#' @param wb A workbook object
#' @param sheet A vector of names or indices of worksheets
#' @param col Column a column number of letter. For `remove_comment` this can be a range.
#' @param row A row number. For `remove_comment` this can be a range.
#' @param comment A Comment object. See [create_comment()].
#' @param dims worksheet cell "A1"
#' @rdname comment
#' @keywords internal
#' @export
write_comment <- function(
wb,
Expand Down Expand Up @@ -337,9 +343,9 @@ write_comment <- function(


#' @name remove_comment
#' @rdname comment_internal
#' @param gridExpand If `TRUE`, all data in rectangle min(rows):max(rows) X min(cols):max(cols)
#' will be removed.
#' @rdname comment
#' @keywords internal
#' @export
remove_comment <- function(
Expand Down
6 changes: 1 addition & 5 deletions R/class-workbook-wrappers.R
Original file line number Diff line number Diff line change
Expand Up @@ -2929,6 +2929,7 @@ wb_add_dxfs_style <- function(
#' @param ... additional arguments
#' @returns The `wbWorkbook` object
#' @seealso [wb_add_thread()]
#' @rdname comment
#' @export
wb_add_comment <- function(
wb,
Expand All @@ -2950,11 +2951,6 @@ wb_add_comment <- function(
}

#' Remove comment from worksheet
#' @param wb A workbook object
#' @param sheet A worksheet of the workbook
#' @param dims Optional row and column as spreadsheet dimension, e.g. "A1"
#' @param ... additional arguments
#' @returns The `wbWorkbook` object
#' @rdname comment
#' @export
wb_remove_comment <- function(
Expand Down
34 changes: 6 additions & 28 deletions man/comment.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions man/comment_internal.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 0 additions & 28 deletions man/wb_add_comment.Rd

This file was deleted.

0 comments on commit 063ca7c

Please sign in to comment.