Skip to content

Commit 04c9dcb

Browse files
authored
fix: Exports S3 methods, silence roxygen warnings
Roxygen throws warnings. Export of s3 methods required. See discussion here: r-lib/roxygen2#1592
1 parent b6f053c commit 04c9dcb

File tree

8 files changed

+33
-1
lines changed

8 files changed

+33
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: officer
33
Title: Manipulation of Microsoft Word and PowerPoint Documents
4-
Version: 0.6.7.011
4+
Version: 0.6.7.012
55
Authors@R: c(
66
person("David", "Gohel", , "[email protected]", role = c("aut", "cre")),
77
person("Stefan", "Moog", , "[email protected]", role = "aut"),

NAMESPACE

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
# Generated by roxygen2: do not edit by hand
22

3+
S3method("[",core_properties)
4+
S3method("[",custom_properties)
5+
S3method("[<-",core_properties)
6+
S3method("[<-",custom_properties)
37
S3method(as.character,fp_tab)
48
S3method(as.character,fp_tabs)
9+
S3method(as.character,officer_cursor)
10+
S3method(as.data.frame,external_img)
11+
S3method(as.data.frame,fpar)
512
S3method(as.matrix,rpptx)
613
S3method(body_add,block_caption)
714
S3method(body_add,block_list)
@@ -18,6 +25,7 @@ S3method(body_add,numeric)
1825
S3method(body_add,plot_instr)
1926
S3method(body_add,run_columnbreak)
2027
S3method(body_add,run_pagebreak)
28+
S3method(dim,external_img)
2129
S3method(format,fp_cell)
2230
S3method(format,fp_par)
2331
S3method(format,fp_text)
@@ -31,6 +39,8 @@ S3method(fortify_location,location_type)
3139
S3method(length,rdocx)
3240
S3method(length,rpptx)
3341
S3method(length,rxlsx)
42+
S3method(ph_from_location,location_label)
43+
S3method(ph_from_location,location_type)
3444
S3method(ph_with,block_list)
3545
S3method(ph_with,character)
3646
S3method(ph_with,data.frame)

R/core_properties.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ default_cp_tags <- list(
5151
category = list(ns = "cp", attrs = NA_character_)
5252
)
5353

54+
55+
#' @export
5456
`[<-.core_properties` <- function( x, i, j, value ){
5557
if( !i %in% x$data[,"name"] ) {
5658
attrs <- ifelse(is.na(default_cp_tags[[i]]$attrs), "", paste0(" ", default_cp_tags[[i]]$attrs))
@@ -61,10 +63,14 @@ default_cp_tags <- list(
6163
}
6264
x
6365
}
66+
67+
68+
#' @export
6469
`[.core_properties` <- function( x, i, j ){
6570
x$data[i,j]
6671
}
6772

73+
6874
write_core_properties <- function(core_matrix, package_dir){
6975
ns_ <- core_matrix$ns
7076
core_matrix <- core_matrix$data

R/custom_properties.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ read_custom_properties <- function(package_dir) {
3636
z
3737
}
3838

39+
40+
#' @export
3941
`[<-.custom_properties` <- function(x, i, j, value) {
4042
if (!i %in% x$data[, "name"]) {
4143
if (nrow(x$data) < 1) {
@@ -50,6 +52,9 @@ read_custom_properties <- function(package_dir) {
5052
}
5153
x
5254
}
55+
56+
57+
#' @export
5358
`[.custom_properties` <- function(x, i, j) {
5459
if (nrow(x$data) < 1) {
5560
return(character())

R/docx_cursor.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ officer_cursor <- function(node) {
207207
class(x) <- "officer_cursor"
208208
x
209209
}
210+
211+
212+
#' @export
210213
as.character.officer_cursor <- function(x, ...) {
211214
if (length(x$nodes_names) < 1) {
212215
return(NA_character_)

R/ooxml_block_objects.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,7 @@ fortify_fpar <- function(x){
886886
}
887887

888888

889+
#' @export
889890
as.data.frame.fpar <- function( x, ...){
890891
chks <- fortify_fpar(x)
891892
chks <- chks[sapply(chks, function(x) inherits(x, "ftext"))]
@@ -897,6 +898,7 @@ as.data.frame.fpar <- function( x, ...){
897898
rbind_match_columns(chks)
898899
}
899900

901+
900902
#' @export
901903
to_wml.fpar <- function(x, add_ns = FALSE, style_id = NULL, ...) {
902904

R/ooxml_run_objects.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,11 +1050,15 @@ external_img <- function(src, width = .5, height = .2, unit = "in", guess_size =
10501050
src
10511051
}
10521052

1053+
1054+
#' @export
10531055
dim.external_img <- function(x) {
10541056
x <- attr(x, "dims")
10551057
data.frame(width = x$width, height = x$height)
10561058
}
10571059

1060+
1061+
#' @export
10581062
as.data.frame.external_img <- function(x, ...) {
10591063
dimx <- attr(x, "dims")
10601064
data.frame(path = as.character(x), width = dimx$width, height = dimx$height, alt = attr(x, "alt"), stringsAsFactors = FALSE)

R/ppt_notes.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ ph_from_location <- function(loc, doc, ...){
143143
}
144144

145145

146+
#' @export
146147
ph_from_location.location_label <- function(loc, doc, ...) {
147148
xfrm <- doc$notesMaster$xfrm()
148149
location <- xfrm[xfrm$ph_label == loc$ph_label, ]
@@ -155,6 +156,7 @@ ph_from_location.location_label <- function(loc, doc, ...) {
155156
}
156157

157158

159+
#' @export
158160
ph_from_location.location_type <- function(loc, doc, ...) {
159161
xfrm <- doc$notesMaster$xfrm()
160162
location <- xfrm[xfrm$type == loc$type, ]

0 commit comments

Comments
 (0)