Forráskód Böngészése

No need to try to put the $ back into the formula where there are none to begin with.

Thieu Pham 10 éve
szülő
commit
a63081780a
1 módosított fájl, 5 hozzáadás és 3 törlés
  1. 5 3
      lib.go

+ 5 - 3
lib.go

@@ -401,21 +401,23 @@ func shiftCell(cellID string, dx, dy int) string {
 	// New shifted cell
 	shiftedCellID := getCellIDStringFromCoords(fx, fy)
 
-	// Need put the $ back if they have absolute references
+	if !fixedCol && !fixedRow {
+		return shiftedCellID
+	}
+
+	// There are absolute references, need to put the $ back into the formula.
 	letterPart := strings.Map(letterOnlyMapF, shiftedCellID)
 	numberPart := strings.Map(intOnlyMapF, shiftedCellID)
 
 	result := ""
 
 	if fixedCol {
-		// Insert dollar sign ($) back into the formula
 		result += "$"
 	}
 
 	result += letterPart
 
 	if fixedRow {
-		// Insert dollar sign ($) back into the formula
 		result += "$"
 	}