浏览代码

Fix for (Issue Tracker) Item #9526

master
coffeycathal_cp 14 年前
父节点
当前提交
22bb86a8da
共有 2 个文件被更改,包括 15 次插入1 次删除
  1. 3
    1
      DocX/DocX.cs
  2. 12
    0
      UnitTests/UnitTest1.cs

+ 3
- 1
DocX/DocX.cs 查看文件

@@ -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>

+ 12
- 0
UnitTests/UnitTest1.cs 查看文件

@@ -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()
{

正在加载...
取消
保存