Unpredictable behavior of Document.SetActiveSegmentPair when document is a multi-file view.

The Document.SetActiveSegmentPair seems to behave unpredictably when multiple files are opened in a merged document by selecting multiple files in the Files view and choosing Open for Translation.

Sometimes the segment count starts counting at the very beginning of the merged view (that would be the expected behavior), sometimes it starts counting any of the contained files.  For example, if you run Document.SetActiveSegmentPair("4"), the cursor might go to the 4th segment of any of the files contained in the merged view, which effectively means that you put the cursor on a random segment pair.

My expectation would be that the segment number starts counting always at the first file in the view and that proceeds in the order of the files returned by Document.Files.

That is, if Document.Files returns "File1", "File2", and "File3" (in this order), and "Files1", "Files2" and "Files3" have 10 segments each, then I would expect that:

- Document.SetActiveSegmentPair("4") puts the cursor on the 4th segment of "File1".

- Document.SetActiveSegmentPair("14") puts the cursor on the 4th segment of "File2".

- Document.SetActiveSegmentPair("24") puts the cursor on the 4th segment of "File3".

Is this a bug in Document.SetActiveSegmentPair or am I missing anything on how the API should be used for merged views?

Regards,

Josep.

Parents Reply
  • The issue seems to continue to happen in CU3.  

    One possible workaround would be to programmatically save and close the multi-file document and then open the single-file document, but we found it too intrusive so we did not implement it.  Until this issue is fixed, we opted to issue a warning prompting the user to close the muti-file document and ask her to try again.

    Hopefully this issue with the SetActiveSegmentPair will be shortlisted for resolving in next CU or in SP2, as apparently sometimes it can be inconvenient to close the multi-file document depending on what the user is doing.

Children
No Data