private static boolean borderChanged(CTBorder currentBorder, CTBorder lastBorder) { if (currentBorder != lastBorder) { if ((currentBorder != null) && (lastBorder != null)) { return !currentBorder.getVal().equals(lastBorder.getVal()); } //one was null return true; } //both null or both identical return false; }
public static boolean areEqual(CTBorder border1, CTBorder border2) { return ((border1 == border2) || ((border1 != null) && (border2 != null) && areEqual(border1.getColor(), border2.getColor()) && areEqual(border1.getSpace(), border2.getSpace()) && areEqual(border1.getSz(), border2.getSz()) && areEqual(border1.getThemeColor(), border2.getThemeColor()) && areEqual(border1.getThemeShade(), border2.getThemeShade()) && areEqual(border1.getThemeTint(), border2.getThemeTint()) && ((border1.getVal() == border2.getVal()) || ((border1.getVal() != null) && (border1.getVal().equals(border2.getVal())))) ) ); }
TblBorders tblBorders = s.getTblPr().getTblBorders(); if (tblBorders.getInsideH()!=null) { if (tblBorders.getInsideH().getVal()==STBorder.NONE || tblBorders.getInsideH().getVal()==STBorder.NIL || tblBorders.getInsideH().getSz()==BigInteger.ZERO ) { properties.add( new AdHocProperty("border-top-style", "none", null, null)); if (tblBorders.getInsideV().getVal()==STBorder.NONE || tblBorders.getInsideV().getVal()==STBorder.NIL || tblBorders.getInsideV().getSz()==BigInteger.ZERO ) { properties.add( new AdHocProperty("border-left-style", "none", null, null));
public static boolean isEmpty(CTBorder border) { return ((border == null) || (isEmpty(border.getColor()) && isEmpty(border.getSpace()) && isEmpty(border.getSz()) && (border.getThemeColor() == null) && isEmpty(border.getThemeShade()) && isEmpty(border.getThemeTint()) && (border.getVal() == null) ) ); }
public static CTBorder apply(CTBorder source, CTBorder destination) { if (!isEmpty(source)) { if (destination == null) destination = Context.getWmlObjectFactory().createCTBorder(); destination.setColor(apply(source.getColor(), destination.getColor())); destination.setSpace(apply(source.getSpace(), destination.getSpace())); destination.setSz(apply(source.getSz(), destination.getSz())); destination.setThemeColor(source.getThemeColor()); destination.setThemeShade(apply(source.getThemeShade(), destination.getThemeShade())); destination.setThemeTint(apply(source.getThemeTint(), destination.getThemeTint())); destination.setVal(apply(source.getVal(), destination.getVal())); } return destination; }
public CTBorder keepDiff(CTBorder orig, CTBorder from) { if (from != null && orig != null) { if (orig.getVal() != null && from.getVal() != null && from.getVal() != null && orig.getVal().compareTo(from.getVal()) == 0) orig.setVal(null); if (orig.getThemeColor() != null && from.getThemeColor() != null && orig.getThemeColor().compareTo(from.getThemeColor()) == 0) orig.setThemeColor(null); if (orig.getSpace() != null && from.getSpace() != null && orig.getSpace().compareTo(from.getSpace()) == 0) orig.setSpace(null); if (orig.getSz() != null && from.getSz() != null && orig.getSz().compareTo(from.getSz()) == 0) orig.setSz(null); if (orig.getColor() != null && from.getColor() != null && orig.getColor().compareTo(from.getColor()) == 0) orig.setColor(null); if (orig.getThemeShade() != null && from.getThemeShade() != null && orig.getThemeShade().compareTo(from.getThemeShade()) == 0) orig.setThemeShade(null); if (orig.getThemeTint() != null && from.getThemeTint() != null && orig.getThemeTint().compareTo(from.getThemeTint()) == 0) orig.setThemeTint(null); if (orig.isFrame() == from.isFrame()) orig.setFrame(null); if (orig.isShadow() == from.isShadow()) orig.setShadow(null); } return StyleUtil.isEmpty(orig) ? null : orig; }
private static boolean borderChanged(CTBorder currentBorder, CTBorder lastBorder) { if (currentBorder != lastBorder) { if ((currentBorder != null) && (lastBorder != null)) { return !currentBorder.getVal().equals(lastBorder.getVal()); } //one was null return true; } //both null or both identical return false; }
public CTBorder getCopy(CTBorder copy, boolean whenNull) { if (copy != null) { CTBorder result = myFactory.createCTBorder(); result.setVal(copy.getVal()); result.setThemeColor(copy.getThemeColor()); result.setSpace(copy.getSpace()); result.setSz(copy.getSz()); result.setFrame(copy.isFrame()); result.setShadow(copy.isShadow()); result.setColor(copy.getColor()); result.setThemeShade(copy.getThemeShade()); result.setThemeTint(copy.getThemeTint()); return result; } if (whenNull) { return myFactory.createCTBorder(); } return null; }
public static boolean areEqual(CTBorder border1, CTBorder border2) { return ((border1 == border2) || ((border1 != null) && (border2 != null) && areEqual(border1.getColor(), border2.getColor()) && areEqual(border1.getSpace(), border2.getSpace()) && areEqual(border1.getSz(), border2.getSz()) && areEqual(border1.getThemeColor(), border2.getThemeColor()) && areEqual(border1.getThemeShade(), border2.getThemeShade()) && areEqual(border1.getThemeTint(), border2.getThemeTint()) && ((border1.getVal() == border2.getVal()) || ((border1.getVal() != null) && (border1.getVal().equals(border2.getVal())))) ) ); }
public static boolean isEmpty(CTBorder border) { return ((border == null) || (isEmpty(border.getColor()) && isEmpty(border.getSpace()) && isEmpty(border.getSz()) && (border.getThemeColor() == null) && isEmpty(border.getThemeShade()) && isEmpty(border.getThemeTint()) && (border.getVal() == null) ) ); }
public static CTBorder apply(CTBorder source, CTBorder destination) { if (!isEmpty(source)) { if (destination == null) destination = Context.getWmlObjectFactory().createCTBorder(); destination.setColor(apply(source.getColor(), destination.getColor())); destination.setSpace(apply(source.getSpace(), destination.getSpace())); destination.setSz(apply(source.getSz(), destination.getSz())); destination.setThemeColor(source.getThemeColor()); destination.setThemeShade(apply(source.getThemeShade(), destination.getThemeShade())); destination.setThemeTint(apply(source.getThemeTint(), destination.getThemeTint())); destination.setVal(apply(source.getVal(), destination.getVal())); } return destination; }