Skip to content

Commit

Permalink
style: format project files
Browse files Browse the repository at this point in the history
  • Loading branch information
philprime committed Nov 10, 2024
1 parent 0379632 commit fbbd3d8
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let package = Package(
platforms: [
.iOS(.v9),
.macOS(.v10_14),
.visionOS(.v1)
.visionOS(.v1),
],
products: [
.library(name: "TPPDF", targets: ["TPPDF"]),
Expand Down
2 changes: 1 addition & 1 deletion Source/API/Layout/PDFContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public enum PDFContainer: CaseIterable {
[
.headerLeft, .headerCenter, .headerRight,
.contentLeft, .contentCenter, .contentRight,
.footerLeft, .footerCenter, .footerRight
.footerLeft, .footerCenter, .footerRight,
]
}
}
2 changes: 1 addition & 1 deletion Source/API/Metadata/PDFInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public class PDFInfo {
kCGPDFContextSubject as String: subject,
kCGPDFContextKeywords as String: keywords,
kCGPDFContextAllowsPrinting as String: allowsPrinting,
kCGPDFContextAllowsCopying as String: allowsCopying
kCGPDFContextAllowsCopying as String: allowsCopying,
]

var creator = Bundle.main.infoDictionary?["CFBundleName"] as? String ?? "TPPDF"
Expand Down
2 changes: 1 addition & 1 deletion Source/API/PDFGenerator+Generation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public extension PDFGenerator {
layout.margin.top + layout.heights.maxHeaderHeight(),
layout.margin.top + layout.heights.maxHeaderHeight() + document.layout.space.header,
document.layout.height - layout.margin.bottom - layout.heights.maxFooterHeight(),
document.layout.height - layout.margin.bottom - layout.heights.maxFooterHeight() - document.layout.space.footer
document.layout.height - layout.margin.bottom - layout.heights.maxFooterHeight() - document.layout.space.footer,
]

var lines: [PDFLineObject] = []
Expand Down
2 changes: 1 addition & 1 deletion Source/API/Utils/CrossPlattformGraphics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
}
}

extension NSEdgeInsets: @retroactive Equatable {
extension NSEdgeInsets: @retroactive Equatable {
public static func == (lhs: NSEdgeInsets, rhs: NSEdgeInsets) -> Bool {
lhs.top == rhs.top && lhs.left == rhs.left && lhs.bottom == rhs.bottom && lhs.right == rhs.right
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Internal/External/PDFExternalPageObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class PDFExternalPageObject: PDFRenderObject {
override func calculate(generator _: PDFGenerator, container: PDFContainer) throws -> [PDFLocatedRenderObject] {
frame = page.getBoxRect(.mediaBox)
return [
(container, self)
(container, self),
]
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Internal/Graphics/PDFContextGraphics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ enum PDFContextGraphics {
var mediaBox = bounds
let boxData = NSData(bytes: &mediaBox, length: MemoryLayout.size(ofValue: mediaBox))
let pageInfo = [
kCGPDFContextMediaBox as String: boxData
kCGPDFContextMediaBox as String: boxData,
]
context.beginPDFPage(pageInfo as CFDictionary)

Expand Down
2 changes: 1 addition & 1 deletion Source/Internal/Group/PDFGroupObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class PDFGroupObject: PDFRenderObject {
}

var groupedResult = [
[PDFLocatedRenderObject]()
[PDFLocatedRenderObject](),
]

// Set padding
Expand Down
20 changes: 10 additions & 10 deletions Source/Internal/Layout/PDFColumnLayoutState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,27 @@ class PDFColumnLayoutState: CustomStringConvertible {
self.currentColumn = [
.headerLeft: 0,
.contentLeft: 0,
.footerLeft: 0
.footerLeft: 0,
]
self.columnWidths = [
.headerLeft: [],
.contentLeft: [],
.footerLeft: []
.footerLeft: [],
]
self.columnSpacings = [
.headerLeft: [],
.contentLeft: [],
.footerLeft: []
.footerLeft: [],
]
self.wrapColumnsHeight = [
.headerLeft: 0,
.contentLeft: 0,
.footerLeft: 0
.footerLeft: 0,
]
self.inset = [
.headerLeft: (0, 0),
.contentLeft: (0, 0),
.footerLeft: (0, 0)
.footerLeft: (0, 0),
]
}

Expand All @@ -53,27 +53,27 @@ class PDFColumnLayoutState: CustomStringConvertible {
currentColumn = [
.headerLeft: 0,
.contentLeft: 0,
.footerLeft: 0
.footerLeft: 0,
]
columnWidths = [
.headerLeft: [],
.contentLeft: [],
.footerLeft: []
.footerLeft: [],
]
columnSpacings = [
.headerLeft: [],
.contentLeft: [],
.footerLeft: []
.footerLeft: [],
]
wrapColumnsHeight = [
.headerLeft: 0,
.contentLeft: 0,
.footerLeft: 0
.footerLeft: 0,
]
inset = [
.headerLeft: (0, 0),
.contentLeft: (0, 0),
.footerLeft: (0, 0)
.footerLeft: (0, 0),
]
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Internal/Section/PDFSectionObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class PDFSectionObject: PDFRenderObject {
// stores how many objects are in one column at max
let maxObjectsPerColumn = objectsPerColumn.reduce(0) { max($0, $1.value.count) }

/*
/*
* as soon as a column requests a page break, we need to stack subsequent objects of the very same column until the following is `true`:
* one or more columns do not have more objects and all other columns, which have more objects left, are requesting a page break
*/
Expand Down
4 changes: 2 additions & 2 deletions Source/Internal/Table/PDFTableObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class PDFTableObject: PDFRenderObject {
let attributes: [NSAttributedString.Key: AnyObject] = [
.foregroundColor: cellStyle.colors.text,
.font: cellStyle.font,
.paragraphStyle: paragraph
.paragraphStyle: paragraph,
]
return NSAttributedString(string: text, attributes: attributes)
}
Expand Down Expand Up @@ -615,7 +615,7 @@ class PDFTableObject: PDFRenderObject {
endPoint: CGPoint(x: frame.maxX, y: frame.maxY)),
PDFLineObject(style: borders.left,
startPoint: CGPoint(x: frame.minX, y: frame.minY),
endPoint: CGPoint(x: frame.minX, y: frame.maxY))
endPoint: CGPoint(x: frame.minX, y: frame.maxY)),
]
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Internal/Text/PDFAttributedTextObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ class PDFAttributedTextObject: PDFRenderObject {
return [
NSAttributedString.Key.font: style?.font ?? fonts[container]!,
NSAttributedString.Key.foregroundColor: style?.color ?? textColor[container]!,
NSAttributedString.Key.paragraphStyle: paragraphStyle
NSAttributedString.Key.paragraphStyle: paragraphStyle,
]
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Internal/Utils/PDFSlicedObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class PDFSlicedObject: PDFRenderObject {

override func calculate(generator _: PDFGenerator, container: PDFContainer) throws -> [PDFLocatedRenderObject] {
[
(container, self)
(container, self),
]
}

Expand Down

0 comments on commit fbbd3d8

Please sign in to comment.