/** * Specifies that a break shall be placed at the current location in the run * content. A break is a special character which is used to override the * normal line breaking that would be performed based on the normal layout * of the document's contents. * <p> * The behavior of this break character (the * location where text shall be restarted After this break) shall be * determined by its type (in this case is BreakType.TEXT_WRAPPING as default) and clear attribute values. * </p> * @see BreakClear */ public void AddBreak(BreakClear Clear) { CT_Br br = run.AddNewBr(); br.type = EnumConverter.ValueOf <ST_BrType, BreakType>(BreakType.TEXTWRAPPING); br.clear = EnumConverter.ValueOf <ST_BrClear, BreakClear>(Clear); }
public void TestAddPageBreak() { ctRun.AddNewT().Value = ("TEST STRING"); ctRun.AddNewBr(); ctRun.AddNewT().Value = ("TEST2 STRING"); CT_Br breac = ctRun.AddNewBr(); breac.clear = (ST_BrClear.left); ctRun.AddNewT().Value = ("TEST3 STRING"); Assert.AreEqual(2, ctRun.SizeOfBrArray()); XWPFRun run = new XWPFRun(new CT_R(), p); run.SetText("TEXT1"); run.AddBreak(); run.SetText("TEXT2"); run.AddBreak(BreakType.TEXTWRAPPING); Assert.AreEqual(2, run.GetCTR().SizeOfBrArray()); }
/** * Specifies that a break shall be placed at the current location in the run * content. * A break is a special character which is used to override the * normal line breaking that would be performed based on the normal layout * of the document's contents. * <p> * The behavior of this break character (the * location where text shall be restarted After this break) shall be * determined by its type values. * </p> * @see BreakType */ public void AddBreak(BreakType type) { CT_Br br = run.AddNewBr(); br.type = EnumConverter.ValueOf <ST_BrType, BreakType>(type); }