private void CollectValuesFromMultiStringControl(LabeledMultiStringControl lmsControl,
IList<ITsString> alternativesCollector, ITsString defaultIfNoMultiString)
{
var bldr = m_cache.TsStrFactory;
if (lmsControl == null)
{
alternativesCollector.Add(defaultIfNoMultiString);
}
else
{
// Save all the writing systems.
for (var i = 0; i < lmsControl.NumberOfWritingSystems; i++)
{
int ws;
ITsString tss = lmsControl.ValueAndWs(i, out ws);
if (tss != null && tss.Text != null)
{
// In the case of copied text, sometimes the string had the wrong ws attached to it. (LT-11950)
alternativesCollector.Add(bldr.MakeString(tss.Text, ws));
}
}
}
}