diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index f1d75eaa..c30b0e71 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -5,13 +5,13 @@ env: on: push: - pull_request: + paths-ignore: + - '*.md' jobs: build: if: | - github.event_name == 'push' || - (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) + github.event_name == 'push' runs-on: ${{ matrix.os }} strategy: matrix: @@ -44,7 +44,7 @@ jobs: path: "TestResult/**/*" deployRelease: - if: github.event_name == 'push' && github.ref == 'refs/heads/release' + if: github.ref == 'refs/heads/release' runs-on: ubuntu-latest needs: build steps: @@ -68,7 +68,7 @@ jobs: gh release create ${{env.CURRENT_VERSION}} *.*nupkg --generate-notes deployTest: - if: github.event_name == 'push' && github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest needs: build steps: diff --git a/OpenXmlPowerTools.Tests/ChartUpdaterTests.cs b/OpenXmlPowerTools.Tests/ChartUpdaterTests.cs index b4107fc9..1cc0291c 100644 --- a/OpenXmlPowerTools.Tests/ChartUpdaterTests.cs +++ b/OpenXmlPowerTools.Tests/ChartUpdaterTests.cs @@ -5,7 +5,7 @@ using System.IO; using Xunit; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class CuTests { diff --git a/OpenXmlPowerTools.Tests/ColorParserTests.cs b/OpenXmlPowerTools.Tests/ColorParserTests.cs index c4cf50bd..ed4e7df5 100644 --- a/OpenXmlPowerTools.Tests/ColorParserTests.cs +++ b/OpenXmlPowerTools.Tests/ColorParserTests.cs @@ -2,7 +2,7 @@ using SkiaSharp; using Xunit; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class ColorParserTests { @@ -53,4 +53,4 @@ public void ShouldRejectInvalidColors(string? input) Assert.False(success); } } -} +} \ No newline at end of file diff --git a/OpenXmlPowerTools.Tests/CssPropertyValueTests.cs b/OpenXmlPowerTools.Tests/CssPropertyValueTests.cs index 8aaa38e5..85ec87ce 100644 --- a/OpenXmlPowerTools.Tests/CssPropertyValueTests.cs +++ b/OpenXmlPowerTools.Tests/CssPropertyValueTests.cs @@ -2,7 +2,7 @@ using SkiaSharp; using Xunit; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class CssPropertyValueTests { diff --git a/OpenXmlPowerTools.Tests/DocumentAssemblerTests.cs b/OpenXmlPowerTools.Tests/DocumentAssemblerTests.cs index 8add91d7..ad2e7ed2 100644 --- a/OpenXmlPowerTools.Tests/DocumentAssemblerTests.cs +++ b/OpenXmlPowerTools.Tests/DocumentAssemblerTests.cs @@ -1,18 +1,18 @@ using Codeuctivity.OpenXmlPowerTools; using DocumentFormat.OpenXml.Packaging; -using DocumentFormat.OpenXml.Wordprocessing; using DocumentFormat.OpenXml.Validation; +using DocumentFormat.OpenXml.Wordprocessing; using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using System.Text; using System.Xml; using System.Xml.Linq; using Xunit; -using System.Globalization; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class DaTests { @@ -126,7 +126,7 @@ public void DA101(string name, string data, bool err) ms.Write(afterAssembling.DocumentByteArray, 0, afterAssembling.DocumentByteArray.Length); using var wDoc = WordprocessingDocument.Open(ms, true); var v = new OpenXmlValidator(); - var valErrors = v.Validate(wDoc).Where(ve => !s_ExpectedErrors.Contains(ve.Description)); + var valErrors = v.Validate(wDoc, TestContext.Current.CancellationToken).Where(ve => !s_ExpectedErrors.Contains(ve.Description)); var sb = new StringBuilder(); foreach (var item in valErrors.Select(r => r.Description).OrderBy(t => t).Distinct()) @@ -215,7 +215,7 @@ public void DA103_UseXmlDocument(string name, string data, bool err) ms.Write(afterAssembling.DocumentByteArray, 0, afterAssembling.DocumentByteArray.Length); using var wDoc = WordprocessingDocument.Open(ms, true); var v = new OpenXmlValidator(); - var valErrors = v.Validate(wDoc).Where(ve => !s_ExpectedErrors.Contains(ve.Description)); + var valErrors = v.Validate(wDoc, TestContext.Current.CancellationToken).Where(ve => !s_ExpectedErrors.Contains(ve.Description)); Assert.Empty(valErrors); } @@ -515,8 +515,8 @@ private static string InnerText(XContainer e) .StringConcatenate(); } - private static readonly List s_ExpectedErrors = new List() - { + private static readonly List s_ExpectedErrors = + [ "The 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:evenHBand' attribute is not declared.", "The 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:evenVBand' attribute is not declared.", "The 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:firstColumn' attribute is not declared.", @@ -531,6 +531,6 @@ private static string InnerText(XContainer e) "The 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:noVBand' attribute is not declared.", "The 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:oddHBand' attribute is not declared.", "The 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:oddVBand' attribute is not declared.", - }; + ]; } -} +} \ No newline at end of file diff --git a/OpenXmlPowerTools.Tests/DocumentBuilderTests.cs b/OpenXmlPowerTools.Tests/DocumentBuilderTests.cs index 13fc63b9..c0d26092 100644 --- a/OpenXmlPowerTools.Tests/DocumentBuilderTests.cs +++ b/OpenXmlPowerTools.Tests/DocumentBuilderTests.cs @@ -10,7 +10,7 @@ using System.Xml.Linq; using Xunit; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class DbTests { @@ -22,7 +22,7 @@ public void DB001_DocumentBuilderKeepSections() var sourceDocx = new FileInfo(Path.Combine(sourceDir.FullName, name)); var sources = new List() { - new Source(new WmlDocument(sourceDocx.FullName), true), + new(new WmlDocument(sourceDocx.FullName), true), }; var processedDestDocx = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, sourceDocx.Name.Replace(".docx", "-processed-by-DocumentBuilder.docx"))); DocumentBuilder.BuildDocument(sources, processedDestDocx.FullName); @@ -36,9 +36,9 @@ public void DB002_DocumentBuilderKeepSectionsDiscardHeaders() var source2Docx = new FileInfo(Path.Combine(sourceDir.FullName, "DB002-Landscape-Section.docx")); var sources = new List() { - new Source(new WmlDocument(source1Docx.FullName)) { KeepSections = true }, - new Source(new WmlDocument(source2Docx.FullName)) { KeepSections = true, DiscardHeadersAndFootersInKeptSections = true }, - new Source(new WmlDocument(source1Docx.FullName)) { KeepSections = true }, + new(new WmlDocument(source1Docx.FullName)) { KeepSections = true }, + new(new WmlDocument(source2Docx.FullName)) { KeepSections = true, DiscardHeadersAndFootersInKeptSections = true }, + new(new WmlDocument(source1Docx.FullName)) { KeepSections = true }, }; var processedDestDocx = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, "DB002-Keep-Sections-Discard-Headers-And-Footers.docx")); DocumentBuilder.BuildDocument(sources, processedDestDocx.FullName); @@ -52,9 +52,9 @@ public void DB003_DocumentBuilderOnlyDefaultHeader() var source2Docx = new FileInfo(Path.Combine(sourceDir.FullName, "DB002-Landscape-Section.docx")); var sources = new List() { - new Source(new WmlDocument(source1Docx.FullName)) { KeepSections = true }, - new Source(new WmlDocument(source2Docx.FullName)) { KeepSections = true, DiscardHeadersAndFootersInKeptSections = true }, - new Source(new WmlDocument(source1Docx.FullName)) { KeepSections = true }, + new(new WmlDocument(source1Docx.FullName)) { KeepSections = true }, + new(new WmlDocument(source2Docx.FullName)) { KeepSections = true, DiscardHeadersAndFootersInKeptSections = true }, + new(new WmlDocument(source1Docx.FullName)) { KeepSections = true }, }; var processedDestDocx = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, "DB003-Only-Default-Header.docx")); DocumentBuilder.BuildDocument(sources, processedDestDocx.FullName); @@ -68,9 +68,9 @@ public void DB004_DocumentBuilderNoHeaders() var source2Docx = new FileInfo(Path.Combine(sourceDir.FullName, "DB002-Landscape-Section.docx")); var sources = new List() { - new Source(new WmlDocument(source1Docx.FullName)) { KeepSections = true }, - new Source(new WmlDocument(source2Docx.FullName)) { KeepSections = true, DiscardHeadersAndFootersInKeptSections = true }, - new Source(new WmlDocument(source1Docx.FullName)) { KeepSections = true }, + new(new WmlDocument(source1Docx.FullName)) { KeepSections = true }, + new(new WmlDocument(source2Docx.FullName)) { KeepSections = true, DiscardHeadersAndFootersInKeptSections = true }, + new(new WmlDocument(source1Docx.FullName)) { KeepSections = true }, }; var processedDestDocx = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, "DB003-Only-Default-Header.docx")); DocumentBuilder.BuildDocument(sources, processedDestDocx.FullName); @@ -84,9 +84,9 @@ public void DB005_HeadersWithRefsToImages() var source2Docx = new FileInfo(Path.Combine(sourceDir.FullName, "DB002-Landscape-Section.docx")); var sources = new List() { - new Source(new WmlDocument(source1Docx.FullName)) { KeepSections = true }, - new Source(new WmlDocument(source2Docx.FullName)) { KeepSections = true, DiscardHeadersAndFootersInKeptSections = true }, - new Source(new WmlDocument(source1Docx.FullName)) { KeepSections = true }, + new(new WmlDocument(source1Docx.FullName)) { KeepSections = true }, + new(new WmlDocument(source2Docx.FullName)) { KeepSections = true, DiscardHeadersAndFootersInKeptSections = true }, + new(new WmlDocument(source1Docx.FullName)) { KeepSections = true }, }; var processedDestDocx = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, "DB005.docx")); DocumentBuilder.BuildDocument(sources, processedDestDocx.FullName); @@ -103,7 +103,7 @@ public void DB006_Example_DocumentBuilder01() // Create new document from 10 paragraphs starting at paragraph 5 of Source1.docx var sources = new List() { - new Source(new WmlDocument(source1.FullName), 5, 10, true), + new(new WmlDocument(source1.FullName), 5, 10, true), }; var out1 = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, "DB006-Out1.docx")); DocumentBuilder.BuildDocument(sources, out1.FullName); @@ -111,33 +111,33 @@ public void DB006_Example_DocumentBuilder01() // Create new document from paragraph 1, and paragraphs 5 through end of Source3.docx. // This effectively 'deletes' paragraphs 2-4 - sources = new List() - { + sources = + [ new Source(new WmlDocument(source3.FullName), 0, 1, false), new Source(new WmlDocument(source3.FullName), 4, false), - }; + ]; var out2 = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, "DB006-Out2.docx")); DocumentBuilder.BuildDocument(sources, out2.FullName); Validate(out2); // Create a new document that consists of the entirety of Source1.docx and Source2.docx. Use // the section information (headings and footers) from source1. - sources = new List() - { + sources = + [ new Source(new WmlDocument(source1.FullName), true), new Source(new WmlDocument(source2.FullName), false), - }; + ]; var out3 = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, "DB006-Out3.docx")); DocumentBuilder.BuildDocument(sources, out3.FullName); Validate(out3); // Create a new document that consists of the entirety of Source1.docx and Source2.docx. Use // the section information (headings and footers) from source2. - sources = new List() - { + sources = + [ new Source(new WmlDocument(source1.FullName), false), new Source(new WmlDocument(source2.FullName), true), - }; + ]; var out4 = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, "DB006-Out4.docx")); DocumentBuilder.BuildDocument(sources, out4.FullName); Validate(out4); @@ -145,11 +145,11 @@ public void DB006_Example_DocumentBuilder01() // Create a new document that consists of the first 5 paragraphs of Source1.docx and the first // five paragraphs of Source2.docx. This example returns a new WmlDocument, when you then can // serialize to a SharePoint document library, or use in some other interesting scenario. - sources = new List() - { + sources = + [ new Source(new WmlDocument(source1.FullName), 0, 5, false), new Source(new WmlDocument(source2.FullName), 0, 5, true), - }; + ]; var wmlOut5 = DocumentBuilder.BuildDocument(sources); var out5 = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, "DB006-Out5.docx")); @@ -167,10 +167,10 @@ public void DB007_Example_DocumentBuilder02_WhitePaper() var authorBio = new FileInfo(Path.Combine(sourceDir.FullName, "DB007-AuthorBiography.docx")); var sources = new List() { - new Source(new WmlDocument(whitePaper.FullName), 0, 1, true), - new Source(new WmlDocument(paperAbstract.FullName), false), - new Source(new WmlDocument(authorBio.FullName), false), - new Source(new WmlDocument(whitePaper.FullName), 1, false), + new(new WmlDocument(whitePaper.FullName), 0, 1, true), + new(new WmlDocument(paperAbstract.FullName), false), + new(new WmlDocument(authorBio.FullName), false), + new(new WmlDocument(whitePaper.FullName), 1, false), }; var assembledPaper = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, "DB007-AssembledPaper.docx")); DocumentBuilder.BuildDocument(sources, assembledPaper.FullName); @@ -187,7 +187,7 @@ public void DB008_DeleteParasWithGivenStyle() // Delete all paragraphs with a specific style. using (var doc = WordprocessingDocument.Open(notes.FullName, false)) { - sources = doc + sources = [.. doc .MainDocumentPart .GetXDocument() .Root @@ -206,8 +206,7 @@ public void DB008_DeleteParasWithGivenStyle() .Where(g => g.Key == true) .Select(g => new Source( new WmlDocument(notes.FullName), g.First().Index, - g.Last().Index - g.First().Index + 1, true)) - .ToList(); + g.Last().Index - g.First().Index + 1, true))]; } var newNotes = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, "DB008-NewNotes.docx")); DocumentBuilder.BuildDocument(sources, newNotes.FullName); @@ -247,7 +246,7 @@ public void DB009_ImportIntoHeadersFooters(string testId, string src, string des var thisTestTempDir = new DirectoryInfo(Path.Combine(rootTempDir.FullName, testId)); if (thisTestTempDir.Exists) { - Assert.True(false, "Duplicate test id: " + testId); + Assert.Fail("Duplicate test id: " + testId); } else { @@ -296,8 +295,8 @@ public void DB009_ImportIntoHeadersFooters(string testId, string src, string des var sources = new List() { - new Source(wmlDestDocument), - new Source(wmlSourceDocument, insertId), + new(wmlDestDocument), + new(wmlSourceDocument, insertId), }; var outFi = new FileInfo(Path.Combine(tempDirFullName, "Output.docx")); @@ -349,22 +348,21 @@ public void DB009_ShredDocument() pi.Index, SectionIndex = sc, }); - documentList = zipped + documentList = [.. zipped .GroupAdjacent(p => p.SectionIndex) .Select(g => new DocumentInfo { DocumentNumber = g.Key, Start = g.First().Index, Count = g.Last().Index - g.First().Index + 1, - }) - .ToList(); + })]; } foreach (var doc in documentList) { var fileName = string.Format("DB009-Section{0:000}.docx", doc.DocumentNumber); var fiSection = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, fileName)); var documentSource = new List { - new Source(new WmlDocument(spec.FullName), doc.Start, doc.Count, true) + new(new WmlDocument(spec.FullName), doc.Start, doc.Count, true) }; DocumentBuilder.BuildDocument(documentSource, fiSection.FullName); Validate(fiSection); @@ -422,10 +420,10 @@ public void DB010_InsertUsingInsertId() var sources = new List() { - new Source(doc1, true), - new Source(new WmlDocument(insert01.FullName), "Liz"), - new Source(new WmlDocument(insert02.FullName), "Eric"), - new Source(new WmlDocument(front.FullName), "Front"), + new(doc1, true), + new(new WmlDocument(insert01.FullName), "Liz"), + new(new WmlDocument(insert02.FullName), "Eric"), + new(new WmlDocument(front.FullName), "Front"), }; var out1 = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, "DB010-Inserted.docx")); DocumentBuilder.BuildDocument(sources, out1.FullName); @@ -441,8 +439,8 @@ public void DB011_BodyAndHeaderWithShapes() var source2 = new FileInfo(Path.Combine(sourceDir.FullName, "DB011-Body-With-Shape.docx")); var sources = new List() { - new Source(new WmlDocument(source1.FullName)), - new Source(new WmlDocument(source2.FullName)), + new(new WmlDocument(source1.FullName)), + new(new WmlDocument(source2.FullName)), }; var processedDestDocx = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, "DB011-Body-And-Header-With-Shapes.docx")); @@ -461,7 +459,7 @@ public void DB012_NumberingsWithSameAbstractNumbering() var sourceDocx = new FileInfo(Path.Combine(sourceDir.FullName, name)); var sources = new List() { - new Source(new WmlDocument(sourceDocx.FullName)), + new(new WmlDocument(sourceDocx.FullName)), }; var processedDestDocx = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, sourceDocx.Name.Replace(".docx", "-processed-by-DocumentBuilder.docx"))); @@ -481,7 +479,7 @@ public void DB012a_NumberingWithZeroIdIsValid() var sourceDocx = new FileInfo(Path.Combine(sourceDir.FullName, name)); var sources = new List() { - new Source(new WmlDocument(sourceDocx.FullName)), + new(new WmlDocument(sourceDocx.FullName)), }; var processedDestDocx = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, sourceDocx.Name.Replace(".docx", "-processed-by-DocumentBuilder.docx"))); @@ -513,8 +511,8 @@ public void DB012b_NumberingWithZeroIdWorks() var sources = new List() { - new Source(doc1, true), - new Source(new WmlDocument(source1.FullName), "Front"), + new(doc1, true), + new(new WmlDocument(source1.FullName), "Front"), }; var processedDestDocx = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, "DB012b-NumberingWithZeroIdWorks.docx")); @@ -534,11 +532,11 @@ public void DB013a_LocalizedStyleIds_Heading() "DB013a-Green-Heading1-Danish.docx")); List sources = null; - sources = new List() - { + sources = + [ new Source(new WmlDocument(source1.FullName)), new Source(new WmlDocument(source2.FullName)), - }; + ]; var processedDestDocx = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, "DB013a-Colored-Heading1.docx")); DocumentBuilder.BuildDocument(sources, processedDestDocx.FullName); @@ -566,11 +564,11 @@ public void DB013b_LocalizedStyleIds_List() "DB013b-Blue-List-English.docx")); List sources = null; - sources = new List() - { + sources = + [ new Source(new WmlDocument(source1.FullName)), new Source(new WmlDocument(source2.FullName)), - }; + ]; var processedDestDocx = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, "DB013b-Colored-List.docx")); DocumentBuilder.BuildDocument(sources, processedDestDocx.FullName); @@ -593,7 +591,7 @@ public void DB014_KeepWebExtensions() var source = new FileInfo(Path.Combine(sourceDir.FullName, "DB014-WebExtensions.docx")); var sources = new List() { - new Source(new WmlDocument(source.FullName)), + new(new WmlDocument(source.FullName)), }; var processedDestDocx = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, "DB014-WebExtensions.docx")); DocumentBuilder.BuildDocument(sources, processedDestDocx.FullName); @@ -612,7 +610,7 @@ public void DB015_LatentStyles() var source = new FileInfo(Path.Combine(sourceDir.FullName, "DB015-LatentStyles.docx")); var sources = new List() { - new Source(new WmlDocument(source.FullName)), + new(new WmlDocument(source.FullName)), }; var processedDestDocx = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, "DB015-LatentStyles.docx")); DocumentBuilder.BuildDocument(sources, processedDestDocx.FullName); @@ -634,7 +632,7 @@ public void DB0016_DocDefaultStyles() var sourceDocx = new FileInfo(Path.Combine(sourceDir.FullName, name)); var sources = new List() { - new Source(new WmlDocument(sourceDocx.FullName), true), + new(new WmlDocument(sourceDocx.FullName), true), }; var processedDestDocx = new FileInfo(Path.Combine(TestUtil.TempDir.FullName, sourceDocx.Name.Replace(".docx", "-processed-by-DocumentBuilder.docx"))); @@ -654,8 +652,8 @@ public void DB017_ApplyHeaderAndFooterToAllDocs() var sources = new List() { - new Source(new WmlDocument(source1.FullName)){KeepSections = true}, - new Source(new WmlDocument(source2.FullName)){KeepSections = true, DiscardHeadersAndFootersInKeptSections = true}, + new(new WmlDocument(source1.FullName)){KeepSections = true}, + new(new WmlDocument(source2.FullName)){KeepSections = true, DiscardHeadersAndFootersInKeptSections = true}, }; var processedDestDocx = new FileInfo(Path.Combine(Path.Combine(TestUtil.TempDir.FullName), "DB017-ApplyHeaderAndFooterToAllDocs.docx")); @@ -714,7 +712,7 @@ public void WithGlossaryDocuments(string testId, string baseline, string src1, s var thisTestTempDir = new DirectoryInfo(Path.Combine(rootTempDir.FullName, testId)); if (thisTestTempDir.Exists) { - Assert.True(false, "Duplicate test id: " + testId); + Assert.Fail("Duplicate test id: " + testId); } else { @@ -769,12 +767,12 @@ private void Validate(FileInfo fi) sb.Append(item.Description).Append(Environment.NewLine); } var s = sb.ToString(); - Assert.True(false, s); + Assert.Fail(s); } } - private static readonly List s_ExpectedErrors = new List() - { + private static readonly List s_ExpectedErrors = + [ "The 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:evenHBand' attribute is not declared.", "The 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:evenVBand' attribute is not declared.", "The 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:firstColumn' attribute is not declared.", @@ -802,7 +800,7 @@ private void Validate(FileInfo fi) "http://schemas.microsoft.com/office/word/2008/9/12/wordml:", "The 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:allStyles' attribute is not declared.", "The 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:customStyles' attribute is not declared.", - }; + ]; private void ValidateUniqueDocPrIds(FileInfo fi) { diff --git a/OpenXmlPowerTools.Tests/FormattingAssemblerTests.cs b/OpenXmlPowerTools.Tests/FormattingAssemblerTests.cs index 4980dcbf..6a90b662 100644 --- a/OpenXmlPowerTools.Tests/FormattingAssemblerTests.cs +++ b/OpenXmlPowerTools.Tests/FormattingAssemblerTests.cs @@ -8,7 +8,7 @@ using System.Text; using Xunit; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class FaTests { @@ -49,7 +49,7 @@ public void FA001_DocumentsWithRevTracking(string testId, string src) var thisTestTempDir = new DirectoryInfo(Path.Combine(rootTempDir.FullName, testId)); if (thisTestTempDir.Exists) { - Assert.True(false, "Duplicate test id: " + testId); + Assert.Fail("Duplicate test id: " + testId); } else { @@ -100,12 +100,12 @@ private void Validate(FileInfo fi) sb.Append(item.Description).Append(Environment.NewLine); } var s = sb.ToString(); - Assert.True(false, s); + Assert.Fail(s); } } - private static readonly List s_ExpectedErrors = new List() - { + private static readonly List s_ExpectedErrors = + [ "The 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:evenHBand' attribute is not declared.", "The 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:evenVBand' attribute is not declared.", "The 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:firstColumn' attribute is not declared.", @@ -135,6 +135,6 @@ private void Validate(FileInfo fi) "The 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:customStyles' attribute is not declared.", "The element has invalid child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:ins'.", "The element has invalid child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:del'.", - }; + ]; } } \ No newline at end of file diff --git a/OpenXmlPowerTools.Tests/HtmlToWmlConverterTests.cs b/OpenXmlPowerTools.Tests/HtmlToWmlConverterTests.cs index 56630fba..83cc1911 100644 --- a/OpenXmlPowerTools.Tests/HtmlToWmlConverterTests.cs +++ b/OpenXmlPowerTools.Tests/HtmlToWmlConverterTests.cs @@ -25,7 +25,7 @@ * this module do not require the HtmlAgilityPack to run. *******************************************************************************************/ -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class HwTests { diff --git a/OpenXmlPowerTools.Tests/HtmlToWmlReadAsXElement.cs b/OpenXmlPowerTools.Tests/HtmlToWmlReadAsXElement.cs index 8defdb03..f8b65955 100644 --- a/OpenXmlPowerTools.Tests/HtmlToWmlReadAsXElement.cs +++ b/OpenXmlPowerTools.Tests/HtmlToWmlReadAsXElement.cs @@ -26,7 +26,7 @@ using HtmlAgilityPack; #endif -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class HtmlToWmlReadAsXElement { diff --git a/OpenXmlPowerTools.Tests/ImageHandlerTests.cs b/OpenXmlPowerTools.Tests/ImageHandlerTests.cs index 4e8b3d8d..f52dafa3 100644 --- a/OpenXmlPowerTools.Tests/ImageHandlerTests.cs +++ b/OpenXmlPowerTools.Tests/ImageHandlerTests.cs @@ -5,7 +5,7 @@ using SkiaSharp; using Xunit; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class ImageHandlerTests { diff --git a/OpenXmlPowerTools.Tests/MarkupSimplifierTests.cs b/OpenXmlPowerTools.Tests/MarkupSimplifierTests.cs index 71408483..3ad6c794 100644 --- a/OpenXmlPowerTools.Tests/MarkupSimplifierTests.cs +++ b/OpenXmlPowerTools.Tests/MarkupSimplifierTests.cs @@ -6,7 +6,7 @@ using System.Xml.Linq; using Xunit; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class MarkupSimplifierTests { diff --git a/OpenXmlPowerTools.Tests/MetricsGetterTests.cs b/OpenXmlPowerTools.Tests/MetricsGetterTests.cs index e450bc23..1b7d9b8c 100644 --- a/OpenXmlPowerTools.Tests/MetricsGetterTests.cs +++ b/OpenXmlPowerTools.Tests/MetricsGetterTests.cs @@ -3,7 +3,7 @@ using System.Xml.Linq; using Xunit; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class MgTests { diff --git a/OpenXmlPowerTools.Tests/OpenXMLWordprocessingMLToHtmlConverter/AllowedDiffInfo.cs b/OpenXmlPowerTools.Tests/OpenXMLWordprocessingMLToHtmlConverter/AllowedDiffInfo.cs index 59411961..138d6d8b 100644 --- a/OpenXmlPowerTools.Tests/OpenXMLWordprocessingMLToHtmlConverter/AllowedDiffInfo.cs +++ b/OpenXmlPowerTools.Tests/OpenXMLWordprocessingMLToHtmlConverter/AllowedDiffInfo.cs @@ -1,4 +1,4 @@ -namespace Codeuctivity.Tests.OpenXMLWordProcessingMLToHtmlConverter +namespace OpenXmlPowerTools.Tests.OpenXMLWordprocessingMLToHtmlConverter { internal class AllowedDiffInfo { diff --git a/OpenXmlPowerTools.Tests/OpenXMLWordprocessingMLToHtmlConverter/WmlToHtmlConverterHandlerTests.cs b/OpenXmlPowerTools.Tests/OpenXMLWordprocessingMLToHtmlConverter/WmlToHtmlConverterHandlerTests.cs index fa78d8b5..aeaf78de 100644 --- a/OpenXmlPowerTools.Tests/OpenXMLWordprocessingMLToHtmlConverter/WmlToHtmlConverterHandlerTests.cs +++ b/OpenXmlPowerTools.Tests/OpenXMLWordprocessingMLToHtmlConverter/WmlToHtmlConverterHandlerTests.cs @@ -8,7 +8,7 @@ using System.Xml.Linq; using Xunit; -namespace Codeuctivity.Tests.OpenXMLWordProcessingMLToHtmlConverter +namespace OpenXmlPowerTools.Tests.OpenXMLWordprocessingMLToHtmlConverter { public class WmlToHtmlConverterHandlerTests { diff --git a/OpenXmlPowerTools.Tests/OpenXMLWordprocessingMLToHtmlConverter/WmlToHtmlConverterTests.cs b/OpenXmlPowerTools.Tests/OpenXMLWordprocessingMLToHtmlConverter/WmlToHtmlConverterTests.cs index 3329b53c..1bbd9402 100644 --- a/OpenXmlPowerTools.Tests/OpenXMLWordprocessingMLToHtmlConverter/WmlToHtmlConverterTests.cs +++ b/OpenXmlPowerTools.Tests/OpenXMLWordprocessingMLToHtmlConverter/WmlToHtmlConverterTests.cs @@ -13,7 +13,7 @@ using System.Xml.Linq; using Xunit; -namespace Codeuctivity.Tests.OpenXMLWordProcessingMLToHtmlConverter +namespace OpenXmlPowerTools.Tests.OpenXMLWordprocessingMLToHtmlConverter { public class WmlToHtmlConverterTests { @@ -117,7 +117,7 @@ public async Task HC003_ContainsSubstring(string name, params string[] expectedS var sourceDocx = new FileInfo(Path.Combine(sourceDir.FullName, name)); var settings = new WmlToHtmlConverterSettings(sourceDocx.FullName, new ImageHandler(), new TextDummyHandler(), new SymbolHandler(), new BreakHandler(), new FontHandler(), false); - var byteArray = await File.ReadAllBytesAsync(sourceDocx.FullName); + var byteArray = await File.ReadAllBytesAsync(sourceDocx.FullName, TestContext.Current.CancellationToken); using var memoryStream = new MemoryStream(); memoryStream.Write(byteArray, 0, byteArray.Length); using var wDoc = WordprocessingDocument.Open(memoryStream, true); @@ -243,7 +243,7 @@ internal static async Task AssertImageIsEqual(string actualImagePath, string exp Assert.Fail($"Expected PixelErrorCount less or equal {allowedPixelErrorCount} but was {result.PixelErrorCount}\nExpected {expectFullPath}\ndiffers to actual {actualFullPath}\n Diff is {allowedDiffInfo.NewDiffImageFileName} \nReplace {actualFullPath} with the new value or store the diff as {allowedDiffInfo.ExistingDiffImageFilename.First()}."); } } - catch (System.Exception ex) when (!(ex is Xunit.Sdk.FailException)) + catch (System.Exception ex) when (ex is not Xunit.Sdk.FailException) { SaveToGithubActionsPickupTestresultsDirectory(actualFullPath, expectFullPath, allowedDiffInfo.NewDiffImageFileName); } diff --git a/OpenXmlPowerTools.Tests/OpenXmlPowerTools.Tests.csproj b/OpenXmlPowerTools.Tests/OpenXmlPowerTools.Tests.csproj index d324d823..c2bbe2a5 100644 --- a/OpenXmlPowerTools.Tests/OpenXmlPowerTools.Tests.csproj +++ b/OpenXmlPowerTools.Tests/OpenXmlPowerTools.Tests.csproj @@ -6,25 +6,17 @@ - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + - + \ No newline at end of file diff --git a/OpenXmlPowerTools.Tests/OpenXmlRegexTests.cs b/OpenXmlPowerTools.Tests/OpenXmlRegexTests.cs index 810d3009..7c303e10 100644 --- a/OpenXmlPowerTools.Tests/OpenXmlRegexTests.cs +++ b/OpenXmlPowerTools.Tests/OpenXmlRegexTests.cs @@ -7,7 +7,7 @@ using System.Xml.Linq; using Xunit; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class OpenXmlRegexTests { diff --git a/OpenXmlPowerTools.Tests/PowerToolsBlockExtensionsTests.cs b/OpenXmlPowerTools.Tests/PowerToolsBlockExtensionsTests.cs index 188ece9d..03a217f1 100644 --- a/OpenXmlPowerTools.Tests/PowerToolsBlockExtensionsTests.cs +++ b/OpenXmlPowerTools.Tests/PowerToolsBlockExtensionsTests.cs @@ -6,7 +6,7 @@ using System.Xml.Linq; using Xunit; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class PowerToolsBlockExtensionsTests : TestsBase { @@ -52,7 +52,7 @@ public void MustBeginPowerToolsBlockToUsePowerTools() // paragraph. This is caused by the GetXDocument method using the cached // XDocument, i.e., the annotation, rather reading the part's stream again. content = part.GetXDocument(); - paragraphElements = content.Descendants(W.p).ToList(); + paragraphElements = [.. content.Descendants(W.p)]; Assert.Single(paragraphElements); Assert.Equal("First", paragraphElements[0].Value); @@ -65,7 +65,7 @@ public void MustBeginPowerToolsBlockToUsePowerTools() // Get content through the PowerTools in the exact same way as above. // We should now see both paragraphs. content = part.GetXDocument(); - paragraphElements = content.Descendants(W.p).ToList(); + paragraphElements = [.. content.Descendants(W.p)]; Assert.Equal(2, paragraphElements.Count); Assert.Equal("First", paragraphElements[0].Value); Assert.Equal("Second", paragraphElements[1].Value); @@ -114,7 +114,7 @@ public void MustEndPowerToolsBlockToUseStronglyTypedClasses() // Get the part's content through the SDK. Having reloaded the root element, // we should still see both paragraphs. body = part.Document.Body; - paragraphs = body.Elements().ToList(); + paragraphs = [.. body.Elements()]; Assert.Equal(2, paragraphs.Count); Assert.Equal("Added through SDK", paragraphs[0].InnerText); Assert.Equal("Added through PowerTools", paragraphs[1].InnerText); diff --git a/OpenXmlPowerTools.Tests/PowerToolsBlockTests.cs b/OpenXmlPowerTools.Tests/PowerToolsBlockTests.cs index 955bf41a..9b7ebf74 100644 --- a/OpenXmlPowerTools.Tests/PowerToolsBlockTests.cs +++ b/OpenXmlPowerTools.Tests/PowerToolsBlockTests.cs @@ -7,7 +7,7 @@ using System.Xml.Linq; using Xunit; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class PowerToolsBlockTests : TestsBase { diff --git a/OpenXmlPowerTools.Tests/PtUtilTests.cs b/OpenXmlPowerTools.Tests/PtUtilTests.cs index 7b209f93..04a29496 100644 --- a/OpenXmlPowerTools.Tests/PtUtilTests.cs +++ b/OpenXmlPowerTools.Tests/PtUtilTests.cs @@ -2,7 +2,7 @@ using System.IO; using Xunit; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class PtUtilTests { diff --git a/OpenXmlPowerTools.Tests/RevisionAccepterTests.cs b/OpenXmlPowerTools.Tests/RevisionAccepterTests.cs index c98a3934..28884fef 100644 --- a/OpenXmlPowerTools.Tests/RevisionAccepterTests.cs +++ b/OpenXmlPowerTools.Tests/RevisionAccepterTests.cs @@ -2,7 +2,7 @@ using System.IO; using Xunit; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class RaTests { diff --git a/OpenXmlPowerTools.Tests/RevisionProcessorTests.cs b/OpenXmlPowerTools.Tests/RevisionProcessorTests.cs index f4b92234..819d979a 100644 --- a/OpenXmlPowerTools.Tests/RevisionProcessorTests.cs +++ b/OpenXmlPowerTools.Tests/RevisionProcessorTests.cs @@ -3,7 +3,7 @@ using System.IO; using Xunit; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class RpTests { diff --git a/OpenXmlPowerTools.Tests/SmlCellFormatterTests.cs b/OpenXmlPowerTools.Tests/SmlCellFormatterTests.cs index abc3026a..a6c64473 100644 --- a/OpenXmlPowerTools.Tests/SmlCellFormatterTests.cs +++ b/OpenXmlPowerTools.Tests/SmlCellFormatterTests.cs @@ -4,7 +4,7 @@ using System.Linq; using Xunit; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class CfTests { diff --git a/OpenXmlPowerTools.Tests/SmlToHtmlConverterTests.cs b/OpenXmlPowerTools.Tests/SmlToHtmlConverterTests.cs index 5cb0b5ea..4e747839 100644 --- a/OpenXmlPowerTools.Tests/SmlToHtmlConverterTests.cs +++ b/OpenXmlPowerTools.Tests/SmlToHtmlConverterTests.cs @@ -3,7 +3,7 @@ using System.IO; using Xunit; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class ShTests { diff --git a/OpenXmlPowerTools.Tests/SpreadsheetWriterTests.cs b/OpenXmlPowerTools.Tests/SpreadsheetWriterTests.cs index e17ae745..66b8e71c 100644 --- a/OpenXmlPowerTools.Tests/SpreadsheetWriterTests.cs +++ b/OpenXmlPowerTools.Tests/SpreadsheetWriterTests.cs @@ -8,7 +8,7 @@ using System.Text; using Xunit; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class SwTests { @@ -19,25 +19,21 @@ public void SW001_Simple() { Worksheets = new WorksheetDfn[] { - new WorksheetDfn - { + new() { Name = "MyFirstSheet", TableName = "NamesAndRates", ColumnHeadings = new CellDfn[] { - new CellDfn - { + new() { Value = "Name", Bold = true, }, - new CellDfn - { + new() { Value = "Age", Bold = true, HorizontalCellAlignment = HorizontalCellAlignment.Left, }, - new CellDfn - { + new() { Value = "Rate", Bold = true, HorizontalCellAlignment = HorizontalCellAlignment.Left, @@ -45,38 +41,36 @@ public void SW001_Simple() }, Rows = new RowDfn[] { - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "Eric", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = 50, }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = (decimal)45.00, FormatCode = "0.00", }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "Bob", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = 42, }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = (decimal)78.00, FormatCode = "0.00", @@ -100,18 +94,15 @@ public void SW002_AllDataTypes() { Worksheets = new WorksheetDfn[] { - new WorksheetDfn - { + new() { Name = "MyFirstSheet", ColumnHeadings = new CellDfn[] { - new CellDfn - { + new() { Value = "DataType", Bold = true, }, - new CellDfn - { + new() { Value = "Value", Bold = true, HorizontalCellAlignment = HorizontalCellAlignment.Right, @@ -119,185 +110,172 @@ public void SW002_AllDataTypes() }, Rows = new RowDfn[] { - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "Boolean", }, - new CellDfn { + new() { CellDataType = CellDataType.Boolean, Value = true, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "Boolean", }, - new CellDfn { + new() { CellDataType = CellDataType.Boolean, Value = false, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "String", }, - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "A String", HorizontalCellAlignment = HorizontalCellAlignment.Right, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "int", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = 100, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "int?", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = 100, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "int? (is null)", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = null, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "uint", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = 101, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "long", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = long.MaxValue, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "float", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = (float)123.45, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "double", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = 123.45, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "decimal", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = (decimal)123.45, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "date (t:str)", }, - new CellDfn { + new() { Value = new DateTime(2012, 1, 8).ToOADate(), FormatCode= "mm-dd-yy", Bold = true, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "date (t:str)", }, - new CellDfn { + new() { Value = new DateTime(2012, 1, 9).ToOADate(), FormatCode= "mm-dd-yy", Bold = true, @@ -305,15 +283,14 @@ public void SW002_AllDataTypes() }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "date (t:d)", }, - new CellDfn { + new() { CellDataType = CellDataType.Date, Value = new DateTime(2012, 1, 11).ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff"), }, @@ -350,9 +327,9 @@ private void Validate(FileInfo fi) Assert.Empty(errors); } - private static readonly List s_ExpectedErrors = new List() - { + private static readonly List s_ExpectedErrors = + [ "The attribute 't' has invalid value 'd'. The Enumeration constraint failed.", - }; + ]; } } \ No newline at end of file diff --git a/OpenXmlPowerTools.Tests/StronglyTypedBlockTests.cs b/OpenXmlPowerTools.Tests/StronglyTypedBlockTests.cs index 18edaba4..757a3933 100644 --- a/OpenXmlPowerTools.Tests/StronglyTypedBlockTests.cs +++ b/OpenXmlPowerTools.Tests/StronglyTypedBlockTests.cs @@ -7,7 +7,7 @@ using System.Xml.Linq; using Xunit; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class StronglyTypedBlockTests : TestsBase { diff --git a/OpenXmlPowerTools.Tests/TestUtil.cs b/OpenXmlPowerTools.Tests/TestUtil.cs index 4ef92264..6700fe7a 100644 --- a/OpenXmlPowerTools.Tests/TestUtil.cs +++ b/OpenXmlPowerTools.Tests/TestUtil.cs @@ -1,7 +1,7 @@ using System; using System.IO; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class TestUtil { diff --git a/OpenXmlPowerTools.Tests/TestsBase.cs b/OpenXmlPowerTools.Tests/TestsBase.cs index 03c62f91..feaeb25c 100644 --- a/OpenXmlPowerTools.Tests/TestsBase.cs +++ b/OpenXmlPowerTools.Tests/TestsBase.cs @@ -3,7 +3,7 @@ using DocumentFormat.OpenXml.Wordprocessing; using System.IO; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { /// /// Base class for unit tests providing utility methods. diff --git a/OpenXmlPowerTools.Tests/UnicodeMapperTests.cs b/OpenXmlPowerTools.Tests/UnicodeMapperTests.cs index 0e129975..8532dc2d 100644 --- a/OpenXmlPowerTools.Tests/UnicodeMapperTests.cs +++ b/OpenXmlPowerTools.Tests/UnicodeMapperTests.cs @@ -3,7 +3,7 @@ using System.Xml.Linq; using Xunit; -namespace Codeuctivity.Tests +namespace OpenXmlPowerTools.Tests { public class UnicodeMapperTests { diff --git a/OpenXmlPowerTools.sln b/OpenXmlPowerTools.sln deleted file mode 100644 index 77971c1b..00000000 --- a/OpenXmlPowerTools.sln +++ /dev/null @@ -1,258 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31903.59 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenXmlPowerTools", "OpenXmlPowerTools\OpenXmlPowerTools.csproj", "{6F957FF3-AFCC-4D69-8FBC-71AE21BC45C9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChartUpdater01", "OpenXmlPowerToolsExamples\ChartUpdater01\ChartUpdater01.csproj", "{1B03D24F-FB08-42E1-BB25-2D1BB907991B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocumentBuilder01", "OpenXmlPowerToolsExamples\DocumentBuilder01\DocumentBuilder01.csproj", "{A8A6FCF0-CA4F-4637-8E66-D86603B92204}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocumentBuilder02", "OpenXmlPowerToolsExamples\DocumentBuilder02\DocumentBuilder02.csproj", "{BF8153AA-C390-4D00-98F2-083DEFEC7094}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocumentBuilder03", "OpenXmlPowerToolsExamples\DocumentBuilder03\DocumentBuilder03.csproj", "{BE635672-D3FD-42C5-96E3-EDE50E05CE29}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocumentBuilder04", "OpenXmlPowerToolsExamples\DocumentBuilder04\DocumentBuilder04.csproj", "{CE0ECABB-03AD-42CE-A5BD-D0CC4DCE35AB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FieldRetriever01", "OpenXmlPowerToolsExamples\FieldRetriever01\FieldRetriever01.csproj", "{E1FD7B15-FA09-4F7F-A30E-9FBD9F765D02}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FormattingAssembler01", "OpenXmlPowerToolsExamples\FormattingAssembler01\FormattingAssembler01.csproj", "{6EAF15B6-98BE-428B-A018-A5266521551E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Formulas01", "OpenXmlPowerToolsExamples\Formulas01\Formulas01.csproj", "{618B95DB-3A70-4DC8-BD87-00F636F72453}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HtmlConverter01", "OpenXmlPowerToolsExamples\HtmlConverter01\HtmlConverter01.csproj", "{BC9E7408-508D-482D-8602-96E76ACBB5EA}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ListItemRetriever01", "OpenXmlPowerToolsExamples\ListItemRetriever01\ListItemRetriever01.csproj", "{04935FA6-E48B-496F-8D6A-41A59232303D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MetricsGetter01", "OpenXmlPowerToolsExamples\MetricsGetter01\MetricsGetter01.csproj", "{ED37372C-DFBF-4720-BD4B-CE1415961038}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenXmlRegex01", "OpenXmlPowerToolsExamples\OpenXmlRegex01\OpenXmlRegex01.csproj", "{4330D46F-6703-4BA2-844D-177F722C0820}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PivotTables01", "OpenXmlPowerToolsExamples\PivotTables01\PivotTables01.csproj", "{6785A554-BBBB-480C-8E4D-9FE90DD91A46}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReferenceAdder01", "OpenXmlPowerToolsExamples\ReferenceAdder01\ReferenceAdder01.csproj", "{211F05D3-F8EE-497F-9DE9-AFFA0A72140D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RevisionAccepter01", "OpenXmlPowerToolsExamples\RevisionAccepter01\RevisionAccepter01.csproj", "{84823BA5-B860-4CAF-885E-981D7F121830}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TextReplacer01", "OpenXmlPowerToolsExamples\TextReplacer01\TextReplacer01.csproj", "{5CA29B44-C4A5-4310-9429-553F0BC9FC1D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TextReplacer02", "OpenXmlPowerToolsExamples\TextReplacer02\TextReplacer02.csproj", "{153E5218-E9C0-4ED8-9073-0802204C8B90}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocumentAssembler01", "OpenXmlPowerToolsExamples\DocumentAssembler01\DocumentAssembler01.csproj", "{EFE77658-EDD7-4597-8016-CBE4A18951B0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocumentAssembler", "OpenXmlPowerToolsExamples\DocumentAssembler\DocumentAssembler.csproj", "{2D081A36-48F9-4A09-8247-420682545492}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpreadsheetWriter01", "OpenXmlPowerToolsExamples\SpreadsheetWriter01\SpreadsheetWriter01.csproj", "{0911F996-DF86-4FB1-A1CE-0539599EC0E0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpreadsheetWriter02", "OpenXmlPowerToolsExamples\SpreadsheetWriter02\SpreadsheetWriter02.csproj", "{DF1D84AF-27B8-4F87-A673-CCFADC3AAF02}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenXmlPowerTools.Tests", "OpenXmlPowerTools.Tests\OpenXmlPowerTools.Tests.csproj", "{B1328B70-33B8-40E0-A729-38C34D659B5C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocumentAssembler02", "OpenXmlPowerToolsExamples\DocumentAssembler02\DocumentAssembler02.csproj", "{D6DFAC7C-82F4-4318-A9F0-6450D2945D96}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HtmlToWmlConverter01", "OpenXmlPowerToolsExamples\HtmlToWmlConverter01\HtmlToWmlConverter01.csproj", "{9E194D13-F5A0-4430-8F87-D74326457385}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocumentAssembler03", "OpenXmlPowerToolsExamples\DocumentAssembler03\DocumentAssembler03.csproj", "{214F0E80-D2E3-4E19-A3FC-2BE15B3906B0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HtmlToWmlConverter02", "OpenXmlPowerToolsExamples\HtmlToWmlConverter02\HtmlToWmlConverter02.csproj", "{1E75CB7D-2A4A-4B03-80A9-7B7D59B18BB4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WmlToHtmlConverter01", "OpenXmlPowerToolsExamples\WmlToHtmlConverter01\WmlToHtmlConverter01.csproj", "{396D9209-0D9A-4E61-9471-04C71F6CA6B9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WmlToHtmlConverter02", "OpenXmlPowerToolsExamples\WmlToHtmlConverter02\WmlToHtmlConverter02.csproj", "{D4078011-2611-46A7-8A30-55E4AB8FA786}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SmlDataRetriever01", "OpenXmlPowerToolsExamples\SmlDataRetriever01\SmlDataRetriever01.csproj", "{DCE8EC51-1E58-49A0-82CF-5BE269FA0A9D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{A83D6B58-6D38-46AF-8C20-5CFC170A1063}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9AFB8C96-1E6E-483E-9882-75D2483E7076}" - ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig - .github\workflows\cla.yml = .github\workflows\cla.yml - .github\dependabot.yml = .github\dependabot.yml - .github\workflows\dotnet.yml = .github\workflows\dotnet.yml - LICENSE.md = LICENSE.md - README.md = README.md - .github\workflows\stale.yml = .github\workflows\stale.yml - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MarkupSimplifierApp", "OpenXmlPowerToolsExamples\MarkupSimplifierApp\MarkupSimplifierApp.csproj", "{6731E031-9C81-48FB-97A7-0E945993BCE2}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenXmlPowerToolsExamples", "OpenXmlPowerToolsExamples", "{AA7E2DBC-70B3-4F8A-AC47-4416CDA9F3DA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DocumentAssembler04", "OpenXmlPowerToolsExamples\DocumentAssembler04\DocumentAssembler04.csproj", "{94E64B7D-BB4A-4478-B3BF-69F83C2FD379}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6F957FF3-AFCC-4D69-8FBC-71AE21BC45C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6F957FF3-AFCC-4D69-8FBC-71AE21BC45C9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6F957FF3-AFCC-4D69-8FBC-71AE21BC45C9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6F957FF3-AFCC-4D69-8FBC-71AE21BC45C9}.Release|Any CPU.Build.0 = Release|Any CPU - {1B03D24F-FB08-42E1-BB25-2D1BB907991B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1B03D24F-FB08-42E1-BB25-2D1BB907991B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1B03D24F-FB08-42E1-BB25-2D1BB907991B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1B03D24F-FB08-42E1-BB25-2D1BB907991B}.Release|Any CPU.Build.0 = Release|Any CPU - {A8A6FCF0-CA4F-4637-8E66-D86603B92204}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A8A6FCF0-CA4F-4637-8E66-D86603B92204}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A8A6FCF0-CA4F-4637-8E66-D86603B92204}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A8A6FCF0-CA4F-4637-8E66-D86603B92204}.Release|Any CPU.Build.0 = Release|Any CPU - {BF8153AA-C390-4D00-98F2-083DEFEC7094}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BF8153AA-C390-4D00-98F2-083DEFEC7094}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BF8153AA-C390-4D00-98F2-083DEFEC7094}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BF8153AA-C390-4D00-98F2-083DEFEC7094}.Release|Any CPU.Build.0 = Release|Any CPU - {BE635672-D3FD-42C5-96E3-EDE50E05CE29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BE635672-D3FD-42C5-96E3-EDE50E05CE29}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BE635672-D3FD-42C5-96E3-EDE50E05CE29}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BE635672-D3FD-42C5-96E3-EDE50E05CE29}.Release|Any CPU.Build.0 = Release|Any CPU - {CE0ECABB-03AD-42CE-A5BD-D0CC4DCE35AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CE0ECABB-03AD-42CE-A5BD-D0CC4DCE35AB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CE0ECABB-03AD-42CE-A5BD-D0CC4DCE35AB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CE0ECABB-03AD-42CE-A5BD-D0CC4DCE35AB}.Release|Any CPU.Build.0 = Release|Any CPU - {E1FD7B15-FA09-4F7F-A30E-9FBD9F765D02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E1FD7B15-FA09-4F7F-A30E-9FBD9F765D02}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E1FD7B15-FA09-4F7F-A30E-9FBD9F765D02}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E1FD7B15-FA09-4F7F-A30E-9FBD9F765D02}.Release|Any CPU.Build.0 = Release|Any CPU - {6EAF15B6-98BE-428B-A018-A5266521551E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6EAF15B6-98BE-428B-A018-A5266521551E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6EAF15B6-98BE-428B-A018-A5266521551E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6EAF15B6-98BE-428B-A018-A5266521551E}.Release|Any CPU.Build.0 = Release|Any CPU - {618B95DB-3A70-4DC8-BD87-00F636F72453}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {618B95DB-3A70-4DC8-BD87-00F636F72453}.Debug|Any CPU.Build.0 = Debug|Any CPU - {618B95DB-3A70-4DC8-BD87-00F636F72453}.Release|Any CPU.ActiveCfg = Release|Any CPU - {618B95DB-3A70-4DC8-BD87-00F636F72453}.Release|Any CPU.Build.0 = Release|Any CPU - {BC9E7408-508D-482D-8602-96E76ACBB5EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BC9E7408-508D-482D-8602-96E76ACBB5EA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BC9E7408-508D-482D-8602-96E76ACBB5EA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BC9E7408-508D-482D-8602-96E76ACBB5EA}.Release|Any CPU.Build.0 = Release|Any CPU - {04935FA6-E48B-496F-8D6A-41A59232303D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {04935FA6-E48B-496F-8D6A-41A59232303D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {04935FA6-E48B-496F-8D6A-41A59232303D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {04935FA6-E48B-496F-8D6A-41A59232303D}.Release|Any CPU.Build.0 = Release|Any CPU - {ED37372C-DFBF-4720-BD4B-CE1415961038}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ED37372C-DFBF-4720-BD4B-CE1415961038}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ED37372C-DFBF-4720-BD4B-CE1415961038}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ED37372C-DFBF-4720-BD4B-CE1415961038}.Release|Any CPU.Build.0 = Release|Any CPU - {4330D46F-6703-4BA2-844D-177F722C0820}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4330D46F-6703-4BA2-844D-177F722C0820}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4330D46F-6703-4BA2-844D-177F722C0820}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4330D46F-6703-4BA2-844D-177F722C0820}.Release|Any CPU.Build.0 = Release|Any CPU - {6785A554-BBBB-480C-8E4D-9FE90DD91A46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6785A554-BBBB-480C-8E4D-9FE90DD91A46}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6785A554-BBBB-480C-8E4D-9FE90DD91A46}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6785A554-BBBB-480C-8E4D-9FE90DD91A46}.Release|Any CPU.Build.0 = Release|Any CPU - {211F05D3-F8EE-497F-9DE9-AFFA0A72140D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {211F05D3-F8EE-497F-9DE9-AFFA0A72140D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {211F05D3-F8EE-497F-9DE9-AFFA0A72140D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {211F05D3-F8EE-497F-9DE9-AFFA0A72140D}.Release|Any CPU.Build.0 = Release|Any CPU - {84823BA5-B860-4CAF-885E-981D7F121830}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {84823BA5-B860-4CAF-885E-981D7F121830}.Debug|Any CPU.Build.0 = Debug|Any CPU - {84823BA5-B860-4CAF-885E-981D7F121830}.Release|Any CPU.ActiveCfg = Release|Any CPU - {84823BA5-B860-4CAF-885E-981D7F121830}.Release|Any CPU.Build.0 = Release|Any CPU - {5CA29B44-C4A5-4310-9429-553F0BC9FC1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5CA29B44-C4A5-4310-9429-553F0BC9FC1D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5CA29B44-C4A5-4310-9429-553F0BC9FC1D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5CA29B44-C4A5-4310-9429-553F0BC9FC1D}.Release|Any CPU.Build.0 = Release|Any CPU - {153E5218-E9C0-4ED8-9073-0802204C8B90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {153E5218-E9C0-4ED8-9073-0802204C8B90}.Debug|Any CPU.Build.0 = Debug|Any CPU - {153E5218-E9C0-4ED8-9073-0802204C8B90}.Release|Any CPU.ActiveCfg = Release|Any CPU - {153E5218-E9C0-4ED8-9073-0802204C8B90}.Release|Any CPU.Build.0 = Release|Any CPU - {EFE77658-EDD7-4597-8016-CBE4A18951B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EFE77658-EDD7-4597-8016-CBE4A18951B0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EFE77658-EDD7-4597-8016-CBE4A18951B0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EFE77658-EDD7-4597-8016-CBE4A18951B0}.Release|Any CPU.Build.0 = Release|Any CPU - {2D081A36-48F9-4A09-8247-420682545492}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2D081A36-48F9-4A09-8247-420682545492}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2D081A36-48F9-4A09-8247-420682545492}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2D081A36-48F9-4A09-8247-420682545492}.Release|Any CPU.Build.0 = Release|Any CPU - {0911F996-DF86-4FB1-A1CE-0539599EC0E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0911F996-DF86-4FB1-A1CE-0539599EC0E0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0911F996-DF86-4FB1-A1CE-0539599EC0E0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0911F996-DF86-4FB1-A1CE-0539599EC0E0}.Release|Any CPU.Build.0 = Release|Any CPU - {DF1D84AF-27B8-4F87-A673-CCFADC3AAF02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DF1D84AF-27B8-4F87-A673-CCFADC3AAF02}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DF1D84AF-27B8-4F87-A673-CCFADC3AAF02}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DF1D84AF-27B8-4F87-A673-CCFADC3AAF02}.Release|Any CPU.Build.0 = Release|Any CPU - {B1328B70-33B8-40E0-A729-38C34D659B5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B1328B70-33B8-40E0-A729-38C34D659B5C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B1328B70-33B8-40E0-A729-38C34D659B5C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B1328B70-33B8-40E0-A729-38C34D659B5C}.Release|Any CPU.Build.0 = Release|Any CPU - {D6DFAC7C-82F4-4318-A9F0-6450D2945D96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D6DFAC7C-82F4-4318-A9F0-6450D2945D96}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D6DFAC7C-82F4-4318-A9F0-6450D2945D96}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D6DFAC7C-82F4-4318-A9F0-6450D2945D96}.Release|Any CPU.Build.0 = Release|Any CPU - {9E194D13-F5A0-4430-8F87-D74326457385}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9E194D13-F5A0-4430-8F87-D74326457385}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9E194D13-F5A0-4430-8F87-D74326457385}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9E194D13-F5A0-4430-8F87-D74326457385}.Release|Any CPU.Build.0 = Release|Any CPU - {214F0E80-D2E3-4E19-A3FC-2BE15B3906B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {214F0E80-D2E3-4E19-A3FC-2BE15B3906B0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {214F0E80-D2E3-4E19-A3FC-2BE15B3906B0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {214F0E80-D2E3-4E19-A3FC-2BE15B3906B0}.Release|Any CPU.Build.0 = Release|Any CPU - {1E75CB7D-2A4A-4B03-80A9-7B7D59B18BB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1E75CB7D-2A4A-4B03-80A9-7B7D59B18BB4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1E75CB7D-2A4A-4B03-80A9-7B7D59B18BB4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1E75CB7D-2A4A-4B03-80A9-7B7D59B18BB4}.Release|Any CPU.Build.0 = Release|Any CPU - {396D9209-0D9A-4E61-9471-04C71F6CA6B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {396D9209-0D9A-4E61-9471-04C71F6CA6B9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {396D9209-0D9A-4E61-9471-04C71F6CA6B9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {396D9209-0D9A-4E61-9471-04C71F6CA6B9}.Release|Any CPU.Build.0 = Release|Any CPU - {D4078011-2611-46A7-8A30-55E4AB8FA786}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D4078011-2611-46A7-8A30-55E4AB8FA786}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D4078011-2611-46A7-8A30-55E4AB8FA786}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D4078011-2611-46A7-8A30-55E4AB8FA786}.Release|Any CPU.Build.0 = Release|Any CPU - {DCE8EC51-1E58-49A0-82CF-5BE269FA0A9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DCE8EC51-1E58-49A0-82CF-5BE269FA0A9D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DCE8EC51-1E58-49A0-82CF-5BE269FA0A9D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DCE8EC51-1E58-49A0-82CF-5BE269FA0A9D}.Release|Any CPU.Build.0 = Release|Any CPU - {6731E031-9C81-48FB-97A7-0E945993BCE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6731E031-9C81-48FB-97A7-0E945993BCE2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6731E031-9C81-48FB-97A7-0E945993BCE2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6731E031-9C81-48FB-97A7-0E945993BCE2}.Release|Any CPU.Build.0 = Release|Any CPU - {94E64B7D-BB4A-4478-B3BF-69F83C2FD379}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {94E64B7D-BB4A-4478-B3BF-69F83C2FD379}.Debug|Any CPU.Build.0 = Debug|Any CPU - {94E64B7D-BB4A-4478-B3BF-69F83C2FD379}.Release|Any CPU.ActiveCfg = Release|Any CPU - {94E64B7D-BB4A-4478-B3BF-69F83C2FD379}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {1B03D24F-FB08-42E1-BB25-2D1BB907991B} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {A8A6FCF0-CA4F-4637-8E66-D86603B92204} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {BF8153AA-C390-4D00-98F2-083DEFEC7094} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {BE635672-D3FD-42C5-96E3-EDE50E05CE29} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {CE0ECABB-03AD-42CE-A5BD-D0CC4DCE35AB} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {E1FD7B15-FA09-4F7F-A30E-9FBD9F765D02} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {6EAF15B6-98BE-428B-A018-A5266521551E} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {618B95DB-3A70-4DC8-BD87-00F636F72453} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {BC9E7408-508D-482D-8602-96E76ACBB5EA} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {04935FA6-E48B-496F-8D6A-41A59232303D} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {ED37372C-DFBF-4720-BD4B-CE1415961038} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {4330D46F-6703-4BA2-844D-177F722C0820} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {6785A554-BBBB-480C-8E4D-9FE90DD91A46} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {211F05D3-F8EE-497F-9DE9-AFFA0A72140D} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {84823BA5-B860-4CAF-885E-981D7F121830} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {5CA29B44-C4A5-4310-9429-553F0BC9FC1D} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {153E5218-E9C0-4ED8-9073-0802204C8B90} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {EFE77658-EDD7-4597-8016-CBE4A18951B0} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {2D081A36-48F9-4A09-8247-420682545492} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {0911F996-DF86-4FB1-A1CE-0539599EC0E0} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {DF1D84AF-27B8-4F87-A673-CCFADC3AAF02} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {D6DFAC7C-82F4-4318-A9F0-6450D2945D96} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {9E194D13-F5A0-4430-8F87-D74326457385} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {214F0E80-D2E3-4E19-A3FC-2BE15B3906B0} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {1E75CB7D-2A4A-4B03-80A9-7B7D59B18BB4} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {396D9209-0D9A-4E61-9471-04C71F6CA6B9} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {D4078011-2611-46A7-8A30-55E4AB8FA786} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {DCE8EC51-1E58-49A0-82CF-5BE269FA0A9D} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {6731E031-9C81-48FB-97A7-0E945993BCE2} = {A83D6B58-6D38-46AF-8C20-5CFC170A1063} - {94E64B7D-BB4A-4478-B3BF-69F83C2FD379} = {AA7E2DBC-70B3-4F8A-AC47-4416CDA9F3DA} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {E623EFF5-2CA4-4FA0-B3AB-53F921DA212E} - EndGlobalSection -EndGlobal diff --git a/OpenXmlPowerTools.sln.DotSettings b/OpenXmlPowerTools.sln.DotSettings deleted file mode 100644 index bdfe054c..00000000 --- a/OpenXmlPowerTools.sln.DotSettings +++ /dev/null @@ -1,270 +0,0 @@ - - True - SOLUTION - <?xml version="1.0" encoding="utf-16"?><Profile name="Prudent Cleanup"><CSUseAutoProperty>True</CSUseAutoProperty><CSMakeAutoPropertyGetOnly>True</CSMakeAutoPropertyGetOnly><CSArrangeQualifiers>True</CSArrangeQualifiers><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings><EmbraceInRegion>False</EmbraceInRegion><RegionName></RegionName></CSOptimizeUsings><CSReformatCode>True</CSReformatCode><CSharpFormatDocComments>True</CSharpFormatDocComments><CSShortenReferences>True</CSShortenReferences><CSReorderTypeMembers>True</CSReorderTypeMembers><CSCodeStyleAttributes ArrangeTypeAccessModifier="True" ArrangeTypeMemberAccessModifier="True" SortModifiers="True" RemoveRedundantParentheses="True" AddMissingParentheses="False" ArrangeBraces="False" ArrangeAttributes="True" ArrangeArgumentsStyle="True" /><RemoveCodeRedundancies>True</RemoveCodeRedundancies><CSFixBuiltinTypeReferences>True</CSFixBuiltinTypeReferences></Profile> - Built-in: Full Cleanup - Prudent Cleanup - NotRequired - False - True - True - True - True - True - 1 - 1 - True - NEVER - True - True - 130 - CHOP_IF_LONG - RemoveIndent - RemoveIndent - <?xml version="1.0" encoding="utf-16"?> -<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"> - <TypePattern DisplayName="Non-reorderable types"> - <TypePattern.Match> - <Or> - <And> - <Kind Is="Interface" /> - <Or> - <HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" /> - <HasAttribute Name="System.Runtime.InteropServices.ComImport" /> - </Or> - </And> - <Kind Is="Struct" /> - <HasAttribute Name="JetBrains.Annotations.NoReorderAttribute" /> - <HasAttribute Name="JetBrains.Annotations.NoReorder" /> - </Or> - </TypePattern.Match> - </TypePattern> - <TypePattern DisplayName="xUnit.net Test Classes" RemoveRegions="All"> - <TypePattern.Match> - <And> - <Kind Is="Class" /> - <HasMember> - <And> - <Kind Is="Method" /> - <HasAttribute Name="Xunit.FactAttribute" Inherited="True" /> - </And> - </HasMember> - </And> - </TypePattern.Match> - <Entry DisplayName="Setup/Teardown Methods"> - <Entry.Match> - <Or> - <Kind Is="Constructor" /> - <And> - <Kind Is="Method" /> - <ImplementsInterface Name="System.IDisposable" /> - </And> - </Or> - </Entry.Match> - <Entry.SortBy> - <Kind Order="Constructor" /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="All other members" /> - <Entry DisplayName="Test Methods" Priority="100"> - <Entry.Match> - <And> - <Kind Is="Method" /> - <HasAttribute Name="Xunit.FactAttribute" /> - </And> - </Entry.Match> - <Entry.SortBy> - <Name /> - </Entry.SortBy> - </Entry> - </TypePattern> - <TypePattern DisplayName="NUnit Test Fixtures" RemoveRegions="All"> - <TypePattern.Match> - <And> - <Kind Is="Class" /> - <HasAttribute Name="NUnit.Framework.TestFixtureAttribute" Inherited="True" /> - </And> - </TypePattern.Match> - <Entry DisplayName="Setup/Teardown Methods"> - <Entry.Match> - <And> - <Kind Is="Method" /> - <Or> - <HasAttribute Name="NUnit.Framework.SetUpAttribute" Inherited="True" /> - <HasAttribute Name="NUnit.Framework.TearDownAttribute" Inherited="True" /> - <HasAttribute Name="NUnit.Framework.FixtureSetUpAttribute" Inherited="True" /> - <HasAttribute Name="NUnit.Framework.FixtureTearDownAttribute" Inherited="True" /> - </Or> - </And> - </Entry.Match> - </Entry> - <Entry DisplayName="All other members" /> - <Entry DisplayName="Test Methods" Priority="100"> - <Entry.Match> - <And> - <Kind Is="Method" /> - <HasAttribute Name="NUnit.Framework.TestAttribute" /> - </And> - </Entry.Match> - <Entry.SortBy> - <Name /> - </Entry.SortBy> - </Entry> - </TypePattern> - <TypePattern DisplayName="Default Pattern"> - <Entry DisplayName="Public Delegates" Priority="100"> - <Entry.Match> - <And> - <Access Is="Public" /> - <Kind Is="Delegate" /> - </And> - </Entry.Match> - <Entry.SortBy> - <Name /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Public Enums" Priority="100"> - <Entry.Match> - <And> - <Access Is="Public" /> - <Kind Is="Enum" /> - </And> - </Entry.Match> - <Entry.SortBy> - <Name /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Static Fields and Constants"> - <Entry.Match> - <Or> - <Kind Is="Constant" /> - <And> - <Kind Is="Field" /> - <Static /> - </And> - </Or> - </Entry.Match> - <Entry.SortBy> - <Kind Order="Constant Field" /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Fields"> - <Entry.Match> - <And> - <Kind Is="Field" /> - <Not> - <Static /> - </Not> - </And> - </Entry.Match> - <Entry.SortBy> - <Readonly /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Constructors"> - <Entry.Match> - <Kind Is="Constructor" /> - </Entry.Match> - <Entry.SortBy> - <Static /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Properties, Indexers"> - <Entry.Match> - <Or> - <Kind Is="Property" /> - <Kind Is="Indexer" /> - </Or> - </Entry.Match> - <Entry.SortBy> - <Access /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Interface Implementations" Priority="100"> - <Entry.Match> - <And> - <Kind Is="Member" /> - <ImplementsInterface /> - </And> - </Entry.Match> - <Entry.SortBy> - <ImplementsInterface /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="All other members" /> - <Entry DisplayName="Nested Types"> - <Entry.Match> - <Kind Is="Type" /> - </Entry.Match> - </Entry> - </TypePattern> -</Patterns> - UseVarWhenEvident - UseVarWhenEvident - UseVarWhenEvident - -$FILENAME$ - -Copyright $CREATED_YEAR$ Thomas Barnekow - -Developer: Thomas Barnekow -Email: thomas<at/>barnekow<dot/>info - - - True - False - True - False - True - False - False - SHA - STA - UTF - <Configurator><ConnectList /></Configurator> - True - True - False - 4000 - True - C:\Users\BARNEKOWT\AppData\Local\JetBrains\Transient\ReSharperPlatformVs14\v08\SolutionCaches - True - True - True - True - True - True - True - True - True - True - True - True - 06/16/2017 18:30:31 - VS - <data /> - <data><IncludeFilters /><ExcludeFilters><Filter ModuleMask="DokuMate.WordAddIn" ModuleVersionMask="*" ClassMask="*" FunctionMask="*" IsEnabled="True" /><Filter ModuleMask="DokuMate.ExcelAddIn" ModuleVersionMask="*" ClassMask="*" FunctionMask="*" IsEnabled="True" /><Filter ModuleMask="VSTOContrib.*" ModuleVersionMask="*" ClassMask="*" FunctionMask="*" IsEnabled="True" /><Filter ModuleMask="*.AppData.*" ModuleVersionMask="*" ClassMask="*" FunctionMask="*" IsEnabled="True" /><Filter ModuleMask="DokuMasker" ModuleVersionMask="*" ClassMask="*" FunctionMask="*" IsEnabled="True" /><Filter ModuleMask="DokuMate.Moq" ModuleVersionMask="*" ClassMask="*" FunctionMask="*" IsEnabled="True" /><Filter ModuleMask="DokuMate.Updater" ModuleVersionMask="*" ClassMask="DokuMate.Updater.App" FunctionMask="*" IsEnabled="True" /><Filter ModuleMask="DokuMate.Updater" ModuleVersionMask="*" ClassMask="DokuMate.Updater.MainWindow" FunctionMask="*" IsEnabled="True" /><Filter ModuleMask="DokuMate.Updater" ModuleVersionMask="*" ClassMask="DokuMate.Updater.ViewModelLocator" FunctionMask="*" IsEnabled="True" /><Filter ModuleMask="DokuMate.Updater" ModuleVersionMask="*" ClassMask="DokuMate.Updater.UpdaterModule" FunctionMask="*" IsEnabled="True" /><Filter ModuleMask="DokuMate.Core" ModuleVersionMask="*" ClassMask="DokuMate.Core.ProcessFactory" FunctionMask="*" IsEnabled="True" /><Filter ModuleMask="DokuMate.Core" ModuleVersionMask="*" ClassMask="DokuMate.Core.DokuMateException" FunctionMask="*" IsEnabled="True" /><Filter ModuleMask="DokuMate.Updater" ModuleVersionMask="*" ClassMask="DokuMate.Updater.Services.HttpClientAdapter" FunctionMask="*" IsEnabled="True" /><Filter ModuleMask="DokuMate.Updater" ModuleVersionMask="*" ClassMask="DokuMate.Updater.Services.UnexpectedUpdaterException" FunctionMask="*" IsEnabled="True" /><Filter ModuleMask="DokuMate.Updater" ModuleVersionMask="*" ClassMask="DokuMate.Updater.Services.ExpectedUpdaterException" FunctionMask="*" IsEnabled="True" /><Filter ModuleMask="DokuMate.Updater" ModuleVersionMask="*" ClassMask="DokuMate.Updater.Services.UpdaterException" FunctionMask="*" IsEnabled="True" /></ExcludeFilters></data> - <data><AttributeFilter ClassMask="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" IsEnabled="True" /></data> - 1.5 - True - True - anonymous - True - True - -235,-461 - 424 - 271.125 - 212 - 90.375 - True - False - False - True - Vertical - 1 - 1.1448525508114591 - True - True - C:\Users\BARNEKOWT\AppData\Local\JetBrains\Shared\vAny\Sessions - 326 - True \ No newline at end of file diff --git a/OpenXmlPowerTools.slnx b/OpenXmlPowerTools.slnx new file mode 100644 index 00000000..863a2fce --- /dev/null +++ b/OpenXmlPowerTools.slnx @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenXmlPowerTools/MetricsGetter.cs b/OpenXmlPowerTools/MetricsGetter.cs index b893334f..d7781da3 100644 --- a/OpenXmlPowerTools/MetricsGetter.cs +++ b/OpenXmlPowerTools/MetricsGetter.cs @@ -112,18 +112,11 @@ private static int _getTextWidth(SKTypeface typeface, FontStyle fs, decimal sz, { try { - var skFontStyle = SKFontStyle.Normal; - if (fs.HasFlag(FontStyle.Bold) && fs.HasFlag(FontStyle.Italic)) - skFontStyle = new SKFontStyle(SKFontStyleWeight.Bold, SKFontStyleWidth.Normal, SKFontStyleSlant.Italic); - else if (fs.HasFlag(FontStyle.Bold)) - skFontStyle = new SKFontStyle(SKFontStyleWeight.Bold, SKFontStyleWidth.Normal, SKFontStyleSlant.Upright); - else if (fs.HasFlag(FontStyle.Italic)) - skFontStyle = new SKFontStyle(SKFontStyleWeight.Normal, SKFontStyleWidth.Normal, SKFontStyleSlant.Italic); - - using var font = new SKFont(typeface, (float)sz / 2f); - using var paint = new SKPaint(font); - var bounds = new SKRect(); - paint.MeasureText(text, ref bounds); + var fallbackTypeface = fs == FontStyle.Bold + ? SKTypeface.FromFamilyName("Arial", SKFontStyle.Bold) + : SKTypeface.FromFamilyName("Arial", SKFontStyle.Normal); + using var font = new SKFont(typeface ?? fallbackTypeface, size: (float)sz / 2f); + font.MeasureText(text, out var bounds); return (int)bounds.Width; } catch diff --git a/OpenXmlPowerTools/OpenXmlPowerTools.csproj b/OpenXmlPowerTools/OpenXmlPowerTools.csproj index e691a49d..0dabdede 100644 --- a/OpenXmlPowerTools/OpenXmlPowerTools.csproj +++ b/OpenXmlPowerTools/OpenXmlPowerTools.csproj @@ -43,8 +43,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/OpenXmlPowerToolsExamples/DocumentBuilder01/DocumentBuilder01.cs b/OpenXmlPowerToolsExamples/DocumentBuilder01/DocumentBuilder01.cs index c7f678d6..e9288d17 100644 --- a/OpenXmlPowerToolsExamples/DocumentBuilder01/DocumentBuilder01.cs +++ b/OpenXmlPowerToolsExamples/DocumentBuilder01/DocumentBuilder01.cs @@ -21,45 +21,45 @@ private static void Main() // Create new document from 10 paragraphs starting at paragraph 5 of Source1.docx var sources = new List() { - new Source(new WmlDocument(source1), 5, 10, true), + new(new WmlDocument(source1), 5, 10, true), }; DocumentBuilder.BuildDocument(sources, Path.Combine(tempDi.FullName, "Out1.docx")); // Create new document from paragraph 1, and paragraphs 5 through end of Source3.docx. // This effectively 'deletes' paragraphs 2-4 - sources = new List() - { + sources = + [ new Source(new WmlDocument(source3), 0, 1, false), new Source(new WmlDocument(source3), 4, false), - }; + ]; DocumentBuilder.BuildDocument(sources, Path.Combine(tempDi.FullName, "Out2.docx")); // Create a new document that consists of the entirety of Source1.docx and Source2.docx. Use // the section information (headings and footers) from source1. - sources = new List() - { + sources = + [ new Source(new WmlDocument(source1), true), new Source(new WmlDocument(source2), false), - }; + ]; DocumentBuilder.BuildDocument(sources, Path.Combine(tempDi.FullName, "Out3.docx")); // Create a new document that consists of the entirety of Source1.docx and Source2.docx. Use // the section information (headings and footers) from source2. - sources = new List() - { + sources = + [ new Source(new WmlDocument(source1), false), new Source(new WmlDocument(source2), true), - }; + ]; DocumentBuilder.BuildDocument(sources, Path.Combine(tempDi.FullName, "Out4.docx")); // Create a new document that consists of the first 5 paragraphs of Source1.docx and the first // five paragraphs of Source2.docx. This example returns a new WmlDocument, when you then can // serialize to a SharePoint document library, or use in some other interesting scenario. - sources = new List() - { + sources = + [ new Source(new WmlDocument(source1), 0, 5, false), new Source(new WmlDocument(source2), 0, 5, true), - }; + ]; var out5 = DocumentBuilder.BuildDocument(sources); out5.SaveAs(Path.Combine(tempDi.FullName, "Out5.docx")); // save it to the file system, but we could just as easily done something // else with it. diff --git a/OpenXmlPowerToolsExamples/DocumentBuilder02/DocumentBuilder02.cs b/OpenXmlPowerToolsExamples/DocumentBuilder02/DocumentBuilder02.cs index 282ae430..8948436c 100644 --- a/OpenXmlPowerToolsExamples/DocumentBuilder02/DocumentBuilder02.cs +++ b/OpenXmlPowerToolsExamples/DocumentBuilder02/DocumentBuilder02.cs @@ -30,13 +30,13 @@ private static void Main() // Insert an abstract and author biography into a white paper. List sources = null; - sources = new List() - { + sources = + [ new Source(new WmlDocument("../../WhitePaper.docx"), 0, 1, true), new Source(new WmlDocument("../../Abstract.docx"), false), new Source(new WmlDocument("../../AuthorBiography.docx"), false), new Source(new WmlDocument("../../WhitePaper.docx"), 1, false), - }; + ]; DocumentBuilder.BuildDocument(sources, Path.Combine(tempDi.FullName, "AssembledPaper.docx")); // Delete all paragraphs with a specific style. @@ -114,7 +114,7 @@ private static void Main() { var fileName = string.Format("Section{0:000}.docx", doc.DocumentNumber); var documentSource = new List { - new Source(new WmlDocument("../../Spec.docx"), doc.Start, doc.Count, true) + new(new WmlDocument("../../Spec.docx"), doc.Start, doc.Count, true) }; DocumentBuilder.BuildDocument(documentSource, Path.Combine(tempDi.FullName, fileName)); } diff --git a/OpenXmlPowerToolsExamples/DocumentBuilder03/DocumentBuilder03.cs b/OpenXmlPowerToolsExamples/DocumentBuilder03/DocumentBuilder03.cs index 0b00db72..c08b054b 100644 --- a/OpenXmlPowerToolsExamples/DocumentBuilder03/DocumentBuilder03.cs +++ b/OpenXmlPowerToolsExamples/DocumentBuilder03/DocumentBuilder03.cs @@ -43,10 +43,10 @@ private static void Main() var outFileName = Path.Combine(tempDi.FullName, "Out.docx"); var sources = new List() { - new Source(doc1, true), - new Source(new WmlDocument(@"..\..\Insert-01.docx"), "Liz"), - new Source(new WmlDocument(@"..\..\Insert-02.docx"), "Eric"), - new Source(new WmlDocument(@"..\..\FrontMatter.docx"), "Front"), + new(doc1, true), + new(new WmlDocument(@"..\..\Insert-01.docx"), "Liz"), + new(new WmlDocument(@"..\..\Insert-02.docx"), "Eric"), + new(new WmlDocument(@"..\..\FrontMatter.docx"), "Front"), }; DocumentBuilder.BuildDocument(sources, outFileName); } diff --git a/OpenXmlPowerToolsExamples/MarkupSimplifierApp/MarkupSimplifierApp.csproj b/OpenXmlPowerToolsExamples/MarkupSimplifierApp/MarkupSimplifierApp.csproj index 7c91b84a..e8ea0dc6 100644 --- a/OpenXmlPowerToolsExamples/MarkupSimplifierApp/MarkupSimplifierApp.csproj +++ b/OpenXmlPowerToolsExamples/MarkupSimplifierApp/MarkupSimplifierApp.csproj @@ -7,7 +7,7 @@ - + diff --git a/OpenXmlPowerToolsExamples/SpreadsheetWriter01/SpreadsheetWriter01.cs b/OpenXmlPowerToolsExamples/SpreadsheetWriter01/SpreadsheetWriter01.cs index ffc66d04..b3eba732 100644 --- a/OpenXmlPowerToolsExamples/SpreadsheetWriter01/SpreadsheetWriter01.cs +++ b/OpenXmlPowerToolsExamples/SpreadsheetWriter01/SpreadsheetWriter01.cs @@ -16,25 +16,21 @@ private static void Main() { Worksheets = new WorksheetDfn[] { - new WorksheetDfn - { + new() { Name = "MyFirstSheet", TableName = "NamesAndRates", ColumnHeadings = new CellDfn[] { - new CellDfn - { + new() { Value = "Name", Bold = true, }, - new CellDfn - { + new() { Value = "Age", Bold = true, HorizontalCellAlignment = HorizontalCellAlignment.Left, }, - new CellDfn - { + new() { Value = "Rate", Bold = true, HorizontalCellAlignment = HorizontalCellAlignment.Left, @@ -42,38 +38,36 @@ private static void Main() }, Rows = new RowDfn[] { - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "Eric", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = 50, }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = (decimal)45.00, FormatCode = "0.00", }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "Bob", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = 42, }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = (decimal)78.00, FormatCode = "0.00", diff --git a/OpenXmlPowerToolsExamples/SpreadsheetWriter02/SpreadsheetWriter02.cs b/OpenXmlPowerToolsExamples/SpreadsheetWriter02/SpreadsheetWriter02.cs index f3d6acbb..b111db27 100644 --- a/OpenXmlPowerToolsExamples/SpreadsheetWriter02/SpreadsheetWriter02.cs +++ b/OpenXmlPowerToolsExamples/SpreadsheetWriter02/SpreadsheetWriter02.cs @@ -16,18 +16,15 @@ private static void Main() { Worksheets = new WorksheetDfn[] { - new WorksheetDfn - { + new() { Name = "MyFirstSheet", ColumnHeadings = new CellDfn[] { - new CellDfn - { + new() { Value = "DataType", Bold = true, }, - new CellDfn - { + new() { Value = "Value", Bold = true, HorizontalCellAlignment = HorizontalCellAlignment.Right, @@ -35,171 +32,159 @@ private static void Main() }, Rows = new RowDfn[] { - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "Boolean", }, - new CellDfn { + new() { CellDataType = CellDataType.Boolean, Value = true, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "Boolean", }, - new CellDfn { + new() { CellDataType = CellDataType.Boolean, Value = false, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "String", }, - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "A String", HorizontalCellAlignment = HorizontalCellAlignment.Right, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "int", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = 100, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "int?", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = (int?)100, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "int? (is null)", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = null, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "uint", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = (uint)101, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "long", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = long.MaxValue, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "float", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = (float)123.45, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "double", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = 123.45, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.String, Value = "decimal", }, - new CellDfn { + new() { CellDataType = CellDataType.Number, Value = (decimal)123.45, }, } }, - new RowDfn - { + new() { Cells = new CellDfn[] { - new CellDfn { + new() { CellDataType = CellDataType.Date, Value = new DateTime(2012, 1, 8), FormatCode = "mm-dd-yy", }, - new CellDfn { + new() { CellDataType = CellDataType.Date, Value = new DateTime(2012, 1, 9), FormatCode = "mm-dd-yy", diff --git a/TestFiles/HC024-Tabs-01.docxExpectation.png.diff.win20260703135818.png b/TestFiles/HC024-Tabs-01.docxExpectation.png.diff.win20260703135818.png new file mode 100644 index 00000000..9048641b Binary files /dev/null and b/TestFiles/HC024-Tabs-01.docxExpectation.png.diff.win20260703135818.png differ diff --git a/TestFiles/HC024-Tabs-01.docxExpectation.png.diff.win20260703155117.png b/TestFiles/HC024-Tabs-01.docxExpectation.png.diff.win20260703155117.png new file mode 100644 index 00000000..79477543 Binary files /dev/null and b/TestFiles/HC024-Tabs-01.docxExpectation.png.diff.win20260703155117.png differ diff --git a/TestFiles/HC025-Tabs-02.docxExpectation.png.diff.win20260703135731.png b/TestFiles/HC025-Tabs-02.docxExpectation.png.diff.win20260703135731.png new file mode 100644 index 00000000..9048641b Binary files /dev/null and b/TestFiles/HC025-Tabs-02.docxExpectation.png.diff.win20260703135731.png differ diff --git a/TestFiles/HC025-Tabs-02.docxExpectation.png.diff.win20260703155101.png b/TestFiles/HC025-Tabs-02.docxExpectation.png.diff.win20260703155101.png new file mode 100644 index 00000000..79477543 Binary files /dev/null and b/TestFiles/HC025-Tabs-02.docxExpectation.png.diff.win20260703155101.png differ diff --git a/TestFiles/HC026-Tabs-03.docxExpectation.png.diff.win20260703135711.png b/TestFiles/HC026-Tabs-03.docxExpectation.png.diff.win20260703135711.png new file mode 100644 index 00000000..94e66b60 Binary files /dev/null and b/TestFiles/HC026-Tabs-03.docxExpectation.png.diff.win20260703135711.png differ diff --git a/TestFiles/HC026-Tabs-03.docxExpectation.png.diff.win20260703155115.png b/TestFiles/HC026-Tabs-03.docxExpectation.png.diff.win20260703155115.png new file mode 100644 index 00000000..63417741 Binary files /dev/null and b/TestFiles/HC026-Tabs-03.docxExpectation.png.diff.win20260703155115.png differ diff --git a/TestFiles/HC031-Complicated-Document.docxExpectation.png.diff.win20260703135522.png b/TestFiles/HC031-Complicated-Document.docxExpectation.png.diff.win20260703135522.png new file mode 100644 index 00000000..4fe2d012 Binary files /dev/null and b/TestFiles/HC031-Complicated-Document.docxExpectation.png.diff.win20260703135522.png differ diff --git a/TestFiles/HC031-Complicated-Document.docxExpectation.png.diff.win20260703155104.png b/TestFiles/HC031-Complicated-Document.docxExpectation.png.diff.win20260703155104.png new file mode 100644 index 00000000..ec7335df Binary files /dev/null and b/TestFiles/HC031-Complicated-Document.docxExpectation.png.diff.win20260703155104.png differ