Skip to content

Commit eb54510

Browse files
committed
Add missing XML attributes customWorkbookViews and customWorkbookView in the workbook, relate issue qax-os#152.
Signed-off-by: Ri Xu <xuri.me@gmail.com>
1 parent 96b3e1e commit eb54510

File tree

1 file changed

+59
-12
lines changed

1 file changed

+59
-12
lines changed

xmlWorkbook.go

Lines changed: 59 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,19 @@ type xlsxWorkbookRelation struct {
2020
// http://schemas.openxmlformats.org/spreadsheetml/2006/main - currently I have
2121
// not checked it for completeness - it does as much as I need.
2222
type xlsxWorkbook struct {
23-
XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main workbook"`
24-
FileVersion *xlsxFileVersion `xml:"fileVersion"`
25-
WorkbookPr *xlsxWorkbookPr `xml:"workbookPr"`
26-
WorkbookProtection *xlsxWorkbookProtection `xml:"workbookProtection"`
27-
BookViews xlsxBookViews `xml:"bookViews"`
28-
Sheets xlsxSheets `xml:"sheets"`
29-
ExternalReferences *xlsxExternalReferences `xml:"externalReferences"`
30-
DefinedNames *xlsxDefinedNames `xml:"definedNames"`
31-
CalcPr *xlsxCalcPr `xml:"calcPr"`
32-
PivotCaches *xlsxPivotCaches `xml:"pivotCaches"`
33-
ExtLst *xlsxExtLst `xml:"extLst"`
34-
FileRecoveryPr *xlsxFileRecoveryPr `xml:"fileRecoveryPr"`
23+
XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main workbook"`
24+
FileVersion *xlsxFileVersion `xml:"fileVersion"`
25+
WorkbookPr *xlsxWorkbookPr `xml:"workbookPr"`
26+
WorkbookProtection *xlsxWorkbookProtection `xml:"workbookProtection"`
27+
BookViews xlsxBookViews `xml:"bookViews"`
28+
Sheets xlsxSheets `xml:"sheets"`
29+
ExternalReferences *xlsxExternalReferences `xml:"externalReferences"`
30+
DefinedNames *xlsxDefinedNames `xml:"definedNames"`
31+
CalcPr *xlsxCalcPr `xml:"calcPr"`
32+
CustomWorkbookViews *xlsxCustomWorkbookViews `xml:"customWorkbookViews"`
33+
PivotCaches *xlsxPivotCaches `xml:"pivotCaches"`
34+
ExtLst *xlsxExtLst `xml:"extLst"`
35+
FileRecoveryPr *xlsxFileRecoveryPr `xml:"fileRecoveryPr"`
3536
}
3637

3738
// xlsxFileRecoveryPr maps sheet recovery information. This element defines
@@ -233,3 +234,49 @@ type xlsxCalcPr struct {
233234
IterateDelta float64 `xml:"iterateDelta,attr,omitempty"`
234235
RefMode string `xml:"refMode,attr,omitempty"`
235236
}
237+
238+
// xlsxCustomWorkbookViews defines the collection of custom workbook views that
239+
// are defined for this workbook. A customWorkbookView is similar in concept to
240+
// a workbookView in that its attributes contain settings related to the way
241+
// that the workbook should be displayed on a screen by a spreadsheet
242+
// application.
243+
type xlsxCustomWorkbookViews struct {
244+
CustomWorkbookView []xlsxCustomWorkbookView `xml:"customWorkbookView"`
245+
}
246+
247+
// xlsxCustomWorkbookView directly maps the customWorkbookView element. This
248+
// element specifies a single custom workbook view. A custom workbook view
249+
// consists of a set of display and print settings that you can name and apply
250+
// to a workbook. You can create more than one custom workbook view of the same
251+
// workbook. Custom Workbook Views are not required in order to construct a
252+
// valid SpreadsheetML document, and are not necessary if the document is never
253+
// displayed by a spreadsheet application, or if the spreadsheet application has
254+
// a fixed display for workbooks. However, if a spreadsheet application chooses
255+
// to implement configurable display modes, the customWorkbookView element
256+
// should be used to persist the settings for those display modes.
257+
type xlsxCustomWorkbookView struct {
258+
ActiveSheetID *int `xml:"activeSheetId,attr"`
259+
AutoUpdate *bool `xml:"autoUpdate,attr"`
260+
ChangesSavedWin *bool `xml:"changesSavedWin,attr"`
261+
GUID *string `xml:"guid,attr"`
262+
IncludeHiddenRowCol *bool `xml:"includeHiddenRowCol,attr"`
263+
IncludePrintSettings *bool `xml:"includePrintSettings,attr"`
264+
Maximized *bool `xml:"maximized,attr"`
265+
MergeInterval int `xml:"mergeInterval,attr"`
266+
Minimized *bool `xml:"minimized,attr"`
267+
Name *string `xml:"name,attr"`
268+
OnlySync *bool `xml:"onlySync,attr"`
269+
PersonalView *bool `xml:"personalView,attr"`
270+
ShowComments *string `xml:"showComments,attr"`
271+
ShowFormulaBar *bool `xml:"showFormulaBar,attr"`
272+
ShowHorizontalScroll *bool `xml:"showHorizontalScroll,attr"`
273+
ShowObjects *string `xml:"showObjects,attr"`
274+
ShowSheetTabs *bool `xml:"showSheetTabs,attr"`
275+
ShowStatusbar *bool `xml:"showStatusbar,attr"`
276+
ShowVerticalScroll *bool `xml:"showVerticalScroll,attr"`
277+
TabRatio *int `xml:"tabRatio,attr"`
278+
WindowHeight *int `xml:"windowHeight,attr"`
279+
WindowWidth *int `xml:"windowWidth,attr"`
280+
XWindow *int `xml:"xWindow,attr"`
281+
YWindow *int `xml:"yWindow,attr"`
282+
}

0 commit comments

Comments
 (0)