From 9fdae10bb9649c21b48d02c9256fe6b48509f6d3 Mon Sep 17 00:00:00 2001 From: David Gohel Date: Fri, 23 Feb 2024 00:42:59 +0100 Subject: [PATCH] fix: Word captions set with `set_caption()` can have no bookmark and have autonumber used together. fix #527 --- DESCRIPTION | 2 +- NEWS.md | 2 ++ R/captions.R | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 27368cb7..9cc530e8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: flextable Type: Package Title: Functions for Tabular Reporting -Version: 0.9.5.012 +Version: 0.9.5.013 Authors@R: c( person("David", "Gohel", role = c("aut", "cre"), email = "david.gohel@ardata.fr"), diff --git a/NEWS.md b/NEWS.md index e2570a97..98736d5a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,6 +7,8 @@ - `footnote()` handle undefined `ref_symbols` argument - `delete_rows()` does not delete rows if the row selection is empty - improve `gen_grob()` alignments when wrapping text +- Word captions set with `set_caption()` can have no bookmark and have +autonumber used together. ## Changes diff --git a/R/captions.R b/R/captions.R index a04eb662..8f5e5421 100644 --- a/R/captions.R +++ b/R/captions.R @@ -269,7 +269,7 @@ has_caption <- function(x) { has_autonum <- function(x) { has_it <- FALSE - if (!is.null(x$caption$autonum$bookmark)) { + if (!is.null(x$caption$autonum)) { has_it <- TRUE } has_it