Skip to content

Commit

Permalink
Merge branch 'release/9.1' into Features/LT-21672a
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-sil authored Apr 4, 2024
2 parents 0467bcc + c54bd64 commit cd2be74
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Build/buildLocalLibraries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function delete_and_pack_liblcm {
(cd "$liblcm_dir/artifacts" && rm *nupkg)

echo "Running 'dotnet pack' in the liblcm directory: $liblcm_dir"
pack_output=$(cd "$liblcm_dir" && dotnet pack -c Debug)
pack_output=$(cd "$liblcm_dir" && dotnet pack -c Debug -p:TargetFrameworks=net461)

# Extract version number using regex
if [[ $pack_output =~ $version_regex ]]; then
Expand Down Expand Up @@ -87,7 +87,7 @@ function delete_and_pack_chorus {
(cd "$chorus_dir/output" && rm *nupkg)

echo "Running 'dotnet pack' in the chorus directory: $chorus_dir"
pack_output=$(cd "$chorus_dir" && dotnet pack -c Debug)
pack_output=$(cd "$chorus_dir" && dotnet pack -c Debug -p:TargetFrameworks=net461)

# Extract version number using regex
if [[ $pack_output =~ $version_regex ]]; then
Expand Down Expand Up @@ -130,7 +130,7 @@ function delete_and_pack_libpalaso {
(cd "$libpalaso_dir/output" && rm *nupkg)

echo "Running 'dotnet pack' in the libpalaso directory: $libpalaso_dir"
pack_output=$(cd "$libpalaso_dir" && dotnet pack -c Debug)
pack_output=$(cd "$libpalaso_dir" && dotnet pack -c Debug -p:TargetFrameworks=net461)

# Extract version number using regex
if [[ $pack_output =~ $version_regex ]]; then
Expand Down
20 changes: 11 additions & 9 deletions Src/xWorks/WordStylesGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ internal static Style GenerateWordStyleFromLcmStyleSheet(

if (exportStyleInfo.HasTrailingIndent)
{
// Check bidirectional flag to determine correct orientation for indent
if (exportStyleInfo.DirectionIsRightToLeft == TriStateBool.triTrue)
parProps.Append(new Indentation() { Left = MilliPtToTwentiPt(exportStyleInfo.TrailingIndent).ToString() });
else
Expand All @@ -279,23 +280,18 @@ internal static Style GenerateWordStyleFromLcmStyleSheet(
ancestorIndents = CalculateParagraphIndentsFromAncestors(ancestorIndents.Ancestor, styleSheet, new AncestorIndents(0f, 0f));
var leadingIndent = CalculateMarginLeft(exportStyleInfo, ancestorIndents, hangingIndent);

// Check bidirectional flag to determine correct orientation for indent
if (exportStyleInfo.DirectionIsRightToLeft == TriStateBool.triTrue)
parProps.Append(new Indentation() { Right = leadingIndent.ToString() });
else
parProps.Append(new Indentation() { Left = leadingIndent.ToString() });
}
}

// If text direction is specified, add specification to paragraph properties
if (exportStyleInfo.DirectionIsRightToLeft != TriStateBool.triNotSet)
// If text direction is right to left, add BiDi property to the paragraph.
if (exportStyleInfo.DirectionIsRightToLeft == TriStateBool.triTrue)
{
parProps.Append(new BiDi());

if (exportStyleInfo.DirectionIsRightToLeft == TriStateBool.triTrue)
parProps.Append(new TextDirection() { Val = TextDirectionValues.TopToBottomRightToLeft });

else
parProps.Append(new TextDirection() { Val = TextDirectionValues.LefToRightTopToBottom });
}
exportStyle.Append(parProps);
}
Expand Down Expand Up @@ -441,12 +437,18 @@ private static Style GenerateWordStyleFromWsOptions(ConfigurableDictionaryNode c
// if the writing system isn't a magic name just use it otherwise find the right one from the magic list
var wsIdString = possiblyMagic == 0 ? ws.Id : WritingSystemServices.GetWritingSystemList(cache, possiblyMagic, true).First().Id;
var wsId = cache.LanguageWritingSystemFactoryAccessor.GetWsFromStr(wsIdString);
var wsString = String.Format("[lang=\'{0}\']", wsIdString).Trim('.');

var wsStyle = new Style();

if (!string.IsNullOrEmpty(configNode.Style))
wsStyle = GenerateWordStyleFromLcmStyleSheet(configNode.Style, wsId, propertyTable);

wsStyle.StyleId = configNode.Style + (String.Format("[lang=\'{0}\']", wsIdString)).Trim('.');
//style should be based on the span for the current ws as well as the style info for the current node that is independent from the ws
wsStyle.Append(new BasedOn() { Val = "span" + wsString });
wsStyle.Append(new BasedOn() { Val = configNode.Style });

wsStyle.StyleId = configNode.Style + wsString;

if (!IsEmptyStyle(wsStyle))
return wsStyle;
Expand Down

0 comments on commit cd2be74

Please sign in to comment.