Repository: MaxDesiatov/CoreXLSX (swift)

Issue:
Unable to sort columns by intValue
**Version**

version 0.13.0

**Description of the bug**

when sorting columns, sort is made with _value_ not _intValue_, then sorting columns is not accurate (column 'AB' is lower than 'B' and should be greater) (order is : A ; B ; C ; ... ; Y; Z; AA; AB ; ...)

**Steps to reproduce**

        row.cells.sorted(by: {$0.reference.column < $1.reference.column}).forEach({cell in
            let cellData: CellValue = CellValue(row: row.reference, reference: cell.reference, type: cell.type, initialValue: cell.value, dateValue: cell.dateValue, sharedString: cell.stringValue(self.sharedStrings))
            cellDataArray.append(cellData)
        })

**Expected behavior**

- being able to extend in order to access ColumnReference intValue which is private in this version
- modify Comparable protocole to replace ColumnReference value with ColumnReference intValue


**Additional context**

Thanks for watching this !

Pull request:
Resolve #137

Patch:
diff --git a/Sources/CoreXLSX/Worksheet/ColumnReference.swift b/Sources/CoreXLSX/Worksheet/ColumnReference.swift
index 5be1f791..693ceb12 100644
--- a/Sources/CoreXLSX/Worksheet/ColumnReference.swift
+++ b/Sources/CoreXLSX/Worksheet/ColumnReference.swift
@@ -118,7 +118,7 @@ extension ColumnReference: CustomStringConvertible {
 
 extension ColumnReference: Comparable {
   public static func <(lhs: ColumnReference, rhs: ColumnReference) -> Bool {
-    return lhs.value < rhs.value
+    return lhs.intValue < rhs.intValue
   }
 
   public static func ==(lhs: ColumnReference, rhs: ColumnReference) -> Bool {


Test patch:
diff --git a/Tests/CoreXLSXTests/CellReference.swift b/Tests/CoreXLSXTests/CellReference.swift
index e1f14ad5..62684a3d 100644
--- a/Tests/CoreXLSXTests/CellReference.swift
+++ b/Tests/CoreXLSXTests/CellReference.swift
@@ -109,6 +109,16 @@ final class CellReferenceTests: XCTestCase {
     XCTAssertEqual((az ... bz).count, alphabetLength + 1)
   }
 
+  func testColumnReferenceComparable() {
+    guard let ab = ColumnReference("AB"), let b = ColumnReference("B")
+    else {
+      XCTFail("failed to create simple column references")
+      return
+    }
+
+    XCTAssertGreaterThan(ab, b)
+  }
+
   func testColumnReferenceIntInitializer() {
     guard let a = ColumnReference("A"), let z = ColumnReference("z"),
           let aa = ColumnReference("AA"), let az = ColumnReference("Az"),
diff --git a/Tests/CoreXLSXTests/XCTestManifests.swift b/Tests/CoreXLSXTests/XCTestManifests.swift
index e4dc2a6a..d77a60e7 100644
--- a/Tests/CoreXLSXTests/XCTestManifests.swift
+++ b/Tests/CoreXLSXTests/XCTestManifests.swift
@@ -27,6 +27,7 @@ extension CellReferenceTests {
     ("testCellReference", testCellReference),
     ("testColumnReference", testColumnReference),
     ("testColumnReferenceAdvancedBy", testColumnReferenceAdvancedBy),
+    ("testColumnReferenceComparable", testColumnReferenceComparable),
     ("testColumnReferenceDistance", testColumnReferenceDistance),
     ("testColumnReferenceIntInitializer", testColumnReferenceIntInitializer),
     ("testColumnReferenceIntInitializerPerformance", testColumnReferenceIntInitializerPerformance),