Pārlūkot izejas kodu

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

master
DragonFire_cp pirms 14 gadiem
vecāks
revīzija
ab0640f886
4 mainītis faili ar 6 papildinājumiem un 3 dzēšanām
  1. 2
    2
      DocX/Table.cs
  2. 3
    0
      Examples/Examples.csproj
  3. Binārs
      Examples/Input.docx
  4. 1
    1
      Examples/Program.cs

+ 2
- 2
DocX/Table.cs Parādīt failu

@@ -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 Parādīt failu

@@ -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ārs
Examples/Input.docx Parādīt failu


+ 1
- 1
Examples/Program.cs Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt