| @@ -945,7 +945,9 @@ namespace Novacode | |||
| if (rowCount < 1 || coloumnCount < 1) | |||
| throw new ArgumentOutOfRangeException("Row and Coloumn count must be greater than zero."); | |||
| return (new Table(this, HelperFunctions.CreateTable(rowCount, coloumnCount))); | |||
| Table t = new Table(this, HelperFunctions.CreateTable(rowCount, coloumnCount)); | |||
| t.mainPart = mainPart; | |||
| return t; | |||
| } | |||
| /// <summary> | |||
| @@ -1041,6 +1041,18 @@ namespace UnitTests | |||
| File.Delete(file_temp); | |||
| } | |||
| [TestMethod] | |||
| public void Test_Table_mainPart_bug9526() | |||
| { | |||
| using (DocX document = DocX.Create("test.docx")) | |||
| { | |||
| Hyperlink h = document.AddHyperlink("follow me", new Uri("http://www.google.com")); | |||
| Table t = document.AddTable(2, 2); | |||
| Paragraph p = t.Rows[0].Cells[0].Paragraphs[0]; | |||
| p.AppendHyperlink(h); | |||
| } | |||
| } | |||
| [TestMethod] | |||
| public void Test_Table_InsertRow() | |||
| { | |||