Skip to content

Commit

Permalink
Merge branch 'release/9.1' into LT-21776
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeOliver28 authored May 8, 2024
2 parents 9024f6e + 540ff24 commit 1f47f41
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Src/xWorks/LcmWordGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,12 @@ public void AppendToParagraph(IFragment fragToCopy, OpenXmlElement run, bool for
if (forceNewParagraph)
{
// When forcing a new paragraph use a 'continuation' style for the new paragraph.
// The continuation style is based on the style used in the last paragraph.
// The continuation style is based on the style used in the first paragraph.
string style = null;
WP.Paragraph lastParagraph = DocBody.OfType<WP.Paragraph>().LastOrDefault();
if (lastParagraph != null)
WP.Paragraph firstParagraph = DocBody.OfType<WP.Paragraph>().FirstOrDefault();
if (firstParagraph != null)
{
WP.ParagraphProperties paraProps = lastParagraph.OfType<WP.ParagraphProperties>().FirstOrDefault();
WP.ParagraphProperties paraProps = firstParagraph.OfType<WP.ParagraphProperties>().FirstOrDefault();
if (paraProps != null)
{
ParagraphStyleId styleId = paraProps.OfType<WP.ParagraphStyleId>().FirstOrDefault();
Expand Down Expand Up @@ -1206,14 +1206,16 @@ public void AddEntryData(IFragmentWriter writer, List<ConfiguredLcmGenerator.Con
{
if (pieceHasImage)
{
wordWriter.WordFragment.AppendToParagraph(frag, new Run(), true);
wordWriter.WordFragment.GetNewParagraph();
wordWriter.WordFragment.AppendToParagraph(frag, new Run(), false);
}

// We have now added at least one image from this piece.
pieceHasImage = true;
}

wordWriter.WordFragment.AppendToParagraph(frag, run, wordWriter.ForceNewParagraph);
wordWriter.WordFragment.GetNewParagraph();
wordWriter.WordFragment.AppendToParagraph(frag, run, false);
wordWriter.WordFragment.LinkParaStyle(WordStylesGenerator.PictureAndCaptionTextframeStyle);
}

Expand Down

0 comments on commit 1f47f41

Please sign in to comment.