Skip to content

Commit

Permalink
Fix reversal export naming & don't export empty reversals
Browse files Browse the repository at this point in the history
Change-Id: I5d84eaf3563ac80c8c96e77c32b1c1d24f781b53
  • Loading branch information
aror92 committed May 3, 2024
1 parent 442b37a commit 2587e7f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Src/xWorks/DictionaryExportService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,15 @@ public void ExportReversalForWord(string filePath, string reversalWs, Dictionary
configuration = configuration ?? new DictionaryConfigurationModel(
DictionaryConfigurationListener.GetCurrentConfiguration(m_propertyTable, "ReversalIndex"), m_cache);
var publicationDecorator = ConfiguredLcmGenerator.GetPublicationDecoratorAndEntries(m_propertyTable, out var entriesToSave, ReversalType);

// Don't export empty reversals
if (entriesToSave.Length == 0)
return;

if (progress != null)
progress.Maximum = entriesToSave.Length;

string reversalFilePath = filePath.Split(new string[] { ".docx"}, StringSplitOptions.None)[0] + "-" + reversalWs + ".docx";
string reversalFilePath = filePath.Split(new string[] { ".docx"}, StringSplitOptions.None)[0] + "-reversal-" + reversalWs + ".docx";

LcmWordGenerator.SavePublishedDocx(entriesToSave, publicationDecorator, int.MaxValue, configuration, m_propertyTable, reversalFilePath, progress);
}
Expand Down

0 comments on commit 2587e7f

Please sign in to comment.