Skip to content

Commit 1a301bf

Browse files
committed
LT-21785: Add more style support
- When a run is created set the style name. (It may get modified with basedOn information as we get other notifications.) - Add styles during run creation. - Allow styles to be based on other styles, which can be based on other styles… - Support different styles on different document fragments. TODO: A remaining task is to change the style names from the config.Style to the config.DisplayLabel. This will improve the style names that appear in Word. At that time we will need to add additional code to generate a unique style name if the properties of a style are different. Change-Id: I12b308232559b4845970d0b345a840ae230f7534
1 parent 4962c35 commit 1a301bf

6 files changed

+309
-250
lines changed

Src/xWorks/ConfiguredLcmGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2807,7 +2807,7 @@ private static IFragment GenerateAudioWsContent(string wsId,
28072807
private static void GenerateRunWithPossibleLink(GeneratorSettings settings, string writingSystem, IFragmentWriter writer, string style,
28082808
string text, Guid linkDestination, bool rightToLeft, ConfigurableDictionaryNode config, string externalLink = null)
28092809
{
2810-
settings.ContentGenerator.StartRun(writer, writingSystem);
2810+
settings.ContentGenerator.StartRun(writer, config, settings.PropertyTable, writingSystem);
28112811
var wsRtl = settings.Cache.WritingSystemFactory.get_Engine(writingSystem).RightToLeftScript;
28122812
if (rightToLeft != wsRtl)
28132813
{
@@ -3031,7 +3031,7 @@ private static void GenerateTableRow(ITsString rowUSFM, IFragmentWriter writer,
30313031
private static void GenerateError(string text, IFragmentWriter writer, GeneratorSettings settings)
30323032
{
30333033
var writingSystem = settings.Cache.WritingSystemFactory.GetStrFromWs(settings.Cache.WritingSystemFactory.UserWs);
3034-
settings.ContentGenerator.StartRun(writer, writingSystem);
3034+
settings.ContentGenerator.StartRun(writer, null, settings.PropertyTable, writingSystem);
30353035
settings.ContentGenerator.SetRunStyle(writer, null, settings.PropertyTable, writingSystem, null, true);
30363036
if (text.Contains(TxtLineSplit))
30373037
{

Src/xWorks/ILcmContentGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ IFragment GenerateGroupingNode(object field, string className, ConfigurableDicti
3232
void EndMultiRunString(IFragmentWriter writer);
3333
void StartBiDiWrapper(IFragmentWriter writer, bool rightToLeft);
3434
void EndBiDiWrapper(IFragmentWriter writer);
35-
void StartRun(IFragmentWriter writer, string writingSystem);
35+
void StartRun(IFragmentWriter writer, ConfigurableDictionaryNode config, ReadOnlyPropertyTable propTable, string writingSystem);
3636
void EndRun(IFragmentWriter writer);
3737
void SetRunStyle(IFragmentWriter writer, ConfigurableDictionaryNode config, ReadOnlyPropertyTable propertyTable, string writingSystem, string runStyle, bool error);
3838
void StartLink(IFragmentWriter writer, ConfigurableDictionaryNode config, Guid destination);

Src/xWorks/LcmJsonGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public void EndBiDiWrapper(IFragmentWriter writer)
161161
{
162162
}
163163

164-
public void StartRun(IFragmentWriter writer, string writingSystem)
164+
public void StartRun(IFragmentWriter writer, ConfigurableDictionaryNode config, ReadOnlyPropertyTable propTable, string writingSystem)
165165
{
166166
var jsonWriter = (JsonFragmentWriter)writer;
167167
jsonWriter.StartObject();

0 commit comments

Comments
 (0)