Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Word Export LT-21830: Fix indentation issues #147

Merged
merged 4 commits into from
Sep 3, 2024
Merged

Conversation

mark-sil
Copy link
Contributor

@mark-sil mark-sil commented Aug 29, 2024

Many of the code changes were a result of Word not allowing nested paragraphs. As a result, all paragraphs need to be moved to first level elements in the Body.

  • Add paragraphs instead of starting a new line.
  • Nested content like sub-senses still result in a new paragraph.
  • Removed condition from GenerateWordStyleFromLcmStyleSheet() that was preventing nodes under senses from indenting correctly (examples).
  • The basedOn value can now come from either the styles basedOn value or from the parent node.

Change-Id: Ibf9faba0ad79131100a7783d258a26429a9513d5


This change is Reviewable

mark-sil and others added 2 commits August 29, 2024 10:17
Many of the code changes were a result of Word not allowing
nested paragraphs.  As a result, all paragraphs need to be moved
to first level elements in the Body.
- Add paragraphs instead of starting a new line.
- Nested content like sub-senses still result in a new
  paragraph.
- Removed condition from GenerateWordStyleFromLcmStyleSheet()
  that was preventing nodes under senses from indenting
  correctly (examples).
- The basedOn value can now come from either the styles basedOn
  value or from the parent node.

Change-Id: Ibf9faba0ad79131100a7783d258a26429a9513d5
@jasonleenaylor
Copy link
Contributor

Src/xWorks/LcmWordGenerator.cs line 2227 at r1 (raw file):

			var workingParagraph = outputParagraph;
			var elements = ((DocFragment)contentToAdd).DocBody.Elements();
			foreach (OpenXmlElement elem in elements)

What is the behavior if we encounter two un-nestable elements back to back? If it isn't harmful we don't need to do anything really.

Copy link
Contributor

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all commit messages.
Reviewable status: 0 of 3 files reviewed, all discussions resolved


Src/xWorks/LcmWordGenerator.cs line 1778 at r1 (raw file):

					{
						style.BasedOn.Val = basedOnStyle.StyleId;
						if(continuationStyle && style.BasedOn.Val != WordStylesGenerator.NormalParagraphStyleName)

If you intend that we will fix this method to work with continuationStyle then I approve of this change, if you don't think we need it for that we should remove any use of continuationStyle after the Assert and return.

Copy link
Contributor Author

@mark-sil mark-sil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @jasonleenaylor)


Src/xWorks/LcmWordGenerator.cs line 1778 at r1 (raw file):

Previously, jasonleenaylor (Jason Naylor) wrote…

If you intend that we will fix this method to work with continuationStyle then I approve of this change, if you don't think we need it for that we should remove any use of continuationStyle after the Assert and return.

Right now, I don’t know of a situation that requires it, but I’m kind of guessing it will be needed, so I left it in.


Src/xWorks/LcmWordGenerator.cs line 2227 at r1 (raw file):

Previously, jasonleenaylor (Jason Naylor) wrote…

What is the behavior if we encounter two un-nestable elements back to back? If it isn't harmful we don't need to do anything really.

Multiple un-nestable elements back to back is not a problem. Each will be in it's own paragraph, then when/if we encounter nestable elements a continuation paragraph is started.

@jasonleenaylor
Copy link
Contributor

Src/xWorks/LcmWordGenerator.cs line 1778 at r1 (raw file):

Previously, mark-sil (Mark Kidder) wrote…

Right now, I don’t know of a situation that requires it, but I’m kind of guessing it will be needed, so I left it in.

👍

Copy link
Contributor

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, all discussions resolved

@mark-sil mark-sil merged commit 2ab9847 into release/9.1 Sep 3, 2024
4 of 5 checks passed
@mark-sil mark-sil deleted the LT-21830 branch September 3, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants