diff --git a/DistFiles/xample64.dll b/DistFiles/xample64.dll index 7b8732d2fb..d14b1da4fa 100644 Binary files a/DistFiles/xample64.dll and b/DistFiles/xample64.dll differ diff --git a/Src/LexText/Interlinear/ChooseAnalysisHander.cs b/Src/LexText/Interlinear/ChooseAnalysisHandler.cs similarity index 100% rename from Src/LexText/Interlinear/ChooseAnalysisHander.cs rename to Src/LexText/Interlinear/ChooseAnalysisHandler.cs diff --git a/Src/LexText/Interlinear/ITextDll.csproj b/Src/LexText/Interlinear/ITextDll.csproj index 33471b521f..6f0ff53fce 100644 --- a/Src/LexText/Interlinear/ITextDll.csproj +++ b/Src/LexText/Interlinear/ITextDll.csproj @@ -351,7 +351,7 @@ Code - + Code diff --git a/Src/LexText/Interlinear/InterlinVc.cs b/Src/LexText/Interlinear/InterlinVc.cs index 1fcddda4d9..e756c655ff 100644 --- a/Src/LexText/Interlinear/InterlinVc.cs +++ b/Src/LexText/Interlinear/InterlinVc.cs @@ -144,7 +144,6 @@ public class InterlinVc : FwBaseVc, IDisposable private InterlinLineChoices m_lineChoices; protected IVwStylesheet m_stylesheet; private IParaDataLoader m_loader; - private readonly HashSet m_vernWss; // all vernacular writing systems private readonly int m_selfFlid; private int m_leftPadding; @@ -184,8 +183,7 @@ public InterlinVc(LcmCache cache) : base(cache.DefaultAnalWs) m_tssEmptyPara = TsStringUtils.MakeString(ITextStrings.ksEmptyPara, m_wsAnalysis); m_tssSpace = TsStringUtils.MakeString(" ", m_wsAnalysis); m_msaVc = new MoMorphSynAnalysisUi.MsaVc(m_cache); - m_vernWss = WritingSystemServices.GetAllWritingSystems(m_cache, "all vernacular", - null, 0, 0); + // This usually gets overridden, but ensures default behavior if not. m_lineChoices = InterlinLineChoices.DefaultChoices(m_cache.LangProject, WritingSystemServices.kwsVernInParagraph, WritingSystemServices.kwsAnal); @@ -227,7 +225,8 @@ protected virtual void GetSegmentLevelTags(LcmCache cache) /// internal bool CanBeAnalyzed(AnalysisOccurrence occurrence) { - return !(occurrence.Analysis is IPunctuationForm) && m_vernWss.Contains(occurrence.BaselineWs); + return !(occurrence.Analysis is IPunctuationForm) && + WritingSystemServices.GetAllWritingSystems(m_cache, "all vernacular", null, 0, 0).Contains(occurrence.BaselineWs); } internal IVwStylesheet StyleSheet diff --git a/Src/xWorks/LcmWordGenerator.cs b/Src/xWorks/LcmWordGenerator.cs index b3294152e0..3153aacded 100644 --- a/Src/xWorks/LcmWordGenerator.cs +++ b/Src/xWorks/LcmWordGenerator.cs @@ -341,9 +341,12 @@ public static string GetWsStyleName(string styleName, ConfigurableDictionaryNode { if (opt.IsEnabled) { - if (opt.Id == "vernacular" || opt.Id == "all vernacular") + // If it's magic then don't return a language tag specific style. + var possiblyMagic = WritingSystemServices.GetMagicWsIdFromName(opt.Id); + if (possiblyMagic != 0) + { return styleName; - + } // else, the DictionaryNodeOption Id specifies a particular writing system // if there is no base style, return just the ws style if (styleName == null) @@ -468,12 +471,12 @@ public void AppendToParagraph(IFragment fragToCopy, OpenXmlElement run, bool for if (forceNewParagraph) { // When forcing a new paragraph use a 'continuation' style for the new paragraph. - // The continuation style is based on the style used in the last paragraph. + // The continuation style is based on the style used in the first paragraph. string style = null; - WP.Paragraph lastParagraph = DocBody.OfType().LastOrDefault(); - if (lastParagraph != null) + WP.Paragraph firstParagraph = DocBody.OfType().FirstOrDefault(); + if (firstParagraph != null) { - WP.ParagraphProperties paraProps = lastParagraph.OfType().FirstOrDefault(); + WP.ParagraphProperties paraProps = firstParagraph.OfType().FirstOrDefault(); if (paraProps != null) { ParagraphStyleId styleId = paraProps.OfType().FirstOrDefault(); @@ -1206,14 +1209,16 @@ public void AddEntryData(IFragmentWriter writer, List("cache"); foreach (var ws in wsOptions.Options.Where(opt => opt.IsEnabled)) { - var possiblyMagic = WritingSystemServices.GetMagicWsIdFromName(ws.Id); - // if the writing system isn't a magic name just use it otherwise find the right one from the magic list - var wsIdString = possiblyMagic == 0 ? ws.Id : WritingSystemServices.GetWritingSystemList(cache, possiblyMagic, true).First().Id; - var wsId = cache.LanguageWritingSystemFactoryAccessor.GetWsFromStr(wsIdString); - var wsString = GetWsString(wsIdString).Trim('.'); - var wsStyle = new Style(); + // If it's magic then don't add a specific style for the language tag. + var possiblyMagic = WritingSystemServices.GetMagicWsIdFromName(ws.Id); + if (possiblyMagic != 0) + { + return wsStyle; + } + if (!string.IsNullOrEmpty(configNode.Style)) + { + var wsId = cache.LanguageWritingSystemFactoryAccessor.GetWsFromStr(ws.Id); wsStyle = GenerateWordStyleFromLcmStyleSheet(configNode.Style, wsId, propertyTable); + } // Any given style can only be based on one style. // This style should be based on the span for the current ws; // style info for the current node (independent of WS) should be added during creation of this style. + var wsString = GetWsString(ws.Id).Trim('.'); wsStyle.Append(new BasedOn() { Val = "span" + wsString }); wsStyle.StyleId = configNode.Style + wsString;