Skip to content

Commit

Permalink
LT-21829: Properly remove excluded lex refs (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeOliver28 authored Nov 15, 2024
1 parent 67cf893 commit 25a2a14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Src/xWorks/ConfiguredLcmGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,7 @@ private static IFragment GenerateContentForSenses(ConfigurableDictionaryNode con
foreach (ILexSense item in senseCollection)
{
Debug.Assert(item != null);
if (publicationDecorator != null && publicationDecorator.IsExcludedObject(item))
if (publicationDecorator?.IsExcludedObject(item) ?? false)
continue;
filteredSenseCollection.Add(item);
}
Expand Down Expand Up @@ -2099,6 +2099,11 @@ private static IFragment GenerateCrossReferenceChildren(ConfigurableDictionaryNo
if (targetInfo == null)
return settings.ContentGenerator.CreateFragment();
var reference = targetInfo.Item2;
if (targetInfo.Item1 == null || (!publicationDecorator?.IsPublishableLexRef(reference.Hvo) ?? false))
{
return settings.ContentGenerator.CreateFragment();
}

if (LexRefTypeTags.IsUnidirectional((LexRefTypeTags.MappingTypes)reference.OwnerType.MappingType) &&
LexRefDirection(reference, collectionOwner) == ":r")
{
Expand Down
2 changes: 1 addition & 1 deletion Src/xWorks/DictionaryPublicationDecorator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ private bool IsPublishableReversalEntry(IReversalIndexEntry revEntry)
/// </summary>
/// <param name="hvoRef"></param>
/// <returns></returns>
private bool IsPublishableLexRef(int hvoRef)
internal bool IsPublishableLexRef(int hvoRef)
{
var publishableItems = VecProp(hvoRef, LexReferenceTags.kflidTargets);
int originalItemCount = BaseSda.get_VecSize(hvoRef, LexReferenceTags.kflidTargets);
Expand Down

0 comments on commit 25a2a14

Please sign in to comment.