From 430596a0a0e2c4aa4a8518e1ad91897a66f76991 Mon Sep 17 00:00:00 2001 From: Mark Kidder <83427558+mark-sil@users.noreply.github.com> Date: Thu, 7 Nov 2024 13:15:22 -0500 Subject: [PATCH 1/3] Word Export LT-21673: Fix bold/italic for complex script (#198) Change-Id: Ice8ebb05b94e6194a2532dd2237bbba7ef08487a --- Src/xWorks/WordStylesGenerator.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Src/xWorks/WordStylesGenerator.cs b/Src/xWorks/WordStylesGenerator.cs index e3c66e9da7..5f039d7f58 100644 --- a/Src/xWorks/WordStylesGenerator.cs +++ b/Src/xWorks/WordStylesGenerator.cs @@ -546,7 +546,9 @@ private static StyleRunProperties AddFontInfoWordStyles(BaseStyleInfo projectSty if (bold) { var boldFont = new Bold() { Val = true }; + var boldCS = new BoldComplexScript() { Val = true }; charDefaults.Append(boldFont); + charDefaults.Append(boldCS); } // Check for italic @@ -555,7 +557,9 @@ private static StyleRunProperties AddFontInfoWordStyles(BaseStyleInfo projectSty if (ital) { var italFont = new Italic() { Val = true }; + var italicCS = new ItalicComplexScript() { Val = true }; charDefaults.Append(italFont); + charDefaults.Append(italicCS); } // Check for font color From 9ffba0fcad25690202547de7f0dad31fdd7ce26f Mon Sep 17 00:00:00 2001 From: "Ariel Ror." Date: Tue, 12 Nov 2024 10:41:34 -0500 Subject: [PATCH 2/3] LT-21968: Word Export Target Office 2019 (#201) Change-Id: I5a2a896fc794a5bd88f6e10d7eda88c5eb298610 --- Src/xWorks/LcmWordGenerator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/xWorks/LcmWordGenerator.cs b/Src/xWorks/LcmWordGenerator.cs index 4583d00416..78365e437b 100644 --- a/Src/xWorks/LcmWordGenerator.cs +++ b/Src/xWorks/LcmWordGenerator.cs @@ -173,7 +173,7 @@ public static void SavePublishedDocx(int[] entryHvos, DictionaryPublicationDecor Name = CompatSettingNameValues.CompatibilityMode, // val determines the version of word we are targeting. // 14 corresponds to Office 2010; 16 would correspond to Office 2019 - Val = new StringValue("14"), + Val = new StringValue("16"), Uri = new StringValue("http://schemas.microsoft.com/office/word") }, new CompatibilitySetting() @@ -183,7 +183,7 @@ public static void SavePublishedDocx(int[] entryHvos, DictionaryPublicationDecor Val = new StringValue("0"), Uri = new StringValue("http://schemas.microsoft.com/office/word") } - // If in the future, if we find that certain style items are different in different version of word, + // If in the future, if we find that certain style items are different in different versions of word, // it may help to specify more compatibility settings. // A full list of all possible compatibility settings may be found here: // https://learn.microsoft.com/en-us/dotnet/api/documentformat.openxml.wordprocessing.compatsettingnamevalues?view=openxml-3.0.1 From 2d05f6fa6ea243994cd065cb95c7c58cb46a8db9 Mon Sep 17 00:00:00 2001 From: John T Maxwell III Date: Tue, 12 Nov 2024 07:56:44 -0800 Subject: [PATCH 3/3] Fix LT-21933: Picture thumbnail is not showing configuration dialog (#200) --- Src/xWorks/ConfiguredLcmGenerator.cs | 11 +++++++++-- Src/xWorks/LcmWordGenerator.cs | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Src/xWorks/ConfiguredLcmGenerator.cs b/Src/xWorks/ConfiguredLcmGenerator.cs index 1fd8220138..3841eb9e91 100644 --- a/Src/xWorks/ConfiguredLcmGenerator.cs +++ b/Src/xWorks/ConfiguredLcmGenerator.cs @@ -861,7 +861,7 @@ private static string GenerateSrcAttributeFromFilePath(ICmFile file, string subF { filePath = MakeSafeFilePath(file.AbsoluteInternalPath); } - return filePath; + return (settings.UseRelativePaths || !settings.UseUri) ? filePath : new Uri(filePath).ToString(); } private static string GenerateSrcAttributeForMediaFromFilePath(string filename, string subFolder, GeneratorSettings settings) @@ -3175,6 +3175,8 @@ public class GeneratorSettings public LcmCache Cache { get; } public ReadOnlyPropertyTable PropertyTable { get; } public bool UseRelativePaths { get; } + + public bool UseUri { get; } public bool CopyFiles { get; } public string ExportPath { get; } public bool RightToLeft { get; } @@ -3186,8 +3188,12 @@ public GeneratorSettings(LcmCache cache, PropertyTable propertyTable, bool relat { } - public GeneratorSettings(LcmCache cache, ReadOnlyPropertyTable propertyTable, bool relativePaths, bool copyFiles, string exportPath, bool rightToLeft = false, bool isWebExport = false, bool isTemplate = false) + : this(cache, propertyTable == null ? null : propertyTable, relativePaths, true, copyFiles, exportPath, rightToLeft, isWebExport, isTemplate) + { + } + + public GeneratorSettings(LcmCache cache, ReadOnlyPropertyTable propertyTable, bool relativePaths, bool useUri, bool copyFiles, string exportPath, bool rightToLeft = false, bool isWebExport = false, bool isTemplate = false) { if (cache == null || propertyTable == null) { @@ -3196,6 +3202,7 @@ public GeneratorSettings(LcmCache cache, ReadOnlyPropertyTable propertyTable, bo Cache = cache; PropertyTable = propertyTable; UseRelativePaths = relativePaths; + UseUri = useUri; CopyFiles = copyFiles; ExportPath = exportPath; RightToLeft = rightToLeft; diff --git a/Src/xWorks/LcmWordGenerator.cs b/Src/xWorks/LcmWordGenerator.cs index 78365e437b..7957ac9933 100644 --- a/Src/xWorks/LcmWordGenerator.cs +++ b/Src/xWorks/LcmWordGenerator.cs @@ -65,7 +65,8 @@ public static void SavePublishedDocx(int[] entryHvos, DictionaryPublicationDecor generator.Init(readOnlyPropertyTable); IsBidi = ConfiguredLcmGenerator.IsEntryStyleRtl(readOnlyPropertyTable, configuration); - var settings = new ConfiguredLcmGenerator.GeneratorSettings(cache, readOnlyPropertyTable, false, true, System.IO.Path.GetDirectoryName(filePath), + // Call GeneratorSettings with relativesPaths = false but useUri = false because that works better for Word. + var settings = new ConfiguredLcmGenerator.GeneratorSettings(cache, readOnlyPropertyTable, false, false, true, System.IO.Path.GetDirectoryName(filePath), IsBidi, System.IO.Path.GetFileName(cssPath) == "configured.css") { ContentGenerator = generator, StylesGenerator = generator}; settings.StylesGenerator.AddGlobalStyles(configuration, readOnlyPropertyTable);