Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions src/DocumentFormat.OpenXml.Framework/EnumerableExtensions.cs

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AddedPartIsNotAllowed" xml:space="preserve">
<value>The part cannot be added here.</value>
</data>
<data name="CannotChangeDocumentType" xml:space="preserve">
<value>Cannot change the document type.</value>
</data>
Expand Down Expand Up @@ -411,7 +408,7 @@
<data name="FailedToOpenPackage" xml:space="preserve">
<value>Package could not be opened for stream. See inner exception for details and be aware that there are behavior differences in stream support between .NET Framework and Core.</value>
</data>
<data name="FirstOrDefaultMaxOne" xml:space="preserve">
<value>The enumerable contained more than a single element when only zero or one are allowed.</value>
<data name="AddedPartIsNotAllowed" xml:space="preserve">
<value>The part cannot be added here.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public RelationshipTypeConstraint(OpenXmlQualifiedName attribute, string type)
{
var pair = current.Part.Parts
.Where(p => p.RelationshipId == attribute.Value.InnerText)
.FirstOrDefaultAndMaxOne();
.SingleOrDefault();

if (pair is { })
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ protected static bool GetAttrNumVal(OpenXmlSimpleType attributeValue, out double
CultureInfo.InvariantCulture, out value);
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1851:Possible multiple enumerations of 'IEnumerable' collection", Justification = "We're resetting the parts variable, but the analyzer doesn't realize that")]
private static OpenXmlPart? GetPartThroughPartPath(IEnumerable<IdPartPair> pairs, string[] path)
{
var foundPart = default(OpenXmlPart);
Expand All @@ -251,7 +252,7 @@ protected static bool GetAttrNumVal(OpenXmlSimpleType attributeValue, out double
foundPart = parts
.Where(p => p.OpenXmlPart.GetType().Name == path[i])
.Select(t => t.OpenXmlPart)
.FirstOrDefaultAndMaxOne(static () => new System.IO.FileFormatException(ValidationResources.MoreThanOnePartForOneUri));
.SingleOrDefault();

if (foundPart is not { })
{
Expand Down
Loading