Repository navigation
Keep the page setup print attributes when reading and writing - #427
Open
LuisFigueroaG wants to merge 1 commit into
Open
LuisFigueroaG wants to merge 1 commit into
LuisFigueroaG wants to merge 1 commit into
Conversation
PageSetup only read and wrote paperSize, scale, orientation, fitToHeight, fitToWidth, horizontalDpi and verticalDpi, so firstPageNumber, useFirstPageNumber, pageOrder, blackAndWhite, draft, cellComments, errors and copies were lost on a round trip. A pageSetup element with only these attributes was dropped entirely. Read these attributes, write back the ones that are set and add getters and setters for them, with PageOrderValues, CellCommentsValues and PrintErrorValues for the enum ones.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PageSetuponly keptpaperSize,scale,orientation,fitToHeight,fitToWidth,horizontalDpiandverticalDpi, so a sheet withwas saved as
<pageSetup paperSize="9" orientation="landscape"/>. The starting page number, page order, black and white and draft printing, how comments and errors are printed and the number of copies were all lost. ApageSetupelement with only these attributes was dropped entirely, because the writer skips the element when none of the known attributes is set.This adds getters/setters for
firstPageNumber,useFirstPageNumber,pageOrder,blackAndWhite,draft,cellComments,errorsandcopiestoPageSetup, withPageOrderValues,CellCommentsValuesandPrintErrorValuesfor the enum attributes. The reader keeps them and the writer writes back the ones that are set. Getters return the defaults from the spec when an attribute is missing (firstPageNumberandcopiesdefault to 1). A new workbook, or a file without any of these attributes, is written exactly as before.The added test inserts
pageSetupin a saved workbook, reads it, checks the values, writes it again and checks the element. It also checks the defaults, the output for a new workbook and setting the attributes through the API.