SourceToTargetCopier with .Preserve enumeration, working?

I have been unsuccessful in getting the SourceToTargetCopier working when the ExistingContentHandling enumeration set to .Preserve, example:

converter.AddBilingualProcessor(new SourceToTargetCopier(ExistingContentHandling.Preserve));
converter.Parse();

it seems to work perfectly when the enumeration is set to .Replace or .ThrowException, but I need to use the .Preserve

Can someone please confirm if they can get this working with the .Preserve enum?

Thank you in advance for your support,

P.

Parents Reply
  • Thank you for confirming and following up with this bug.

    For now I have just added the following addition to the ProcessParagraphUnit method to copy a clone of the IAbstractMarkupData segment items from the source.
    for me this seems to be working correctly;  what do you think?

    public void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
    {
         [...]
         foreach (ISegmentPair segmentPair in paragraphUnit.SegmentPairs)
         {
             [...]
                    if (segmentPair.Target.Count == 0)
                    {
                        for (int i = 0; i < segmentPair.Source.Count; i++)
                            segmentPair.Target.Add((IAbstractMarkupData)segmentPair.Source[ i ] .Clone());
                    }
              [...]
         }
    }

Children