private CT_CellAlignment ConvertAlignment(CellAlignment a) { var res = new CT_CellAlignment { indent = (uint)a.Indent, indentSpecified = a.Indent != 0, shrinkToFit = a.ShrinkToFit, shrinkToFitSpecified = a.ShrinkToFit, textRotation = (uint)a.TextRotation, textRotationSpecified = a.TextRotation != 0, wrapText = a.WrapText, wrapTextSpecified = a.WrapText, justifyLastLine = a.JustifyLastLine, justifyLastLineSpecified = a.JustifyLastLine }; if (a.HAlign.HasValue) { res.horizontal = (ST_HorizontalAlignment)a.HAlign.Value; res.horizontalSpecified = true; } if (a.VAlign.HasValue) { res.vertical = (ST_VerticalAlignment)a.VAlign.Value; res.verticalSpecified = true; } return(res); }
/// <summary> /// Get the type of vertical alignment for the cell /// </summary> /// <returns></returns> internal VerticalAlignment GetVerticalAlignmentEnum() { CT_CellAlignment align = _cellXf.alignment; if (align != null && align.IsSetVertical()) { return((VerticalAlignment)align.vertical); } return(VerticalAlignment.Bottom); }
/// <summary> /// Get the type of horizontal alignment for the cell /// </summary> /// <returns>the type of alignment</returns> internal HorizontalAlignment GetAlignmentEnum() { CT_CellAlignment align = _cellXf.alignment; if (align != null && align.IsSetHorizontal()) { return((HorizontalAlignment)align.horizontal); } return(HorizontalAlignment.General); }
/** * Get the type of vertical alignment for the cell * * @return the type of alignment, default value is {@link NPOI.ss.usermodel.VerticalAlignment#BOTTOM} * @see NPOI.ss.usermodel.VerticalAlignment */ public VerticalAlignment GetVerticalAlignmentEnum() { CT_CellAlignment align = _cellXf.alignment; if (align != null && align.IsSetVertical()) { return((VerticalAlignment)align.vertical); } return(VerticalAlignment.BOTTOM); }
/** * Get the type of horizontal alignment for the cell * * @return HorizontalAlignment - the type of alignment * @see NPOI.ss.usermodel.HorizontalAlignment */ public HorizontalAlignment GetAlignmentEnum() { CT_CellAlignment align = _cellXf.alignment; if (align != null && align.IsSetHorizontal()) { return((HorizontalAlignment)align.horizontal); } return(HorizontalAlignment.GENERAL); }
private CellAlignment ConvertAlignment(CT_CellAlignment al) { CellAlignment a = new CellAlignment { Indent = al.indentSpecified ? (int)al.indent : 0, WrapText = al.wrapTextSpecified ? al.wrapText : false, TextRotation = al.textRotationSpecified ? (int)al.textRotation : 0, ShrinkToFit = al.shrinkToFitSpecified ? al.shrinkToFit : false, VAlign = al.verticalSpecified ? (VerticalAlignment)al.vertical : (VerticalAlignment?)null, HAlign = al.horizontalSpecified ? (HorizontalAlignment)al.horizontal : (HorizontalAlignment?)null, JustifyLastLine = al.justifyLastLineSpecified ? al.justifyLastLine : false }; return(a); }
public XSSFCellAlignment(CT_CellAlignment cellAlignment) { this.cellAlignement = cellAlignment; }