/// <summary> /// 设置段落对齐方式 /// </summary> /// <param name="p"></param> /// <param name="align"></param> public static void SetAlign(this CT_P p, ST_Jc align) { CT_PPr ppr = p.pPr == null?p.AddNewPPr() : p.pPr; CT_Jc jc = ppr.IsSetJc() ? ppr.jc : ppr.AddNewJc(); jc.val = align; }
public static ParagraphAlignment ValueOf(ST_Jc val) { switch (val) { case ST_Jc.both: return(ParagraphAlignment.BOTH); case ST_Jc.center: return(ParagraphAlignment.CENTER); case ST_Jc.distribute: return(ParagraphAlignment.DISTRIBUTE); default: return(ParagraphAlignment.LEFT); } }
static ST_Jc() { ST_Jc.left = new ST_Jc("left"); ST_Jc.center = new ST_Jc("center"); ST_Jc.right = new ST_Jc("right"); ST_Jc.both = new ST_Jc("both"); ST_Jc.mediumKashida = new ST_Jc("mediumKashida"); ST_Jc.distribute = new ST_Jc("distribute"); ST_Jc.numTab = new ST_Jc("numTab"); ST_Jc.highKashida = new ST_Jc("highKashida"); ST_Jc.lowKashida = new ST_Jc("lowKashida"); ST_Jc.thaiDistribute = new ST_Jc("thaiDistribute"); }
static ST_Jc() { left = new ST_Jc("left"); center = new ST_Jc("center"); right = new ST_Jc("right"); both = new ST_Jc("both"); mediumKashida = new ST_Jc("mediumKashida"); distribute = new ST_Jc("distribute"); numTab = new ST_Jc("numTab"); highKashida = new ST_Jc("highKashida"); lowKashida = new ST_Jc("lowKashida"); thaiDistribute = new ST_Jc("thaiDistribute"); }
private CT_Lvl NumberingLevel(int level, ST_NumberFormat numFmt, string text, string font, ST_Jc jc, string size) { CT_Lvl cT_Lvl = new CT_Lvl(); cT_Lvl.Ilvl_Attr = level; cT_Lvl.Start = new CT_DecimalNumber { Val_Attr = 1 }; cT_Lvl.NumFmt = new CT_NumFmt { Val_Attr = numFmt }; cT_Lvl.LvlText = new CT_LevelText { Val_Attr = text }; cT_Lvl.LvlJc = new CT_Jc { Val_Attr = jc }; cT_Lvl.RPr = new CT_RPr { RFonts = new CT_Fonts { Ascii_Attr = font, EastAsia_Attr = font, HAnsi_Attr = font, Cs_Attr = font }, Sz = new CT_HpsMeasure { Val_Attr = size } }; return(cT_Lvl); }
private CT_Lvl NumberingLevel(int level, ST_NumberFormat numFmt, string text, string font, ST_Jc jc, string size) { return(new CT_Lvl { Ilvl_Attr = level, Start = new CT_DecimalNumber { Val_Attr = 1 }, NumFmt = new CT_NumFmt { Val_Attr = numFmt }, LvlText = new CT_LevelText { Val_Attr = text }, LvlJc = new CT_Jc { Val_Attr = jc }, RPr = new CT_RPr { RFonts = new CT_Fonts { Ascii_Attr = font, EastAsia_Attr = font, HAnsi_Attr = font, Cs_Attr = font }, Sz = new CT_HpsMeasure { Val_Attr = size } } }); }