Skip to content

Commit 01a504f

Browse files
committed
make OpenXmlCompositeElement.IsValidChild virtual
1 parent c08a012 commit 01a504f

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

src/DocumentFormat.OpenXml.Framework/OpenXmlCompositeElement.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,11 +534,14 @@ public override void RemoveAllChildren()
534534
#endregion
535535

536536
/// <summary>
537-
/// Determines if the specified element is a valid child of the current element.
537+
/// Determines whether the specified <see cref="OpenXmlElement"/> is a valid child element
538+
/// for this <see cref="OpenXmlCompositeElement"/> according to the schema definition.
538539
/// </summary>
539-
/// <param name="element">The element to check.</param>
540-
/// <returns>True if the specified element is a valid child; otherwise, false.</returns>
541-
public override bool IsValidChild(OpenXmlElement element)
540+
/// <param name="element">The <see cref="OpenXmlElement"/> to validate as a child.</param>
541+
/// <returns>
542+
/// <c>true</c> if the specified element is a valid child; otherwise, <c>false</c>.
543+
/// </returns>
544+
public virtual bool IsValidChild(OpenXmlElement element)
542545
{
543546
if (element is null)
544547
{

src/DocumentFormat.OpenXml.Framework/OpenXmlElement.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,16 +1330,6 @@ public bool IsBefore(OpenXmlElement element)
13301330
return GetOrder(this, element) == ElementOrder.Before;
13311331
}
13321332

1333-
/// <summary>
1334-
/// Determines if the specified element is a valid child of the current element.
1335-
/// </summary>
1336-
/// <param name="element">The element to check.</param>
1337-
/// <returns>True if the specified element is a valid child; otherwise, false.</returns>
1338-
public virtual bool IsValidChild(OpenXmlElement element)
1339-
{
1340-
return false;
1341-
}
1342-
13431333
private enum ElementOrder
13441334
{
13451335
Same, // same element

src/DocumentFormat.OpenXml.Framework/PublicAPI/PublicAPI.Shipped.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,5 +1009,4 @@ DocumentFormat.OpenXml.OpenXmlPartWriterSettings.Encoding.set -> void
10091009
DocumentFormat.OpenXml.OpenXmlPartWriterSettings.OpenXmlPartWriterSettings() -> void
10101010
DocumentFormat.OpenXml.OpenXmlPartWriter.OpenXmlPartWriter(DocumentFormat.OpenXml.Packaging.OpenXmlPart! openXmlPart, DocumentFormat.OpenXml.OpenXmlPartWriterSettings! settings) -> void
10111011
DocumentFormat.OpenXml.OpenXmlPartWriter.OpenXmlPartWriter(System.IO.Stream! partStream, DocumentFormat.OpenXml.OpenXmlPartWriterSettings! settings) -> void
1012-
virtual DocumentFormat.OpenXml.OpenXmlElement.IsValidChild(DocumentFormat.OpenXml.OpenXmlElement! element) -> bool
1013-
override DocumentFormat.OpenXml.OpenXmlCompositeElement.IsValidChild(DocumentFormat.OpenXml.OpenXmlElement! element) -> bool
1012+
virtual DocumentFormat.OpenXml.OpenXmlCompositeElement.IsValidChild(DocumentFormat.OpenXml.OpenXmlElement! element) -> bool

0 commit comments

Comments
 (0)