Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LT-21829: Properly remove excluded lex refs #207

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading