From db54be6b237a1a912032f3847c455570eca9f509 Mon Sep 17 00:00:00 2001 From: Ariel Rorabaugh Date: Fri, 3 May 2024 12:32:52 -0400 Subject: [PATCH] Fix reversal export naming & don't export empty reversals Change-Id: I5d84eaf3563ac80c8c96e77c32b1c1d24f781b53 --- Src/xWorks/DictionaryExportService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Src/xWorks/DictionaryExportService.cs b/Src/xWorks/DictionaryExportService.cs index d67d537df1..4fded0980d 100644 --- a/Src/xWorks/DictionaryExportService.cs +++ b/Src/xWorks/DictionaryExportService.cs @@ -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); }