/// <summary> /// Get the TableCell which belongs to the TableCell /// </summary> /// <param name="cell"></param> /// <returns></returns> public XWPFTableCell GetTableCell(CT_Tc cell) { object obj = cell.Parent; if (!(obj is CT_Row)) { return(null); } CT_Row row = (CT_Row)obj; if (!(row.Parent is CT_Tbl)) { return(null); } CT_Tbl tbl = (CT_Tbl)row.Parent; XWPFTable table = GetTable(tbl); if (table == null) { return(null); } XWPFTableRow tableRow = table.GetRow(row); if (row == null) { return(null); } return(tableRow.GetTableCell(cell)); }
/** * Get the TableCell which belongs to the TableCell */ public XWPFTableCell GetTableCell(CT_Tc cell) { if (!(cell.Parent is CT_Row)) { return(null); } CT_Row row = (CT_Row)cell.Parent; if (!(row.Parent is CT_Tbl)) { return(null); } CT_Tbl tbl = (CT_Tbl)row.Parent; XWPFTable table = GetTable(tbl); if (table == null) { return(null); } XWPFTableRow tr = table.GetRow(row); if (tr == null) { return(null); } return(tr.GetTableCell(cell)); }