Skip to content

Commit 09f401d

Browse files
authored
LT-21766: Fix Reversal Sort Order in Webonary (#363)
In some situations the CurrentReversalWsId is not correct. Now we first try to get a ws from the SubComparer (if it is a WritingSystemComparer). This looks like the same place that the Sorter gets the ws. Note: This change also fixes a similar problem with the reversal sort order in Word Export.
1 parent 0e323c9 commit 09f401d

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

Src/LexText/Lexicon/ReversalListener.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,15 @@ private void ChangeOwningObject(Guid newGuid)
417417
var layoutFinder = ((Sorter as GenRecordSorter)?.Comparer as StringFinderCompare)?.Finder as LayoutFinder;
418418
if (layoutFinder?.Vc != null)
419419
{
420-
layoutFinder.Vc.OverrideWs = WritingSystemServices.CurrentReversalWsId;
420+
var wsComparer = ((Sorter as GenRecordSorter)?.Comparer as StringFinderCompare)?.SubComparer as WritingSystemComparer;
421+
if (wsComparer != null)
422+
{
423+
layoutFinder.Vc.OverrideWs = Cache.WritingSystemFactory.GetWsFromStr(wsComparer.WsId);
424+
}
425+
else
426+
{
427+
layoutFinder.Vc.OverrideWs = WritingSystemServices.CurrentReversalWsId;
428+
}
421429
}
422430

423431
try

0 commit comments

Comments
 (0)