From 27d84b545fcf06076dd0ae68f905e39d91895d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bernl=C3=B6hr?= Date: Tue, 28 Dec 2021 00:59:11 +0100 Subject: [PATCH] Ignore Fallback and drawing in GetFirstRunEffectedByEditRecursive to be symmetric with HelperFunctions.GetTextRecursive - fixes #414 --- Xceed.Document.NET/Src/Paragraph.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Xceed.Document.NET/Src/Paragraph.cs b/Xceed.Document.NET/Src/Paragraph.cs index a2c5532..9210de1 100644 --- a/Xceed.Document.NET/Src/Paragraph.cs +++ b/Xceed.Document.NET/Src/Paragraph.cs @@ -5079,7 +5079,11 @@ internal void GetFirstRunEffectedByEditRecursive( XElement Xml, int index, ref i return; } - if( Xml.HasElements ) + // Ignore Fallback and drawing to be symmetric with HelperFunctions.GetTextRecursive. + var fallbackValue = Xml.Name.Equals(XName.Get("Fallback", Document.mc.NamespaceName)); + var drawingValue = Xml.Name.Equals(XName.Get("drawing", Document.w.NamespaceName)); + + if( Xml.HasElements && !fallbackValue && !drawingValue ) { foreach( XElement e in Xml.Elements() ) {