/** * Specifies that the contents of this run.should be displayed along with an * underline appearing directly below the character heigh * If this element is not present, the default value is to leave the * formatting applied at previous level in the style hierarchy. If this * element is never applied in the style hierarchy, then an underline shall * not be applied to the contents of this run. * * @param value - * underline type * @see UnderlinePatterns : all possible patterns that could be applied */ public void SetUnderline(UnderlinePatterns value) { CT_RPr pr = run.IsSetRPr() ? run.rPr : run.AddNewRPr(); CT_Underline underline = (pr.u == null) ? pr.AddNewU() : pr.u; underline.val = EnumConverter.ValueOf <ST_Underline, UnderlinePatterns>(value); }
/** * Get the CTUnderline for the run. * @param create Create a new underline if necessary * @return The underline, or null create is false and there is no underline. */ private CT_Underline GetCTUnderline(bool create) { CT_RPr pr = GetRunProperties(true); CT_Underline underline = pr.u; if (create && underline == null) { underline = pr.AddNewU(); } return(underline); }