Exemple #1
0
 /**
  * add a new AbstractNum and return its AbstractNumID 
  * @param abstractNum
  */
 public string AddAbstractNum(XWPFAbstractNum abstractNum)
 {
     int pos = abstractNums.Count;
     if (abstractNum.GetAbstractNum() != null)
     { // Use the current CTAbstractNum if it exists
         ctNumbering.AddNewAbstractNum().Set(abstractNum.GetAbstractNum());
     }
     else
     {
         ctNumbering.AddNewAbstractNum();
         abstractNum.GetAbstractNum().abstractNumId = pos.ToString();
         ctNumbering.SetAbstractNumArray(pos, abstractNum.GetAbstractNum());
     }
     abstractNums.Add(abstractNum);
     return abstractNum.GetAbstractNum().abstractNumId;
 }
Exemple #2
0
 /// <summary>
 /// Add a new AbstractNum
 /// </summary>
 /// <returns></returns>
 /// @author antony liu
 public string AddAbstractNum()
 {
     CT_AbstractNum ctAbstractNum = ctNumbering.AddNewAbstractNum();
     XWPFAbstractNum abstractNum = new XWPFAbstractNum(ctAbstractNum, this);
     abstractNum.AbstractNumId = abstractNums.Count.ToString();
     abstractNum.MultiLevelType = MultiLevelType.HybridMultilevel;
     abstractNum.InitLvl();
     abstractNums.Add(abstractNum);
     return abstractNum.GetAbstractNum().abstractNumId;
 }
Exemple #3
0
 /**
  * Compare AbstractNum with abstractNums of this numbering document.
  * If the content of abstractNum Equals with an abstractNum of the List in numbering
  * the Bigint Value of it will be returned.
  * If no equal abstractNum is existing null will be returned
  * 
  * @param abstractNum
  * @return 	Bigint
  */
 public string GetIdOfAbstractNum(XWPFAbstractNum abstractNum)
 {
     CT_AbstractNum copy = (CT_AbstractNum)abstractNum.GetCTAbstractNum().Copy();
     XWPFAbstractNum newAbstractNum = new XWPFAbstractNum(copy, this);
     int i;
     for (i = 0; i < abstractNums.Count; i++)
     {
         newAbstractNum.GetCTAbstractNum().abstractNumId = i.ToString();
         newAbstractNum.SetNumbering(this);
         if (newAbstractNum.GetCTAbstractNum().ValueEquals(abstractNums[i].GetCTAbstractNum()))
         {
             return newAbstractNum.GetCTAbstractNum().abstractNumId;
         }
     }
     return null;
 }