Sfoglia il codice sorgente

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

master
DragonFire_cp 14 anni fa
parent
commit
ab0640f886
4 ha cambiato i file con 6 aggiunte e 3 eliminazioni
  1. 2
    2
      DocX/Table.cs
  2. 3
    0
      Examples/Examples.csproj
  3. BIN
      Examples/Input.docx
  4. 1
    1
      Examples/Program.cs

+ 2
- 2
DocX/Table.cs Vedi File

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

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

BIN
Examples/Input.docx Vedi File


+ 1
- 1
Examples/Program.cs Vedi File

@@ -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…
Annulla
Salva