Просмотр исходного кода

Fix for (Issue Tracker) Item #9526

master
coffeycathal_cp 14 лет назад
Родитель
Сommit
22bb86a8da
2 измененных файлов: 15 добавлений и 1 удалений
  1. 3
    1
      DocX/DocX.cs
  2. 12
    0
      UnitTests/UnitTest1.cs

+ 3
- 1
DocX/DocX.cs Просмотреть файл

if (rowCount < 1 || coloumnCount < 1) if (rowCount < 1 || coloumnCount < 1)
throw new ArgumentOutOfRangeException("Row and Coloumn count must be greater than zero."); 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> /// <summary>

+ 12
- 0
UnitTests/UnitTest1.cs Просмотреть файл

File.Delete(file_temp); 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] [TestMethod]
public void Test_Table_InsertRow() public void Test_Table_InsertRow()
{ {

Загрузка…
Отмена
Сохранить