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

Refactor Worksheet and Pane values to optional #31

Merged
merged 3 commits into from
Jan 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions Sources/CoreXLSX/Worksheet/Cell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public struct Cell: Codable, Equatable {

/// FIXME: Attribute "s" in a cell is an index into the styles table,
/// while the cell type "s" corresponds to the shared string table.
/// Can XMLCoder distinguish between an attribute and a
/// node having the same name?
/// Can XMLCoder distinguish between an attribute and an
/// element having the same name?
public let s: String?
public let inlineString: InlineString?
public let formula: String?
Expand Down
12 changes: 6 additions & 6 deletions Sources/CoreXLSX/Worksheet/Worksheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public struct Worksheet: Codable {
}

/// https://docs.microsoft.com/en-us/dotnet/api/documentformat.openxml.spreadsheet.sheetdimension?view=openxml-2.8.1
public let dimension: Dimension
public let dimension: Dimension?

public let sheetViews: SheetViews

Expand Down Expand Up @@ -144,11 +144,11 @@ public struct SheetView: Codable {
}

public struct Pane: Codable {
public let topLeftCell: String
public let xSplit: String
public let ySplit: String
public let activePane: String
public let state: String
public let topLeftCell: String?
public let xSplit: String?
public let ySplit: String?
public let activePane: String?
public let state: String?
}

@available(*, deprecated, renamed: "Columns")
Expand Down
2 changes: 1 addition & 1 deletion Tests/CoreXLSXTests/CoreXLSX.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ final class CoreXLSXTests: XCTestCase {
XCTAssertEqual(ws.sheetFormatPr, ws.formatProperties)
XCTAssertEqual(ws.sheetFormatPr.defaultColWidth, ws.formatProperties.defaultColumnWidth)
XCTAssertEqual(ws.sheetFormatPr.outlineLevelCol, ws.formatProperties.outlineLevelColumn)
XCTAssertEqual(ws.dimension.ref, ws.dimension.reference)
XCTAssertEqual(ws.dimension?.ref, ws.dimension?.reference)

guard let mcs = ws.mergeCells else {
XCTAssert(false, "expected to parse merge cells from categories.xlsx")
Expand Down