瀏覽代碼

Change example project, fix Table.RemoveColumn null reference exception.

master
DragonFire_cp 14 年之前
父節點
當前提交
ab0640f886
共有 4 個文件被更改,包括 6 次插入3 次删除
  1. 2
    2
      DocX/Table.cs
  2. 3
    0
      Examples/Examples.csproj
  3. 二進制
      Examples/Input.docx
  4. 1
    1
      Examples/Program.cs

+ 2
- 2
DocX/Table.cs 查看文件

@@ -736,7 +736,7 @@ namespace Novacode
if (index < 0 || index > columnCount - 1)
throw new IndexOutOfRangeException();
foreach (Row r in rows)
foreach (Row r in Rows)
r.Cells[index].Xml.Remove();
}
@@ -851,7 +851,7 @@ namespace Novacode
rows = (from r in Xml.Elements(XName.Get("tr", DocX.w.NamespaceName))
select new Row(this, Document, r)).ToList();
rowCount = rows.Count;
rowCount = Rows.Count;
if (rows.Count > 0)
if (rows[0].Cells.Count > 0)

+ 3
- 0
Examples/Examples.csproj 查看文件

@@ -63,6 +63,9 @@
</ItemGroup>
<ItemGroup>
<None Include="bin\Debug\docs\Input.docx" />
<None Include="Input.docx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

二進制
Examples/Input.docx 查看文件


+ 1
- 1
Examples/Program.cs 查看文件

@@ -635,7 +635,7 @@ namespace Examples
const string str = "Hello World";
// Open the document Input.docx.
using (DocX document = DocX.Load(@"docs\Input.docx"))
using (DocX document = DocX.Load(@"Input.docx"))
{
// Make sure this document has at least one Image.
if (document.Images.Count() > 0)

Loading…
取消
儲存