diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a172e5d..c5f928e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed +- [SIL.LCModel] Multi-string (AUni) alternatives in writing systems the cache has not seen yet are no longer dropped on load; the writing system is created on demand, as for string runs, so the result no longer depends on activation order (LT-22834) - [SIL.LCModel] BaseStyleInfo now loads default font features (ktptFontVariations) from style rules, fixing font features set as style defaults being dropped on reload (LT-22351) - [SIL.LCModel] BaseStyleInfo no longer clobbers ws-specific font overrides inherited from a based-on style with the default font info's merely-inherited values; only explicitly-set default properties are propagated to ws overrides (LT-22351) - [SIL.LCModel] BulletInfo now decodes all properties of an encoded bullet font info instead of stopping at the first string property, fixing bullet font features (ktptFontVariations) being lost when a bullet font name was also set (LT-22351) diff --git a/src/SIL.LCModel/DomainImpl/Strings.cs b/src/SIL.LCModel/DomainImpl/Strings.cs index c554f5e9..c6bde652 100644 --- a/src/SIL.LCModel/DomainImpl/Strings.cs +++ b/src/SIL.LCModel/DomainImpl/Strings.cs @@ -929,10 +929,21 @@ internal static int ReadMultiUnicodeAlternative(XElement aUniNode, ILgWritingSys var wsVal = aUniNode.Attribute("ws"); if (wsVal == null || String.IsNullOrEmpty(wsVal.Value)) return 0; - var wsHvo = wsf.GetWsFromStr(wsVal.Value); + // Like the runs of an AStr (see TsStringSerializer.GetWsForId), create the writing + // system on demand: GetWsFromStr returns 0 for one the cache has not seen yet, which + // dropped the alternative and made the result depend on activation order (LT-22834). + int wsHvo; + try + { + wsHvo = wsf.get_Engine(wsVal.Value).Handle; + } + catch (Exception) + { + // An identifier that cannot be made into a writing system is still dropped. + wsHvo = 0; + } // Throwing out a string without a ws is probably better than crashing // and preventing a db from being opened. - // This code currently accepts this data, only storing en__IPA and fr strings. //