this.setObject(val);
}
public AbstractCellMargin(CSSValue value, String suffix) {
CSSPrimitiveValue cssPrimitiveValue = (CSSPrimitiveValue)value;
TblWidth tblWidth = Context.getWmlObjectFactory().createTblWidth();
short ignored = 1;
float fVal = cssPrimitiveValue.getFloatValue(ignored); // unit type ignored in cssparser
int twip;
short type = cssPrimitiveValue.getPrimitiveType();
if (CSSPrimitiveValue.CSS_IN == type) {
twip = UnitsOfMeasurement.inchToTwip(fVal);
} else if (CSSPrimitiveValue.CSS_MM == type) {
twip = UnitsOfMeasurement.mmToTwip(fVal);
} else if (CSSPrimitiveValue.CSS_PERCENTAGE == type) {
twip = twipFromPercentage(fVal);
} else {
log.error("No support for unit " + type);
twip = 0;
}
init(suffix);
tblWidth.setW(BigInteger.valueOf(twip));
tblWidth.setType(TblWidth.TYPE_DXA);
this.setObject(tblWidth);
}