Преглед изворни кода

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

Loading…
Откажи
Сачувај