isNewBorder static method

bool isNewBorder(
  1. CellStyle toCompareStyle
)

Check whether the cell border already exists.

Implementation

static bool isNewBorder(CellStyle toCompareStyle) {
  final CellStyle bStyle = CellStyle(toCompareStyle.workbook);
  if (isAllBorder(toCompareStyle.borders)) {
    return bStyle.borders.all.color == toCompareStyle.borders.all.color &&
        bStyle.borders.all.lineStyle == toCompareStyle.borders.all.lineStyle;
  } else {
    return bStyle.borders.left.color == toCompareStyle.borders.left.color &&
        bStyle.borders.left.lineStyle ==
            toCompareStyle.borders.left.lineStyle &&
        bStyle.borders.right.color == toCompareStyle.borders.right.color &&
        bStyle.borders.right.lineStyle ==
            toCompareStyle.borders.right.lineStyle &&
        bStyle.borders.top.color == toCompareStyle.borders.top.color &&
        bStyle.borders.top.lineStyle ==
            toCompareStyle.borders.top.lineStyle &&
        bStyle.borders.bottom.color == toCompareStyle.borders.bottom.color &&
        bStyle.borders.bottom.lineStyle ==
            toCompareStyle.borders.bottom.lineStyle;
  }
}