Completed
Last Updated: 31 May 2016 13:40 by ADMIN
ADMIN
Deyan
Created on: 25 Apr 2016 17:47
Category: WordsProcessing
Type: Bug Report
3
Cloning document containing fields without Separator causes NullReferenceException
Workaround:

private static void WorkaroundFieldsIssue(RadFlowDocument flowdocument)
{
    foreach (FieldCharacter fieldCharacter in flowdocument.EnumerateChildrenOfType<FieldCharacter>().ToList())
    {
        // only for start
        if (fieldCharacter.FieldCharacterType == FieldCharacterType.Start)
        {
            if (fieldCharacter.FieldInfo.Separator != null && fieldCharacter.FieldInfo.Separator.Parent == null)
            {
                Paragraph parent = fieldCharacter.FieldInfo.End.Paragraph;
                int index = parent.Inlines.IndexOf(fieldCharacter.FieldInfo.End);

                fieldCharacter.FieldInfo.End.Paragraph.Inlines.Insert(index, fieldCharacter.FieldInfo.Separator);
            }
        }
    }
}
1 comment
ADMIN
Aylin
Posted on: 31 May 2016 13:40
Hi, 

The issue is fixed and will be released in our next LIB version.
It will be included in the next official 2016 Q2 SP1 release as well.

Do not hesitate to contact us if any issues arise.

Regards,
Aylin,
The Telerik Team