Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve window size and position, also get and set #466

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c86349b
preserve windows size on load and save workbook; get and set windows …
michael-dewar Apr 19, 2024
189a128
document()
michael-dewar Apr 19, 2024
205037c
lintr for my changes to package
michael-dewar Apr 19, 2024
66bb53c
add test for set/get and load/save windowSize
michael-dewar Apr 19, 2024
e7137cf
[Rcpp] & -> &&; | -> ||; sprintf() -> snprintf()
JanMarvin Jun 3, 2024
938ee65
[Rcpp] attempt to fix R-devel segfaults
JanMarvin Jun 3, 2024
0d3e9f6
[roxygen] updates
JanMarvin Jun 3, 2024
2864701
[misc] update gitignore
JanMarvin Jun 3, 2024
55dbbba
[misc] further cleanups
JanMarvin Jun 3, 2024
f3d212e
[misc] update gh-action
JanMarvin Jun 3, 2024
e49cfc5
Merge pull request #472 from ycphs/fix_rdevel_segfaults
ycphs Jun 3, 2024
39ba4da
[misc] update gh-action
JanMarvin Jun 3, 2024
f4501c5
[misc] skip_if_offline() requires curl
JanMarvin Jun 3, 2024
227ea7c
[misc] update gh-action
JanMarvin Jun 3, 2024
6b0cf0f
Merge pull request #473 from ycphs/fix_rdevel_segfaults2
ycphs Jun 3, 2024
e96a28e
[docs] fix R CMD check notes and invalid url. Update license year and…
JanMarvin Jul 17, 2024
0f042ee
[gha] add recheck.yml
JanMarvin Jul 17, 2024
36a41ba
Merge pull request #477 from ycphs/fix_cran_notes
JanMarvin Jul 17, 2024
c6b3517
fix loading "loadExample.xlsx"
JanMarvin Jul 18, 2024
853c9ce
Merge pull request #478 from ycphs/restore_load_example
JanMarvin Jul 19, 2024
dab1b9d
Revert "fixed typo - workbok -> workbook"
JanMarvin Jul 20, 2024
aacfe91
bump version
JanMarvin Jul 20, 2024
9b5698d
update NEWS
JanMarvin Jul 20, 2024
85b3c14
redoc
JanMarvin Jul 20, 2024
35e9095
update WORDLIST
JanMarvin Jul 20, 2024
8ab63cd
update lintr
JanMarvin Jul 20, 2024
7fcdeb3
remove revdep. it does not work and for whatever kind of reason is sp…
JanMarvin Jul 20, 2024
46245b9
Merge pull request #479 from ycphs/4.2.6
JanMarvin Jul 23, 2024
cbd60f3
[tests] fix broken skip_if_not_installed()
JanMarvin Jul 23, 2024
d86a54e
Merge pull request #481 from ycphs/gh_issue_480
JanMarvin Jul 23, 2024
66fbe60
Merge window size commits with updates in ycphs
michael-dewar Jul 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 11 additions & 17 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 12 * * *'

name: R-CMD-check

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
Expand All @@ -20,25 +20,18 @@ jobs:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'oldrel-1'}
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: 'devel', http-user-agent: 'release'}
- {os: macOS-latest, r: 'oldrel-1'}
- {os: macOS-latest, r: 'release'}
- {os: macOS-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

if: "!contains(github.event.head_commit.message, 'revdepcheck run - No changes to commit')"
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -55,4 +48,5 @@ jobs:

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
10 changes: 7 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master, development]
branches: [main, master]
pull_request:
branches: [main, master, development]
branches: [main, master]

name: lint

permissions: read-all

jobs:
lint:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
Expand All @@ -28,3 +30,5 @@ jobs:
- name: Lint
run: lintr::lint_package()
shell: Rscript {0}
env:
LINTR_ERROR_ON_LINT: true
18 changes: 18 additions & 0 deletions .github/workflows/recheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
workflow_dispatch:
inputs:
which:
type: choice
description: Which dependents to check
options:
- strong
- most

name: Reverse dependency check

jobs:
revdep_check:
name: Reverse check ${{ inputs.which }} dependents
uses: r-devel/recheck/.github/workflows/recheck.yml@v1
with:
which: ${{ inputs.which }}
94 changes: 0 additions & 94 deletions .github/workflows/revdep.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.Rproj.user
.Rhistory
.RData
.DS_Store
src/*.o
src/*.so
src/*.dll
Expand All @@ -19,3 +20,4 @@ docs/
openxlsx.Rcheck/
openxlsx*.tar.gz
openxlsx*.tgz
vignettes/*
12 changes: 9 additions & 3 deletions .lintr
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ linters: linters_with_defaults(
function_left_parentheses_linter = NULL, #
spaces_inside_linter = NULL, #
spaces_left_parentheses_linter = NULL, #
no_tab_linter = NULL, #
single_quotes_linter = NULL, #
object_length_linter = NULL, #
assignment_linter = NULL # just one case
assignment_linter = NULL, # just one case
vector_logic_linter = NULL, # many
indentation_linter = NULL, # many
quotes_linter = NULL,
T_and_F_symbol_linter = NULL,
seq_linter = NULL,
trailing_blank_lines_linter = NULL,
paren_body_linter = NULL,
semicolon_linter = NULL
)
14 changes: 9 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Type: Package
Package: openxlsx
Title: Read, Write and Edit xlsx Files
Version: 4.2.5.9001
Date: 2021-12-13
Version: 4.2.6.1
Date: 2024-07-23
Authors@R:
c(person(given = "Philipp",
family = "Schauberger",
role = c("aut", "cre"),
role = "aut",
email = "[email protected]"),
person(given = "Alexander",
family = "Walker",
Expand All @@ -20,7 +20,7 @@ Authors@R:
role = "ctb"),
person(given = "Jan Marvin",
family = "Garbuszus",
role = "ctb",
role = c("ctb", "cre"),
email = "[email protected]"),
person(given = "Jordan Mark",
family = "Barbone",
Expand Down Expand Up @@ -51,6 +51,8 @@ Imports:
utils,
zip
Suggests:
curl,
formula.tools,
knitr,
rmarkdown,
testthat
Expand All @@ -60,7 +62,7 @@ VignetteBuilder:
knitr
Encoding: UTF-8
Language: en-US
RoxygenNote: 7.2.0
RoxygenNote: 7.3.2
Collate:
'CommentClass.R'
'HyperlinkClass.R'
Expand All @@ -83,6 +85,7 @@ Collate:
'openxlsx.R'
'openxlsxCoerce.R'
'readWorkbook.R'
'setWindowSize.R'
'sheet_data_class.R'
'utils.R'
'workbook_column_widths.R'
Expand All @@ -95,3 +98,4 @@ Collate:
'writexlsx.R'
'zzz.R'
Roxygen: list(markdown = TRUE)
LazyData: true
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2014-2022
YEAR: 2014-2024
COPYRIGHT HOLDER: openxlsx authors
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export(getNamedRegions)
export(getSheetNames)
export(getStyles)
export(getTables)
export(getWindowSize)
export(groupColumns)
export(groupRows)
export(insertImage)
Expand Down Expand Up @@ -77,6 +78,7 @@ export(setHeader)
export(setHeaderFooter)
export(setLastModifiedBy)
export(setRowHeights)
export(setWindowSize)
export(sheetVisibility)
export(sheetVisible)
export(sheets)
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# openxlsx (development version)
# openxlsx 4.2.6

* Fix external links ([#410](https://github.com/ycphs/openxlsx/pull/410))
* Do not add unneccessary sheetPr node ([#409](https://github.com/ycphs/openxlsx/pull/409))
* Add support for `namedRegion`s having dots and other special characters ([#338](https://github.com/ycphs/openxlsx/issues/338)).
* Add type blanks and not blanks to conditional formatting ([#311](https://github.com/ycphs/openxlsx/pull/311))

Expand Down
9 changes: 8 additions & 1 deletion R/WorkbookClass.R
Original file line number Diff line number Diff line change
Expand Up @@ -3238,6 +3238,12 @@ Workbook$methods(
workbook$sheets <<- workbook$sheets[sheetOrder]
}

## preserve window size and position on save:
bookViews <-workbook$bookViews
xWindow <- getAttrs(bookViews, "xWindow")$xWindow
yWindow <- getAttrs(bookViews, "yWindow")$yWindow
windowWidth <- getAttrs(bookViews, "windowWidth")$windowWidth
windowHeight <- getAttrs(bookViews, "windowHeight")$windowHeight


## re-assign tabSelected
Expand All @@ -3247,7 +3253,8 @@ Workbook$methods(
visible_sheets <- which(state %in% "visible")
workbook$bookViews <<-
sprintf(
'<bookViews><workbookView xWindow="0" yWindow="0" windowWidth="13125" windowHeight="6105" firstSheet="%s" activeTab="%s"/></bookViews>',
'<bookViews><workbookView xWindow="%s" yWindow="%s" windowWidth="%s" windowHeight="%s" firstSheet="%s" activeTab="%s"/></bookViews>',
xWindow, yWindow, windowWidth, windowHeight,
visible_sheet_index - 1L,
ActiveSheet - 1L
)
Expand Down
Loading